<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>myKludge</title><generator>Tumblr (3.0; @mykludge)</generator><link>http://mykludge.tumblr.com/</link><item><title>Data Available</title><description>&lt;p&gt;So far I&amp;#8217;ve been collecting data and reading some papers. More on the papers soon.&lt;/p&gt;
&lt;p&gt;This is what I&amp;#8217;ve gathered so far from &lt;strong&gt;Singapore&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Twitter&lt;/em&gt;: 9.5 million unique tweets from Singapore from 27-05-2011 to 14-11-2011 (55k tweets on average per day)&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Eventful&lt;/em&gt;: 9750 events throughout 2011&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Asia-City&lt;/em&gt;: 2033 events throughout 2011&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Timeout&lt;/em&gt;: 2119 events throughout 2011&lt;/p&gt;
&lt;p&gt;&lt;em&gt;YourSingapore&lt;/em&gt;: 325 events throughout 2011&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Zvents&lt;/em&gt;: 185 events throughout 2011&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Eventbrite&lt;/em&gt;: 107 events only after December 2011&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Sistic&lt;/em&gt;: &amp;lt;pending&amp;gt;&lt;/p&gt;

&lt;p&gt;From &lt;strong&gt;Portugal&lt;/strong&gt; I&amp;#8217;ve gathered:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;ICA-IP&lt;/em&gt;: Movie blockbusters gross values from theaters across the country from September and October.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Twitter&lt;/em&gt;: 8 million tweets from 15k different portuguese users from August to mid December.&lt;/p&gt;</description><link>http://mykludge.tumblr.com/post/14216715525</link><guid>http://mykludge.tumblr.com/post/14216715525</guid><pubDate>Wed, 14 Dec 2011 17:20:00 +0000</pubDate></item><item><title>Thesis</title><description>&lt;p&gt;Its my last year of the masters and I&amp;#8217;m starting to work on my thesis named &amp;#8220;Sensing the Buzz&amp;#8221;. &lt;br/&gt;&lt;br/&gt;From now until the last days of this school year (july 2012) I will be using this space to track report of my progress and simultaneously publish my notes and finds.&lt;/p&gt;
&lt;p&gt;What is my thesis about?&lt;/p&gt;
&lt;p&gt;The goal is collect (and enrich) lists of events happening in a specific place (e.g. Portugal/Singapore) to infere its popularity based on online buzz. This should help to measure its mobility implications (e.g. traffic).&lt;/p&gt;
&lt;p&gt;More about this on following posts&amp;#8230;&lt;/p&gt;</description><link>http://mykludge.tumblr.com/post/10235157837</link><guid>http://mykludge.tumblr.com/post/10235157837</guid><pubDate>Wed, 14 Dec 2011 17:19:44 +0000</pubDate><category>general</category><category>thesis</category></item><item><title>I get to escape madness aka StreamCorruptedException problems</title><description>&lt;p&gt;During the last few days I&amp;#8217;ve been crawling a API from a news outlet and saving everything I could find to file. I was doing it like this:&lt;/p&gt;
&lt;blockquote&gt;&lt;code&gt;
&lt;p&gt;oos = new ObjectOutputStream(new FileOutputStream("news.dat", true));&lt;/p&gt;
&lt;br/&gt;&lt;p&gt;while(true) {&lt;/p&gt;
&lt;br/&gt;&lt;p&gt;  file.writeObject(API.getItem());&lt;/p&gt;
&lt;br/&gt;&lt;p&gt;}&lt;/p&gt;
&lt;br/&gt;&lt;/code&gt;&lt;/blockquote&gt;
&lt;p&gt;What I didn&amp;#8217;t knew was that opening a object stream writes an header even when using the append flag. What this means is that everytime I restarted my downloader I was getting the header written to the file.&lt;/p&gt;
&lt;p&gt;How did I find out? Today, after nearly 72 hours running the application, I was trying to read it all and all I got was an StreamCorruptedException. More exactly: &amp;#8220;Exception in thread &amp;#8220;main&amp;#8221; java.io.StreamCorruptedException: invalid stream header: ED000573&amp;#8221;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve now found that appending to object streams files is nothing something supported&amp;#8230; but I don&amp;#8217;t have time to redo all my data fetching.&lt;/p&gt;
&lt;p&gt;What I&amp;#8217;ve done to fix this was loading a new ObjectInputStream everytime I get a StreamCorruptedException but reusing the same FileInputStream, so the file position stays on the position where it found a bad header. But because the ObjectInputStream has to read at least one byte (from docs its STREAM_MAGIC const) I have to go back 1 byte in position before loading the new ObjectInputStream.&lt;/p&gt;
&lt;p&gt;My solution follows:&lt;/p&gt;
&lt;blockquote&gt;

