A place to keep my thoughts on programming

Monthly Archives: February 2005

Trigonometry and Javascript

Had some fun this weekend playing with Javascript, trying draw dynamic lines. Since Javascript doesn’t actually have any kind of Draw() or Paint() methods, it comes down to manipulating images. I originally started by scaling images of lines, but even … Continue reading

February 28, 2005 geek, javascript

Atomic file replacement

A traditional way for overwriting a file atomically is to write the new file to temp file, and then use move to replace the original with the new. That way the replacement is atomic and no script that relies on … Continue reading

February 22, 2005 .net

Emacs, Nxml-Mode and Unicode

I’ve run into this too many times and fixed just as many.. grr. And i always forget.. Time to write it down. I use James Clark’s excellent nxml-mode to edit pretty much anything that’s vaguely XML, i.e. i usually convert … Continue reading

February 17, 2005 geek ,

Asynchronous Postback in Web Applications

So a while back I read an an article about the Client Callback Feature in ASP.NET 2.0, which allows ASP.NET 2.0 to do updates to a page without a full page rountrip to the server. But wouldn’t you know it, … Continue reading

February 14, 2005 .net, javascript ,

Tweaking ContextMenu’s for List Items

A little System.Windows.Forms diversion. One thing that’s ill-documented, imho, is the CheckedListBox. And if you then want to add a context menu that’s context sensitive to the Item in the list you are over, then good luck finding any useful … Continue reading

February 7, 2005 .net

An exercise in overcomplication

Ok, there really isn’t a need for doing this, but since i’m already stuck on creating compact language independent binary representations, here’s a quick struct with an int, a fixed sized string and a variable data field that implements a … Continue reading

February 4, 2005 .net ,

Fixed arrays in structs

Figured out that the good old C struct foo { int many[10]; } does not work in C#. Best description of workarounds I found are on Eric Gunnerson blog here. Ho hum. Of course, it’s a problem of limited application, … Continue reading

February 2, 2005 .net

When casting is not enough

Dealing with raw bytes coming across the network has given me plenty of opportunity to figure out how to convert data from one type to another. As previously noted, the good old C method of memcpy‘ing bytes into structs takes … Continue reading

February 1, 2005 .net