Wedding

Kellbot Plans a Wedding

Folks may or may not know that at the end of April I became engaged to my wonderful boyfriend Chris aka RevolvingDork.

I used to ask my mom what her dream house would be like, and she’d reply “I don’t dream about houses.” I thought this was a weird response until I started looking at wedding stuff. And realized… I don’t dream about weddings. And at first, navigating the behemoth that is the wedding industry seemed very daunting and off-putting. I positioned myself squarely as the anti-bride, determined to have the smallest wedding possible with the least amount of drama.

When it turned out Chris wanted what I kept referring to as “a big stupid wedding,” well, it became clear I was going to need a bit of an attitude adjustment. What’s happened since then, in regard to the wedding and all that it encompasses, has been really interesting and not at all what I expected (in a good way!).

Continue reading “Kellbot Plans a Wedding”

Programming, Software

Fixed: WordPress MU Uploaded Image Display Issues

Just a quick fix for something I couldn’t discount cialis without prescription find earlier:

If you’re on shared hosting which has PHP’s safe_mode enabled, you may run into problems with uploading images. Specifically, you can upload images just fine (assuming you’ve configured uploads correctly) but can’t see uploaded files. This is the case on NearlyFreeSpeech.Net (where my sites are hosted), and probably a few other hosts as well.

WordPress MU uses some .htaccess & PHP tomfoolery to obfuscate the real file path (among other things). Because safe_mode checks to see if the UID/GUIDs match on file_exists(), the script that fetches the images will fail and return a 404. Which is to say, the owner/group of the uploaded file is web/web (or whatever your server’s web user is), but since I manually uploaded the WPMU files originally, those are me/me. Since me != web, it failed. WordPress took this to mean the file was absent and returned 404.

On NearlyFreeSpeech, adding wp-content/blogs.php to the ‘web’ group was all it needed.

Business

Too Long for Twitter

My friend Adam said something which is too long for twitter or Facebook, but realy to excellent to be confined to my inbox. We were discussing the topics of the upcoming Ignite NYC, and how it’s become (always was?) a bit… buzz-wordy.

Ignite is leveraged to provide out-of-the-box solutions for thinking
outside of the box!  By inner left joining your assets to the
blogosphere’s most whuffie-laden creatives, you can provide a rich
canvas for your stakeholders to express their content-driven buy-in.
Generate partnerships, leads, and “branded civil unions” while
managing your passionate identity and getting hella sticky eyeball
clickthru!  You’ll can’t best these practices, folks.

Synergy. Pure synergy.

LEGO

From Polygons to Voxels to LEGO: A Utah Teapot

It was only after hours of searching that I finally came up with what I was looking for: a way to take a polygon mesh (OBJ or similar) and convert it into a blueprint for building LEGO sculptures.

Don’t get me wrong, there are tons of tools out there for LEGO CAD. But strangely none of them mention being able to go from a mesh to a LEGO layout. It’s surprising, since it seems like such a natural fit. The rise of 3D printers has rejuvinated interest in voxels, voulmetric pixels, and as evidenced by all the LEGO sculpture artists we seem to be in a golden age of LEGO.

Armed with Blender and a giant LEGO collection, I set out to get the computer to do the hard work for me. I used Blender, graph paper, a pencil, and of course lots of LEGOs.

Step 1: Voxelizing a Utah teapot

Let me preface this by saying that the Blender UI is not for the faint of heart. I took classes on Rhino and 3DSMax in college, and thought to myself “how different could it be?” The answer: very. If you’re new to blender, don’t fear the manual. You’re going to need it, particularly the parts on installing/using python scripts.

To voxelize the teapot I used a script called Add Cells which covers the surface of any object with any other object. First I imported the teapot, and scaled it up a bit. Then I created my “fundamental unit” of LEGO. LEGOs have an aspect ratio of 6:5, so I created a 1×1 LEGO, a 0.6×0.5×0.5 rectangular prism in Blender.

Selecting both the teapot and my 1×1 lego I ran the Add Cells script (go to the Scripts menu –> Add -> Cells). I chose the Teapot for my object to be voxelized and the 1×1 LEGO as my voxel model.

Tada! A blocky teapot!

