« November 2007 | Main | January 2008 »

December 2007 Archives

December 3, 2007

Video Game Contentment Levels Are A Zero Sum Game

For one reason or another, I ended up leaving Guitar Hero (and the associated guitar) at Ben's apartment on Saturday. Sunday afternoon (after an incredibly surprising [well, surprising for those who don't look at the weekend weather {me}]) as I was walking by his apartment, I mentioned to Allison that I wanted to pick it up. At which point she said that I should be a good friend, and let Ben play with it on Sunday (since it had just snowed, we were both aware that he was not going to leave the house for the next three months and needed something to do). So I did.

Fast forward to later that evening, when I get a call at 11PM. Now, normally when I get calls at 11PM, it means something has happened at the office that I'm not going to like, so Allison was subjected to my cursing as I put on my slippers and headed to the living room to pick up my phone. Thankfully, it wasn't a work number, but rather my friend and friends wife, Arin.

Arin: Kenny, I have to have words with you

Ken: Hey Arin - what's up?

Arin: All I want to do it go to sleep, but I can't because Ben has been playing Smoke On The Water for the past four hours.

Ken: I wonder if that's why Allison wanted me to leave Guitar Hero at your place this weekend.

December 5, 2007

Not really a post

I wanted to post this to see if (a) my change to auto publish typekey comments is working and (b) to see if there's something widgy with my tags. Please ignore

December 6, 2007

Truly We Are Living In The Future

Allison sent me a text today saying that she was bored, and that I should send her something funny to entertain her. I was in a meeting at the time, standing up. So I surreptitiously took a camera phone picture of my butt, and texted it to her with one hand.

I love the time in which we live.

