• jul
    30
    2010

    TTMMHTW: math, research, network, syscalls and linux

    Some things that made me happy this week.

    Sage combines the power of many existing open-source packages into a common Python-based interface. http://www.sagemath.org
    Useful things to know about Phd thesis research http://www.cs.caltech.edu/~weixl/research/experience/phd-thesis.txt
    Just another free touch typing tutor program http://klavaro.sourceforge.net/en/
    poll vs select vs event-based http://daniel.haxx.se/docs/poll-vs-select.html
    Free Electrons presentation at 11th Libre Software Meeting about Linux Kernel: devices and drivers [...]

  • jul
    22
    2010

    Shortening URL

    There are many URL shortening services. I just picked one (u.nu) to use from command line interface and chose something really quick and simple. Here’s the code:
    # -*- coding: utf-8 -*-
    from urllib import urlencode
    import httplib
    import sys

    api_url=”u.nu”
    var = urlencode({‘url’:sys.argv[1]})
    args = “/unu-api-simple?%s” % (var)
    conn = httplib.HTTPConnection(api_url)
    conn.request(“GET”,args)
    ret = conn.getresponse()
    print ret.read()
    Download the script here.
    Just run passing the URL, for example:
    $ [...]

  • jul
    13
    2010

    A brief on “designated initializers”

    The GNU Compiler Collection (GCC) for C language doesn’t initialize variables zeroed. For simple variables types like int or float is just equal to 0 or 0.0 respectively. Now, suppose that you have a “large” struct and doesn’t want to set each member  individually… you could just type “={0}” which means that the first member [...]

  • jul
    03
    2010

    Embed Python inside Latex

    After a video demostrating the use of Python inside a Tex document. I decided to do a document explaining how to use,  check it:
    Embed Python Inside Latex (pdf ~ 100KB)

    Update: I also published online through Scribd, check here.