Archive for July, 2009

Dylan/Springsteen lyrics comparison

Monday, July 20th, 2009

It’s hardly possible to write something about Bob Dylan that have not been written before. But using computer to analize artist lyrics is rather uncommon, so my first thought was to find most common words used by Dylan in his songs. Bruce Springsteen cites him as one of his influences, so Springsteen lyrics are added as an comparison.

Python was my language of choice to write some simple code that sorts words in order of their occurrence. That task is easy, sure, but you have to get full lyrics first, preferably stored in one place(i.e. file). I haven’t even bothered to look after something like that on the Net. Instead, I used Beautiful Soup to parse artist’s web pages, download lyrics and write them to file. Beautiful Soup is fast and simple Python parser, excellent tool for this kind of job. http://www.bobdylan.com/ and http://www.brucespringsteen.net/ contains new and error-free songs lyrics (from 2009 albums) – you can’t say that about lyrics found on various strange fan-made pages in the internet.

(more…)

Android development

Friday, July 3rd, 2009

I’m the fresh and happy owner of G1 Android phone. I have chosen it instead of Apple IPhone, because Android is open platform and I have read many dissatisfied IPhone developers complaints about Apple distribution model and objective C language unnecessary complexity. Android advertises it’s SDK as fast and easy, so I had to verify it immediately after unpacking and fully charging my phone. SDK comes with Eclipse plugin, which aids refactoring, debugging, provides class and method stubs etc. Installing it, setting enviroment and connecting your phone is piece of cake. After writing “hello world” application and running it on my phone , I noticed a possibility of using OpenGL ES 1.0 (fixed pipeline). I’m not really familiar with OpenGL API, but I managed to find some code samples showing how to create vertex-colored cube (standard example – not fun to watch anymore). After adding simple touch interface, I’m able to rotate my cube using index finger.

The whole process – setting everything up, going through hello world and adding controls to simple OpenGL ES demo took me around an hour. It is indeed very easy to start developing on Android. I would like to create something more sophisticated now – maybe a game with touch interface. Android store is not overwhelmed by games like Apple store, creating even simple, free game could be nice thing for community.

Result may be not very impressive :) , but anyway – here’s the screenshot:

android_OGLes

If you would like to read more, a nice artice which compares Android and IPhone development can be found here:

Android vs IPhone Development: a comparison

PS. Android also has ASE – Android scripting enviroment that allows you to write simple Python or Lua scripts directly on your phone (preferably by using attached keyboard). Scripts can be used to make phone calls, send messages, poll location from GPS, use text-to-speech module and many more. There is even a guy who wrote automatic garage door opener using ASE – you can read about it on his blog: brad’s life .

Havok vehicle demo

Wednesday, July 1st, 2009

I’m currently having fun with Havok Physics Vehicle kit. Goal is to create a demo application, which uses Havok to calculate vehicle physics and render that vehicle with DirectX. So far I managed to put everything together: terrain, simple skybox and vehicle with camera following it. Here are some screenshots:

Graphics need polishing and vehicle model is temporary. Notice that size of rendered model and size of Visual Debugger vehicle shape don’t match (in reference to terrain). This is the first issue I have to fix. I plan to add some rigid body objects to scene, crashing into them should be fun. Terrain should be flattened a little (…or maybe vehicle replaced with an-off road car?). I’d like to publish some source code here, although some improvements and refactoring have to be done – it works, but it’s not very pretty.