About three weeks ago I finally told myself “Ugh, what the heck, let’s buy a bitcoin! I want one just to have one.”. I had looking into buying many times before, even before the rush to $1000, then in the subsequent drop and finally bought after the “crash” resulting in Ghash.io having over 50% of the hashrate. The main reason I hadn’t bought any before is that it’s a hassle for a non-american to set up accounts with Exchanges to buy into it, you need all sorts of address and identity verification which is a bit of a turn-off.

tetris



I was talking to a friend about passwords and I came to think of this: The always epic XKCD is of course right, choosing four random words as your password is better than choosing a series of numbers and letters. Now the comic makes it a little bit too geekish maybe, talking about bits of entropy and whatnot. But the way I always learned to calculate brute-force strength is by taking the “degrees of freedom” or in other words, how many possibilities there are, times the number of times you have that possibility, i.e.

tetris



If you follow me on twitter (or via the side-bar here on this blog) you might know that I’ve been spending some free time on making an iPhone application. It’s finally in the store and if you want it right now instead of reading this blog entry then go over to www.simplecardsapp.com. I wanted to write a little bit about how this app came into creation, since it’s my first one that I’ve actually put on the store.

tetris



For a long time I’ve been wanting to create one page that showcased my history as a developer a bit, but also put focus on some of the development that I do just for fun. I’ve sketched at designs and I’ve even gone so far as to do mockups in HTML. But I’ve never finished one (until now). That is because I always ask myself “Who is this for?” “Why am I doing this?” And I haven’t been able to properly answer any of those questions.

tetris



I can never decide wether to host code stuff on my code blog (that is very inactive and no-one reads) or here where someone might see it. I like this little tidbit so I’ll post it here. For whatever reason that we don’t need to get in to here I will probably need to create dynamic LaTeX documents in the near future. That is, pull in a bunch of figures from a database and put them into a LaTeX table.

tetris



Update: Ericsson Labs has now posted on their blog about the challenge. I’m back from DreamHack and things went down well. The last task was a bit too hard (well, impossible really – until we released clues) but otherwise we got a very good response. The best thing about the event was however that me and Emanuel participated in the Ericsson Labs developer challenge. So this is a story of how I won a PS3 by proof of concept alone.

tetris



I’ve been keeping quite busy the last couple of days. School takes up a lot but the little extra time I have I spend trying to make a little file upload demo in Cappuccino, which is really awesome. I love being able to code Objective-C and then just refresh my browser to see my application running in there instead of on the desktop. Another very awesome thing is that I have now been officially approved as an iPhone Developer, meaning I can develop apps on my own phone and if they get good enough I can start selling them in the App Store.

tetris



For the non-technically inclined people reading this you could read it just to gauge my emotions and get a glimpse of the future, but this post will probably not mean much. Watch this first and read later, you can skip a bit of the start since he really doesn’t demo the new tech until after about half the video. The first half is an explanation of why the tech is needed.

tetris



Yesterday I participated in a programming contest. Unfortunately the required language was C/C++ or Java, since I have no idea what available data-structures there are in C/C++ we chose (like last year) to code in Java. But the thing is - I haven’t coded Java since sometime last year. Because it sucks. Neither had my partner and we were out a third team-member. This all resulted in us finishing in 37th place of 40 competing teams :P If the language had been Ruby on the other hand I do believe I would have kicked a bit more ass.

tetris



I recently tried setting up sphinx on a rails app with thinking-sphinx and ran into a bit of an issue. ERROR: malformed or unknown option near '--pidfile'. That was the error message I got and this appeared when trying to start the sphinx server with rake ts:start or rake ts:rebuild. I installed sphinx via MacPorts and it turns out this (still) installs the 0.9.7 version and not the 0.9.8 version, and apparently the –pidfile option did not arrive until 0.9.8.

tetris



If you don’t want to install MySQL via MacPorts for whatever reason and want a clean installation to work with Ruby on Rails and the mysql gem, you need to do this: Go to http://dev.mysql.com/downloads/ to get the latest version of MySQL (by clicking on Download for Community Server). Download the Mac OS X package format and choose Mac OS X 10.5 (x86). Important here is to choose x86, not x86_64.

tetris



Jag har börjat “gå” en kurs på distans, från Stanford. De spelar in alla föreläsningar och lägger ut som videos som är gratis att ladda ner via iTunes. http://www.stanford.edu/class/cs193p/cgi-bin/index.php Det där är kurshemsidan och där kan man få tag i föreläsnings-slides och inlämningsuppgifter. Jag har gått igenom de 3 första föreläsningarna och gjort inlämningsuppgift 1A, 1B samt 2A. Kursen handlar om iPhone programmering och språket som man gör det i: Objective-C.

tetris



Jag har upptäckt min första bugg med iPhonen. Det vill säga riktiga bugg och inte bara feature brist eller något. Jag upptäckte det först för några veckor sen. Jag skulle skriva “Läget” till Emma i ett sms, men skrev fel, skrev “Lager”. Sudda ut allting och skrev det igen, återigen blev det “Lager”. Tänkte wtf? Rättar den “Laget” till “Lager” eller vad? Skrev en gång till långsamt denna gången, och till min förvåning gick det inte att trycka på T!

