Wednesday, February 28, 2007

LoneSeek improvements

Although I should have learned for my Cisco skill based test tomorrow I have improved LoneSeek. I am now working the chat functionality, and I have implemented the following things today:
  • Support for listing all available chat rooms.
  • Code for joining a chat room is there but not tested, I suppose there are still some bugs in it.
And I have fixed some bugs:
  • Removed a bug in the code which reads String arrays off a SoulSeek packet which caused the LoneSeek framework to hang up.
  • Using ReadBytes() now instead of Read() since Read() might not read ALL data as requested but just what it can. Read() was causing huge packets to be splitted up when the data were received with a little delay.
  • Fixed a bug where an event is being invoked without being checked if it is null.
There is still one issue I cannot resolve though: I am using a seperated thread to handle the incoming data and another one to process the packets. The first thread is reading the data, assembling the packet ships it to a queue. The second thread then dequeues the packets and dispatches them. The dispatching progress also requires the call of the events, so the event listeners get notified. But the use of threads require the event listener to use Invoke() everytime it is updating GUI controls. Has anyone a fix for that?

Tuesday, February 27, 2007

LoneSeek goes BerliOS and CodePlex

I guess I will move LoneSeek to BerliOS for normal developing (their SVN is pretty stable), publishing releases and for the website hosting. But I will also put in on CodePlex. I guess I will port major releases to CodePlex. Well here we go.

Monday, February 26, 2007

My new notebook.

After the monitor of my old Fujitsu-Siemens M1425 broke again (it is pretty dark and seems to have a defective contact - the third time something broke) I decided to buy a new one and plug the Fujitsu-Siemens on my KVM switch. I wanted something around 15" but it does not have to have the newest hardware though. I am just using it for working and for programming. Therefore my voted down for a Lenovo Thinkpad R60E. Yeah, E, I guess what you are thinking, but I hadn't enough money for anything above "R60E". And all above are using a Core 2 Duo Mobile; power I would never really use the advantage of though. It might not be the fastest high end machine but it does its work! I pretty sure I will install a FreeBSD 6.2 with KDE on it, but I am unsure if I should keep the Windows 5.1 Home it came with or reinstall by using a Windows 5.1 Professional.

Sunday, February 25, 2007

LoneSeek improvements.

Just a quick summary on what I have done today on LoneSeek:

  • Improvement on the algorithm which reads the packets: I have completly rewritten the code which parses the packets: It is now centralized as "class PacketStream".
  • I have added some events to the LoneSeekClient class: OnConnect, OnDisconnect and OnLogin. I guess you can figure out when they are called. ;-)
  • File indexing service, which is used for sharing. You can now specify directories, which will be searched for files with file extension you specify. Ha! A functionality the official SoulSeek client doesn't have!
  • Tell the server the number of files and directories we share.
  • Tell the server which port we use.
  • Improved the network code: The last two points above are only invoked when we are successfully logged in.

Well... more code will follow soon. I am aiming for implementing the chat functionality.

Saturday, February 24, 2007

HashCalc: A hash calculation utility.

Oh my was I bored today. After being feed up with programming on LoneSeek and noticing that my laptop's TFT screen is broken (it's hard to program on PC-BSD when you can hardly see what you write) I didn't know what to do. Therefore I picked out my "tools-I-ever-wanted-to-have" list and picked the first item: "Get some utility which can calculate hashes/checksums (md5, sha1) and compare them with existing values".

So here we are: HashCalc, a hash/checksum calculation utility supporting various hash algorithms and forms of input data. Supported hash/checksum algorithms are:
  • MD5
  • SHA1
  • SHA256
  • SHA384
  • SHA512
  • CRC32
  • RIPEMD160

Supported forms of input data are:

  • Raw binary in hex notation (e.g. the output of hexdump)
  • Raw binary in decimal notation (for those who can't read hex)
  • Text in different encodings: ASCII, UTF7, UTF8, UTF16 Big Endian, UTF16 Little Endian, UTF32

Screenshot:

Download links:

HashCalc v100
HashCalc v100 Source Code

LoneSeek: A SoulSeek client

I am currently writing on "LoneSeek" a (hopefuly) fully featured SoulSeek client. But it's a hard work to do, since there is only one document out there describing the protocol of SoulSeek, and this document is pretty outdated. I am on it though to implement the features and try to figure out what has changed since the document was written and the newest version of the SoulSeek (version 156) came out. A very interesting work, and I am sure I will release LoneSeek as soon as the features are useable. Current implementation details are:

  • Library/Frontend implementation to keep the network code abstract.
  • Design is open for a SoulSeek server.

And now what is currently working? Not much though:

  • Connection to official SoulSeek server.
  • Login via username/password.
  • Retrieving the welcoming message.

What am I aiming for?

  • A good threading model that keeps the speed accurate.
  • Full support for chatting, including rooms.
  • Full "privileged user" support.
  • File sharing support, including queueing and browsing.
  • A user friendly GUI.
  • Ports to other platforms than Windows.

Wednesday, February 21, 2007

A nice perl script

I wrote a neat perl script today. Quite helpful, in case someone is interested. The script 'createm3u' creates a M3U playlist with the files of a directory and its subdirectories matching a certain pattern you specify. Really neat to update an existing playlist or to quickly create a playlist:

flo@nolaloth$ ./createm3u.pl mymedia.m3u ~/music/ .mp3 .ogg

This creates a playlist called 'mymedia.m3u' out of all files of the directory '~/music/' which have either .mp3 or .ogg as file ending.

Download the script.

Tuesday, February 20, 2007

Without a voice

It seems like I cannot live without some way of airing my voice, hu? Although I believe no one will actually read it I will go on posting. At least for a moment. I definitely headed into the wrong direction with my first blog; full of broken thoughts never really sanitized to reflect my person. I wrote something, and after it got posted I edited it heavily to feel comfortable with what I wrote. I hope that becomes better.