(Except, of course, when I get pictures of Ben's taint, which happens more than you might expect).

December 12, 2007

Thanks, Apple

There has been something of a substantial change in my life, and I think I'm just now appreciating the its full effects. It's not a recent change - I think it happened a couple of months ago. It's something that heavily mitigated the negative repercussions of my most common mistake. It's a firmware update to my iPod.

You'll perhaps recall from an earlier blog post that the reason I can't stand the band !!! (at least, one of the reasons) is that they are the first band to play when I accidentally the play button on my iPod and it's not on a particular song or band. They are kind of annoying, and when they start playing because of a mistake, they become really annoying.

The recent (for some definition of that term) software update to my iPod changed the way that things are alphabetized, so that bands like !!!, ยต-ziq, or 65 days of static show up at the end of my list of artists. This leaves the number one spot for AC/DC (specifically, their seminal album Back In Black... although thinking about it, perhaps the adjective is better applied to their Dirty Deeds Done Dirt Cheap, containing the songs Big Balls and Love At First Feel. But I digress). Thus does the once negative stimulus from making a mistake on my iPod and being made listen to the first few bars of When The Going Gets Tough, The Tough Get Karazzzeee get turned into the positive stimulus of Hells Bells. A more gentle, rocking scolding for a mistake as opposed to a brusque shaking punishment.

I believe this has led the way for me to be a little more fearless in my actions, which is a good thing. Thank you, Apple, for all you have wrought. I definitely intend to continue purchasing your products.

December 19, 2007

Large File Support For std::ifstream

This is another one of those "if you aren't a computer programmer, you aren't going to be interested in this" kind of things.

The past couple of days, I had a problem at work. My team has to process a bunch of very large (from 1 - 8 GB) binary files, which contain records of some sort. For a while, we had an application which processed this individually, and was called something that looked like this:

./taskname.o < datafile.1
./taskname.o < datafile.2
etc

The datafiles were being piped into the application, and everything was working all hunky-dory. But this is clearly an inefficient way to process data - at the very least there is time taken up in the starting and stopping of the process, and if there is any caching that is done as part of the data processing (and in our case, there is), you are losing that in memory cache every time you start a new datafile.

So what do you do? You change the program just the smallest bit so that instead of being called with the name of the data file, it's called with the name of a file that contains the list of your data files. Very small change.

However, when you do that, you'll find that some of your datafiles don't process correctly anymore, since the creation of the std::ifstream object is failing. Then you'll note that it's failing on objects greater than 4.2 GBs. Ah HA! So clearly what's happening here is that, though you are compiling your code with the correct flags to support large file sizes (which you were perceptive enough to get from running getconf LFS_CFLAGS from your unix prompt), the std stream operators (for the implementation of stl that you are using) are not respecting the 64 bit versions of the underlying fopen routines, and are using the 32 bit versions. Clearly these will choke on files that have addresses greater than that which can be contained in a 32 bit value. Duh.

You have a couple of options here:

- Cry (I tried this for a bit. While cathartic, this is ultimately an ineffectual solution).
- Rewrite your code using the 'raw' C routines (fopen and fread instead of the really nice std objects which are awesome. Or at least as awesome as C++ gets)
- Follow the advice of Lance Diduck, who suggests inheriting from std::basic_strambuf, and then implement xputsn, underflow, overflow, sputc, sgetc (I tried this for a while as well, and it resulted in a repeat of the first option).
- Think about why exactly this worked when you were piping information right into the application. That doesn't make sense, does it? Wait. Wait! What if we do the following:

int fd = open( dump_files[i].c_str(), O_LARGEFILE|O_RDONLY );
ifstream dump_stream(fd);

So we use the raw C open (which *does* respect the compile flags for large file support) and use *that* to act as a constructor argument for the std::ifstream! Will this work? Probably, as long as we just stream in from the file descriptor. It almost definitely won't work if you call seek, since the position is probably going to be read as negative. So take care to not do that.

More Wedding Pics

Again, for those of you that are interested, I have more wedding pictures. Ally and I finally got the pics back from the professional photographer, which can be seen at this flickr page. We were very impressed - the photographer (Josh Kristal) comes from a photojournalist background, and so his pictures have a different feel than a lot of those we saw from other, more traditional, photographers.

This is a small set of the 800 that we got from him. My favorite? Definitely the one of my sister-in-law in curlers.

December 20, 2007

Man of the Year

One of my favorite books in the whole wide world is Mark Danielewski's House Of Leaves. I seem to recall writing about this book in the past (A quick Google search agrees with my memory). Sean didn't agree with my assessment (or at least not during his half-hearted attempt to finish the thing) due in part to the format (heavily digressive. Think that might be part of why I like it?).

There's a lot of things to like about that book (my second favorite line from horror fiction is found in this book "And that's when Karen began to scream" [second only to Matheson's "I am legend." from the similarly named novella and recent blockbuster movie]). One of the things to like about it is the way that Danielewski presents the horror of the house through the cold (shall I say, chilling?) authorship of Zampano. It's very well done, and also showcases Danielewski's scholarship - he's clearly a really intelligent guy who knows a bunch of stuff about a bunch of stuff.

I'm not really one for reading scholarly articles about things (I really go more for space opera, and the occassional graphic novel of Batman fighting Superman, kind of thing). So the essay Zampano writes about Navidson's skill at photography (in regards to a particular [fictional] picture which ostensibly won Navidson a Pulitzer) was literally the first time I've ever read any sort of exposition of why a particular photograph was better than any other photograph. It really kind of opened my eyes to the concept of photography as art, and why it isn't just snapping a picture at the right place at the right time.

Mind you, I haven't really done all that much with that information, or done any sort of follow up on that very interesting field of thought. Not up until about 15 minutes ago, when I ran across this link, discussing two pictures from the photographer Platon. Thought it was interesting, and thought you might be interested in reading it as well. Particularly you, XmasGorilla (in case you read my blog).

December 31, 2007

Caps Lock

I hate the Caps Lock key. Worst key ever. It's fairly easy to turn this key off with a Mac, but in Windows it's a little more complicated. So I was pleased to find this while I was at work today. It sure beats waiting for my cat to sit on my keyboard and tear off the key like she did my 'O' key last week.

Creepy Internet Hunting

Definitely had a colleague walk up to me at work today and say: "Hey Ken! I ran across your profile on Facebook! You had some great pictures, but you should definitely consider setting some of them as Private."

That got me a little concerned, so I checked out my the pictures in the albums connected to my profile. Nothing too racy - just me in a pink wig in one, and me dressed as a sexy pirate in another. All sorts of chest hair pouring out of my open poets shirt, but nothing I would be ashamed for my mother to see. Of course, she's probably considerably more open-minded than, say, any of my bosses. But I'm not too concerned.

As I was checkout out my profile, I noticed that some baby had sent me a message from their profile. Not baby as in "shawty," but an actual baby, wrapped in swaddling cloth and all. I certainly did not recognize the baby, nor did I really recognize the person the baby (putatively) represented as their father (who's profile I was able to see). The infant only reported the first and married names of it's mother, so I started on something I really haven't done in a while. Some creepy internet information hunting. It took a little while, but I finally figured out who the mother was (a friend from high school). Involved crawling around Facebook, Classmates.com (on which I had to create a fake profile. Welcome to Garden City High, Hagbard Celine!), Friendster (on which, embarrassingly enough, I did not have to create a fake profile, but I did have to get my password sent to me. They were probably so psyched to have someone log in! I wonder if they had a pizza party) and Google news searches.

Once I figured out who it was, I was honestly kind of surprised that she was the type of person to put a profile of her baby on a social networking site. But then I realized that I'm the kind of guy who has an entire album set aside for pictures of his grumpy cat on a social networking site, so I really can't judge.

About December 2007

This page contains all entries posted to Kennyblog Redux in December 2007. They are listed from oldest to newest.

November 2007 is the previous archive.

January 2008 is the next archive.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34