You are reading an archived copy of my old blog. Please visit blog.ppy.sh for fresh stuff!

Archive for the 'dev' Category

h1

bspatch c# port

Saturday, November 22nd, 2008

For osu! updates, I use an algorithm called bsdiff (bytewise subtraction) designed by Colin Percival.  Up until now it has been an external dependency that causes problems with Vista (UAC issues) and occasional instability in the process handling, so I got around to porting it over to .NET last night.  I thought for once I’d share this publicly because I think it may be helpful for others out there wanting to do a similar thing.

I only ported the bspatch part over, so you’ll need to create the diff files using the original code (also available as a native windows c++ port here. The sharpziplib library is used for bzip2 stream handling, and only minimal files are included.  This makes for a very small binary (19,968 bytes).

Binary available here (pruned to smallest possible size).
Source code here.

While I haven’t benchmarked performance seriously, it should be near-equal to the native code.  There is no unsafe code used (although it can be employed very easily for a performance boost).

h1

simple file diff’ing

Wednesday, October 22nd, 2008

ever wanted to find the difference between two files – as in lines contained in one but not the other?  probably not.  but if you ever found yourself in such a situation you might find this little tool handy.

It will take two text input files, and give two outputs – one containing lines found in in1 but not in2, and vice-versa.  It accepts drag-drop for files and should be quite performant (two lists of 10,000 lines takes around 100ms on a p4 3ghz).  It should also scale quite well.

This was a 10-minute coding challenge.

h1

rajio ahoy

Wednesday, October 8th, 2008

a little pet project developed over a three hour period including setup and speedcoding with php/python/mysql/icecast/ices0.  quoting myself:

“I got a bit annoyed at work without my music collection handy, so I decided to make a little request-based radio app up. Its all good to go, but will only handle about 6 people at once. Feel free to check it out here. It searches my full music collection, which is ~400gb of jpop/anime/game/misc music. You can place requests and they will be queued in order.

Depending on how it gets used, I will decide whether to put more time into it or not.”

h1

etickets aren’t any fun

Tuesday, November 20th, 2007

what ever happened to the days of getting a nice wad of paper detailing your flight plan around the world?  i felt a bit cut receiving a single 6-character code which was my ticket.  i guess i should be used to this, as it wasn’t the first time around, but it was the first i ordered completely over the internet… which meant i didn’t even get the combination on a piece of paper!

so yup, i’ve booked my flight to japan for dec-jan.  it is during the peak season so i was  almost thinking about delaying it a few months to save money on the flight… but i really feel like going sooner rather than later, and avoiding the christmas heat (and enjoying a white christmas) should be worth it!

there has been a lack of updates here, yes.  time to blog when i’m writing code every spare minute of the day?  i don’t think so.  its a pretty monotonous life at the moment, and my sleep pattern is absolutely fubared, but the end results are worth it… and hopefully i can get things to a stable point sometime soon and take a bit of time off.

rararararaaaaaaaaah