Tag >> programming
20 May, 2010

We just bought new machines a couple of weeks back.  They're pretty sweet.  I don't normally splurge on things, but I do like to buy quality that serves a purpose.  So, rather than buying a typical off-the-shelf Dell or even an HP workstation, I decided to have some built by my good friend Jeremy Siprelle who knows how to build such things.  I'm a demanding customer, though, and wanted some top shelf parts and some solid but economical parts.

 

The case is a Silverstone Raven.  Beautiful, oddball, and huge.  Beautiful because Jeremy built everything so the power cables are all shrinked in black against a fully powder coated black case, so there's no light leakage or reflections inside the case, except from the motherboard and piping.  We didn't get a circus case with glowing LEDs... that's for kids.  But looking inside a perfectly clean case is a joy in itself.  Oddball, in that the motherboard is rotated 90 degrees so that the connectors are UP rather than BACK.  This helps heat rise off cards, as well as the massive but slow moving fans in the base of the case blow just enough air upward that the heat is extracted, but make almost no noise.  Huge, in that it's at least 8 inches longer than a normal case, so there's plenty of room to mount a ridiculous number of hard drives in it.  My one gripe about the case is that since there's a lid that is relatively close to the connectors, if you buy any dongles or rigid converters, you may have trouble fitting the lid back on.  Display port - to - HDMI connectors sometimes are this way, and we had to buy cable-style ones rather than rigid.  No biggie, but a minor annoyance.

 

The mobo is a Gigabyte X58 of some variant, with a Core i7 920 and 6gb of tri-channel ram.  Plenty of bandwidth, lots of speed, and 8 cores (4 + 4 hyper).  Yeah, it's fast.

 

Most important, though, was my insistence on a Sandforce driven solid-state drive (SSD).  The first one I could get a hold of was the Corsair, which at 100gb is not tiny but not huge either.  It's incredibly snappy compared to the 7200rpm drives I'm used to.  Oh, and silent and produces virtually no heat.  Today, though, I was dinking around and decided to run a few benchmarks.

 

HOLY CRAP.  The drive wasn't all that fast.  Access times are incredible, but the throughput was lousy at the low-end, and only climbed up near the 285mb/s it's supposed to have when you get up to very large file sizes, and  even then it was only at 235mb/s.  I gave it a pass since the drive is already 60% full, and SSD's are supposed to degrade a little as they fill.  Except Sandforce controllers aren't supposed to.

 

After an hour of reading and tinkering and running benchmarks, I found out that the BIOS needs the SATA controller to be configured for AHCI rather than IDE mode, and the registry (HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/Msahci) needs to have a tweak 'Start' changed to zero (0) rather than 3.  Change the registry first, then the bios, then reboot twice and Windows 7 will figure it out.  Don't sweat the first reboot... it takes a long time!

 

Once I'd gotten that fixed up and re-run the benchmarks, I'm getting over 120mb/s at 4kb random reads and writes, and easily hitting 285mb/s on anything over 64kb.  Smokin'! So, if you have an SSD, you might consider checking your settings.  Yes, they matter.  A lot.

 

JH


06 May, 2010

In the midst of having a spirited discussion with a friend, a handful of quotable quotes came up.  I was just presumptuous enough to think it might be interesting to a handful of the nerdly-wise.  Enjoy or don't.

 

"What I've noticed is that the best programmers refactor once. Lousy ones, frequently. Terrible ones, never. "

 

"The quality of a programmer is not just determined by how quickly and effectively he can write code, but also by how well he understands the implications of the code he has written."

 

"The quality of the code is determined by how quickly it is debugged, and how frequently it is re-debugged."

 

"From my perch, methodologies are an attempt at supplying the inexperienced with lessons that come from making mistakes, but without having the freedom to make them." 

 

Some days we just play with our food, other times we build sculpture.   More sculpture in our souls lately, I guess.

 

JH


19 Mar, 2010

Yesterday, I had a pleasant surprise on my way to work.  Opening the front door  and making a mad dash to the car is pretty routine in Texas: in summer, it's to avoid the blazing sun and heat, in winter it'll be the rain (or lately, snow?).  As I pushed open the door, there was unexpected and substantial resistance... aha!  A cardboard box with my name on it.  Jenny and I played 20 questions for a moment guessing who had ordered what, why it would come right now, and so on.  Clueless, I slit the tape holding the mysterious box from my prying eyes.  Moments later, Ooos and Aaahs as I pulled out my complimentary copy of Game Engine Gems 1, which marks the first time I've ever been published.

 

Thumbing through the articles, it looks like a really great read--I'm actually looking forward to seeing how the other authors work their miracles in game development.  Eric Lengyel, my good friend, did an excellent job editing the tome and maintaining consistency (even if he moved all my consts to the wrong side of the type declarations  :-) ).  If there's any complaint to make, it's that the whole book wasn't printed in color.  Code is so much more readable that way, as are the various diagrams.  At least there's a cdrom that contains everything (and then some) in glorious color.

 

So, while I didn't get to go to GDC this year again--too busy--at least I have a consolation prize that promises to be pretty interesting. 


19 Feb, 2010

WxWidgets is a beautiful thing. Coupled with wxFormBuilder, you can make relatively complex GUI applications in a fraction of the time a traditional C++ app would take... still not as quick to build as C#, but then again, if you have a huge library of useful C++ code lying around, the relative value of C# is diminished. The MSVC GUI builder is fast and simple, but the amount of extra binding code to use our C++ libs would make it far less than ideal.

 

So, wxWidgets is the best alternative I've found. Of particular interest is wxGrid. It's a beast that warrants a moment of understanding, because the design is actually kind of beautiful once you grok it. It's incredibly useful to have a grid of stuff. But I wrote an entire translation tool the WRONG WAY using wxGrid, because it seemed like the right way to do things according to the (admittedly minimal) documentation. Do not use a vanilla wxGrid except in toy apps where you don't have many elements and don't care if the contents are duplicated into the grid itself--which sucks in so many, many ways. Let me state this plainly and clearly: wxGrid should always be used in conjunction with your own custom-derivation of wxGridTableBase. Sounds complicated, but really it's just a handful of functions that convert a row/column pair into a string and back again when it's been modified.

 

What are the benefits? For one, you don't have to go in and stuff the grid full of data that you no doubt already have somewhere else in a perfectly reasonable structure. Instead, the grid asks you for the data it needs to display--only the data it displays--not every cell in the grid. This added efficiency saves a lot of memory and dramatically improves a full refresh.

 

More important than the above, from what I can tell, deriving your own data provider is the only way to add custom controls inside the grid for editing the contents. I had no luck simply registering my own data types with the default wxGrid until I added my table type to it. Then, suddenly, everything started working! That means you can put file browser controls, or drop-down choosers, or whatever in the grid trivially by calling RegisterDataType(), and on specific cells or even whole columns, SetColFormatCustom() with the same type names.

 

Then it Just Works. The grid is no longer a separate control, but a direct view of your data structure, and you write about 10x less code dealing with it. In fact, it's a damn shame more controls don't work like this. Good job wxWidgets coders!


<< Start < Prev 1 2 3 Next > End >>