Sudoku
November 20, 2006 | Comments OffOn our flights to Maui I was doing the usual in-flight magazine reading, and since the flights were sufficiently long, I got through the magazine not long after we started the second (longer) leg. This is usually the point at which I start doing the crossword, which I attempted but crosswords aren’t my forte; I don’t have enough practice with them to get their hints (tip: if the clue ends with a question mark, it’s probably remarkably obtuse). So I figured I’d try this whole sudoku thing I keep hearing about.
There were three puzzles, effectively: easy, medium, difficult. Easy had already been attempted, so I figured I’d start with medium. I really butchered it pretty badly before I got the hang of how they get solved and that’s around the time I regretted only bringing a pen. So armed with newfound knowledge I spent a good part of the rest of the flight making my first informed attempt with the difficult puzzle, and I had it maybe half way filled.
I realized as I was doing the puzzle that the committed mistakes weren’t logic errors but accounting mistakes. I’d overlooked that this cell could or couldn’t have this number, and that the vast majority of the puzzle solving was record keeping the number sets as opposed to logical noodling. I made a mental note that I’d write a program to help with the tedious bit.
On the flight back I happened to get the American Airlines spanish-language magazine (no puzzle sections, unfortunately) which entertained me for a while but soon my attentions turned to sudoku. Leigha was asleep and I was stuck in the middle so I got my contraband laptop out of where I had cleverly smuggled it in the seat-back pocket and began.
My first thought was to do it in MS Excel, I thought I remembered Excel having union/intersection functions, but apparently there weren’t any, which left me in a pickle. My next choice would have been to hack something together in perl but I didn’t have an environment. So I resolved to cram it into Excel as best I could. Effectively I ended up translating all of the simple set logic into hundreds of cells. I ended up with an input sudoku grid (fill in the cells here) and an output grid (these are the numbers this cell could have). When a cell can only have 1 number, it turns red. When you fill that red number into the input grid, it turns blue and recomputes (no VisualBasic was used/harmed/cursed in the making of this sheet).
Now the sheet doesn’t do any real logic for you – just tracks the sets and which numbers are legal in which cells, this doesn’t autosolve for you because the clever puzzle makers expect you can do set math without error (which apparently, I can’t). Then you get to the logic portion of the puzzle and that’s where the real fun lives. Now the sheet could do some of the easier logic, but I’ve lost interest in impleneting the one I thought would be easiest; i.e., if this cell is the only one that can hold this number, the number must go here. I think I’ll save that for my next flight.
As a side note: I’ve always had the impression that crossword puzzles would be trivial to write (computationally). All you need is an obscure wordset and a grid and the computer should be able to figure it out. Then all you do is write clues to the requisite level of obscurity. Sudoku on the other hand seems like a trickier puzzle to write. I imagine one would start with a full grid (computer can help here), and then start removing numbers and create the mental leaps the player must make. The downside of sudoku (and, incidentally, the reason I think it will not last long) is that there’s likely to be a limited set of logic patterns to use, and once the player knows those (and has a handy record keeping tool!) it might get old. Of course there might not be any applicable logic and the player would have to resort to trial and error.
I’ve put the Sudoku Solver up for download. It is released under GPL. Additionally, no macros were used so if you get prompted for macro priveldges decline.
Stutter tones
November 11, 2006 | Comments OffRecently I was shopping for a two-line phone for the office, and let me tell you two line phones used to be a lot easier to acquire. The pickin’s are pretty slim. I wanted a cordless phone, with speakerphone on the base, but no answering machine. No such luck. I ended up buying a Motorola MD7081 from Amazon (apparently the price went up, I paid $103 for it). It’s expandable – although I haven’t bought additional handsets – and it has some really great features. The handset has it’s own speakerphone and I discovered that the answering machine worked out in my favor, which brings me to the subject of this post.
Apparently since I last shopped for a phone there’s been an interesting technology developed. Since many people have voicemail instead of answering machines the phone will detect the stutter tones when you first get a dialtone and light up a message waiting light. I’m not sure how frequently it checks, but it’s a pretty neat feature. I just migrated Leigha’s mom to Vonage and her single major complaint was that she didn’t know if she had a message waiting unless she picked up the phone to listen for the stutter. Someone already solved her problem! Of course, the cordless phone we bought her for Christmas last year doesn’t have this feature, but the Motorola does.
Personally, Vonage sends me email when I have voicemail (and we almost never miss calls) so this isn’t something from which I get a great deal of use, but I thought it was an interesting piece of technology – and it doesn’t work perfectly. One time after deleting voicemail it took a while (I stopped paying attention after about 10 minutes) for the message waiting light to turn off, whereas usually it did it within a minute.
ReadyNAS
November 3, 2006 | Comments OffI mentioned in a previous post buying an additional drive for my NAS, so I thought I’d talk about it. Just before Anna was born I realized that I was in need of serious storage, especially with the amount of video I was planning on capturing. So I started doing research on network-attached storage. I’d been looking into it for a while. I had found some VERY sexy hardware like the Jetstor 416 series (16 SATA drives in 3U). But that was just cost prohibitive. I knew more or less what I wanted: Volume expansion, low power consumption, hot swapping, and preferrably Linux based. I could have built my own server, but I just didn’t want another 300 or 450 watt power supply sitting idle, and I wasn’t convinced I could do it for cheaper than an off-the-shelf product.
I ended up ordering a ReadyNAS NV chassis with 2x 500gb drives from ExcaliberPC (random company found via Froogle). Infrant has what they call X-RAID and it morphs the RAID type as you add drives, so 1 drive is just 1 drive, 2 drives acts like RAID1, 3 drives acts like RAID5. I paid a hefty amount for it – $1400 – but 500gb sata drives were pricier back then. I migrated all my critical data off of the servers, and started doing scheduled backups of everything else on the network onto the NAS and keeping about a months worth of backups at any given time. Just before we went on honeymoon the array was starting to get full so I ordered a new 500gb drive from newegg, popped it in and a few hours later the volume had grown to 1TB.
Having that much data in a proprietary format would make me very nervous, but according to the Infrant forums the format is not proprietary and recoverable with a standard Linux install (the ReadyNAS runs Linux). In addition the dashboard is excellent. It shows: internal temperature, drive temperatures, fan speed, and drive health status, so at least I *feel* like I’d know if something was going wrong. The thing I most worry about now is insidious data corruption.
Some other features I like:
- Provides rsync server for easier backup of Linux servers
- Gigabit ethernet with jumbo frame support
- Snazzy good looks
- It will use drives up to the lowest common denominator, but if you replace the smallest drive, it will auto-expand.
- Auto-shutdown on overheat
- Helpfully emails when: available capacity drops below certain milestones, new firmware released, problems occur.