The READIN Family Album
(March 2005)

READIN

Jeremy's journal

The gate is wide open, the madmen escape.

José Saramago


(This is a page from my archives)
Front page
Most recent posts about Programming
More posts about Projects

Archives index
Subscribe to RSS

This page renders best in Firefox (or Safari, or Chrome)

Tuesday, November 25th, 2008

🦋 O Excellent New Tool!

You know what debugging tool I just hate having to deal with? Purify, is what. Its interface seems insanely cumbersome to me, it's hard to use in conjunction with gdb, I dislike having to compile a separate version for heap-checking. Well today, my co-worker Nick hipped me to valgrind, which just seems like it was made for me. Exactly suited to my style of debugging. Basically it just spits out a ton of messages to stderr, interspersed with your own stderr output you can troubleshoot very quickly and come up with a bug location to reproduce in gdb.

My goal is to become a power user of valgrind -- starting with no knowledge of the product I was quickly able to isolate the problem I was seeing. If I acquaint myself with it's features it's going to make a really valuable addition to the toolchest.

posted evening of November 25th, 2008: Respond
➳ More posts about Programming Projects

Saturday, January 10th, 2009

🦋 Dream Blogging

An anxiety dream last night about the code I am maintaining: a customer reported a bug, which on analysis proved to be a corruption in shared memory caused by the customer's input. When a year was specified in the date parameter, the corruption would occur -- if only month and day were specified, everything was ok. It was pretty mysterious how this would not have been discovered years ago as the section of code governing this parameter had not been modified in a long time; but the bug was pretty easy to track down and fix. Except, a little later I was talking to my boss and he thought I had told him the bug was not fixable and we would have to find a workaround. I was going crazy trying to figure out how to respond to this because I had forgotten where I had put the fix in and I had not commented it or kept any records...

Later in the night, I dreamed I was examining and modifying the source code for my dreams. It was not clear how or whether I would be able to recompile and distribute the fixes to my consciousness.

posted morning of January 10th, 2009: Respond
➳ More posts about Dreams

Friday, April 24th, 2009

🦋 (Relatively) Close to the metal

Neat-o, I found a new tool for testing stuff out! It is called netcat and it is essentially what I've always wished telnet would be. You can basically open up a socket and listen as the server or attach as a client, and see all the traffic from the other party, and type in the traffic from your side. Be sure to read the (brief) man page as the tutorial pages I've found on the web this morning all omit important information and leave you scratching your head as to what is going wrong.

The two things (at first glance) that nc has over telnet: primary point is that you can listen on a port, and thus emulate a server; telnet does not do this at all. Secondary advantage, the whole thing is much cleaner and simpler, and easier to run as a batch job; you don't have to learn escape characters or anything like that. Drawback is that error reporting is pretty minimal; but I can live with that.

posted morning of April 24th, 2009: Respond
➳ More posts about Projects

Thursday, August 20th, 2009

🦋 errno

Perhaps you are a programmer; perhaps you use gdb to step through the programs you have written, looking for bugs; perhaps you have wondered why gdb will not let you examine the contents of the errno variable. Here's the deal: if you are typing print errno and getting the message Cannot access memory at address 0x8, it is because errno is not an actual variable; the compiler has replaced references to errno with *__errno_location() --

print *__errno_location()
will give you what you're looking for.

posted morning of August 20th, 2009: 5 responses

Saturday, March 13th, 2010

🦋 Character sets

At work, I've been involved in a project to support the full Unicode character set in a more-than-cursory way*, getting to understand wide characters and utf-8 much more fully than I ever did before; and finally I am thinking I want to encode READIN in utf-8. All this time it has been in ISO-8859-1, which works ok as long as I escape unsupported Unicode characters; but it seems like time to get with the program.

My question is, what's the easiest way to convert my data? A lot of posts have got characters like äöüæ... which are going to show up as garbage if I just change the encoding of the blog. I was thinking I would use mysqldump and use iconv to convert the data. But somehow the output from mysqldump is already encoded with utf8. Does this mean I can just rebuild the database from this output and I'll be good to go? I'm a little confused why mysqldump is not respecting the encoding in the database...

Well, restoring from the output of mysql-dump does not have the desired effect; characters that were ISO-8859-1 in the original db, that were UTF-8 in the dump, are converted back to ISO-8859-1 in the restore.

After further investigation, it seems like my original idea will work: although it looks to me like iconv is essentially double-encoding the characters that were transformed to utf-8 by mysqldump, when I load them back into mysql I get utf-8 characters. Not totally comfortable with this yet...

* (Previously our support for Unicode had consisted of walking through utf-8 strings looking for high-order characters we recognized, and flattening them to 7-bit ASCII.)

posted morning of March 13th, 2010: Respond
➳ More posts about The site

Drop me a line! or, sign my Guestbook.
    •
Check out Ellen's writing at Patch.com.

What's of interest:

(Other links of interest at my Google+ page. It's recommended!)

Where to go from here...

Friends and Family
Programming
Texts
Music
Woodworking
Comix
Blogs
South Orange
readincategory