2007 November : Geekin in the 7 cities

Give me some FLAC

Idea #1: Hey I think I’ll convert my CD collection to MP3! That lasted until I discovered Ogg Vorbis. Idea #2: Hey I think I’ll convert my CD collection to Ogg Vorbis! That lasted until I discovered FLAC. So after a couple false starts, this is the plan (or Idea #3 if you like):

  1. Rip my CD collection to FLAC
  2. Upload FLAC to S3 account for archiving
  3. Convert FLAC to Ogg Vorbis on my local drive
  4. Delete FLAC files from my local drive

Read more

PODS

Plain Old Data Structures. A couple years ago, when I first tried my hand at C#, Every project I did used custom collection classes. It seems I was always implementing the ICollection Interface, dealing with enumeration as such. So much scaffolding just so that I could write foreach thing in things. My opinion is that I’ve been wasting my time. The System.Collections and System.Collections.Generic namespaces contain enough data structures to help you accomplish any task you will normally be confronted with. These data structures help you loosen the coupling between your assemblies and leverage a long history of tried and true algorithms. Combine that with generics for type safety and I’m not sure what more you could ask for. Maybe I’m being influenced by Python, Ruby, Lua et al. Their liberal use of a few (in Lua’s case One) data structure(s) make applications more readable and in my opinion more reliable. What ever the reason, I’m all for Plain Old Data Structures.

Embedding Lua in C#

About a year ago I played around with Lua. I had a good bit of fun but it never really took off for me. As is the case so many times, I pretty much forgot about Lua. I’ve got one of those attention spans that supports moving on quickly. Recently though, Lua came back into focus. This time as an embedded scripting component in a C#/AutoCAD.NET API application that I’m working on. Extending the extension sounds crazy but there was a need for it, and LuaInterface made the job uber simple. LuaInterface allows you expose your C# methods and classes to Lua. You can also use Lua tables within C#. For the methods I want Lua to have access to, I attribute them with a custom attribute class. I use a method (got the idea here) that performs some reflection tricks and handles the Lua registration automatically. As an old friend of mine used to say, it’s killer diller.