I asked for suggestions on who to educate myself in Film Noir. One of the recommendations was The Big Sleep. In it were these unresolved codes, that formed no part of the plot whatsoever, but got a whopping 3 seconds of screen time. These may be nonsensical, but I’m going to try and figure ‘em out. Any help appreciated!

    SALTER

ROYTR GWYRC YTROCXM
37Y RQY LLMONXY
TLMYES 479XY TMN
GYLETTRTE EVRCH 179X

1 1 2 3 4 5 6 7 8 9 10 11 12
2 E F G A K B L M O X  C  J D
3 G P A N L D E X C L  R  V W
4 L Q J O C E F T H M  T  V
5 M R S P B I W D K O  U  X

49
60
TEXT
--------------------------
STERNWOOD

JEVTWQP IXGYLTWIP
IPTRS GWYOGWT TR5
PSWOX XYW
RTFGO BLMPD CXRVE
GPAN LDXEC LRVLQ
WKOUX JOCEFH XE
WFEL OTXMOCH CRTU
RT4 TH5
RS6 TR5
SK4 RQRS 11 F 41
GTOAB LEXIN
LDXCD TRUCX

Friday Night

As detailed previously, we were going to build a health app in 48 hours. I got to searching through Canada’s data, and stumbled upon the Nutritional Value of Fruits and Fruit Juices. The data was billed as a list of 19 nutrients for 1000 of the foods most commonly consumed in Canada”. And yet, there were only 106 foods in the data, with no link to other datasets from the same group. Inexplicably, this took several hours to figure out and find the accompanying data. So, around noon on Saturday, we finally started. Hold up. 

Saturday? The Hackathon started Friday, at 13:00PST. Alan had to go to the other university campus for something, I had work until 9, and Matheson was the most productive and started figuring out how to use the data. The rest of Friday night was spend trying to understand Core Data, which none of us had any prior experience with. And then I went to a bar. 

Saturday Morning

I woke up, and the Hackathon was already 24 hours in. In those first 24 hours we realized we were in way over our heads: we had never had to deal with a database before, much less populate Core Data from a dozen CSV’s.  I jumped into RStudio, an awesome IDE for the R statistical language, and tried at least getting one large table from all of these smaller, food-group specific tables. I was thrilled to start using the data, and even tweeted about it: 

How wrong I was.

No Dice

There was no consistency between the CSVs, that were organized by Canada. Let’s take a look at 2 examples and how badly they set us back.

image

We have the Fruit table on top, and the Baked Goods table underneath. A large problem is the lack of a consistent Measure column. At least in baked goods it’s always comparing singular units, not “6 halves”  to “3 wholes”of apricots (which incidentally, is the same). A much bigger problem is how one has a row for measurement units, while the other does not. Simple as this is for a human, a sqlite3 database can only have one set of headers, and then columns of data underneath. R, while much more flexible, also has no logical way how to interpret this. These are just two of the tables. They all had their particular quirks, and would have to be adjusted. By hand. As a programmer, I never want to have to repeat any action more than I absolutely have to. 

I spent about 4 hours trying to solve this problem. There were a variable amount of columns, including contextual “nutrients” such as alcohol and caffeine where necessary. With no real data to drive the app, Matheson couldn’t start coding anything beyond four squares as a home screen that would go to the Big Four Features we had originally expected to implement. 

The Solution

The solution was surprisingly simple: if you can’t cook with the crap you’re given, get better ingredients (I worked as a night-shift cook at Denny’s, but that’s a post for another day). My father was gracious enough to take some time out of his day to find us a much more complete and systematic data set from Health Canada.This data was amazing! It was modular normalized; with separate tables for pretty much each piece of information; food and food groups were separate; measurements were all in 100g portions and even had another table that acted as the conversion factor to find amounts in silly units like “6 halves”. Despite adding to the learning curve, we finally had what we need to start writing code. And write code we would: by this point we only had about 16 hours left

What did we do with those 16 hours? That (and actual code) will be in the next post. 

tl;dr haiku

Open Data failed
Tired of cooking with this crap
Dad threw me a bone

Hackathon?

My team, and I, participated in the Canadian Open Data Experience (CODE) Hackathon, which was basically a 48-hour code fest. The theme was something along the lines of “Increased Productivity” for Canadians using Open Data. That sounds fun!

In a series of (about 3 or so) posts I will briefly surmise what the data that we picked and how we started using it, and what we ended up building with it. (Spoiler alert, it wasn’t amazing).

Role Call

I was introduced to this hackathon by my good friend (and classmate) Alan Lee, who is President of a little thing called the Software Systems Student Society at SFU

The other member of our team, Matheson (I can’t spell his last name), is an iPhone developer (like me) and generally my partner in crime. 

Open Data

I spent a few days before the Hackathon looking over the Open Data provided by Canada. This ranged from Google Maps-esque topography images, to historical border wait-times to photographs of 2500 World War II Veterans. An underlying theme that I noticed is that none of this data was useful, and the reason for that was because none of it was dynamic. Google Maps already exists and there’s not much replay value, so to speak, in historical photographs. Live border data would be great, but even then, if enough people used the app there would be a sort of Quantum Observer Effect that would cancel out any potential benefit. Every dataset I looked at made me think of esoteric fringe-cases where it would increase productivity for Canadians. 

So I got to thinking: if we don’t have access to live-data, how can we find meaningful data which retains its use after numerous uses. We needed something that mattered to people, something that stayed constant, and something that would require constant consultation for best results. Did someone say Unicorn?

What Matters Most

Health. People are constantly obsessed with their health, specifically their nutrition. Food itself doesn’t change much, but every few years a new craze will climb from discussions deep in foodie-hipster bulletin boards into the mainstream, where every other person is pinning their Gluten-Free Vegan Free-range Muffins

But a lot of people don’t care about their health as much as they should: I, for one, constantly feel like I’m missing half the vitamins I should be eating, but I don’t care enough to find out which. Nor do I know if I get all the food groups in the correct amounts (though I’m sure if caffeine were a food group, I’d max that one out by noon). So we set out looking for nutritional data in Canada’s massive pile of Open Data

But digging through that crap is a post for next. 

tl;dr haiku:

Hackathon with Friends
Open Data Disappointment
Let’s All Eat Smarter

Syntax-highlighting incoming.


    - (id)initWithFoodID:(NSNumber*)fd_id name:(NSString *)name grp_id:(NSNumber*)grp_id group:(NSString *)group {
    if ((self = [super init])) {
        self.fd_id = fd_id;
        self.name = name;
        self.grp_id = grp_id;
        self.group = group;
    }
    return self;
}

1000 bits of information. Follow me on twitter

Follow on Tumblr