Carl’s Water as a Service

My buddy Carl was at Tableau Conference in New Orleans in October and noticed something strange:

Oct 23, 2018, 1:56 PM: The temperature of the water at the hydration station varies widely. One had the perfect sipping temp, but I forgot which one it was

He’s an old man at heart, so apparently this is what he is concerned about in New Orleans. He continued throughout the conference:

Oct 23, 2018, 2:33 PM: Update regarding current cup of water: a bit to cold

Oct 23, 2018, 2:40 PM: Current water: too warm

Oct 23, 2018, 3:14 PM: Current water: too cold. May mix it with the too warm water

Oct 23, 2018, 3:16 PM: Failure. Additional water also too cold

Oct 23, 2018, 3:22 PM: HUGE news… Current water: Just Right !!

Oct 24, 2018, 10:42 AM: Current water temp, quite pleasant

Oct 24, 2018, 10:58 AM: current water temp: just a touch too cold

Oct 24, 2018, 11:58 AM: Current water: waaay too cold

… you get the idea (as well as how hydrated Carl stays).

Anyway, these mission critical transmissions had a few problems:

  1. It’s terribly inefficient for Carl to have to type this out every time.
  2. Text messages are a push-notification thing, instead of a passive data collection method. Ideally, I could go check on Carl’s water temperature at my convenience, instead of being notified.
  3. There’s no real-time charting to track trends in Carl’s water temperature.

So I got to work. Presenting, https://water.copeland.bz/, Carl’s Water as a Service!

It’s a python flask app with a sqlite3 database on the back end and the graph is powered by D3.js.

For Carl’s input, I wanted to to be as simple as possible. To update the world on the temperature of his water, Carl goes to a secret url and sees this page:

It’s mobile optimized, so he can bring it up on his phone, and it requires no authentication or reloading. Every time he hits a button, it’s instantly recorded and reflected on the home page.

You might notice the slider on the bottom. Carl had requested a slider (presumably to fine tune the temperature of his water), so I gave him a slider. He’s also not sure what the “Text Brian” button does, so that’s a plus.

If you’re super curious, you can see the code on my github repo, github.com/briancopelandbz/cwaas.

Cheers!

Edit 2020-10-05 : Previously, the website was http://cwaas.copeland.bz, but I’ve moved it to https://water.copeland.bz and updated the link above accordingly.

The Burger Hunter

tl;dr: The Burger Hunter ‘dissed’ White Castle, but still wrote solid burger reviews. I studied him and used machine learning to replicate his reviews after he quit writing.

I subscribe to Secrets of the City. It’s twice-weekly email that informs you of stuff coming up in the Twin Cities. Super good.

Back in 2017, it had a regular feature called “The Burger Hunter”. This guy reviewed hamburgers around the Twin Cities, ranking them from 1-10 on Flavor, Presentation, and Originality. Even better, this guy had a very specific writing style:

As you can imagine the meat gets dominated by onion and renders that smell we all know from 50 feet away. I order mine without the O’s because they’ve been pretty much marinating in um. Topped with cheese and tbh it’s the only contrast you’ll get in the flavor on this ride. It’s so BOM bun onion meat that the cheese actually stands out.

[Quoted from the White Castle review, for which I hate him for]

Seriously, Mr. Burger Hunter had such a distinctive voice: liberal emoji’s, acronyms no one understands, sentences to make an english teacher cry:

First off it’s a hot mess. But glorious. It’s like I hope nobody’s looking kinda good. Just dig in.

[Quoted from Joe Sensor’s review]

I originally started paying attention out of hate. If you sum the three scores, he gave my beloved White Castle a 17.1, the lowest ever. Which is also bullshit: his only four in any category ever was White Castle’s presentation. Those boxes are a national treasure. I’m not sarcastic at all – just look at this photo from the review of the burger tavern:

That’s ugly as shit. Especially compared to these beauties:

[photo stolen from godairyfree.org]

Enraged, I did what any Data Scientist would do – I scraped his corpus and made a dataset. Definitely explore for yourself, but some highlights:

  • Only one perfect score ever was granted to The Red Cow
  • The worst two scores were the first review (Annie’s Parlour, 17.5, which he still called “A damn good burger”) and last review (White Castle, 17.1)
  • Flavor exclusively exists between 7.1 and 10, making a ten point scale strange
  • The third lowest score ever (Miller’s Corner Bar) is described as “Before us is probably my number 1 most favorite hunt so far”)
  • To be fair, he starts his top review ever, “Have you ever woke up and said, ‘I had too much to dream last night?'” (Red Cow)

Needless to say, this guy is somewhere between, “I love hamburgers” and “BOW BEFORE YOUR HAMBURGER GOD“.

3D plots suck, but here’s every score he gave:

Really, they suck. See how Matt’s Bar looks high on presentation and low on flavor? It’s a Originality:10; Presentation;5, Flavor:10. The lightness of the dot is supposed to tell you it’s low on the presentation scale. Or not, I don’t really know. 3D plots suck. ¯\_(ツ)_/¯

