Author: kostas

  • BitTorrent for geodata was big in 2005

    Big in 2005… Today I’m trying to find out whether BitTorrent + geodata is a “thing”. I have found out that it WAS a thing… in 2005! Just like Coldplay, Gorillaz, Eminem, 50 cents, James Blunt, Green Day… but it never really took off. In 2006 Chris Holmes had a blog post titled Distribution of […]

  • How translate.google.com works

    Actually, this is not about how translate.google.com works. It’s about loading HTML from a random URL, adding some extra Javascript and CSS and redisplaying the page on a different domain. A simple test page I’ve made a simple test web page: Hello world Let’s translate it with Google Translate. The translation page has two iframes […]

  • Building osm2pgsql on Mac OS X using homebrew

    General instructions are here: http://wiki.openstreetmap.org/wiki/Osm2pgsql#Mac_OS_X Note: I’m running Snow Leopard (10.6.6 ) 1. Install homebrew Check that you don’t have it already: $ which brew If you don’t have homebrew install it from here: https://github.com/mxcl/homebrew/wiki/installation E.g. like this: $ ruby -e “$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)” 2. Install proj $ brew install proj $ which proj /usr/local/bin/proj […]

  • Using SQLite databases on different machines as a single virtual database

    You can use separate SQLite database on different machines as a single virtual database by using the attach command in SQLite. I read about the technique here: http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html For this example let’s use the simplest possible database. A contact database containing nothing but email addresses. 1. Create SQL script for a simple contacts database File […]

  • How to import OpenStreetMap data into PostgreSQL

    1. Download data and software The instructions are fairly generic, so should work for both Windows, Linux and Mac OS X. I wrote them for Windows, but I’ve since then switched to Mac OS X. PostgreSQL+PostGIS I assume that you do not already have Postgres/PostGIS installed on your system. Download PostgreSQL+PostGIS for all platforms here: http://www.postgresql.org/download/ […]

  • SOLR with JSONP with JQUERY

    Update: The previous version of this howto was a bit unclear or even erroneous, and some people had problems getting it to work. I have now rewritten it and testet it with SOLR 3.5.0 and jQuery 1.7.1. Making SOLR return results suitable for consumption using JSONP is very easy! Calling SOLR in JSONP style Enter […]

  • Google fusion tables cheat sheet

    See below for commands using the Fusion Tables API. Example table is the oldschool message wall public table. Note that examples are shown first without the required url-encoding. Authenticating: Getting the auth token To authenticate you may use the following test account myjdoe. account: myjdoe@gmail.com password: JoesSecret curl -H “Content-type: application/x-www-form-urlencoded” -d “accountType=GOOGLE &Email=myjdoe@gmail.com&Passwd=JoesSecret&service=fusiontables&source=skipperkongen.dk” https://www.google.com/accounts/ClientLogin […]

  • How to load Javascript dependencies dynamically

    Loading jQuery using plain Javascript:: // inject e.g. jQuery into a webpage var thescript = ‘http://code.jquery.com/jquery-latest.min.js’; var newscript = document.createElement( ‘script’ ); newscript.setAttribute( ‘src’, thescript ); newscript.setAttribute( ‘type’, ‘text/javascript’ ); var head = document.getElementsByTagName(“head”)[0]; head.appendChild(newscript); To call this from your script with a test to see if jQuery is loaded: // Test if jQuery is […]

  • jQuery ASCIIMATION plugin

    Today I’ve authored a simple plugin for jQuery that does ASCIIMATION. It was inspired by the classic Star Wars asciimation. You can have a look at the google code repository for jQuery asciimation or check out the online demo starring a spinning planet Earth. I’m going to use it in an upcoming demo project.

  • Turning big hard problems into smaller, less hard problems.

    Here I have captured a thought process I had while reading about algorithms for hard graph problems. The thoughts are inspired by MapReduce, distributed merge sort and the more colorful newspapers of the world. Summary of thoughts Given an instance of an problem (think Max Clique, Traveling Salesman or another hard graph problem)… Thought 1: […]