tetris



Him: Hey, you're good with computers right? Me: Yes. Him: And you know how to program computers? Me: Yes, that's my job actually. Him: Could you explain programming please? Me: I'm sorry, what do you mean? Him: I want to make a game like Halo, but I don't know how to start. Could you explain what I need to do? Me: You should probably go to the library and get a book.

tetris



Nu har jag äntligen fått tummen ur när det gäller DreamHack Game applikationen. Den sidan som serverar hela vårt spel under eventet DreamHack. När det kodades från början var det väl nog inte direkt tänkt som ett långvarigt och hållbart system som vi skulle använda för alltid. Det kodades ihop väldigt snabbt. Men i ärlighetens namn har det fungerat väl, det har bara saknat en hel del funktioner och småsaker här och där som har gjort det minst sagt suboptimalt att använda.

tetris



I changed my feed out in the right menu (or down below for those who use Internet Explorer, i still thing it’s wrong for them) to display my liked links from reddit. Now reddit didn’t make this easy on me. First of all, their standard link in the xml is to their own page, which i kind of stupid, of course i want to link to the page that i liked, in case it’s a self reddit in which case i of course want to link to that.

tetris



This update kicks ass, the new Wordpress is really awesome. Beautiful piece of software actually.

tetris



Då var man klar med en till inlämningsuppgift idag. Denna var för fördjupningskursen i programmeringsteknik. Vi skulle koda ihop en Sudoku lösare som använde en rekursiv backtracking algoritm. Med det menas att den provar den första siffran som är tillåten enligt sudoku reglerna, sedan går den till nästa ruta och provar första som går enligt reglerna där, så fortsätter den tills den kommit till slutet eller den kommer till en ruta där inga siffror är tillåtna, då är någon tidigare fel så då går den tillbaka ett steg och provar en annan siffra där.

tetris



I usually read brokep’s blog, Copyriot and TorrentFreak. They’re usually very interesting, and recently there have been a lot of talk about how we need to diversify the torrent tracker community, by which i mean we can’t solely rely on The Pirate Bay for all our open torrent-tracking. There are some major sites out there but they all have the same problem, if somehow they should go down, we loose something really huge.

tetris



Nu blev jag mer eller mindre klar med första inlämningsuppgiften i C++. Det tog verkligen inte lång tid när jag väl fått kläm på att .h är interface och .cpp är implementering. Det känns extremt tidigt att dra in interface koncept direkt såhär, var inte beredd på det. Men det är ju lite kul att det inte är bajslåg nivå överallt. Ska snygga till allting med lite JavaDoc sen, funderar på om man ska skriva den i .h eller .cpp filen.

tetris



Jag såg på emanuels blogg att han hade nått fancy sätt att visa source code. Kollade upp det och installerade pluginet! Så nu kan jag visa lite railskod: [sourcecode language=‘rails’] def episode_leader(episode_object) return link_to(episode_object.progresses.first.user.name, :action => :show_user, :id => episode_object.progresses.first.user.id) unless episode_object.progresses.empty? end [/sourcecode] Eller med så kan jag visa hur jag löste sista tentauppgiften på programmeringstentan: [sourcecode language=‘java’] import java.util.*; class ProggTenta { public static void main(String[] args) { new ProggTenta().run(); } public void run() { LinkedList list = new LinkedList(); list.add(new NewInteger(120)); list.add(new NewInteger(865)); list.add(new NewInteger(9)); list.add(new NewInteger(743)); list.add(new NewInteger(12)); list.add(new NewInteger(325)); RadixSorter r = new RadixSorter(); for(NewInteger v : list) { System.out.println(v); } r.sort(list); System.out.println(" "); for(NewInteger v : list) { System.out.println(v); } } } class RadixSorter { public void sort(LinkedList values) { int longestInt = findLongestInt(values); Queue[] queues = (LinkedList[]) new LinkedList[10]; for(int l = 0;l longest) { longest = v.length(); } } return longest; } } class NewInteger { int value; NewInteger (int value) { this.value = value; } public int length() { return toString().length(); } public int intAt(int index) { return ((int)(value/ (int) Math.pow(10,length()-1-index))-((int)(value/(int) Math.pow(10,length()-index))*10)); } } [/sourcecode] Det störiga är att den förstör alla identeringar när man ska editera posten i efterhand.

tetris



So i’ve just set up my slice on slicehost.com. It’s a 256mb slice so i’ve started to keep an eye on how much memory i’m using. Seems i had like 10 fcgi processes running with PHP, one that pulled 15% of memory, one that pulled like 7% and the rest pulling about 2% each. So this was a huge leak i thought. I only have 2 sites running on PHP so it seemed useless to have that many processes available for the sites.

tetris



Idag har jag spenderat ungefär 11 timmar i sträck på att försöka få saker att funka med git och ruby on rails Morgonen spenderades med att koda lite samt få github att funka, vilket var väldigt lätt. Sen började jag prata med Daniel och fick ett konto på heroku.com, satte upp en applikation där och de har stöd för gitserver, som dessutom postar live när man pushar sin branch. Vilket är helt fantastiskt härligt!

tetris