Thursday, November 13, 2014

Fitbit Weights

Speaking of extracting data from websites... and of marriage... Adam and I just spent the morning looking at our weight data from our fitbit scale. Surprisingly, our weight changes track each other very closely in terms of absolute pounds, despite Adam weighing about 36% more than me.

Weight over (unix timestamp) time

The swoop down in the beginning is winter settling over Seattle and us going to the gym to lift weights and play squash. We were still going to the gym as our weights trended up again.

Hypothesis: Adam making hella loaves of bread and piles of tortillas made us gain weight.
Observation: False, weight gain happened before bread-making.

Hypothesis: People let themselves go after marriage.
Observation: Effect seems small, however wedding planning is stressful and seems to leads to more weight gain... although that gain wasn't just fat in our case, it was actually from going to the gym.

Hypothesis: It was muscle mass!
Observation: Looking at the fitbit lean vs. fat charts not shown here, it was indeed a couple pounds of muscle gained.

Notes about dietary patterns: Before we moved, we were eating out a lot, and now we're eating out about once a week max. The eating out could have been 'stress', but I actually think it was the weather turning sunny and beautiful and us deciding it was our duty to experience as many restaurants within walking distance around Capitol Hill as possible before we moved. We also simply had more daylight hours to spend eating and drinking.

Notes about exercise: It's a lot harder to be active since we moved since there's no walking to/from buses and no access to a gym. I try to run around the neighborhood a couple times a week and we go hiking from time to time.

Anyway, I went into this blaming the bread, but now I see it's not a big effect. Gym + eating out + maybe more daylight seemed to be the main cause of weight gain. Hopefully we can get this chart to trend downward again, or at least stay stable.

The most interesting thing to take away is just how closely our weights follow each other!

How we got the data

From the fitbit website, we looked at the crome debugger network log to see when the data for the weight graph was loaded. It comes from a url like this:

https://www.fitbit.com/graph/getNewGraphData?userId=##USERID##&type=weight&dateFrom=2013-11-14&dateTo=2014-11-13&version=&dataVersion=12226&ts=1415904524033

Privacy-wise, you have to be logged in to your own account to see your own data.


Monday, November 10, 2014

Bride hacks into website, decodes proprietary 3D model format to save wedding!!

First off, welcome back to blogging, me! So glad you/I could join us, can't wait to see what you/I write and share!!

I got married in July to another human of nerdy-technical tendencies. We used a Kinect to make a 3D print of ourselves to go atop our cake.

Aww, there we are, printed in plastic

The Scanning



We used a scanning program from Shapify.me, which walks you through spinning around in front of a Kinect. The program says "Turn 45 degrees!" and then the Kinect nods at you, scanning you from foot to head. Then it pauses for a second to let you turn again. When it's done with you, it fuses all the scans together and make a watertight mesh.

It crashed on the first computer we tried, which was running OSX Mavericks, but worked on Snow Leopard. It was kind of tiring to stand still for so long, also to rotate yourself while holding the same pose.

I guess you're not supposed to see the bride/groom in their wedding getup before the special day, but whatever, this was important! We brought the dress and the suit in to school where the Kinect was and did the scanning in the lab. Luckily, it was a weekend around finals and no one was there. I had to pin up my dress so I could spin around. We could have had more dress-train action if we had had someone wave a Kinect around us while we stood in one position, but Richard "Mr. Kinect Fusion" Newcombe was out of town.

The Printing: Color Sandstone 


One of the nice things about Shapify.me is that it integrates directly with a 3D printing service. We paid $70 to get the model we'd just scanned printed in color.


The problem was that the color of the 3D print was kind of icky, due to the lighting in the capture room. The cream color of the dress turned into a dingy gray, especially where the black of the suit bled into it. Our skin had a greenish tinge. My aesthetic bar for this wedding was not that high, but this model did not meet that bar. More photos below.

I needed (also: wanted) to hack something to fix this. Let the headlines read:
"Bride hacks into website, decodes proprietary 3D model format to save wedding!!" 
(Heck, I'm just going to make this the title of the post.)

The Hacking

Shapify.me suggested it would let you download the models if you paid a lot of money to be a partner, or if you paid a lot of money to run your own scanning station (custom built by the company, not just a Kinect). I probably could have asked/begged for the file since I already paid for the print, but like I said, I wanted to be a badass computer bride instead.

Shapify used a web-based 3D model viewer from this other company, Sculpteo, that appeared to be written in Javascript and load some custom binary model format.  I looked at the network log to spot when the webpage loaded the big binary model file and get its URL. I poked at their viewer code and around in the Javascript browser console until I got a handle on the data after it had been parsed and put into a Javascript object for rendering. I looked in that object for the model's vertices and polygons, and then dumped those to a text file that I was able to turn into a .ply file readable by Meshlab.  My experience with Javascript, Chrome debugging, reading and rendering 3D models, even on the web in Canvas and Actionscript... made all this possible.

The Printing: White Plastic

Once we had our own copy of the 3D mesh, we took it to Metrix Create Space in Seattle. A super helpful staff lady offered to print it for us, and even insisted on fixing up the mesh where Adam had a very skinny and unnatural foot.

Printing on a MakerBot at Metrix

Here's the inside of the print, with the honeycomb scaffolding. I don't know why this particular print run got canceled.

Our feetsies/inside a 3D print

Printing took many hours, so we left and came back the next day. We saw ourselves sitting out on their display shelf, but no, that was not the model for us! That was another copy they'd printed to keep and show off because they thought it was neat.

Color vs. White

Here you can see all the details. The gloomy color, the pinned up dress, Adam's adorable bowtie, Adam's messed up foot (shiny shoes don't reflect Kinect IR beams well), the slightly larger size of the plastic print.

Funky Foot

Dreary Dress

Bodacious Bustle 
So the white topper went on the cake, and the colored topper sat on the side as a neat thing to look at. And then they/we lived happily ever after!

Photo by Jeramie Shoda of ShodaLove