Cont'd Decimal Expansion, rational or not?
This is a follow up from this question.
Since it's proven by Calvin Lin that $0.11235813213455...$ (Fibonacci
Sequence), I'm not wondering if the sequence
$$0.123456789101112131415...$$
(which is just natural numbers) is rational or not. Thanks for the help in
advanced!
Tuesday, 1 October 2013
which shell will sudo use to execute a shell script without the shebang line unix.stackexchange.com
which shell will sudo use to execute a shell script without the shebang
line – unix.stackexchange.com
My environment is Ubuntu 12.04 LTS, and the sudo version is 1.8.3p1. First
I login as a normal user: $ whoami fin $ cat /etc/passwd | grep -i
"root\|fin" root:x:0:0:root:/root:/bin/bash ...
line – unix.stackexchange.com
My environment is Ubuntu 12.04 LTS, and the sudo version is 1.8.3p1. First
I login as a normal user: $ whoami fin $ cat /etc/passwd | grep -i
"root\|fin" root:x:0:0:root:/root:/bin/bash ...
Monday, 30 September 2013
Run CRON task directly on router to automate jobs
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?
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?
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]);
}
Subscribe to:
Posts (Atom)