Malicious enjoyment derived from observing someone else’s misfortune
 

Tag Archives: c

Learn from my AVR mistakes

I’m learning a lot programming in AVR C.  There’s are a few subtleties to watch out for, and some of them have had me banging my head against the wall for days.  This post is an attempt to prevent anyone else playing with AVR outside of AVR Studio (I’m using Linux and the command line) from having the same issues. Sections for avr-objcopy When you compile an AVR C program, you get object code, which you have to convert into [...]

Parsing WFM Oscilloscope files in C

So, I got this Rigol Oscilloscope – I wrote a little instructable about it. One cool feature is the ability to save waveforms to a USB stick. There are many options for the file format, but the default is a WFM file. Now, a true minimalist could just use the CSV option, but the WFM is a binary format that contains a lot more information directly from the scope. I wrote a little C program hosted on github that allows [...]

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 to boost.org’s root page and streaming the result to STDOUT. Pretty cool, eh? What if you want a different website? It’s nearly as easy as [...]

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

OSCON Sessions, Day 2

Oh man, what a day. I attended quite a few talks, grabbed a lot of swag, and entered a few contests. I ended up buying the Arduino Starter Kit from MAKE so I can do some awesome embedded Ruby like I saw at FOSCON. It looks really fun – I can’t wait to try it out. The talks I attended were half-way decent, but I learned a lot more on the first day. Hadoop and EC2 A good overview of [...]

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.

Compiling Stepmania in Ubuntu Feisty

OK – so I love DDR. I was trying to compile Stepmania this morning, and found that it has some issues. I found the answer to the first issue in this post, and found the answer to the second in this one. Apparently, there are some patches that have gone into 4.0 CVS that haven’t been put into the old source. Procedure Get the Stepmania Source and extract it somewhere. Now we need to get stuff to compile it: sudo [...]

PL/Ruby on CentOS 5

I had some trouble compiling PL/Ruby for PostgreSQL today on Modzer0. I solved it with some clever extconf.rb switches: ruby extconf.rb –with-pgsql-include=/usr/include/pgsql/ –with-pgsql-version=81 Now I avoid the problems I was having before: [root@modzer0 plruby-0.5.1]# make make[1]: Entering directory #… In function ‘perm_fmgr_info’:plruby.c:116: error: ‘TopMemoryContext’ undeclared (first use in this function) plruby.c:116: error: (Each undeclared identifier is reported only once plruby.c:116: error: for each function it appears in.) plruby.c: In function ‘plruby_call_handler’: plruby.c:706: warning: unused variable ‘result’ plruby.c: In function ‘pl_compile’: [...]

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 it, and it didn’t work for me at first. Then, for some reason, it started working. Here’s what I think did it: In Ubuntu, I [...]