Your leaking thatched hut during the restoration of a pre-Enlightenment state.

 

Hello, my name is Judas Gutenberg and this is my blaag (pronounced as you would the vomit noise "hyroop-bleuach").



links

decay & ruin
Biosphere II
Chernobyl
dead malls
Detroit
Irving housing

got that wrong
Paleofuture.com

appropriate tech
Arduino μcontrollers
Backwoods Home
Fractal antenna

fun social media stuff


Like asecular.com
(nobody does!)

Like my brownhouse:
   autumnal insect invaders
Tuesday, October 24 2017
I had an algorithmic challenge today: to break up a CSV (spreadsheet) into n-pieces (for this task it was three, but of course I made my code capable of dividing by any number). Which record ended up in which piece had to be determined entirely randomly, though each piece had to be as close to the size of the others as possible. My first attempt was to just go through the records and assign each record to one of the n destinations at random, though this produced pieces of noticeably different sizes purely from statistical noise. So then I pre-calculated the maximum number of records any piece could contain and then, when producing the random destination, I first checked to see if the destination piece was full. If so, it would generate another random number until it found a piece that wasn't full. The effect of this code was to limit the randomness at the ends of all but one of the resulting pieces, though for this application the effect would be small. So it wasn't a perfect solution, though I don't think any process that broke a source file into three equal pieces could have a completely random series of constituent records, since the process of ensuring the equality of the pieces places a limit on the randomness of allocation.

This evening, there was a little thunder and lightning as a storm blew through, though there wasn't much wind or even rain. It's a little odd to have a thunderstorm at this time in the fall, but it's been an odd fall for weeks, with lots of warm muggy days and even warm muggy nights. I don't know if this is related, but there have also been a great many of the exotic bugs that try to get inside at this time of year. There are two species of these: one a sort of assassin bug, and the other some sort of stink bug (brown mamorated stink bug?). There's also a species of huge Asian hornet with a yellow face and yellow and black stripes that flies in if I don't completely close my laboratory window at night. Last week while debugging an XML feed I had to capture and release four of those enormous fuckers. At least they aren't especially belligerent. Less evident this year have been lady beetles trying to get into the house, though there have been a few.

Tonight in the bathtub I had a remote-workplace first: deploying a colleague's code with a git pull using an ssh client on my Android smartphone. Normally I would've been using my crappy Windows phone in the bath (can it even run an ssh client?), but when I'd tried to install an eBook reader and couldn't remember the phone's stupid password (which had to conform to Microsoft rules that forbid the usual disposable passwords I can remember), it got paranoid and required me to pick up a code it had texted to a non-existent phone number. So I'd been forced to reset its operating system back to factory, a process that unfolded during my bath.


For linking purposes this article's URL is:
http://asecular.com/blog.php?171024

feedback
previous | next