i want to write trigger for 3 tables and any insert to these 3 tables
should update in the 4th table(combination of 3 tables based on join)
i have 3 tables A,B,C. I have a stored procedure of these 3 tables with
join condition inserted in 4th table D. now what i want is "ANY INSERT OR
UPDATE"made to these 3 tables(A,B,C) should update 4th table D. Can any
one please tel how to write trigger in pl/sql?
Thursday, October 3, 2013
Wednesday, October 2, 2013
Huge firefox CSS issues
Huge firefox CSS issues
I made the following site: http://like-minded.us
to view it you'll have to log in from http://like-minded.us/wp-admin with
the credentials
username: stackoverflow pw: hellothere
then you will be taken to the dashboard - try to go to like-minded while
logged in and you'll be able to view it. The thing basically doesn't
render on firefox, and there is a problem in Safari that appears like it
didn't load a script or hit an error. I would love help with making it
compatible for both, but I am currently focused on Mozilla. I can't seem
to figure out how to find out where the problems in CSS are, and which
ones are the main ones preventing the site from rendering. I also am not
sure if the problem is in CSS in the first place. Can anybody point me in
the right direction? Sorry if there are not enough details, I tried to
cover everything I could think of. The site displays perfectly in Chrome.
I made the following site: http://like-minded.us
to view it you'll have to log in from http://like-minded.us/wp-admin with
the credentials
username: stackoverflow pw: hellothere
then you will be taken to the dashboard - try to go to like-minded while
logged in and you'll be able to view it. The thing basically doesn't
render on firefox, and there is a problem in Safari that appears like it
didn't load a script or hit an error. I would love help with making it
compatible for both, but I am currently focused on Mozilla. I can't seem
to figure out how to find out where the problems in CSS are, and which
ones are the main ones preventing the site from rendering. I also am not
sure if the problem is in CSS in the first place. Can anybody point me in
the right direction? Sorry if there are not enough details, I tried to
cover everything I could think of. The site displays perfectly in Chrome.
Upload multiple files with jquery and coldfusion cffile
Upload multiple files with jquery and coldfusion cffile
Not really a question... Just wanted to post this somewhere because I
couldnt find it elsewhere. Now that I've cobbled together a working demo I
thought i would share. This works equally well on Coldfusion and Railo
CFML servers.
The problem is that for CFML developers is that CFFILE doesn't work with
<input type="file" multiple> ... traditionally if you wanted to upload 3
files and use CFFILE on the back end you would have to include 3 separate
file inputs on your calling page.
Here is my solution shaved down for simplicity. It uses Jquery $.ajax to
make several calls to CFFILE and returns the results to a div on the
calling page. Im sure there is a better way to do this and my code is
probably a complete hack but the below example works. Hope this helps
someone.
multiFileUpload.cfm
<!DOCTYPE html>
<CFPARAM Name="URL.contractID" defualt="">
<head>
<title>Multi File Upload</title>
<script>
$( document ).ready(function() {
$('#submitFrm').on("click", function(e){
e.preventDefault();
//The jquery.each() statement loops through all the files
selected by user
$.each($('#multiFile')[0].files, function(i, file) {
var data = new FormData();
data.append('file-0', file);
ajaxUpload(data);
}); //end .each statement
}); //end submitFrm's click function
function ajaxUpload(data){
console.log("ajaxUpload function called");
$.ajax({url: "multiFileUploadAction.cfm",
data: data,
cache: false,
contentType: false, //this is need for this to work with coldfusion
processData: false, //this is need for this to work with coldfusion
type: 'POST',
success: function(returnData){
console.log(returnData);
//here is where you would update your calling
//page if successfull
$("#msgDiv").html($("#msgDiv").html() + "<p>"
+ returnData + "</p>
},
error: function(returnData){
console.log(returnData);
}
}); //end .ajax call
} //end ajaxUpload function
}); //end onDocument ready
</script>
<style>
</style>
</head>
<body>
<form action="multiFileUploadAction.cfm" Method="POST"
enctype="multipart/form-data" class="well" id="multiFileFrm">
<input type="file" name="multiFile" id="multiFile" multiple />
<button class="btn btn-primary" id="submitFrm" >Submit</button>
<cfoutput>
<input type="hidden" Name="contractID" id="contractID"
value="#URL.contractID#">
</cfoutput>
</form>
<div id="msgDiv" style="display:none;"></div>
</body>
</html>
This is my proccessing page... again stripped down to the bare minimum:
multiFileUploadAction.cfm
<CFOUTPUT>
<CFTRY>
<cffile action="upload"
filefield="file-0"
destination="#expandpath("\images")#"
nameConflict="makeUnique">
<cfcatch>
#cfcatch.Message#
</cfcatch>
</cftry>
<cfcontent reset="true" />Uploaded #cffile.serverFile#
</CFOUTPUT>
<!---
<cfdump var="#form#">
--->
Thats it... in my production code i create a JSON response that includes
the saved file name and path to the file (because of the 'makeUnique' it
could be different then what was sent) I also process the file to create a
thumbnail and send it's name and path back to the calling page. That way
on the calling page I can display a thumbnail. Hope someone finds this
helpful.
Not really a question... Just wanted to post this somewhere because I
couldnt find it elsewhere. Now that I've cobbled together a working demo I
thought i would share. This works equally well on Coldfusion and Railo
CFML servers.
The problem is that for CFML developers is that CFFILE doesn't work with
<input type="file" multiple> ... traditionally if you wanted to upload 3
files and use CFFILE on the back end you would have to include 3 separate
file inputs on your calling page.
Here is my solution shaved down for simplicity. It uses Jquery $.ajax to
make several calls to CFFILE and returns the results to a div on the
calling page. Im sure there is a better way to do this and my code is
probably a complete hack but the below example works. Hope this helps
someone.
multiFileUpload.cfm
<!DOCTYPE html>
<CFPARAM Name="URL.contractID" defualt="">
<head>
<title>Multi File Upload</title>
<script>
$( document ).ready(function() {
$('#submitFrm').on("click", function(e){
e.preventDefault();
//The jquery.each() statement loops through all the files
selected by user
$.each($('#multiFile')[0].files, function(i, file) {
var data = new FormData();
data.append('file-0', file);
ajaxUpload(data);
}); //end .each statement
}); //end submitFrm's click function
function ajaxUpload(data){
console.log("ajaxUpload function called");
$.ajax({url: "multiFileUploadAction.cfm",
data: data,
cache: false,
contentType: false, //this is need for this to work with coldfusion
processData: false, //this is need for this to work with coldfusion
type: 'POST',
success: function(returnData){
console.log(returnData);
//here is where you would update your calling
//page if successfull
$("#msgDiv").html($("#msgDiv").html() + "<p>"
+ returnData + "</p>
},
error: function(returnData){
console.log(returnData);
}
}); //end .ajax call
} //end ajaxUpload function
}); //end onDocument ready
</script>
<style>
</style>
</head>
<body>
<form action="multiFileUploadAction.cfm" Method="POST"
enctype="multipart/form-data" class="well" id="multiFileFrm">
<input type="file" name="multiFile" id="multiFile" multiple />
<button class="btn btn-primary" id="submitFrm" >Submit</button>
<cfoutput>
<input type="hidden" Name="contractID" id="contractID"
value="#URL.contractID#">
</cfoutput>
</form>
<div id="msgDiv" style="display:none;"></div>
</body>
</html>
This is my proccessing page... again stripped down to the bare minimum:
multiFileUploadAction.cfm
<CFOUTPUT>
<CFTRY>
<cffile action="upload"
filefield="file-0"
destination="#expandpath("\images")#"
nameConflict="makeUnique">
<cfcatch>
#cfcatch.Message#
</cfcatch>
</cftry>
<cfcontent reset="true" />Uploaded #cffile.serverFile#
</CFOUTPUT>
<!---
<cfdump var="#form#">
--->
Thats it... in my production code i create a JSON response that includes
the saved file name and path to the file (because of the 'makeUnique' it
could be different then what was sent) I also process the file to create a
thumbnail and send it's name and path back to the calling page. That way
on the calling page I can display a thumbnail. Hope someone finds this
helpful.
need help for my lessonplanner application
need help for my lessonplanner application
Im working on my project which is a simple lesson planner.
does anyone have any codes for saving an input lesson and a date from a
datepicker to sqlite?and put the lesson in a list in another intent. and
when the lesson is click it go to another intent showing us the lesson and
the date and allowing us to edit or delete it.
please help.
Im working on my project which is a simple lesson planner.
does anyone have any codes for saving an input lesson and a date from a
datepicker to sqlite?and put the lesson in a list in another intent. and
when the lesson is click it go to another intent showing us the lesson and
the date and allowing us to edit or delete it.
please help.
how to set height of uilabel equal to uitableviewcell
how to set height of uilabel equal to uitableviewcell
I have a grouped style Tableview which have uilabels in Tableviewcell. Now
i want to set height of uilabels equal to height of cell how can i do
ths???
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:nil];
if (cell == nil) {
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
}
// here i want to make height of label equal to height of cell
UILabel *category = [[UILabel alloc] initWithFrame:CGRectMake(95,1,140,25)];
category.font = [UIFont fontWithName:@"Arial" size:14.0f] ;
category.textAlignment = NSTextAlignmentRight;
[category setBackgroundColor:[UIColor clearColor]];
[cell addSubview:category];
}
I have a grouped style Tableview which have uilabels in Tableviewcell. Now
i want to set height of uilabels equal to height of cell how can i do
ths???
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:nil];
if (cell == nil) {
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
}
// here i want to make height of label equal to height of cell
UILabel *category = [[UILabel alloc] initWithFrame:CGRectMake(95,1,140,25)];
category.font = [UIFont fontWithName:@"Arial" size:14.0f] ;
category.textAlignment = NSTextAlignmentRight;
[category setBackgroundColor:[UIColor clearColor]];
[cell addSubview:category];
}
Tuesday, October 1, 2013
Can someone explain why f(n) + o(f(n)) = theta(f(n))?
Can someone explain why f(n) + o(f(n)) = theta(f(n))?
According to this page:
http://math.stackexchange.com/questions/195935/proof-that-a-function-plus-a-lower-growth-function-is-theta-the-first-function
The statement: f(n) + o(f(n)) = theta(f(n)) appears to be true. Where: o =
little-O, theta = big theta
This does not make intuitive sense to me. We know that o(f(n)) grows
asymptotically faster than f(n). How, then could it be upper bounded by
f(n) as is implied by big theta?
Here is a counter-example:
let f(n) = n, o(f(n)) = n^2. n + n^2 is NOT in theta(n)
It seems to me that the answer in the previously linked stackexchange
answer is wrong. Specifically, the statement below seems as if the poster
is confusing little-o with little-omega.
Since g(n) is o(f(n)), we know that for each ϵ>0 there is an
nϵ such that |g(n)|<ϵ|f(n)| whenever n¡Ýnϵ
Thank you.
According to this page:
http://math.stackexchange.com/questions/195935/proof-that-a-function-plus-a-lower-growth-function-is-theta-the-first-function
The statement: f(n) + o(f(n)) = theta(f(n)) appears to be true. Where: o =
little-O, theta = big theta
This does not make intuitive sense to me. We know that o(f(n)) grows
asymptotically faster than f(n). How, then could it be upper bounded by
f(n) as is implied by big theta?
Here is a counter-example:
let f(n) = n, o(f(n)) = n^2. n + n^2 is NOT in theta(n)
It seems to me that the answer in the previously linked stackexchange
answer is wrong. Specifically, the statement below seems as if the poster
is confusing little-o with little-omega.
Since g(n) is o(f(n)), we know that for each ϵ>0 there is an
nϵ such that |g(n)|<ϵ|f(n)| whenever n¡Ýnϵ
Thank you.
Apply a theme to an activity in Adnroid-Eclipse?
Apply a theme to an activity in Adnroid-Eclipse?
I know how to apply a theme to a whole application, but where would I go
to apply a theme to just a single activity?
I know how to apply a theme to a whole application, but where would I go
to apply a theme to just a single activity?
Why does the compiler cast automatically without going further in the inheritance=?iso-8859-1?Q?=3F_=96_stackoverflow.com?=
Why does the compiler cast automatically without going further in the
inheritance? – stackoverflow.com
While I try to run following code snippet, it's executing wrong overload
method. I'm confused why it does that? [testB.TestMethod(testValue) method
execute the public double TestMethod(double ...
inheritance? – stackoverflow.com
While I try to run following code snippet, it's executing wrong overload
method. I'm confused why it does that? [testB.TestMethod(testValue) method
execute the public double TestMethod(double ...
Should I say "I miss you today when I drop by your office"? ell.stackexchange.com
Should I say "I miss you today when I drop by your office"? –
ell.stackexchange.com
I want to write a note to a person that I could not find him at his
office, but he does not expect that I would be there If I write "I miss
you today when I drop by your office" Does it sound ...
ell.stackexchange.com
I want to write a note to a person that I could not find him at his
office, but he does not expect that I would be there If I write "I miss
you today when I drop by your office" Does it sound ...
Monday, September 30, 2013
Is there a word for the action of lifting the mouse to go further=?iso-8859-1?Q?=3F_=96_english.stackexchange.com?=
Is there a word for the action of lifting the mouse to go further? –
english.stackexchange.com
Using a computer mouse to point to a far away target and running out of
table surface (or hand range), one typically lifts the mouse, moves it in
the opposite direction, puts it back down, and ...
english.stackexchange.com
Using a computer mouse to point to a far away target and running out of
table surface (or hand range), one typically lifts the mouse, moves it in
the opposite direction, puts it back down, and ...
Major differences between mod_fastcgi and mod_proxy_fcgi
Major differences between mod_fastcgi and mod_proxy_fcgi
I noticed there are a couple of modules for Apache that provide FastCGI
support. The two most popular seem to be mod_fastcgi and mod_proxy_fcgi.
There seem to be other ones as well.
My questions are:
Which of these module are the most popular?
Which of them are considered obsolete.
The reason I am asking is that I'm writing FastCGI support for a certain
scripting language and I wonder which setups I should primarily test with.
Granted, FastCGI is a standard so, in theory everything should be
portable. On the other hand, there seem to be certain differences
concerning application server start-up, etc. I would also like to write
some "how-to's" once I'm finished, so I would like to know which options
to cover primarily.
Hope this is not an open-ended question.
I noticed there are a couple of modules for Apache that provide FastCGI
support. The two most popular seem to be mod_fastcgi and mod_proxy_fcgi.
There seem to be other ones as well.
My questions are:
Which of these module are the most popular?
Which of them are considered obsolete.
The reason I am asking is that I'm writing FastCGI support for a certain
scripting language and I wonder which setups I should primarily test with.
Granted, FastCGI is a standard so, in theory everything should be
portable. On the other hand, there seem to be certain differences
concerning application server start-up, etc. I would also like to write
some "how-to's" once I'm finished, so I would like to know which options
to cover primarily.
Hope this is not an open-ended question.
How to delete a row by selecting a check box using jdbc?
How to delete a row by selecting a check box using jdbc?
I am writing a program using (MVC) framework in which the below code will
fetch total no. of request made by a user and each with 7 columns. Now i
want to do is delete a particular row using a check box which user
selects. Can anyone tell me how can i detect which check box user has
selected so that only that row is deleted ?
import java.io.*;
import java.lang.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class allrequestcontrol extends TagSupport
{
HttpServletRequest request;
HttpServletResponse response;
String f="111";
String ss="";
public ResultSet check()
{
JspWriter out=pageContext.getOut();
Connection con;
Statement stmt;
ResultSet rs=null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch( ClassNotFoundException ex)
{
}
try
{
con=
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","gaurav","oracle");
stmt=con.createStatement();
rs=stmt.executeQuery("select * from myadmin where employe_id='"+f+"'");
}
catch(SQLException ex)
{
}
return rs;
}
public int doEndTag() throws JspException
{
JspWriter out=pageContext.getOut();
ResultSet rs= check();
try
{
out.println("<table border=2>");
out.println("<tr>");
out.println("<th>EmployeId</th>");
out.println("<th>Supervisor</th>");
out.println("<th>Department</th>");
out.println("<th>PickDate.</th>");
out.println("<th>PickTime</th>");
out.println("<th>DropDate</th>");
out.println("<th>DropTime</th>");
out.println("<th>Status</th>");
out.println("<th>Check</th>");
out.println("</tr>");
while(rs.next())
{
out.println("<tr>");
out.println("<td>"+rs.getString(1)+"</td>")
out.println("<td>"+rs.getString(2)+"</td>");
out.println("<td>"+rs.getString(3)+"</td>");
out.println("<td>"+rs.getString(4)+"</td>");
out.println("<td>"+rs.getString(5)+"</td>");
out.println("<td>"+rs.getString(6)+"</td>");
out.println("<td>"+rs.getString(7)+"</td>");
out.println("<td>"+rs.getString(8)+"</td>");
out.println("<td><input type=checkbox name=check value=check></td>");
out.println("</tr>");
}
}
catch(Exception ex)
{
}
return super.doEndTag();
}
}
I am writing a program using (MVC) framework in which the below code will
fetch total no. of request made by a user and each with 7 columns. Now i
want to do is delete a particular row using a check box which user
selects. Can anyone tell me how can i detect which check box user has
selected so that only that row is deleted ?
import java.io.*;
import java.lang.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class allrequestcontrol extends TagSupport
{
HttpServletRequest request;
HttpServletResponse response;
String f="111";
String ss="";
public ResultSet check()
{
JspWriter out=pageContext.getOut();
Connection con;
Statement stmt;
ResultSet rs=null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch( ClassNotFoundException ex)
{
}
try
{
con=
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","gaurav","oracle");
stmt=con.createStatement();
rs=stmt.executeQuery("select * from myadmin where employe_id='"+f+"'");
}
catch(SQLException ex)
{
}
return rs;
}
public int doEndTag() throws JspException
{
JspWriter out=pageContext.getOut();
ResultSet rs= check();
try
{
out.println("<table border=2>");
out.println("<tr>");
out.println("<th>EmployeId</th>");
out.println("<th>Supervisor</th>");
out.println("<th>Department</th>");
out.println("<th>PickDate.</th>");
out.println("<th>PickTime</th>");
out.println("<th>DropDate</th>");
out.println("<th>DropTime</th>");
out.println("<th>Status</th>");
out.println("<th>Check</th>");
out.println("</tr>");
while(rs.next())
{
out.println("<tr>");
out.println("<td>"+rs.getString(1)+"</td>")
out.println("<td>"+rs.getString(2)+"</td>");
out.println("<td>"+rs.getString(3)+"</td>");
out.println("<td>"+rs.getString(4)+"</td>");
out.println("<td>"+rs.getString(5)+"</td>");
out.println("<td>"+rs.getString(6)+"</td>");
out.println("<td>"+rs.getString(7)+"</td>");
out.println("<td>"+rs.getString(8)+"</td>");
out.println("<td><input type=checkbox name=check value=check></td>");
out.println("</tr>");
}
}
catch(Exception ex)
{
}
return super.doEndTag();
}
}
2 calculations with one populate button
2 calculations with one populate button
I have a simple worksheet that auto populates hours based on key values.
This all works fine. The problem I have now is that I need to add some
form of a contingency column which is a percentage figure of the total
hours used up to this column. Add the contingency figures to the sheet and
carry on with the populate.
Is there anyway i can do the first populate up to the contingency column.
Stop. Get the current value (for total hours) then do some calculations
and then carry on with the auto populate?
I don't really have any code I can share, but any pointers in the right
direction would be extremely useful.
Thankyou for your time.
I have a simple worksheet that auto populates hours based on key values.
This all works fine. The problem I have now is that I need to add some
form of a contingency column which is a percentage figure of the total
hours used up to this column. Add the contingency figures to the sheet and
carry on with the populate.
Is there anyway i can do the first populate up to the contingency column.
Stop. Get the current value (for total hours) then do some calculations
and then carry on with the auto populate?
I don't really have any code I can share, but any pointers in the right
direction would be extremely useful.
Thankyou for your time.
Sunday, September 29, 2013
How to open a link in the default browser on Firefox OS?
How to open a link in the default browser on Firefox OS?
I have a Firefox OS app where I want a link to open outside of the
application (the link is to a different site, and opening it
in-application would make the application unusable without a force-quite).
How do I do that?
I have a Firefox OS app where I want a link to open outside of the
application (the link is to a different site, and opening it
in-application would make the application unusable without a force-quite).
How do I do that?
Assembly language offsetting multiple ways to store words?
Assembly language offsetting multiple ways to store words?
I am using MIPS with the mars editor and I was wondering if something like
sw $s0,8($v0)
Is equivalent to:
sw $s0,$v0(8)
My instinct tells me this is not the case because it takes the address of
whatevers in the brackets and adds the value of whatever is outside it.
However in the solution posted by codeknight in the link beliw he
http://www.masmforum.com/board/index.php?PHPSESSID=786dd40408172108b65a5a36b09c88c0&topic=1062.0
I am using MIPS with the mars editor and I was wondering if something like
sw $s0,8($v0)
Is equivalent to:
sw $s0,$v0(8)
My instinct tells me this is not the case because it takes the address of
whatevers in the brackets and adds the value of whatever is outside it.
However in the solution posted by codeknight in the link beliw he
http://www.masmforum.com/board/index.php?PHPSESSID=786dd40408172108b65a5a36b09c88c0&topic=1062.0
Why is Internet traffic being blocked for .NET programs ONLY?
Why is Internet traffic being blocked for .NET programs ONLY?
We have a POS-based application in Windows Forms written in VB.NET, which
we're rolling out to franchise stores - 70, so far.
The application replicates data by means of a connection to a head office
server: all communication is by means of Web Services (upload & download).
All is working really well, except - you knew it was coming - on literally
a handful of stores we cannot connect to the web services, although we
know that the Internet service is good!
Here's a bullet-point summary of the situation:
in this handful of stores, ALL .NET (only) internet traffic fails on this
POS computer.
primarily this traffic is using port 80 to connect to web services, using
SOAP (standard)
BUT they can successfully use a browser in the POS to see web pages; also,
a test program I created in Clarion (straight Win 32) also connects to the
web service ok.
In addition, an associated data conversion app (again in VB.NET) also
fails when trying to connect to MS SQL at HQ (and only for this handful of
stores). Note: this uses a standard ADO connection, thus a completely
different protocol to the above.
So it's just all .NET Internet that fails... different apps, different
protocol. The error message in all cases is "The operation has timed out"
Note: timeout is set to 15 seconds - ample time for simple web service,
esp. as the initial method is just a time-check.
Take a POS that's failing to connect and move to a different site: all good
Take a POS that's failing to connect and change the router: all good
But the routers in failing stores are not all the same
It looks as if the .NET setup on the POS pc is somehow being 'blocked'.
Too weird - what am I missing here?
Grateful for pointers... I'm stumped! Steve.
We have a POS-based application in Windows Forms written in VB.NET, which
we're rolling out to franchise stores - 70, so far.
The application replicates data by means of a connection to a head office
server: all communication is by means of Web Services (upload & download).
All is working really well, except - you knew it was coming - on literally
a handful of stores we cannot connect to the web services, although we
know that the Internet service is good!
Here's a bullet-point summary of the situation:
in this handful of stores, ALL .NET (only) internet traffic fails on this
POS computer.
primarily this traffic is using port 80 to connect to web services, using
SOAP (standard)
BUT they can successfully use a browser in the POS to see web pages; also,
a test program I created in Clarion (straight Win 32) also connects to the
web service ok.
In addition, an associated data conversion app (again in VB.NET) also
fails when trying to connect to MS SQL at HQ (and only for this handful of
stores). Note: this uses a standard ADO connection, thus a completely
different protocol to the above.
So it's just all .NET Internet that fails... different apps, different
protocol. The error message in all cases is "The operation has timed out"
Note: timeout is set to 15 seconds - ample time for simple web service,
esp. as the initial method is just a time-check.
Take a POS that's failing to connect and move to a different site: all good
Take a POS that's failing to connect and change the router: all good
But the routers in failing stores are not all the same
It looks as if the .NET setup on the POS pc is somehow being 'blocked'.
Too weird - what am I missing here?
Grateful for pointers... I'm stumped! Steve.
Google Chrome Extensions as standalone application
Google Chrome Extensions as standalone application
Is it possible to run a Google Chrome extensions outside of Chrome? For
instance, there is an add-on called TLDR which summarizes text on a web
page. Is it possible to write a program that can somehow "tap" into it's
summarization capabilities?
Is it possible to run a Google Chrome extensions outside of Chrome? For
instance, there is an add-on called TLDR which summarizes text on a web
page. Is it possible to write a program that can somehow "tap" into it's
summarization capabilities?
Saturday, September 28, 2013
How to load a column generated by awk into a python list
How to load a column generated by awk into a python list
With awk it is very easy to extract a column of data in the bash terminal
using.
awk '{print $1}'
I am doing this inside a python script where i use a bash sequence to
extract the data i'm interested in
os.system(" qstat | awk '{print $1}' ")
If i call this in a certain context I get a column of numbers. I would
like to load all of those numbers into a python list. Can this be done
easily?
With awk it is very easy to extract a column of data in the bash terminal
using.
awk '{print $1}'
I am doing this inside a python script where i use a bash sequence to
extract the data i'm interested in
os.system(" qstat | awk '{print $1}' ")
If i call this in a certain context I get a column of numbers. I would
like to load all of those numbers into a python list. Can this be done
easily?
How do I approach this program?
How do I approach this program?
I need to fill in the code for this program. It is supposed to read
integer scores from a file and print out their average. We are supposed to
account for files that do not contain any integer values. The output is
just a simple print line displaying the averaged out scores.
he gives us a hint:"if input is a Scanner object associated with a file,
input.hasNextInt() returns true if there is an integer value left unread
in the file; otherwise it returns false."
import java.io.*;
import java.util.Scanner;
public class GradeAvg
{
public static void main(String[] args)
{
Scanner input = null;
double average=0.0;
try
{
input = new Scanner(new File("scores.dat"));
}
catch (FileNotFoundException e)
{
System.out.println("*** Can't open scores.dat ***");
System.exit(1);
}
System.out.println("The average of the test scores in the file are: ");
}
}
I need to fill in the code for this program. It is supposed to read
integer scores from a file and print out their average. We are supposed to
account for files that do not contain any integer values. The output is
just a simple print line displaying the averaged out scores.
he gives us a hint:"if input is a Scanner object associated with a file,
input.hasNextInt() returns true if there is an integer value left unread
in the file; otherwise it returns false."
import java.io.*;
import java.util.Scanner;
public class GradeAvg
{
public static void main(String[] args)
{
Scanner input = null;
double average=0.0;
try
{
input = new Scanner(new File("scores.dat"));
}
catch (FileNotFoundException e)
{
System.out.println("*** Can't open scores.dat ***");
System.exit(1);
}
System.out.println("The average of the test scores in the file are: ");
}
}
Turn off vibration inside my app
Turn off vibration inside my app
I'm developing an app and need to completely turn off vibration alerts
when my app is running. For example if an call comes in while my app is
open I don't want to have the vibration alert, the same with emails and
anyother notification.
So I've been googling around for a while and found this:
AudioManager amanager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
amanager.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,AudioManager.VIBRATE_SETTING_OFF);
The problem is that this method is deprecated. And I can't find an other
way of doing this.
The minSdkVersion = 9 and targetSdkVersion = 17.
Any idea?
Thanks!!
I'm developing an app and need to completely turn off vibration alerts
when my app is running. For example if an call comes in while my app is
open I don't want to have the vibration alert, the same with emails and
anyother notification.
So I've been googling around for a while and found this:
AudioManager amanager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
amanager.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,AudioManager.VIBRATE_SETTING_OFF);
The problem is that this method is deprecated. And I can't find an other
way of doing this.
The minSdkVersion = 9 and targetSdkVersion = 17.
Any idea?
Thanks!!
Subscribe to:
Posts (Atom)