&lt;p&gt;&lt;em&gt;FileInputStream fis = new FileInputStream(f);&lt;/em&gt;&lt;/p&gt;
&lt;br/&gt;&lt;em&gt;
&lt;p&gt;try {&lt;/p&gt;
&lt;br/&gt;&lt;p&gt;  Object obj = ois.readObject();&lt;/p&gt;
&lt;br/&gt;&lt;p&gt;  if (obj == null) break;&lt;/p&gt;
&lt;br/&gt;&lt;p&gt;} catch(Exception e) {&lt;/p&gt;
&lt;br/&gt;&lt;p&gt;  fis.getChannel().position(fis.getChannel().position() - 1);&lt;/p&gt;
&lt;br/&gt;&lt;p&gt;  ois = new ObjectInputStream(fis);&lt;/p&gt;
&lt;br/&gt;&lt;p&gt;}&lt;/p&gt;
&lt;br/&gt;&lt;/em&gt; &lt;/blockquote&gt;

&lt;p&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps the several people I&amp;#8217;ve found online having the same problem.&lt;/p&gt;</description><link>http://mykludge.tumblr.com/post/4534813229</link><guid>http://mykludge.tumblr.com/post/4534813229</guid><pubDate>Mon, 11 Apr 2011 22:48:00 +0100</pubDate></item><item><title>Hey, You’re Okay. You’ll Be Fine. Just Breathe. http://zefrank.bandcamp.com/track/chillout</title><description>&lt;p&gt;Hey, You’re Okay. You’ll Be Fine. Just Breathe. &lt;a href="http://zefrank.bandcamp.com/track/chillout"&gt;http://zefrank.bandcamp.com/track/chillout&lt;/a&gt;&lt;/p&gt;</description><link>http://mykludge.tumblr.com/post/1339411501</link><guid>http://mykludge.tumblr.com/post/1339411501</guid><pubDate>Sun, 17 Oct 2010 23:56:32 +0100</pubDate></item><item><title>how cool is today&amp;#8217;s date? 10/10/10 = 42! Grab a towel and don&amp;#8217;t panic.</title><description>&lt;p&gt;how cool is today&amp;#8217;s date? 10/10/10 = 42! Grab a towel and don&amp;#8217;t panic.&lt;/p&gt;</description><link>http://mykludge.tumblr.com/post/1288300362</link><guid>http://mykludge.tumblr.com/post/1288300362</guid><pubDate>Mon, 11 Oct 2010 03:41:23 +0100</pubDate></item><item><title>Code Evaluation and my new Pet Project</title><description>&lt;p&gt;Code evaluation rules! Ok, its not the biggest thing since bread, but I think it has been under-valued for a long time. For a long long time the only use of code evaluation in public open projects was competition platforms like TopCoder,  Mooshak, UVA, and such. I really think we can do better.&lt;/p&gt;
&lt;p&gt;My first try was at DEI Academy project. I wanted to integrate yet another code validation platform so that high school students learning Python through the website could just solve some educational challenges by submitting the code and getting instant validation. They win points with correct anwsers.&lt;/p&gt;
&lt;p&gt;How did I do this? Leveraging google app engine. App engine allows to program a website using java or python, and automatically have google scale the website using its many servers. I was able to build a evaluation validator using a free account that could handle thousands of submissions a day.&lt;/p&gt;
&lt;p&gt;Problems with this solution? Many, but easily solvable. As you know the biggest problem with code evaluation is the security (the &amp;#8220;dont delete all my files please!&amp;#8221; type) and resources exhaustion (&amp;#8220;don&amp;#8217;t write infinite loops please!&amp;#8221;). This solution solves this automatically. For security, python allows you to build a new context (module) and run the evaluation inside this context (exec &amp;#8216;a = 1&amp;#8217; in new_module). Because each HTTP request can only last a limited amount of time (currently 10 seconds), google already fixes our second problem.&lt;/p&gt;
&lt;p&gt;So this is up and running, and has been working fine for a year and half. But I think there&amp;#8217;s still a lot more we can do.&lt;/p&gt;
&lt;p&gt;PacWars is my attempt at showing that.&lt;/p&gt;
&lt;p&gt;PacWars is a competitive pacman game, in witch users use *any* language to program a pac behaviour. These pac&amp;#8217;s are playing each other all day long, winning points by eating dots, or even killing each other if a pac is in supermode (by eating a special dot). Each pac has a code running behind him, telling the server every 500ms witch play it want to make. Every pac gets the current map and its current location simultaneous and has a 500ms timeout to call its decision. &lt;/p&gt;
&lt;p&gt;I plan on posting more about the details of this project very soon.&lt;/p&gt;</description><link>http://mykludge.tumblr.com/post/1235473073</link><guid>http://mykludge.tumblr.com/post/1235473073</guid><pubDate>Sun, 03 Oct 2010 15:38:25 +0100</pubDate></item><item><title>Confession: I always like more the beginning of the movie. Just before the shit hits the fan....</title><description>&lt;p&gt;Confession: I always like more the beginning of the movie. Just before the shit hits the fan. endings are always boring.&lt;/p&gt;</description><link>http://mykludge.tumblr.com/post/759528080</link><guid>http://mykludge.tumblr.com/post/759528080</guid><pubDate>Fri, 02 Jul 2010 01:44:21 +0100</pubDate></item><item><title>Hello to you</title><link>http://mykludge.tumblr.com/post/459040538</link><guid>http://mykludge.tumblr.com/post/459040538</guid><pubDate>Fri, 01 Feb 2008 15:04:00 +0000</pubDate></item></channel></rss>
