March 2012
1 post
3 tags
Vim indent text objects for Coffeescript and...
Do you write a lot of Coffeescript, Python, Jade templates, Haskell, or any other language that uses indentation? If you are like me, you may be sad to find out that your trusty ciB does not work anymore in Vim. ciB is “change inside block” which only matches inside () and {}. This is no good when we are dealing with languages like Python that use indentation instead of curly braces...
January 2012
1 post
Iteratee Hello World
This entire blog post is in literate Haskell, you can clone it from the gist to try it out:
git clone git://gist.github.com/1571444.git iteratee-hello-world
This is the simplest example of an Iteratee that I could think of. It simply reads from an stdin/file Enumerator and spits it out to an stdout Iteratee. The stream is transformed to uppercase characters using an Enumeratee.
I put this...
June 2011
1 post
3 tags
Using Haskell's QuickCheck to generate random test...
QuickCheck is a random testing library written in Haskell and is typically used for fuzz testing code. The main typeclass provided by QuickCheck is the Arbitrary typeclass. When you make one of your data types an instance of this typeclass (by implementing the arbitrary function) you can generate random samples of those data types
I recently needed a way to generate a large number of Serial...
April 2011
0 posts
F# CSV Parsing with FParsec
I needed a .NET CSV parser for work, and since I don’t trust most .NET code I find online I wrote one in F# with FParsec!
This handles both quoted and unquoted cells. It even supports escaped characters (including commas)!
For example,
CODE, EN, FR
HOME_DESCRIPTION, Hello\, welcome to our site!, Bonjour\, bienvenue sur notre site
Will parse to:
[
["CODE", "EN", "FR"],
...
December 2010
1 post
4 tags
Irssi notifications with notify.io
Ever wanted more powerful notification capabilities inside of
irssi?
If you use irssi and you’re like me, you might have a setup similar to
this:
irssi on home desktop or server inside of a screen session
This is an ideal setup for me since it allows me to shell into my box at home
from various locations. A lot of the time the IRC ports are blocked so ssh +
screen + irssi gets around...
November 2010
2 posts
2 tags
Static Factorial in Clay
Meta programming in Clay is very intuitive:
Here’s the same thing in C++:
The cool thing about this is that you can have both runtime and compile time (static) overloads at the same time.
Have a function that you can turn into a compile time operation? Simply add an overload that takes a static value and do your custom logic.
Compile-time meta programming is truly a first class...
Print-friendly lesswrong Sequences
I have started to convert The Sequences over at lesswrong.com to print and ebook ready formats such as epub and PDF. You can get them on my github page:
https://github.com/jb55/lesswrong-print
October 2010
2 posts
1 tag
Interesting Minecraft-clone Projects
I’ve been following Minecraft development for awhile, and I’ve
always wondered what future Minecraft games might look like.
Surprisingly, there already seems to be a couple working clones and
bunch more in development. I wouldn’t be surprised if major game
development are starting to work on their own Minecraft games as
well, who knows!
Manic Digger
Manic Digger
is a...
Stuxnet Dossier
Symantec has released a breakdown of the Stuxnet worm, you can read it here: goo.gl/fkXF
Some interesting quotes:
If this value is equal to 19790509 the threat will exit. This is thought to be an infection marker or a “do not infect” marker. If this is set correctly infection will not occur. The value appears to be a date of May 9, 1979. While on May 9, 1979 a variety of historical events...
September 2010
2 posts
Gists on Tumblr?
Looks like it works!
Hello World
This is my blag