More important than pivoting on 90+ reviews (such as discovering that Kelly’s Depot Bar is the best flavor, in spite of its originality or presentation), we need technology to fill the empty hole left by the Burger Hunter.

Enter Andrej Karpathy. This guy is writing about “Recurrent Neural Networks”, a brand of machine learning that’s good with sequences (like the sequence of letters you’re reading now!). Train a RNN with enough text, it can learn how to spell. Seriously – just give the model a seed of a few letters in a sentence, it guesses the next letter.

For example, let an RNN run through Shakespeare. Then, start it out by providing the first little bit of a text:

PANDARUS:
Alas, I thi

It starts guessing that the next letter is ‘n’. Shift one space over, it thinks the next letter is ‘k’. Eventually, it writes:

PANDARUS:
Alas, I think he shall be come approached and the day
When little srain would be attain’d into being never fed,
And who is but a chain and subjects of his death,
I should not sleep.

I’m glossing over details, but the takeaway here is that this is not a quote from one of Shakespeare’s plays. This RNN model is writing brand-new-Shakespeare. Let’s do this with the Burger Hunter!

I trained a model on every word the Burger Hunter ever published. It’s really entertaining how bad my model is at the beginning. Here’s an excerpt from early in training:

ed burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger is a burger

Notice, the RNN gets the idea – after the sequence ‘burg’ comes the letter ‘e’. But it’s stuck in a loop, it doesn’t realize that ‘i’ does not follow after ‘is a burger ‘. But that’s okay, this was only about twenty minutes of training. Let’s zoom forward an hour:

e is so the burger is a sertise shat conled of cheese and the burger is a big burger cutter frilled and some fresh and they don’t spedite. the bun is soft, fresh and the burger is a secret saled frinl. the burger is topped with a secret sale a burger

It’s gibberish… but not bad! After only an hour of training, it’s starting to write coherent phrases, like “the bun is soft, fresh and “.

More training!

juicy & old timey! but the burger is to food in and the bacon is a big slice and down that are so good that anla to the sime cause they are doubling to the slime chute the meat flavor is fooding and put of some garlic just a smoked galf po y

That looks like something that a human might have written a little (a lot) drunk. It falls apart at the end… but notice, there’s no repeating. It’s just shy of cohesive sentences that tell a story. This is trained off only ~90 reviews. While this was the best result I achieved back in late 2017, technology is constantly getting better. 

We’ll meet again, Mr. Burger Hunter. 

Winter 2017 Mega-Update

Geez, has it been six months since an update? Let’s do it mega-style.

Overview

I’m still a Data Scientist at Target, still living in Minneapolis, and still loving Jenga.

Life is good, cats are healthy, and there’s no major drama. Whereas my 20’s were spent worrying about what person I should be, what hobbies I wanted to cultivate, and whether I was headed in a good career direction, my early 30’s have me becoming more and more satisfied with where I’m headed. I think the biggest difference is fomo (fear of missing out). I used to have a lot of it. I’d wonder what cool people were doing on a Saturday night, or if there were career-developing activities I should be pursuing. Now, I’m pretty relaxed about it all.

Alicia is also kicking ass. We’ve been married seven years now and she’s still my best friend. She’s a budding competitive jigsaw puzzle solver, a voracious reader, and practically an academic on the subject of Horror Movies.

I know it’s against the zeitgeist to compliment 2016, but it was a pretty good year for us.

Hawaii

The biggest 2016 news for the Copelands was a trip to Hawaii in November. We seem to manage to save up for a biggish trip every 2-3 years and our last biggish trip (a Caribbean cruise) left us wishing we had more time at the beach. So we decided to try a new style of vacation; a “go somewhere and do nothing” trip to Maui. It was interesting – vacation lifestyle is different lifestyle, for sure. Everything seemed to shut down around 8pm and we never really adapted to island standard time – I think I was awake by 7am every morning, which is out of character for me.

Our days had ample time for lazy sun-soaking, running along the beach, day drinking, and even reading. The most unexpected highlight was a road-side food truck serving a traditional Hawaiian lunch:

That’s pork, chicken, glazed pineapple, rice, a light salad, and orange wedges – all served on a banana leaf. Even the chop sticks were chopped off of fresh bamboo. We found this stop along the Road to Hana and ate it off the trunk of our rental car – a brand new Ford Mustang.

I think Alicia and I are go-explore vacationers, so I doubt we’ll visit a tropical location soon, but it was still unforgettable.

Halloween

I was a squid. It was fun.

Glasses

It had been two years since I had gotten glasses, thus it was time for a prescription update and some new looks. I decided to go with a few thicker frames. If I haven’t raved to you about Zenni Optical yet, please allow me to do so. Glasses start at $6.95, and by that, I mean that’s frames + lenses. I spent just under $100 for six pairs of glasses and that’s me “splurging” on two fancier $25 models. They take about two weeks to arrive from California, where they manufacture everything and charge $4.95 flat for shipping. It takes all the fear out of new glasses – who cares if you don’t end up liking the style, they were super cheap!

Xmas

I doubled down on lasers, even decorating our “Christmas trees” with lasers.

