28th May 2007
I enjoyed this article, while trying to make the R environment on Windows process some 16 microarrays, using some memory-intensive algorithm… Well, after several hours of processing and gradually increasing the memory use, R script failed with memory-allocation error.
It’s interesting, but running the same script in Topologilinux, launched from within Windows, did the trick. Though being a simulated environment, it was slower, and page-swapping was really heavy with only 0.5GB memory.
Posted in Links, OS, Programming | No Comments »
23rd May 2007
Refreshing my scarce knowledge of Apache’s mod-rewrite, I read through the mod_rewrite guide, and found an extremely interesting section, titled
On-the-fly Content-Regeneration
Here’s the theoretical problem:
- we are building a high-traffic site with lots of once-per-(hour|day) updated items
- we have a CMS with just all the features we need, but it’s really CPU/DB-consuming and slow (does it sound familiar? )
- there’s a need to serve static files
And here’s the ‘radical alternative’ solution:
- install the CMS of choice
- tweak the CMS’s output layer to both produce/write to disk (or update) static HTML files, and to dump those same pages directly to browser
- use the “On-the-fly Content-Regeneration” mod_rewrite rules set
This is it, in short. The “On-the-fly Content-Regeneration” will read the static files if they exist, or will query the CMS, which will create/update the static files and output the necessary page. You can also setup a cron-job to remove all static files older than XX minutes, to force content refresh.
Below is the copy of “On-the-fly Content-Regeneration” from the mod_rewrite guide.
Read the rest of this entry »
Posted in CMS, Links, Notepad, Programming, Web | No Comments »
23rd May 2007
Found a nicely illustrated method for running a background shell command from PHP and continuously checking if the process is still running.
Here’s sample code without explanations:
function run_in_background($Command, $Priority = 0)
{
if($Priority)
$PID = shell_exec("nohup nice -n $Priority $Command 2> /dev/null & echo $!");
else
$PID = shell_exec("nohup $Command 2> /dev/null & echo $!");
return($PID);
}
function is_process_running($PID)
{
exec("ps $PID", $ProcessState);
return(count($ProcessState) >= 2);
}
To run something like hmmsearch from the HMMER package, you’d do this:
echo("Running hmmsearch. . .")
$ps = run_in_background("hmmsearch $hmmfile $fastafile > $outfile");
while(is_process_running($ps))
{
echo(" . ");
ob_flush();flush();
sleep(1);
}
Posted in Links, PHP, Programming | 8 Comments »
22nd May 2007
Came across toonel.net project. It’s free for private, non-commercial use.
Citing the site:
toonel.net is an experiment in a technique for conserving network bandwidth. If you are paying a fee based on the amount of data you transfer (e.g. 3G/GPRS/DSL/CDMA) and have monthly download limit, or if you have narrowband connection (e.g. dialup modem) then you are most likely to appreciate the service toonel.net offers. There are number of toonel.net client application packages. All solutions are 100% Java based and therefore this service can be used on any platform with an installed Java Runtime Environment, including mobile phones.
toonel.net: what it is good for?
- expensive transports (e.g. GPRS, CDMA…)
- narrowband or slow connections (e.g. dial-up)
- stretching download limits
Why toonel.net is different?
- cross platform
- built from open source components
- allows to compress virtually any traffic
As soon as I switch to some java-enabled personal communication device, (and if toonel.net will still exist by that time ), I would definitely try it. Or if I switch to some speedy but traffic-limited internet-access provider.
Posted in Links, Notepad, Web | 2 Comments »
15th May 2007
Today in mail:
AdaCore is pleased to announce the launch of the new Ada Gems series. The Gems will cover a wide-range of Ada programming topics and will often include executable source code and other related resources to help understand and discover the Ada programming language. The first Gem, written by Bob Duff entitled “Limited Aggregates in Ada 2005â€, is available at:
adacore.com/category/developers-center/gems
Posted in Ada, Links, Programming | No Comments »
7th May 2007
This is a rather old method, applicable to magnetic-stripe cards. This is also a good warning/reminder for any card holders – do not let the card out of your sight even for a second.
And do not forget, that simple photocopy of your card’s both sides is sufficient to buy anything on the internet (anything *your card* can handle, that is). It might not be funny do discover that your card was used to buy a motorbike in Africa, though you never traveled outside the US
Update: video (http://www.youtube.com/v/sexUus0igWs) was removed from Youtube due to copyright claims.
Posted in Links | No Comments »
6th May 2007
came across this photo at Flickr. Must-see for any StarWars-lovers!
(“read more” for the photo here…)
Read the rest of this entry »
Posted in Links, Movies | No Comments »