Archive for the 'Hacking' Category

Playing around with XSLT

I recently wanted to have a view of twitter with friends organized into groups the way TweetDeck has it (or at least I suppose it’s the way it has it, as it doesn’t work on linux). So I thought it was a cool project to learn some XSLT. XSLT is basically an XML language for turning an XML document into something else, which can also be XML. As that was exactly what i wanted to do, using the language that was written specifically for that purpose (like a DSL) should make the task very easy and fast. The files to be transformed by the XSL file would be the raw twitter feed and a groups file in which I’d specify the groups that I wanted to display. The XSL would create an XHTML document with the tweets organized into groups depending on the person they came from. It was really fast and the result was mostly what I wanted. I’ve posted the code on github.

If you want to use it you need to create an xml folder and create in there a file named current.xml with the XML from twitter that you want to organize and groups.xml with the following structure:

<groups>
  <group name="Test">
    <user>username</user>
  </group>
</groups>

One group entry per group and one user entry per user in group. That should be it, if you browse to the index.xml file in the main directory you should then get a visualisation of the grouped tweets along with a row in the top of the document with buttons that toggle each group (with some jquery hiding goodness and some quick css):

Also in the repo are merge, count and “id of the first tweet” xsl files that I used to do a simple batch script that updates the feed (using curl and Xalan to fetch 200 updates at a time until there are no more updates to fetch merging it all in the current.xml). It is all very raw and quickly put together at the moment, but in the future I might add more features and make it into a client. However, I hope this might help someone to get into XSLT. I found it to be very interesting and quite powerful and look forward to using it in the future.

Hackable Gadgets and Google Android

What better way to make a comeback than to give you my point of view on the state of gadget hacking and hackers? Feel free to give your own point of view in the comments (or just comment on mine) !

The old days were the time of the small microcontrollers, PICs, later AVRs etc. They were really cool in that they could perform logical operations and were easily programmable. Those were the days of old NES, SNES, Saturn, DOS games, etc. To light an LED was seen as a great achievement and would make you the coolest kid in the block. (I’m obviously exaggerating, but you get the point). Those platforms got progressively cheaper and cheaper and reached their golden age with huge communities. Soon everyone who wanted to make something was able to and a lot of really cool stuff was built.

Enter 2007, everyone talks about photorealistic graphics, high-definition video and audio, signal processing and wireless communications. That crazy ol’ blinking LED lost some of its appeal. Everyone wants to be a part of the web 2.0 revolution, the huge mashupable database. Everyone got a lot more demanding in what comes to gadgets and outcomes. Suddenly everyone wants to hack wi-fi, GPS and video into their gadgets. But the good’ol microcontrollers aren’t able to tackle the task at hand anymore, no. Such applications demand high processing power, and to assemble such a system with separate buyable parts would get really expensive and complex. So everyone tries to reach a solution to this dillema. Everyone wants to be able to build cool stuff in the new age.

Hackable platforms come as an answer to this dillema. Giant companies can build platforms that support all the new juicy stuff for much less than individuals and resell it for less still. In fact they were already doing it, they were just locking the platform to perform what they intended it to perform. So everyone got smashing the locks and opening the platforms to public development. The Apple TV, iPod, iPhone, linux-based routers, etc were all targets to this strike. Soon, all hackers got to tackle the power hidden in such gadgets and could command them to do their will. All was well again in “hackworld”.

But the outside (non-hacker) world began to see the potential of hacking. Hackers made their efforts easily accessible so everyone could benefit from it, even without deep technical knowledge of what they were doing. And the outside world liked it. Soon, everyone started to see the potential. Everything they already owned could be made to perform so much more. And hacking became mainstream. It stopped being such an underground activity and became a media subject. The hacking era arrived.

As the communities started growing, a massive overload of projects got to public knowledge. Widespread internet access made it a lot easier. Everyone who wasn’t tech savvy started to see newfound interest in hacking. Hackers started seeing the potential and they gave easy tools for everyone to develop on. Everything was made easier to program.

Some companies started seeing the potential. As hacking was the new cool, a hackable project would be a lot cooler than a closed source one. So came hackable platforms that were designed to be hackable. So came the iRobot Create, the chumby and Google Android.

Android in particular was made in response to the iphone hack craze that had gotten into the world. Everyone was loving to have their iphones hacked and “on steroids”. And Apple screwed them by making it progressively harder and harder. Everyone started to dislike Apple a bit. Apple has already taken a step back and said they will release an SDK, but in my opinion it’s already too late to massively change opinions. On the other hand Android will provide a hackable gadget without a brand on it, it’s not a device, just an operating system. People will be able to choose which brand they want to supply their Android goodness. Everything has been made by Google to encourage its hacking, and in my opinion it will (deservedly) get a large community and project base.

So there you have it, my view on the current state of hacking. In my opinion we are starting to see a golden age of DIY with more and more people being able to create stuff easily. Everyone will get to know the joy of creating something, of seeing something working which was made by them, and get addicted to it.

Happy hacking!

– Images from Wikipedia, WorthPlaying and Google Android