Run CRON task directly on router to automate jobs
I want to setup CRON job directly on D'LINK DIR-655 router. I need to run
there PING job to monitor my network response times, and log all the
errors with Internet connection directly on router.
D'LINK router firmware have built in some PING tool, but D'LINK prepared
it only to manual tests. I need to automate it with CRON job to monitor
connection 24h/day with interval 3 seconds.
Is it possible?
Monday, 30 September 2013
Is on one hand...on the other hand a cliché to be avoided=?iso-8859-1?Q?=3F_=96_english.stackexchange.com?=
Is "on one hand...on the other hand" a cliché to be avoided? –
english.stackexchange.com
We should find a way of long peace instead of living just for today. On
one hand, we have to prevent the community from coming apart and suffering
the disasters caused by it; on the other hand, to …
english.stackexchange.com
We should find a way of long peace instead of living just for today. On
one hand, we have to prevent the community from coming apart and suffering
the disasters caused by it; on the other hand, to …
How to show a location with respect to my current location?
How to show a location with respect to my current location?
I have a lat and longitude of my friend's location also my current
location. I want to show the position of my friend with respect to my
location, just like a compass - in an iPhone app. I know the function
didUpdateHeading -
-(void)locationManager:(CLLocationManager *)manager
didUpdateHeading:(CLHeading *)newHeading
{
NSLog(@"New magnetic heading: %f", newHeading.magneticHeading);
NSLog(@"New true heading: %f", newHeading.trueHeading);
}
I am not getting an idea about how to do this, Please help me.
I have a lat and longitude of my friend's location also my current
location. I want to show the position of my friend with respect to my
location, just like a compass - in an iPhone app. I know the function
didUpdateHeading -
-(void)locationManager:(CLLocationManager *)manager
didUpdateHeading:(CLHeading *)newHeading
{
NSLog(@"New magnetic heading: %f", newHeading.magneticHeading);
NSLog(@"New true heading: %f", newHeading.trueHeading);
}
I am not getting an idea about how to do this, Please help me.
How to organize js files for a multi page mvc applicaiton
How to organize js files for a multi page mvc applicaiton
We have a project implemented using ASP.NET MVC 4. it is a multi page
application.
We use jQuery for handling client side interactions. Now the js file has a
lot of callback functions.
What is the best way to organize the code in the javascript file?
We have a project implemented using ASP.NET MVC 4. it is a multi page
application.
We use jQuery for handling client side interactions. Now the js file has a
lot of callback functions.
What is the best way to organize the code in the javascript file?
Sunday, 29 September 2013
Function that checks width of an image loaded by user randomly returns 0
Function that checks width of an image loaded by user randomly returns 0
I was trying to write a function that would check if the image I chose via
input[type=file] is exactly 700 px wide and if not - reject this image. I
succeeded, however, sometimes this function randomly returns 0 and I need
to load the same image a couple of times until it reads its width
correctly. Any ideas on how to improve this code? Thanks in advance!
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
var img = new Image;
img.src = e.target.result;
if(img.width == 700) {
DoSomeStuff();
} else {
alert("This image has to be 700 px wide, but is " +
img.width + " px wide. Try again!");
input.value = "";
}
};
reader.readAsDataURL(input.files[0]);
}
I was trying to write a function that would check if the image I chose via
input[type=file] is exactly 700 px wide and if not - reject this image. I
succeeded, however, sometimes this function randomly returns 0 and I need
to load the same image a couple of times until it reads its width
correctly. Any ideas on how to improve this code? Thanks in advance!
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
var img = new Image;
img.src = e.target.result;
if(img.width == 700) {
DoSomeStuff();
} else {
alert("This image has to be 700 px wide, but is " +
img.width + " px wide. Try again!");
input.value = "";
}
};
reader.readAsDataURL(input.files[0]);
}
Get list from list values in a python dictionary
Get list from list values in a python dictionary
I have a python dictionary with the following entries:
professions = {Peasant : ["Peasant", 10000], Merchant : ["Merchant",
15000], ...}
Is there a clever way to get a list of all profession names? I'd like a
function that returns
["Peasant", "Merchant", ...]
thanks for suggestions
I have a python dictionary with the following entries:
professions = {Peasant : ["Peasant", 10000], Merchant : ["Merchant",
15000], ...}
Is there a clever way to get a list of all profession names? I'd like a
function that returns
["Peasant", "Merchant", ...]
thanks for suggestions
In SAO architecture should single API do everything or API should be spilt as multiple action
In SAO architecture should single API do everything or API should be spilt
as multiple action
We have an app which is exposing api(RESTful) to UI for purchasing a item.
I have a question regardinng API design. Lets say the following action
should be taken in order
Item to be chosen for purchase
Next give the address to be delivered to
My question is should we design a single api which gets both data perform
both? Or should we desgin two api calls one that creates a purchase record
and second that update the address to be delivered to?
as multiple action
We have an app which is exposing api(RESTful) to UI for purchasing a item.
I have a question regardinng API design. Lets say the following action
should be taken in order
Item to be chosen for purchase
Next give the address to be delivered to
My question is should we design a single api which gets both data perform
both? Or should we desgin two api calls one that creates a purchase record
and second that update the address to be delivered to?
Subscribe to:
Posts (Atom)