Jonasfj.dk/Blog
A blog by Jonas Finnemann Jensen


October 17, 2009
Musicplayer module for pluck
Filed under: Computer,English by jonasfj at 6:41 am

I’ve been working a bit on a website for a friend, not computer literate, so I took a look around for a simple, easy to use, content management system without a million useless  features and found pluck. It’s simple and yet supports modules to extend the functionality, though within limits…

Anyway, I needed a MusicPlayer module that would make it easy to publish music in Flash based music player, so I wrote one. The documentation for pluck is fairly good, php on the other hand is horrible (it took me a while to figure out I had to enable error reporting). Nevertheless, the result allows the user to upload mp3s, choose player skin and settings. For playback I used Xspf Jukebox which has 20 skins included some of which are fairly good looking…

You can download the module here… It’s for pluck 4.6, tested with 4.6.3.

Update: This plugin is now hosted at github: github.com/jopsen/pluckplayer.



August 26, 2009
Working on Pwytter in Google Summe of Code
Filed under: Computer,English,Linux,Pwytter by jonasfj at 12:44 am

This summer I’ve been working on Pwytter as a part of Google Summer of Code. My project was to separate the backend from the frontend and make a new user interface with PyQt. In my original propsal, I also wanted to do a GTK frontend, however, this was dropped in exchange for a more polished Qt frontend (I do have the basics for a GTK frontend lying around, if anybody is interested, but it’s far from usable).

While writing a backend for Pwytter I also created some abstractions for micro-blogging services, so that Pwytter supports multiple accounts and multiple services (currently Twitter and Identi.ca). With this new backend all the messages are also cached in an sqlite database, enabling Pwytter for work while offline.

pwytter

I also added theming support to the Qt frontend I wrote for Pwytter, above is a screenshot of Pwytter running the “Twitter-like” theme (as you can see have also be translated, so far only to Danish). Pwytter uses WebKit to display tweets, users and other types of content, thus themes can customize the GUI using HTML templates and Qt stylesheets. Documentation for writing such themes can be found in the project wiki, I plan to write an article on subject when this Pwytter branch is released. So far this Pwytter branch is still under development, and interested developers can find install instructions in the project wiki.



August 25, 2009
Framework Design Guidelines
Filed under: Computer,English by jonasfj at 6:50 am

Framework Design Guidelines

A few months ago I felt like I needed to get better at writing clean reusable code, so I impulsively bought a book called Framework Design Guidelines, Conventions, Idioms, and Patterns for Reuable .NET Libraries. Now having read the thing I must admit that I found large parts of it rather boring. The book is mainly presented in “Do”/”Do not” form, however, interrupted by annotations that discusses these guidelines, and gives examples to where these are followed or forgotten in the .Net Framework.

Apart from the annotation this book is mainly about usability of .Net libraries, conventions and guidelines for the public interface of a .Net library. This book only briefly touches a few design patterns, but apart from these it’s all about the public interface and how to design this in order to facilitate extensibility. So if you’re look for coding guidelines on how to design the public interface for a .Net library this is the book. However, I was probably a bit to impulsive, so I’ll be reading Design Patterns next…



May 24, 2009
TheMatrixDistributed, distributed realtime ray tracing
Filed under: Computer,English,School by jonasfj at 4:07 am

Now I’m finally done with my second semester project at Aalborg University, and as usually I publish my things here. This project is about distributed realtime ray tracing. Which have been fun, because ray tracing is CPU bound and it have been a joy to play with all sorts of hacks and optimizations.

The report discusses what the demand for ray tracing is, what ray tracing is and how a ray tracer can be implemented, covering the basics of ray tracing and bounding volume hierarchies. It also discusses how distribution could be done, which is the only slightly new thing in it… It’s not a perfect report there’s still some areas where the English is kind of bad and some sections that could use a rewrite or two 🙂
Nevertheless, considering the circumstances I’m satified the result. And the group have worked fine…

Now the interesting part, TheMatrixDistributed, as a part of this project we implemented a distributed realtime ray tracer, with bounding volume hierarchies, spheres, planes and triangles that supports textures. We also did a small obj parser to import models exported from Blender. TheMatrixDistributed is implemented in C++ and it’s turned out to be quite fast, considering that the rest of my group have little to no programming experirence. When distribution to 6 dualcore laptops and a quadcore desktop we got around 8 FPS at best with 1024×768 screen and about 100,000 triangles in the scene, not filling the entire screen.

TheMatrixDistributed

The frontpage image (original 1024×768) seen above has about 1,000,000 triangles it was render on 6 dualcore laptops and a quadcore desktop at about 0.6 FPS with 4x antialias.

Though the report and TheMatrixDistributed probably isn’t of much value to anybody it’s published here if anybody should be interested. The report is released under Creative Commons Attribution-Noncommercial-Share Alike 2.5 and TheMatrixDistributed is released under GNU GPL.



