Some thoughts about the new desktop – part I

So I finally did what I had been slowly planning for about two years: I upgraded my desktop computer! It’s been a couple of months now, so I’ve had time to get accustomed to it and test it in everyday use.

* * *

During the years I used my previous setup, there was one particular goal in my mind that was clearer than all the others: silence. This was due to the hideous stock cooler of the previous i7 930. Now I would be wiser and select the best the market has to offer, a Noctua NH-D14 cooling a i7 4790k. Combine that beast with a spacious, sound proofed, Fractal Design Define R4 case and a 550W XTR PSU and the result is almost total silence. The low hum of the fans can be heard, but only faintly, in a silent room, laying still in a bed about 1.5 meters from the case.

The trend of low acoustic emissions continued in the selection of the GPU: Gigabyte GTX 770 OC Windforce 3x. Three fans, but on a typical desktop/movie use-case they spin so silently that they barely add any additional noise.

But amidst all that serenity a new, and loud, problem surfaced when I connected the HDDs: the abysmal noise of the older 7200rpm 1 TB disk. I may have to replace it or move it somewhere else. For now it’s still connected but offline in disk management most of the time to prevent accidental spin-ups.

Other than that I had a sweet upgrade in the system disk. From HDD to a Samsung 840 Evo SSD. The system is now so fast! Especially in all the reboots a new system requires. Not going back to HDDs, that is for sure.

* * *

But let’s not get ahead of ourselves. The components needed to be put together first. No big deal, right? Not quite. First: it takes frighteningly large amount of force to close the CPU-socket.  And secondly: after reapplying the thermal paste for the third time and seeing 50c+ in the bios every time I started to think that maybe the thermal paste was not the real issue here. I nervously installed Windows and all the required drivers and behold: idle temps only few degrees higher than ambient. Lesson learned: don’t trust the bios to provide the correct, real-world CPU idle temps.

* * *

But that was just the beginning, only now the dark clouds of system instability are really starting to gather atop the soothing silence that is my new rig. Stay tuned for part II.

Generating a procedural planet/asteroid field

Lately I've been working with a game project where the player flies along a swarm of planetoids, placing bombs, collecting coins and dodging bad asteroids. As it would be quite dull to have a single hand-crafted map for the game, procedural content generation was required. The ultimate goal in map generation would be to create a path for the player to loosely follow. The path should have occasional obstacles but mostly it just contains lots of coins for extra score. Who wouldn't want to get a score as high as possible?

White is the main path, yellow is the obstacle option four. Read more later on.
So we need a path. And not just any path, a naturally looking path that shouldn't zigzag around too wildly. Rather, it should have small, smooth hops from one node to another. And to make the player stay on the path there should be obstacles. In theory there can be obstacles everywhere, just as long as they are not on the path. But note that complete coverage is not a necessity, as long as there is enough obstacles. There can be some open areas that function as alternative routes for the player. But how to create the path?

Proof-of-concept: energy metering with TI Stellaris Launchpad and Python

One afternoon I was trying to think of some quick and easy thing to do with my Stellaris Launchpad and remembered that for a long time I had been pondering on the possibility of semi-accurately measuring the real-time electricity consumption of a whole house. And finally I can present a raw proof-of-concept on that.

I had the MCU, but lacked a sensor. Thinking that I had an LDR tucked somewhere I searched my stashes but unfortunately all I could find was an old calculator solar cell. Might as well give it a try. Knowing practically no theory on connecting anything to MCUs I just plugged its ground to GND and + to an analog input pin via a 4k7 resistor I had lying around. And behold! After some tinkering with the code, I was able to poll meaningful light values with rather non-existent latency. See a video.

Next step: taping the solar cell to the electricity meter and hanging the Stellaris board from a nearby cloth hook. The readings were then transmitted over wi-fi to my desktop for visualization. I implemented an extremely simple pulse detector with on-off thresholds, but it required constant adjustment due to the sun. But the concept was verified, it is very possible to do real-time energy metering with high accuracy.

Maybe I’ll find time some other afternoon to make/find better (delta-based?) pulse detection algorithm and then offload it to the MCU, leaving it to only emit the actual time stamped pulses and kW/h readings.

Edit: had to try the deltas: works great.