Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    • Archives

    • Recent comments

    Archive for the 'Links' Category

    Interesting and relevant links I found.

    Windows memory management unveiled

    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.

    Share

    Posted in Links, OS, Programming | No Comments »

    Radical Alternative to caching: On-the-fly Content-Regeneration

    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:

    1. we are building a high-traffic site with lots of once-per-(hour|day) updated items
    2. we have a CMS with just all the features we need, but it’s really CPU/DB-consuming and slow (does it sound familiar? :) )
    3. there’s a need to serve static files

    And here’s the ‘radical alternative’ solution:

    1. install the CMS of choice
    2. 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
    3. 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 »

    Share

    Posted in CMS, Links, Notepad, Programming, Web | No Comments »

    Executing and checking background shell process from PHP

    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:

    1. function run_in_background($Command, $Priority = 0)
    2. {
    3.  if($Priority)
    4.   $PID = shell_exec("nohup nice -n $Priority $Command 2> /dev/null & echo $!");
    5.  else
    6.   $PID = shell_exec("nohup $Command 2> /dev/null & echo $!");
    7.  return($PID);
    8. }
    9.  
    10. function is_process_running($PID)
    11. {
    12.  exec("ps $PID", $ProcessState);
    13.  return(count($ProcessState) >= 2);
    14. }

    To run something like hmmsearch from the HMMER package, you’d do this:

    1. echo("Running hmmsearch. . .")
    2. $ps = run_in_background("hmmsearch $hmmfile $fastafile > $outfile");
    3. while(is_process_running($ps))
    4. {
    5.  echo(" . ");
    6.  ob_flush();flush();
    7.  sleep(1);
    8. }
    Share

    Posted in Links, PHP, Programming | 8 Comments »

    toonel.net: JZlib-compressing proxy with Java client

    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.

    Share

    Posted in Links, Notepad, Web | 2 Comments »

    The launch of the Ada Gems series

    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

    Share

    Posted in Ada, Links, Programming | No Comments »

    Credit card cloning video

    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.

    Share

    Posted in Links | No Comments »

    StarWars fans: where present meets the past and the future

    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 »

    Share

    Posted in Links, Movies | No Comments »