January 31, 2009
Ny laptop, Lenovo Thinkpad R500
Filed under: Computer,Dansk,Personal by jonasfj at 3:11 pm

Så blev det endelig tid til at få en ny bærbar, jeg har længe gået og truet min Toshiba med at den skulle ud… Til sidst holdt batteriet også op med at virke, men efter 3,5 år som min primære desktop må man også indrømme at det er godt klaret at den overhovedet er i live endnu…

Derfor har jeg fornyeligt anskaffet mig en Lenovo Thinkpad R500, med 2 GiB ram, 250GB harddisk, dualcore 2 processor og 1600×1050 i skærmopløsning, sidste nævnte skal man vende sig lidt til… Verden er jo blevet næsten 4 gange så stor 🙂

Da jeg fik den, havde den en fin Windows Xp installation der fyldte hele harddisken og havde de omkring 70 fuldstændigt totalt uundværlige baggrundsprocessor kørerende. Jeg formoder at ironien er tydeligt, det tog mig i hvertfald ikke ret langtid at få lukke ned for det skidt. Så prøvede jeg om jeg kunne få system gendannelses partitionen til at lave partitioner og gendanne, men fandt ikke uden videre ud af hvordan man skulle gøre det… Hvis man da kan det…

Det lykkedes mig dog, uden størrer problemer at installere Ubuntu 8.10 på PC ved at formatere fuldstændigt. Jeg var dog så betænksom at efterlade en lidt plads til en Windows partition, hvilket jeg nu har installeret fra VirtualBox 🙂 Jeg har ikke prøvet at boote den uden for VirtualBox, og tvivler også lidt på at den vil samarbejde…



December 15, 2008
RaptorMail, an encrypting GMail client
Filed under: Computer,Linux,School by jonasfj at 2:30 am

Tomorrow, I’m finally turning in my P1 project, that’s the first semester project, at Aalborg University. The project is about RSA, and usability of encrypting email clients, and as a part of the project we’ve implemented an encrypting email client for GMail. In Python, with PyGTK and SQLite as backend, e.g. access mail while not online.

Anyway, I thought I’d publish the report here for anyone to stumble upon. Honestly it’s not that great, it’s written in English and is subject to some serious gramma issues, as we’ve been pretty busy actually getting it ready… For those who does not know what a P1 project at AAU is, it is a project conducted by a group of 4-7 students. Most of the education at AAU, happens through these kind of projects, which is kind of nice and gives a lot of freedom. But just for the record, I have not written the entire report myself, so do not blame me all the horror that may be found within it… 🙂

Enough about the report, during the project we also wrote an encrypting GMail client, called RaptorMail – don’t ask why. A GMail client is actually quite interesting, if I managed to find the time, it would be real nice to nail the last few bugs and integrate it with GPG… An application to access GMail through a non-webinterface while still maintaining the same feature set would be nice to have. And cacheing all mail for offline usage is an absolute killer-feature.

But I’m afraid I have a lot of other small projects on my mind too, so actually getting it out there is probably not going to happen. But if anybody is looking for a way to synchronize and interface GMail with a local database from Python the “gmail_cache” module I’ve written for this project is fairly comprehensive and well documented.



October 29, 2008
Announcing TheLastRipper development discussion group/list
Filed under: English,TheLastRipper by jonasfj at 11:04 pm

It’s been quite a while since I’ve been actively developing TheLastRipper, even though I’ve been promising myself I’d find time for it over and over again…
But since there’s other people who have shown interest for the project, I’ve decided that it’s probably best if project coordination happens in an open forum instead of just sending mails between developers. Therefore I’ve created a TheLastRipper development discussion group for discussion of project direction, features, technical matters etc. without always having to create an issue in the issue tracker.
I’m not leaving the project, just realizing that with my current activity or just in general, it’d probably be good for a project with multiple developers to have a development list for discussions of all the stuff we can’t fit in the issue tracker.

So if you’re interested in TheLastRipper development join today

Update: I’m happy to announce that Andreas Langmann is also a project owner now, so that I’m not the only administrator…



January 14, 2008
HSH – A simple hash algorithm + embedded webserver
Filed under: Computer,Electronics,English,School by jonasfj at 8:01 pm

Lately I’ve been building a webserver, in school as a light and curtain controller, on top of an AtMEGA168 and ENC28J60, I’ve based it off an article I found at TuxGraphics.org. Which by the way is a fine place to order components for personal usage – They’re cheap and they shipped to Denmark in 2-3 days…

Anyway, the webserver software I found sends a plaintext password over HTTP for authentication. This is of course not desirable since anybody with access to the same network link can see the password. This is very bad security, especially if it’s a wireless link. And who would want a light and curtain controller if the neighbor kid suddenly hacked it.