Step 2: Graphing each layer on paper

In order to make the build process easier, I went through layer by layer and drew a map of each layer on graph paper. This way when building with LEGOs I could shade in with a pencil each voxel I’d built. It sounds redundant, but when things all start looking the same after a few minutes and something isn’t lining up, it’s very helpful.

To see one layer at a time in Blender I went into Sculpture Mode, side view, and used ctrl+shift+right mouse to select and hide all but the layer I wanted to see. Then I switched to Top view and copied the layer onto my graph paper. By the end I had a sheet of paper full of wobbly circular outlines.

Step 3: Building it with LEGOs!

The completed model uses 244 LEGOs, many of which are tiny 1×1 and 1×2 bricks. The model is hollow, but the walls need to be fairly thick to be able to support the top. As it is I probably should have made things a little thicker; putting the last two layers on was a delicate operation.

I built each layer sequentially. There were a few overhang pieces near the bottom which I had to append to the layer above them, since they couldn’t anchor to anything below.

Overall the project took about 4 hours, with a break in the middle for breakfast, church, etc.

Total LEGO count for the project was 244 individual bricks, distributed thusly:

  • 44 2×3 Bricks
  • 46 2×2 Bricks
  • 58 2×4 Bricks
  • 27 1×2 Bricks
  • 17 1×3 Bricks
  • 8 1×4 Bricks
  • 8 2×2 L shaped Bricks
  • 33 1×1 Bricks
  • 1 2×8 Brick
  • 1 2×6 Brick
  • 1 1×8 Brick
LEGO

My First Lego Ovoids

My first lego ovoids

After ordering a few hundred bricks from bricklink, I started working on what is for now a top secret project.

Step one was to practice making spherical and organic LEGO shapes, and I’m pretty happy with the two sphereoids I came up with while catching up on House. PS, Dr House is a huge jerk.

Software

Success!

Now that I have a few more runs worth of data, I was able to pick a little bit of information out of the miCoach binaries.

There are 40 EXRCS001.BIN files on the device (after the data has been unpacked), each one corresponding to an individual workout. This means you can store up to 40 workouts before you need to sync the device again. Knowing that, I had a bit of a better idea what I was looking at.

The miCoach pacer records various data points periodically – every few seconds as far as I can tell. The record length for these data points is 14 bytes. So far we have:
0x1E – row number, increments one each row
0x21 – distance
0x23 & 0x24 – Not sure exactly what the values are, but these dropped to 0 at a point where I paused the pacer and the miCoach graph shows a stride/pace of 0
0x25 – stride rate
0x26 – same situation as 0x23 and 0x24
0x27 – heart rate
0x28 – Not sure what this is, but it’s the same for each row
0x29 – time in. I think this is in seconds, but I’m not sure. It goes up by 5 each record.

At the start of the file, from 0x07 to 0x10, is a bunch of data that I suspect to be the date but haven’t figured out an obvious format. For my workout on 5/20/2010 9:58am, the hex values are 01 5A 4F B4 3C A7 53 B4 3C 24 8C

Yay progress!

Exercise

Running with the Adidas miCoach

I’ve had the miCoach for 2 days now, and I have to say I’m pretty happy with it. If you remember, I got the miCoach because I wanted an exercise logger to hack around with and wasn’t in the mood to give Apple any of my money. I haven’t had much time to tinker with the device or website itself; the website uses Flash / AMF and the device itself uses a proprietary binary format.

Here’s my impression so far:

Accuracy

I ran on a treadmill and the miCoach was true to the treamill’s distance calculation within two hundredths of a mile. The miCoach measures how for my foot travels, and the treadmill measures how far the belt travels. I’m not sure which I’m inclined to believe, but in truth two hundredths of a mile is fine for my running.

For some reason gym equipment never registers my heart rate, so I don’t have a good way of comparing the miCoach heart rate monitor to anything else. But checking my pulse the old school way (two fingers on my neck) after my run came out to about what the miCoach said.

Sync / Online Interface

