Categories
Programming

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 […]

Categories
Cheat sheet Systems

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/ClientLogincurl […]

Categories
Programming

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);// 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 ); […]

Categories
Programming

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.

Categories
Algorithms

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: […]