Tag Archives: programming

Notes about Google Go

While trying out Google Go, I found out whitespace seriously matters, certain constructs you’re used to are not present, there is more than one way to declare variables, etc. This is a short collection of those observations. Blocks Blocks cannot have a newline between the declaration and the first opening brace. This is a bit [...]

Burst C++ Library

I made a little C++ library called burst. The idea is to extend the awesomeness of Boost with convenience functions for common tasks (mainly my own common tasks, but maybe others can benefit as well). The current trunk is here. Here’s a quick example: And just that quick (3 lines) you’re sending an HTTP request [...]

1,000,000th Fibonacci Number One-Liner in C

This is possibly the best one-liner I’ve ever written: gcc -x c -o /tmp/out – -lgmp

GitHub Widget for WordPress

For all you coders out there wanting to show off all those forked repositories, the github-widget is for you. There are a few ways to install. Download from here.  The most recent stable release will be available.  As of this writing, it’s REL-1.3. Clone the git repository: git clone git://github.com/hank/github-widget.git Get it through WordPress (Work [...]

My favorite program

\ | / /“`\ \/ \/ _ | | _ /\ _ | | _ //\\ \___/ //\\ / | \ || || /||\ +++++++ +++[>+++++++>+++ +++++ +>+++>+\> +++++++++++>++++++++ ++++<<< <<<-]>+++.>> @__ ++.<<+++.>>>>+.>–.<—– —–.<<. <-.>>>>——- / \ .++++++.<<<.<<-.>>>>.>——— .+++++++.< .>++++++.<<.<<–.>>>++++.+++..<<.<++.>>>+++.>—-.<<<.<<++.>>>>——– ——.>—..+++++++.<<<.<<.>>>>++++.<<<<————–.?>>>.__________ Hint: It’s code, and the language it’s in has a dirty word in the [...]

Finding bad JPEGs with Xorg hacks in Ubuntu

So, I have all these JPEGs, and I want to know which ones are corrupt (specifically, ones that end prematurely). qiv will spit out the following to STDERR when it finds one: Premature end of JPEG file So, this is nice, except it’s entirely unscriptable. The solution I found was using the following script to [...]

Random Fun with NASM

I was on IRC tonight and someone was having trouble with their NASM homework. I decided to help them by learning NASM and coding up their homework problem for fun. It was pretty cool.

HAI WURLD! LOL

So, today I was stumbling around and I found an implementation of 99 bottles in LOLCODE! Wow, time to get the interpreter. I really need to make a deb for this, but that can wait. Anyway, first I tried some simple hello world sort of stuff: BTW OMFG A LOLCODE!!oen!111 BTW THIS IS WROTE BY [...]

KLone – C on Rails!

Well, I was over at Debian Package of the Day when I noticed an article on KLone. It’s a little application framework that allows you to do XHTML templating in C! Then, you can compile it and send it off to any Linux machine (with a few dependencies of course) to run it. I got [...]

Using seq to zero-pad strings in a series

I thought this was pretty cool: for i in `seq -f "%03g" 1 100`; do wget http://www.gozerog.com/images/Hawking_$i.jpg; done We were trying to do this the other night using bash, but to no avail since the square brackets only work for local file path expansion. I should have remembered seq. Also, this example shows how to [...]