Therefore I decided that I needed a secure authentication method. Asymmetric cryptographic algorithms are already out of the question since I’m working on a microprocessor with 16kbytes program memory. I tried to find a conventional md5 or sha1 implementation, however they were very easily too big in program size and inefficient. So I looked around and found HSH 11/13 by Herbert Glarner.

HSH 11/13 looked to be efficient, small and easy implement. Later I discovered that with my lack of experience with bit manipulation in C ladder was not true. However, I did manage to get an implementation working, it’s written in C and I’ve tested it with GCC and AVR-GCC against glibc and AVR-libc respectively. You may download it here:

Now having a webserver with a serverside hash algorithm doesn’t solve the issue. The client needs to have the hash algorithm as well. Therefore I wrote a compatible implementation of HSH 11/13 in Javascript. This may seam rather weird, and it’s sure not efficient anymore. I’ve only tested the script in Firefox 2.0, however I’d imagine that it works in other browsers as well. You may download the Javascript implementation here:

Like I said before this may seam rather weird, as the webserver isn’t capable of serving pages as big as the Javascript implementation. However the solution is to let the main page of the embedded webserver be:

< script src = 'http://mywebhost.com/myjsfile.js' > < / script>

Where “http://mywebhost.com/myjsfile.js” is a file located on a remote ordinary webserver, e.g. not served from the embedded webserver. The included Javascript file then writes an entire web 2.0 application using “document.write”. Once the web 2.0 application have been loaded it can use AJAX requests and the HSH 11/13 implementation to communicate with the embedded webserver.Apart from the main page, a simple AJAX API is all the embedded webserver needs to host. Authentication against the webserver may then be done using a HSH hashsum of a timestamp + password + data, referred to as token. Where timestamp, data and token, are send everytime an API request is made. The embedded webserver then knows the password and generates the token from the given timestamp and data, one can then authenticate the request by comparing the generate token with the received token. Note, it may not be desirable to keep track of time on a embedded webserver, so it’s easier to just check if received timestamp is bigger than the latest received timestamp, and then save the timestamp for later use.



January 12, 2008
Release of TheLastRipper 1.3.0 for Windows
Filed under: English,TheLastRipper by jonasfj at 9:35 pm

Development on TheLastRipper have been stalled for a while, but thanks to Andreas’ work we’re now able to release TheLastRipper 1.3.0 for Windows. It features:

  • New GUI station selection improvements.
  • Using the new last.fm protocol version 1.2 (Skip now works!).
  • Additional management features like skip songs already recorded.
  • A few other minor details…

This release is largely created by Andreas, since I haven’t really had time for it. Which is also why it’s not ported to Linux yet, though the executables with Windows.Forms GUI runs fine under Mono/Linux, we’d like a GTK# GUI because it’s much prettier. I hope I’ll find time to do a Linux port soon…

Now some might be wondering why it’s called version 1.3.0 and not 1.2.0 – well, what can I say: It’s a “known issue” 🙂 I think I accidentally incremented it one too much, and since we can’t really delete downloads from GoogleCode it’s going to be version 1.3.0 instead. It would also look weird to have a version 1.2 featured and a version 1.3 deprecated.

Anyway I don’t think the version number thing is so bad either, I think I previously stated that there wouldn’t come a version 1.2.0, because I was going to rewrite the codebase. Because a rewrite would be needed to make a clean, easy portable and extendable backend implementation of the Last.fm protocol version 1.2. I started development of such a clean backend, but it’s still stuck in development, since I don’t have time for it at the moment.



December 29, 2007
SimpleECDSA, a simple implementation of ECDSA in C
Filed under: Computer,English,Linux,School by jonasfj at 2:32 pm

2 weeks ago I did a school project on ECDSA (Elliptic Curve Digital Signature Algorithm). At HTX we have to do a project that goes beyond the curriculum, we must combine two subjects and do an individual project about something we find interesting. I decided to combine mathematics and programming in a project about ECDSA. Personally I think it was great fun, but perhaps I have a twisted sense of humor 🙂

Anyway, I’ve publish my report here, it’s in Danish though. But I did also write an implementation of ECDSA in C. The implementation is called SimpleECDSA, though I must admit it not very Simple anymore. It uses GMP as integer library, and uses the standardized curves cryptographic operations.

The comments in my source is in English, though I did translate them to Danish, before delivering my paper. Anyway, I still have the source with English comments, so I thought I’d post the source here.

As I had a little spare time this holiday I’ve configured the source with the GNU build system. It my first tarball created with Autotools, and it’s mostly hacked together of snippets from the automake and autoconf manual. But it works and the package compiles, and “./configure” complains if GMP isn’t present. I did also manage to get “make check” to run my internal tests, so I think it’s pretty good, considering the fact that is my first package build with autotools.

If you’ve any comments, bug-reports or questions to my packaging or SimpleECDSA, feel free to leave a comment. SimpleECDSA is ofcourse released under GNU GPLv3, and can be downloaded here:



« Newer PostsOlder Posts »