Category: Systems

  • Make a RAM disk on Mac OS X 1.5 or later

    Create the RAM disk: diskutil erasevolume HFS+ “ramdisk” `hdiutil attach -nomount ram://1165430` (the magic number 1165430 is explained here as the number of 512 byte sectors. The string “ramdisk” is just the name of the disk, which will appear under /Volumes after creation) Write some stuff to the RAM disk: echo “hello RAM disk” > […]

  • Calling a Python LP-solver from a PostgreSQL function

    Prepare the database by installing PL/Python and a function: CREATE EXTENSION IF NOT EXISTS plpythonu; CREATE OR REPLACE FUNCTION hello_lp() RETURNS float[] AS $$ import subprocess output = subprocess.Popen ( [ “/Library/Frameworks/Python.framework/Versions/2.7/bin/python”, “/usr/local/trystuff/hello_lp.py” ], stdout = subprocess.PIPE, stderr = subprocess.STDOUT ).communicate()[0] # Parse string of comma-separated floats return map(lambda x: float(x), output.split(“,”)) $$ LANGUAGE plpythonu; […]

  • Introducing the Web Co-Processor

    Here is a project I’m working on called the Web Co-Processor (credit for name goes to Marcos Vaz Salles). There is a demo you can try if you clone the project. Read the following four bullets and you’ll understand what the web co-processor is about: A person opens a webpage in his browser The webpage […]

  • Evolving database algorithms through human experiments

    Here is something fun to do on a sunny day. The idea is the following: A group of people collectively designing an algorithm by playing a game.

  • Systems Stuff on Proggit (May 2013)

    As the title says, this post is just a filtering of todays proggit. Namely the posts that caught my interest that day.

  • Graham C10M talk at Shmoocon 2013

    This video was mentioned on highscalability.com, so I thought I’d have a look. Knowning this stuff is useful when you’re in the business of delivering large amounts of geographical data to a large amount of clients. C10M = 10 million concurrent requests.

  • Taking hadoop for a spin

    Simple. This works.

  • Sequential writes leveldb versus system_x

    OK, calling it a benchmark is a bit of an overstatement. It’s taking two different database libraries for a quick spin, and seeing how fast they can write a bunch of integers to disk. A second benchmark checks how fast we can read them. In this mini-test, I’m running leveldb against a new embedded database […]

  • Trying a Python R-tree implementation

    Rtree is a ctypes Python wrapper of libspatialindex that provides a number of advanced spatial indexing features for the spatially curious Python user.

  • A presentation on spatial indexing

    A friend of mine, who is the CEO of a company that develops an embedded database, asked me to do a presentation on spatial indexing. This was an opportunity for me to brush up on R-trees and similar datastructures. Download the slides The presentation introduces R-trees and spatial indexing to a technical audience, who are […]