The holiday was the most relaxing in years. Christmas Eve being on Saturday meant no rushing home from work. Alicia and I held off from exchanging gifts because we’d splurged in Hawaii, so shopping was a breeze. I even got some interesting gifts, such as this sample of gallium:

It’s a metal that is liquid at slightly above room temperature, which means it melts in your hand and has all the freakiness of mercury without any of the decreased cognitive functions. Great holiday, all around – especially the Prime Rib at my parent’s house!

Websites

I’m always an internet fan. Here’s some of my favorite website as of late:

Salty Bet – A website where you watch two computers fight in a Street Fighter style competition. You bet “salt” on which side will win, which is purely meaningless. Because it’s just for fun, the fights can almost be nonsensical – you get a Sponge Bob fighting an anime samurai chick.

/r/internetisuseless – my new favorite subreddit that collects the most useless websites (read: my favorite types of websites). For example, see http://isitthursday.org/  or http://www.howdoeshomeopathywork.com/ or even http://www.iraqlobster.com/

ZenPen.io  I’m not afraid to admit that I journal. It’s just one of those things that helps me process my thoughts, de-stress, and collect my thoughts. I’ve also found that there’s a lot of things I think about that no one needs to hear, such as my todo list or when someone makes me cranky (sure, I could rant at Alicia, but that is rarely a fun conversation – I’d rather chat about fun and happy things).

So, when it comes time to write up things, I love a simple “just let me type” editor. ZenPen is my favorite, and I’ve even reviewed the source code – it’s a beautiful example of simple HTML5 code.

Shout out to Writer, which is also a solid option. I really love single-purpose websites.

The SCP Foundation – It’s a fictional website that outlines the “Secure, Contain, and Protect” protocols of various phenomenon. It scratches an X-Files itch with lots of omitted and classified information everywhere. You simply pick an entry (such as SCP-087) and start reading it. They usually reference each other and provide a ton of eerie reading.

Spicy Food

For me, it started with my diet two years ago. I wanted a low calorie snack and carrots + hummus fit the bill. But soon, hummus wasn’t enough, it had to be red pepper hummus. Then “supremely spicy” red pepper hummus. Suddenly, foods I thought were stupid hot (such as sriracha) were plesant.

For Alicia, it was watching Hot Ones, a YouTube series that features interviews with celebrities while eating progressively spicier hot wings. It made her want to try some hot wings. Then hot sauce. Then really hot sauce.

Now, we’re putting hot sauce on half the food we eat. Salsa gets doused in Cholula. Buffalo wings are usually too tame. Carribean jerk is a treat. We’ve even polished two bottles of Sriracha within the last two months.

I vividly remember being about 12 y/o at my parent’s house, having a hot wing, and practically crying. It’s crazy how things can change.

New Year’s Resolutions

To wind down the post, here’s some low-commitment resolutions I’m hoping for in 2017.

Pixel Art – I’m not sure if I want to create it myself or just be a patron of the pixel arts, but I want more pixel art in my life.

Weird things – I stumbled upon the below picture of a useless fence and I just love it.  It’s the kind of thing nine of ten people might pass and not put a second thought into, but that tenth person will stop and wonder “why does this even exist? Who constructed a twelve inch fence??”

I love it. I really hope I can contribute some weird things into the world in 2017.

Jenga Party – 2016 went by and I didn’t host anything (see poker party of 2015). I really want to host a Jenga tournament this summer.

Running – As much as I hate running, it’s good exercise. What makes me cranky is how much faster people are than I am. For example, there are competitive “Beer-Mile” runners that will chug four beers and run a mile in 5:00. Now, this is competition winning-speed, but the fact that they are pausing four times to chug a beer and still running a mile significantly faster than I (my fastest mile time is 6:30) is frustrating.

So for 2017, I’d like to run a mile in 6:00 and I’d like to run a 21:00 5k. Just recently, I managed to hit 22:00. It was stupid painful and I know that shaving the next minute will be damned-near impossible, but I might as well dream big, right?


Take care and have a happy 2017!

– B

The Library of Babel

There’s a story written in 1941 by Jorge Luis Borges called “The Library of Babel” that describes a library that contains every single possible 410 page book written with a basic alphabet. The ordering of the books is random and most of the books contain gibberish, but this library also contains every book ever written.

And every book never written.

And alternative versions of every book ever written.

Pause a moment and think about that.

Let’s go a step further. In that library is a vivid description of your death. And the lottery numbers for next week. Every single useful piece of information is in this library. Everything. This sounds like fiction, right?

It exists on the internet: https://libraryofbabel.info/ – You should go browse it.

For example, here is the first page of Genesis. Here’s the powerball numbers for 12/24/2016. Both of these books can be found by browsing. They are in the same place in the library for me (writing this) as for you.

In Borges’ story, “librarians” roam the library looking for a mythical index that provides order to the library. In theory, you could do this as well – you could start browsing the library looking for predictions of the future. It’s a fact that it’s contained in there.

But good luck. To say that 99% of the Library of Babel is gibberish is a gross understatement. That’s what is beautiful about the Library of Babel – it’s a fantastic demonstration that “meaning” is something we provide.