Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    • Archives

    • Recent comments

    Google gadget ads launched

    19th September 2007

    Google launched gadget ads.

    Posted in Affiliate programs, Links, Misc | No Comments »

    PHP proxy

    19th September 2007

    PHP proxy is simple but good. I converted it into a proxy-function for one of my projects.

    Do pay attention to the comments, especially these two:

    I had issues with this script (and others) returning 0 for the bytesTotal in flash. Basically, the Content-Length header was absent from the response. By simply adding
    header(“Content-length: “.strlen($response)) before the echo, it resolved the issue. I don’t know if there is a more appropriate fix to account for character encoding, etc, but it seems to work.

    @Schimmi: Well, if you can add some checks there (like who is referring your script) and allow the access to whitelisted clients (served from your domain)… I think, you can totally make it used applications from same-domain….So it would not be open to world. Yeah above script doesn’t have those things.

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

    Using Cytoscape from behind an HTTP proxy which requires authentication (authorization)

    14th September 2007

    Cytoscape 2.5.1 supports proxies, including HTTP proxies, but there is no support for HTTP proxies requiring authentication/authorization. It’s easy to use Cytoscape in the authentication-requiring proxy scenario; below is one possible method.

    Note, that exactly the same method can be used to allow any software, which supports proxies but not proxies with authentication, to be able to access the internet.
    Read the rest of this entry »

    Posted in Bioinformatics, Notepad, Science, Software | 1 Comment »

    MySQL – Python: good MySQLdb tutorial (examples)

    7th September 2007

    Andy Dustman (used to blog at dustman.net) gave a presentation on Python and MySQL at the MySQL Users Conference 2005, Santa Clara, CA. The presentation is an excellent collection of examples for those who use the MySQLdb Python module.
    Read the rest of this entry »

    Posted in Links, Notepad, Programming, Python | No Comments »

    Date and time in Python scripts

    7th September 2007

    Here’s an excellent description of various methods to handle date and time in Python scripts.

    Posted in Links, Notepad, Programming, Python | No Comments »

    i-SOBOT (Omnibot-2007) by TOMY and SANYO

    3rd September 2007

    This isn’t new, but looks like a milestone to me (yeah, I know about Sony and their robots, but that was before and different).

    i-SOBOT CAMVersion

    i-SOBOT is a tiny 165-mm robot with 17 servo-engines. i-SOBOT can be programmed and controlled at distance (using the LCD-equipped remote control), and understands up to 10 voice commands. This robot will be available in Japan and US in October 2007.

    According to the Guinness Book Of Records, i-SOBOT is the smallest robot in the world.
    Read the rest of this entry »

    Posted in Artificial Intelligence, Robotics | No Comments »

    Elegantly converting Python list into another list with changed items

    30th August 2007

    I just had a small problem with my Python script:

    1. I have a list of tuples, called records_cache; each tuple looks like this:
    (note: for copy-pasting, click the PLAIN TEXT box headers)

    1. (ensembl_transcript_id, ensembl_gene_id, chrom_start, chrom_end, utr_start, utr_end, sequence, strand)

    2. I need to INSERT only some of those values into MySQL table, using the MySQLdb executemany() method. The values I need are utr_start, utr_end, ensembl_gene_id (in exactly this order).

    To do this, I need to create another list of tuples, but with shorter 3-item tuples. Let us call the new list genes_update.

    Here is the elegant, though probably not the most efficient, solution:
    Read the rest of this entry »

    Posted in Programming, Python | 1 Comment »