It lives!

I fixed the short battery life of my laser pointer:

That's right, 3 D size batteries.

$10 worth of watch batteries lasted a week with my other laser pointer. Time to find out how many years $6 of D batteries last. I actually wanted Cs, but the radio shack I went to didn’t have that size battery holder, just AA and smaller and D. I probably should have gone for AA for the sake of compactness, but oh well.

Here’s the top of it:

The hardest part was soldering the wires together, especially since I hadn’t used a soldering iron in years. I don’t think I did a great job of it, but it’s not easy to solder wires together, especially when you’re holding them. Wires are, by definition, a good conductor and they were getting quite warm two inches from the join. De-soldering the laser wires from the original holder melted both the insulation on the wires and the plastic that the battery contacts were mounted in before the solder, but they eventually came off.

Talore was very interested in what I was doing (probably because it wasn’t playing with her), so I ended up doing the soldering/desoldering in the bathroom with the door shut so she wouldn’t sniff at it and burn herself.

Had a rather annoying day at work today. I thought I was finished with my task last night, but there were questions this morning. I answered those, resubmitted the data, and finally moved on to other things, then I got a call pointing out an inconsistency with the data from yesterday. All I changed (as far as I can tell) was that I added an exporter to get csv files out, but until I figure out why it changed by 10% neither data/chart set can be trusted. It takes 20 minutes to test to see if a change helped, so I spent 2 hours after I planned to leave mostly waiting. Didn’t figure it out, but hopefully it’s not urgent enough for them to ask me to go work on it over the weekend.

I’ve improved my average Rubik’s cube solve time by a few seconds (best 3 of 5 is now ~55s, averaging about a minute overall), but I’m barely maintaining my spot on the board. Actually, I might have gotten passed, I know Tom beat my single solve time, but I didn’t check to see if his 3 of 5 changed. We also added a column for 1-handed. My best is just under 3 minutes. I need to work on that, but the speed solve is quicker and easier.

My 4x4x4 cube is solved completely for the first time in years. The only problem is that I still can’t remember how to fix parity errors (or at least not when a single edge is reversed), so I was mixing it up and resolving till I got lucky. The first time I got that parity error I came up with a fix in seconds, but I haven’t been able to figure it out again since. I need to work on the 5x5x5 too, just missing one step (that I think I’ve figured out before).

Edit: Completely forgot to mention the laser dot substitute I created last night. I tied a piece of the heavy duty thread used on my sofa/chain cushions onto the feathery toy. After Talore jerked the thread out of my hand a few times I tied the other end onto a clothes pin. I can clip the clothes pin onto my belt when I’m moving around so the feathery thing follows me, and Talore will stalk it mercilessly.

Rubik’s cube

Some of the people at work have started a scoreboard of rubik’s cube times, so I’ve been working on getting faster at it. I’ve been maintaining an average time of around 1:20 when I tried, but I was usually just solving it for fun, not trying to improve or even timing myself too often.

They’ve been using CubeTimer.com and solving at work. Unlike them, I don’t sit off in an isolated corner with my team, and my cube is rather noisy. Though I solve my cube at work while waiting on builds, app server restarts, etc I try to keep it quiet instead of solving it fast.

Since I just got an Android phone I checked for a cube timer for it. I found SpeedCube Timer. It’s a pretty decent timer, but it can’t be set to a 3s inspect timer and doesn’t track 3 of 5 average (drop high and low, average the remaining 3). We changed to a 5s inspect timer (since we just need a standard time, 3s was chosen because Calvin didn’t want to have any), but the only metrics on the scoreboard are fastest and 3 of 5 average.

Now I could (and did for a couple days) go through the SpeedCube Timer log and calculate my 3 of 5 average times by hand when I think they’ll turn out well, but that’s time consuming. Since I figured it would be straightforward and felt like brushing up on my Python anyway, I wrote a script to parse the SpeedCube Timer exported log file and calculate all the metrics that cubetimer tracks. That script is posted here.

Here’s the sample output using my log file up to tonight:

Average : 67.48 seconds
Best : 40.74 seconds at July 30 2010 09:18:12 PM
Top Averages:
Avg. 5 : 55.18 seconds from July 30 2010 09:16:19 PM to July 30 2010 09:27:47 PM
3 of 5 : 57.04 seconds from July 30 2010 09:16:19 PM to July 30 2010 09:27:47 PM
Avg. 10 : 61.00 seconds from July 30 2010 09:09:46 PM to July 30 2010 09:32:44 PM
10 of 12 : 61.05 seconds from July 30 2010 09:09:46 PM to July 30 2010 09:37:00 PM

Notice all of my best averages are grouped around my 40s solve (when I got crazy-lucky and all the pieces for the first few steps were on the same side but scrambled, so I didn’t have to look for anything till the last two pieces of the first two layers). My next fastest score is just over 50s currently.

I also realized that Android is a rather open platform and that I could probably find an app somewhere that would interpret Python. Sure enough, I found ASE (or SL4A). By default only the Shell interpreter is installed, but the user guide in the wiki on their site has instructions for installing the Python 2.6.2 interpreter. One of the options for adding a script is by QR Code, so I figured I’d encode my script that way rather than copying the file over the usb connection.

While the ASE wiki claims that the most data that can be put into a QR code is 4,296 characters, actually finding a free QR code generator that will go that big is apparently not easy. The recommended one (ZXing) wouldn’t take such a long query. The next several were the same, but some wanted registration or payment to generate a code. This one actually worked, but it resulted in this monstrosity. I’ve gotten it to scan twice, the first time it said it was an invalid qr code, but the second try actually worked (both times took minutes of attempting to line up the scan box on the screen perfectly with the edges of the QR code displayed on my large monitor). Come to think of it, I probably regenerated the QR code between attempts so I may have forgotten the file name or something the first time. By trimming white-space, comments, display of dates, and file-too-short/missing error handling, and generally making the code unreadable I got it down to 737 characters in this QR code.

To use it you’ll have to export the log from SpeedCube Timer, rename that file to “3 x 3 x 3 Cube.csv” (or change the script), and point the script at the file (the default path in the script is where my Droid Incredible put the file). It’s significantly easier to change/understand the script that’s linked as a .py file (or the big QR code) and that one has more features, but for convenience of transfer the compressed QR one is nice.

Now that everything is finished and working, I think I probably spent more time looking for a QR code generator and trimming my program size to make it fit than I did actually writing the program in the first place.