The syncing process is pretty smooth, you plug the pacer into your computer and the miCoach application sends your data to their servers. The graphs are nice looking. I like showing my pace alongside the heart rate data, it’s interesting to see how small changes in the speed of my running affect my heart rate. Running at 5.5 mph is fine, but pushing it up to 6 mph over a few minutes sends my heart into the red.

There’s not much in the way of social interaction, but since no one else I know has one of these that’s not a big drawback for me.

Coaching / Music

If you like, the pacer will coach you through various predefined workouts or your own custom plans based on either runnin speed or heart rate. I still prefer my workout-specific running mixes to the random British dude talking over a generic playlist, but it’s a well implemented feature.

The miCoach daisy chains itself between your MP3 player and headphones. It uses a standard 3.5mm jack so it will work with pretty much any audio source. My gym has TVs and headphone jacks on each treadmill (yes, I go to a fancy gym) and it has been pretty exciting to listen to the audio from the TV instead of just reading the closed captions, while still getting audio cues from the pacer for when to slow down and speed up.

Value

The miCoach is not cheap. I got mine from RoadRunner Sports for $125 shipped. As a running tracker, it’s probably only worth it if you’re serious about running. Otherwise the $30 Nike+ is much more affordable (assuming you have a compatible iPod; I didn’t).

However, comparing the miCoach to the Nike+ is a bit unfair. Nike+ is a pedometer, whereas miCoach is a heart rate monitor with online tracking and a pedometer. This is significant because the miCoach is useful for pretty much any type of exercise, not just running. Since it measures your heart rate and not just your footfalls it’s still useful for rowing, cycling, etc. You won’t get the same type of distance/pace data, obviously.

I really wish there was a standard for exercise data. The ergometer we got back in 2000 has the ability to interface with a PC, so there’s no technical reason all the equipment couldn’t feed into the same tracking systems. But since everyone has their own proprietary thing we end up with a separate tracker for each type of workout data. Bleh.

Hacking

Using FireBug I watched a few of the AMF calls, but since I have no experience with AMF it will be a while before I can see if that’s something I can use in my own code. In theory if the Flash client can do it I should be able to (since Flash is run locally), but it’s been a very long time since I looked at anything Flash related. I wish they’d just open an API. It could only help adoption of the device if third-party sites were able to support it.

Upon mounting the device in Windows it shows up as a removable drive with two files on it, adidas.bin and adidas.dat. There doesn’t appear to be anything in adidas.bin, and adidas.dat looks to be encrypted/compressed/otherwise a pain.

However! Once you run the Adidas MiCoach Manager software, a ton of files show up on the device (I’m assuming decompressed from adidas.dat). From my 28 minute workout there are 40 files named EXRCS###.bin, 16 WKDEF###.bin, and a handful of other binaries. A quick stab with IDA Pro didn’t turn up anything super exciting, but my guess is that the EXRCS files are completed workout data and the WKDEF are pre-programmed workouts.

I have a ton of dev work to do over the next month, and a wedding to start planning, so it will probably be a while before I can really look at these. But it’s a start!

Programming

Extracting + Graphing Wii Fit data

In preparation to tinker with the miCoach data, I started with some better-travelled exercise bits: WiiFit body test data. Starting with Jansen Price’s excellent blog post on the subject, I slowly worked through the data and wrote a python script to interpret the binaries and save them to a CSV. By using the excellent flot javascript library, I was able to generate the nice graph above. There was a lot of trial and error, but here’s an overview of the process:

  1. Copy Wii save game data to the SD card. This is done from Wii Options > Data Management > Save Data > Wii
  2. Find the save game data on the card. It’s in something like ‘private/wii/title/RFPE’, although different regions may have slightly different codes. RFPE is the code for WiiFit Plus. Copy the WiiFit data.bin file from the SD card to your local machine.
  3. Decrypt data.bin. This is explained pretty well here. To create the keys I ended up creating text files with the hex string for each and then using “xxd -r -p sd_iv_hex sd_iv” et al to save a binary version. If you’re getting “MD5 mismatch” errors, you probably saved the keys incorrectly. If you aren’t sure, check the file size. They should be 16 bytes each.
  4. Run the decrypted RPHealth.dat through a parser (I wrote one in Python for this)
  5. Run the CSV through your favorite graph generation library. I use flot because Google Charts don’t handle dates very well.

