Warning: simplexml_load_file() [function.simplexml-load-file]: http://www.alliphones.com/rss.xml:61: parser error : EntityRef: expecting ';' in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: href="http://www.sedo.co.uk/search/details.php4?domain=alliphones.com&language in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: http://www.alliphones.com/rss.xml:61: parser error : EntityRef: expecting ';' in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: tp://www.sedo.co.uk/search/details.php4?domain=alliphones.com&language=pl&et_sub in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: http://www.alliphones.com/rss.xml:61: parser error : EntityRef: expecting ';' in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: .co.uk/search/details.php4?domain=alliphones.com&language=pl&et_sub=37&partnerid in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: http://www.alliphones.com/rss.xml:61: parser error : EntityRef: expecting ';' in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: /details.php4?domain=alliphones.com&language=pl&et_sub=37&partnerid=14460&et_cid in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: http://www.alliphones.com/rss.xml:61: parser error : EntityRef: expecting ';' in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: hp4?domain=alliphones.com&language=pl&et_sub=37&partnerid=14460&et_cid=15&et_lid in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: http://www.alliphones.com/rss.xml:101: parser error : Entity 'reg' not defined in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: c5NjQyYzBmOC45NDY5MTQ4OQkwLjI0NjU4NjY4CTEJCTM1NQkzMDMz" target="_blank">Key® in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: http://www.alliphones.com/rss.xml:173: parser error : Entity 'nbsp' not defined in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: <div id="clear"> </div> in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /var/www/clients/client2/web42/web/inc/rss2base.php on line 20 Interactive World News » GE working on superhydrophobic materials
Sure you have heard of water-resistant and water-repellent materials before, but the folks over at GE Global Research are pushing the envelope when it comes to keeping water off our stuff. Tao Deng has posted in his research blog that their division has been working on superhydrophobic surfaces. They discovered that when water is dropped [...] Publication date: 2008-11-22
More news from 2008-11-22
Bash Trick: Watching Multiple Background Jobs
I recently had a need to add some error checking to a bash script that runs multiple copies of a Perl script in parallel to better utilize a multi-core server. I wanted a way to run these four processes in the background and gather up their exit values. Then, if any of them failed, I'd prematurely exit the bash script and report the error.
After a bit of reading bash docs, I came across some built-ins that I hadn't previously used or even seen. First, I'll show you the code:
wait.sh
This is the bash script that runs the parallel processes and gathers up the exit values.
#!/bin/bash
FAIL=0
echo "starting"
./sleeper 2 0 &
./sleeper 2 1 &
./sleeper 3 0 &
./sleeper 2 0 &
for job in `jobs -p`
do
echo $job
wait $job || let "FAIL+=1"
done
echo $FAIL
if [ "$FAIL" == "0" ];
then
echo "YAY!"
else
echo "FAIL! ($FAIL)"
fi
sleeper
And here's the Perl script that I wrote in order to test the functioning of wait.sh. It accepts to arguments. The first is the number of seconds to sleep (to simulate the delay associated with doing work) and the second is the exit value it should use (any non-zero value indicates a failure).
#!/usr/bin/perl -w
use strict;
my $time = $ARGV[0] || 1;
my $exit = $ARGV[1] || 0;
sleep $time;
exit $exit;
Discussion
New to me was the use of let to do math on a variable so that I can count up the number of failures. Is there a better way? There's no native ++ operator in bash. Similarly, using jobs to get a list of pids to wait on provided to be a very useful idiom.
The code is straightforward and works for my purposes. But since 99% of my time is spent in Perl rather than bash, I wonder what I could have done differently and/or better. Feedback welcome.
And, if this is at all useful to you, feel free to take it and run...
Finally, I'm starting to really dig gist.github for showing off bits of code. It's good stuff. (comments) Publication date: 2008-11-22more
Get your Christmas Ringtunes for your mobile phone
Ringtones are getting an upgrade and you may be able to trick out your mobile phones with some Christmas ringers as a result. In order to test out the new Ringtunes technology (which offers near CD quality ringtones on your cell phone) the company behind the technology is launching a special pilot website. The Christmas [...] Publication date: 2008-11-22more
First Look: The UK
Have you ever wished there was an easier way to buy, install and play games? Well, now there is thanks to the good people over at Metaboli, who have taken on the bold task to revolutionize the world of PC gaming as we know it. Forget spending $50 to play one game that you Publication date: 2008-11-22more