Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    Archive for October, 2009

    Ukraine hit by influenza A/H1N1 (swine flu)

    31st October 2009

    virusStarting October, 30, there is a 3-week quarantine in all primary and higher bodies of education in Ukraine – to limit the spread of the infection.

    A total of 80k people were registered with respiratory infections (not classified by flu type). Several small samples tested for A/H1N1 (which is the cause of swine flu pandemic) indicate that 30-50% of all cases could be swine flu (with other cases being “seasonal flu” – that is, previously known influenza types and subtypes). It is reported that ~37 died since Monday, with symptoms matching those of swine flu. Most of the statistics come from the Western regions of Ukraine, which were the first to face rapid daily temperatures decrease – which could have been the trigger of massive infections.

    Today I’ve seen a number of people in Kyiv’s underground railway wearing medical face masks (or just pulling their scarfs up to cover noses). Drug stores were literally stormed for anti-virus medications, immune system stimulators, medical face masks, vitamins, etc.

    If not the virus, then panic is definitely in the air. I do not recollect seeing something like that before.

    Share

    Posted in Life, Misc, Society | No Comments »

    Search and replace in a MySQL table

    27th October 2009

    This query performs a table-wide search-and-repalce:

    UPDATE `table_name` SET `table_field` = REPLACE(`table_field`,’string to search for and replace’,'replacement string’);

    If you need a database-wide search-and-replace, you could try this script (I haven’t tested/used it myself).

    Beware of the following gotchas:

    1. wrong query syntax may ruin the field you are performing replace on, so always backup first!
    2. be sure to provide “search-for” string as specific as possible, or you will get unexpected replacements (e.g. replacing mini with little will also convert all minivans into littlevans); also, do use WHERE clause when necessary to limit the number of rows modified
    3. the function in the example is case-sensitive, so replacing all minivans with vehicles won’t replace Minivans. However, I believe there exists a case-insensitive version of REPLACE function
    Share

    Posted in how-to, Notepad | No Comments »

    Configuring web-server: for production and for development

    25th October 2009

    Production: see http://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-debian-etch – it is for Debian Etch (which is old-stable), but many of the steps apply equally well to Debian Lenny (current-stable). Also, this is a very basic guide, as if you are going to host multiple sites from multiple clients, you most definitely will need some hosting control panel.

    Development: see http://www.ruzee.com/blog/2009/01/apache-virtual-hosts-a-clean-setup-for-php-developers. This setup works very well, unless you need to create several virtual hosts every day – in which case necessary actions could be partially scripted.

    Share

    Posted in Links, Notepad, PHP, Programming, Software | No Comments »

    R under Debian testing/i386: permanently set pdfviewer option

    21st October 2009

    If you get this message when opening vignettes:

    Error in openPDF(vif) :
    getOption(‘pdfviewer’) is ”; please use ‘options(pdfviewer=…)’

    and you are tired of running this command every time:

    > options(pdfviewer=”okular”)

    then you should check if your system-wide Renviron file has proper PDF viewer set:
    Read the rest of this entry »

    Share

    Posted in *nix, how-to, Notepad, Software | No Comments »

    Single password for multiple sites is safe to use with PwdHash

    16th October 2009

    PwdHash uses your “single password” to create a site-unique password (by making a one-way hash of your password and the site’s domain).

    Although I’m not using “single password for all sites”, PwdHash does look very convenient.

    Share

    Posted in Links, Software, Web | No Comments »

    Convenient design and debugging of regular expressions under Linux

    10th October 2009

    redet-supported languagesRegular expressions (regexps) are powerful indeed. But debugging non-trivial regexps is a burden even if you understand how regexps work, and remember most (if not all) regexp syntax.

    Miscellaneous tools exist to ease this task. This post was inspired by redet’s comparison of regexp helper tools – it could be sufficient to read only that, if you’re going to try the mentioned tools yourself. Otherwise, read on.
    Read the rest of this entry »

    Share

    Posted in *nix, Notepad, Programming, Software | No Comments »

    Google barcode day: make one for your site/blog

    7th October 2009

    bogdan.org.ua barcode Today Google celebrates the invention of the barcode.

    To help in this celebration, you can make a barcode with your site’s address (there is at least one more at barcodesinc, but at the moment of writing it is painfully slow).

    I find these parameters nearly optimal:

    • Type: Code 128-B
    • Styles: Draw value text
    • Size: 234×60 (half-banner size)
    • Xres: 1
    • Text font: 5
    • Value: bogdan.org.ua :)

    If you wish, you can also exactly replicate today’s Google logo – which says “Google”, as you could have guessed.

    You can place this barcode on your “souvenirs” – pens, cups, t-shirts. Many phones now have barcode scanners (e.g. Nokia E71), so put this code onto your namecard.

    Read on to learn about matrix barcodes.
    Read the rest of this entry »

    Share

    Posted in Links, Misc, Software, Web | 1 Comment »