Thanks to Jansen’s handy chart of which bits are where, writing the parser was pretty easy. This isn’t the most elegant code I’ve ever written, but it gets the job done:

import struct
import string
import csv

mii = 0
#we know that each record is 0x9271 bytes long
record_length = 0x9281

record_start = 0

#path to WiiFit data file
infile = 'RPHealth.dat'

FH = open(infile, 'rb');

## It loops through 7 profiles, because I happen to know I have 7.
## A better approach would be to go to the end of the file, of course.
while (mii < 7):

    #go to the start of the current record
    FH.seek(record_start)

    #read the first 30 bytes (header + name)
    line = FH.read(30)

    #for some reason names are stored as N a m e instead of Name.
    #Throw away the header any extranous spaces
    data = struct.unpack("i",line)
        #bit shift to get the month, day, and year. Could also get time if you wanted.
        year = data[0] >> 20 & 0x7ff
        month = data[0] >> 16 & 0xf
        day = data[0] >> 11 & 0x1f

        #break the loop if the date comes back 0
        if(year == 0): break

        #format the date into something humans like to read
        date = str(int(year)) + '-' + str(int(month)+1) + '-' + str(int(day))

        #the next three sets of 2 byte data represent weight, BMI, and balance
        line = FH.read(17)
        data = struct.unpack(">3H",line[0:6])

        recordWriter.writerow([date] + [data[0]] + [data[1]] + [data[2]])

    #now that we're done with the record, advance to the start of the next one
    record_start = record_start + record_length

    mii = mii+1

You can download a copy of it here.

Exercise, Hacking

Exercise + Gadget Lust

I have to give Adidas credit where credit is due. They’ve managed to tie a $140 upsell to a pair of shoes I bought for $55.

It’s no secret that I, like many nerds, suffer from gadget lust. When I see a new gadget, my thought process goes something like: “Oh that’s so neat… but it’s kind of expensive, and I could build something way better for less money… but I’m never going to actually get around to doing that so I’ll just buy it.”

So when I noticed a sticker that said “miCoach compatible” on the new pair of running shoes I got from the clearance rack at DSW, I was intrigued. “Compatible” is almost certainly a hardware term. Was miCoach some sort of Adidas version of the Nike+? Did this mean that my shoe had a secret cavity for storing circuit boards? And would that cavity also fit the Nike+ so I could log my workout data automatically?

The answers to all of the above was yes. Hooray!

I did some research on the miCoach. It’s similar to the Nike+ (widget you put in your shoe to track your workout) but is more of a comprehensive package (includes a heart rate monitor and pacing tool which tells you to slow down / speed up according to your HR). It’s also about $100 more expensive than the Nike+. The shoe sensor has a user replaceable battery, but still.

Then I did some research on the data export. Because what fun is collecting data if you can only get it via someone else’s bad UI? Nike+ hacking is well traversed ground, with easy access to the XML workout data. miCoach doesn’t seem to have much going on, and uses a proprietary binary format to store the workout data (which is then presumably decoded by their servers). Gross.

I was all set to buy a Nike+ when I found out that my 5th generation iPod was not compatible with it. In order to use the Nike+ I’d have to pick up a new Nano. The price of the Nike+ just got a lot more expensive.

After talking to some of the Resistor folks I decided tinkering with the miCoach could be fun. Between the raw data from the device and whatever software is used to transmit it to the the miCoach servers we should be able to get *something* interesting. It’s admittedly pretty far out of the realm of things I’ve done before, so it’ll either be a good learning experience or a huge road block / dead end.

We’ll see when it gets here next week!

Exercise

Couch to 5k Week 3

I’m actually just starting week 4, but I realize I forgot to post last week’s track list. If anyone wants a copy of the mix drop me a line and I can post it you can download it here.

Of Montreal – Sink the Seine
Duran Duran – Notorious
YTMND – Tubesdance
Elf Power – Under the Northern Sky
No Doubt – Excuse Me Mr
Elliot Smith – Son of Sam
White Stripes – Fell in Love with a Girl
Soul Couging – Adolpha Zantziger
Weezer – Hash Pipe
Ani DiFranco – Virtue