Skip to content

Category Archives: code snippet

working with R, postgresql + SSL, and MSSQL

I’ve been able to take a break from my regularly scheduled duties and spend some time working with R.  This is a short log of what I did to get it working. The main things I’m looking to do is regression modelling from a large dataset I have in postgresql and various stats calculations on […]

simple job scheduling with a threaded lisp

Yesterday I had a need to do some batch processing, making many HTTP calls to crawl a government website to pull down some public data.  I didn’t want to run this during normal hours, because I didn’t want to put a strain on their server.  I had the web crawling sorted out as a function […]

logo for wedding favors

I’m getting married in a few weeks, and one of the final tasks was to make some favors for the guests. Heather and I decided on coffee mugs with a cute logo. We quickly came up with the concept of a heart with gears inside, as we’re having a steampunk/victorian themed wedding.  After one very […]

some simple cl-smtp examples

The docs on cl-smtp are a little, um, terse, so I figured I’d post a few snippets for google to find: Sending html email with cl-smtp: (cl-smtp:send-email +mail-server+ “” “” “Subject” “<html><body> <p> Shiny <strong>h</strong><em>t</em><small>m</small>l. </p> <p> </body></html>” :extra-headers ‘((“Content-type” “text/html; charset=\”iso-8859-1\””))) Sending attachments with cl-smtp: (cl-smtp:send-email +mail-server+ “” “” “Subject” “see attachement” :attachments ‘(“/path/to/attachment”)) […]

lisp geocoding, more library possibilities

I’m finally working on a project that has a public component (besides a login screen), and the lisp has been flowing. I’ve been able to put in probably around 10 hours a week on this thing, and I can’t wait until its more presentable to show off. As part of this, we’re building up our […]

an x-axis plus API cleanup

Some more progress on the charting library today: cleaned up the API a little bit, opting for some nicer make-foo function instead of requiring calls to make-instance: make-series label data &key color make-axis label &key control-string draw-gridlines-p label-formatter control-string: a format-compatible control string, and supplying it sets the label-formatter for the axis label-formatter: a function […]

charting library taking form

It now does line charts and better pie charts, and has had a lot of bugs removed since the last post. We did some code review on it at work, brought some of the spaghetti under control, and included the library in an intranet app. Here’s a sample line graph: The (somewhat verbose) code for […]

Graphing my fuel efficiency with lisp and Vecto

Gonna try to be quick about this, as there’s chicken on the grill. I took a break from Team Fortress 2 to play some more with Vecto, another fine library from Xach. I started another post about last weekend’s lisp playing, but this one got finished first. I’ve been tracking my fuel efficiency for a […]

reading passwords from the console in C#

I’m working on a simple command-line app, and have the need to collect a username and password. I don’t want the password to be printed on the screen as they type, but System.Console.ReadLine doesn’t seem to have any option to mask the input before it’s echoed back to the console. There are a couple ways […]

EventHandlerList, key equality, and auto-boxing in C#

I was recently implementing some custom events, and found a couple of good (if old) articles describing how to do this efficiently using EventHandlerList: Manage many events easily with EventHandlerList Objects with dense events, but sparse usage can benefit from custom event storage. Those articles go into why it’s nicer to deal with one EventHandlerList […]