Tag: coding

  1. You're probably wondering where I've been lately.

    26 June 2009

    By and large, work has been, well, work.  Lots of hours at the office, lots of hours stuck in traffic sweating like Kevin Mitnick during a traffic stop.  When I haven't been logging time behind a console, I've either been trying to get my head back into Python coding (try as I might, I just don't understand GUI programming in general or PyGTK in particular), reading data sheets, reading up on the Arduino microcontroller, or pulling a Tesla while pondering the best way to build my latest obsession, a laser synthtar.

    You see, it all started at HacDC a couple …

    Read more...

  2. Python: as simple as possible but no simpler.

    06 June 2009

    When coding something in Python, it's said that your logic should be as simple as possible because the language does the heavy lifting for you. The nice thing about Python is that it makes it very easy to implement complex functionality because all the fiddly stuff that you normally spend ages coding and debugging (like linked lists and sorting algorithms) is already done for you. Also, the basic data types/objects that Python gives you are as orthogonal as you can get without throwing your hands up and using sticky notes instead.

    In short, I spent two weeks debugging a …

    Read more...

  3. Pirates, pants, pets, Python, and Push.

    01 June 2009

    After many months of near misses and scheduling conflicts, Kyrin finally got Lyssa and I to join him for a Friday evening at Piratz Tavern (8402 Georgia Avenue; Silver Spring, MD; 20910; phone 301-588-9001 to cap off a long work week. Hasufin, Lyssa, and I piled into the TARDIS and set course for Silver Spring around 1900 EST5EDT, which we figured would be late enough to dodge weekend traffic on the Beltway.

    It wasn't, actually, but we still made decent time without actually being fashionably late.

    Piratz Tavern is a very small, unassuming place on a corner across the street …

    Read more...

  4. Perl, Getopts::Long, and code hacking.

    19 May 2007

    When working with the Perl, you can use the module Getopt::Long to implement your command line argument parser. However, if your script can take a string of words after the arguments, like this

    ./my_script.pl --arg1 --arg2 --arg3 foo bar baz quux

    the -- options will be removed from @ARGV, leaving only the other words (foo, bar, baz, et al). This means that you don't have to write any routines to dig them out of @ARGV.

    Read more...

  5. Primitive artificial intelligence indicted for unlawful practise of law!

    07 March 2007

    No, I'm not kidding.

    One Henry Ihejirika developed a web application called Ziinet, which was an expert system for bankruptcy law that provided a service to whomever could pay the $216us charge for 60 days of access. The idea was that you paid your fee to log into the web application and hammer in the information relevant to your bankruptcy proceedings. The application would analyse your situation, draw up affadavits (presumably drawing upon a database of pre-written statements and paragraphs - if you write enough papers of any kind, it only stands to reason that re-using parts of older papers is …

    Read more...

  6. Random knowledge VI.

    25 January 2007

    The actions of a systems cracker trying to get a foothold in someone's network by social engineering the people in the NOC and someone hunting for a job who is trying to get hold of a human being in the HR department somewhere in a company are not that different.



    When writing Perl code, generally speaking the simplest code is what will do exactly what you need. If you overthink what you're working on, you won't get anywhere.. especially with the reverse operator.

    Perl gives you enough rope to not only hang yourself but your entire family, too. Don't make …

    Read more...

  7. Random knowledge V.

    25 January 2007

    GNU Screen makes coding so much easier: Run screen to multiplex your shell, then run a text editor in one, a debugger in another, have another shell open to compile.. no more mousing between windows. There isn't much of a learning curve, if you feel comfortable coding under Unix (or using the Cygwin tools for Windows) you'll pick it up in no time.



    Sleeping just enough to recoup your strength so you can go out again isn't a good thing. Sleep enough to get all your energy back. Don't pull two or three all-nighters in a row, either. It'll crush …

    Read more...

  8. Random knowledge IV.

    25 January 2007

    Just because it's usually the one-half teaspoon that falls off the holder and it's usually the one-half teaspoon that fell off the holder that you grabbed out of the drawer doesnt't mean that it's the one-half teaspoon that you really grabbed. Always look before you use measuring implements.



    When a recipe says to use eggs, use real eggs. Four times out of five, Egg Beaters just won't cut it.

    When creaming butter and sugar together (probably butter and anything, I havn't tried yet) it doesn't hurt if you melt the butter in a skillet or frying pan first. If anything …

    Read more...

  9. Random knowledge III.

    25 January 2007

    Coding with a teddy bear in your lap helps immensely.



    IPtables for the v2.4 Linux kernel series doesn't understand virtual interfaces (a.k.a. IP Aliasing). If you've never seen this before you can take one interface, say eth0, and bind an IP address to it, for example 192.168.1.1. Under the v2.4 kernel series you can bind more than one IP address to an interface, which creates a virtual network interface. If I bound a second address (10.0.0.1) to our network interface above you'd see in the output of /sbin/ifconfig eth0 …

    Read more...