Blog Archives

Printing a C array in the debugger Console

I’m by no means a GDB expert.  I know the basics, but I just learned this gem today.  Say you have a C array with five items created with something like this:


int *array = malloc(5 * sizeof(int));

And you want to print it out in the debugger quickly.  You can’t just print the pointer because GDB doesn’t know to print it as an array, but this will:


p *array@5

Output:


$1 = {0, 0, 0, 0, 0, 1}

To use this the left hand side, before the ‘@’ should be an array, and the right hand side needs to be the length of the array.  Very handy.

Advertisements

2011 in review

This is admittedly pretty cool:

 

The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.

Here’s an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 12,000 times in 2011. If it were a concert at Sydney Opera House, it would take about 4 sold-out performances for that many people to see it.

Click here to see the complete report.

Finally Own an iPhone

My dirty little secret as a developer is that I’ve been an Android user for the past 2 years.  I finally upgraded this week to an iPhone.  I can’t begin to describe how much better the experience it is!

UIView Subclass for Custom Drawing Using Blocks

UnderTheBridge picked up a post on a clever method for using blocks for drawing.  Especially useful for small views that don’t do anything else other than just custom drawing.

Check out the original post from David Hamrick here.

Updates to PZIndexedArray

I posted another update to PZIndexedArray that fixes some bugs with sorting and key deletion as well as some greater conveniences for checking keys and lack thereof.

It’s up on GitHub as always.

IndexedArray Updated

I updated the IndexedArray project from yesterday with some fixes and support for NSCopying. You can find it here.

Mindgrub, the company I work for, was featured in this Baltimore Sun article today.  Check it out!