University Living and Barcode Scanners (part 1)

In this blog post and the subsequent one, I think it would be fun to take you on a little ride into my past, where I discuss my third semester as a computer engineering student at the University of Waterloo. Specifically, we will examine the intricacies of Reading Week, during which I had three main goals: 

1) 
Refill on groceries!

2) Cook a new dish!

3) Pray to whoever's above that I pass the term with minimum extra effort! 

Along the way, we shall learn about some thieving mongrels, some very bad decisions, and a little something about how barcode scanners -- and our brains!--recognize patterns. 

So, are we ready? 

3...

2...

1!

Chapter 1 - Grocery Haul 

January 2023 was my first time living alone, away from home. Unsurprisingly, my ability to sleep and general sense of security were the first things that got affected and have ended up being the hardest aspects of living alone to resolve to this day. 

Surprisingly for me but unsurprisingly for my parents, my ability to make good and sane and safe decisions was also suddenly compromised by living alone. 

You always think that you're a mature adult with a fully developed brain until it is time to buy groceries on your own for the first time. 

At home, we used to shop as a family. We'd buy food to feed three people for one week. 

Now, living alone and being 21 years old, my brain didn't bother to scale down these numbers. So off I went to buy a week's worth of groceries with a list that was about one page long. 

You can imagine how this ended, but perhaps you don't understand the severity. So allow me to explain.

Here I was, at 9 PM, carrying 10 kg of potatoes, a 12-pack of water, three cans of beans that I did not need and never used but that I needed to have "just in case", and a huge bottle of orange juice that was probably the most useful item out of all of the above but was also the reason that I'm going to be diagnosed with type 2 diabetes ten years from now. 

My residence was conveniently situated at a random point on campus that wasn't close to anything else. There was a "shortcut" from a bus stop on a main road through a thickly wooded area, which I usually avoided but was forced to use that night, at 9 PM, because I was carrying 10 kg of potatoes, a 12-pack of water, three cans of beans, a huge bottle of orange juice, an empty wallet, and a crippling feeling of inferiority at not being able to do basic tasks properly. 

Every small rustle of leaves from any corner of this wooded path would've normally freaked me out and sent me running for my life, but this was 9 PM, and I was literally wrapped up in my groceries in order to muster the strength to carry them. There is no way I could run without tripping and giving my wild stalker a month's worth of food. 

However, I am happy to report that I made it alive to my dwellings by 9:30 PM, albeit brain-fried and angry and exhausted. It was probably 5 degrees Celsius out, but my innards were burning under the weight of 10 kg of potatoes, a 12-pack of water, three cans of beans, and a huge bottle of orange juice, and my crippling feeling of inferiority at not out-grocery-fying my 50-year-old parents. 

So, the first logical step to take at this point is to place the orange juice in the freezer, let it sit for a while, and then pour myself a nice cold cup of goodness and the liquid equivalent of eating one's feelings. At least I had food now, and I wouldn't have to go grocery shopping for the next two weeks. 

After sleeping for 11 straight hours, I woke up energized and ready to get to work on my next mission: cooking a brand new dish. 

Chapter 2 - Hakka Noodles 

For those of you who do not know what Hakka noodles are: every Indian knows them as Chinese noodles but not a single Chinese person I've spoken to has ever eaten them. 

Given the current India-China tensions, you might be tempted to conclude that China is one thousand steps ahead and is slowly poisoning the Indian population...
... that is yet to be seen, but I've tried to find a good story behind Hakka noodles.

The (highly reliable, do not fact-check me) story goes (source: Wikipedia and random Reddit threads) that Hakka Chinese (south China, subgroup of the Han Chinese) settlers in Kolkata (north-east India) started restaurant businesses and adapted a traditional Hakka noodle dish to appeal to the Indian community that they lived in. 

Over time, these noodles have come to be known as Hakka noodles in India. Their primary ingredient is soy sauce, but a typical Hakka noodles recipe calls for ginger, garlic, pepper, and sometimes chili oil or chili peppers. 

This was during my honeymoon phase with cooking.  My dormitory consisted of a single room, shared bathrooms, and a huge and majestic shared kitchen that, to be honest, was barely shared because most residents did not cook. When I lived with my parents, I hadn't done much cooking beyond simple dishes, so I was excited to have such a large space to myself to experiment with new dishes. 

Tooting my own horn, I was basically a master chef. Halfway through the term, I'd already cooked spicy potatoes, roasted bell peppers, channa masala, and a myriad of other Indian dishes. Things were going swell (with the exception of my educational career, which was taking a swift nosedive because class time was instead devoted to cooking and unintentional grocery workouts). 

In horror movies, the primary antagonist is often a demon. Just as everything seems to be going well, it makes its appearance, starting off small by taunting its victim, by being a little voice in the victim's head that convinces them to do ungodly things, and eventually breaking their morale and their sense of self enough to make them do exactly what the demon wants them to. 

Similarly, just at the point in my cooking endeavours where everything was going great, I believe that a possession attempt was made on me by a Hakka noodle demon. 

Now, having the willpower of a dandelion in the wind, I almost immediately obliged and blocked off my Sunday afternoon to cook Hakka noodles. I went out and bought all the supplies (as is known), and was counting down the hours to 12 PM on Sunday. 

12 PM, Sunday. 

One thing you must know is that soy sauce is sold in glass bottles. 

Another thing you must know is that I have a bit of a reputation for being clumsy. 

Using logical inference, one can deduce what happened at 12:15 PM on Sunday, in the shared kitchen. 

Thankfully, I only got a couple of glass pieces in my foot that were easy to remove. I went over to the Resident Don's room to ask where I could find a broom, a mop, and a bucket to get rid of the Soy Sea in the kitchen and the glass vessels within it. A very confused Don opened up the janitor's closet for me and accompanied me to the crime scene. 

As I was mop(p)ing over in a corner of the kitchen where the soy sauce was, the Don simply stood there, looking aghast. I kept inserting awkward laughs into the silence every few seconds to convey my awareness of the mess and my intention to clean it up, as though my actively mopping this demonic glassy sauce up wasn't enough to convey that. 

Finally, after the sixth iteration of my awkward laugh, the Don found it in him to actually respond to the situation. 

Don: "That looks bad."
Silence. 
Sneha: Awkward laugh #7. 
Don: "Hmm."  Exits the kitchen 
Sneha who insisted on cleaning her mess herself: Is chivalry dead???
Don: returns to kitchen
Sneha, who wondered about chivalry: oh my God, he's coming back to help me... this is all my fault though, he shouldn't have to help me when he wasn't even involved. I look like such a weak fool.
Don: goes straight to microwave without taking a second look at Sneha 
Don: heats up pop tart with an emotionally ambiguous Sneha hanging out in the background.
Don: Collects pop tart and leaves with an emotionally ambiguous Sneha hanging out in the background. 

After a few iterations of sweeping, mopping, and flushing out any potential remaining glass shards, the kitchen was in an acceptable condition. It was around 1 PM at this point and zero progress had been made on the noodles. 

At this moment, I was quite emotionally drained and angry at myself. Was I supposed to stick to plan and go buy new soy sauce and finish these noodles? Was all this effort for nothing? 

Now, from Chapter 1, you can infer where my mind went for comfort. 

Orange Juice. 

Well, wasn't it convenient that I had just bought a humongous bottle of orange juice a day ago? Feeling relieved at being able to justify my questionable decisions, I threw open the door of the shared fridge in the kitchen. 

It was gone. 

Not the fridge; the fridge was still there. The orange juice was gone. 

Look, normally when I hear stories about university students terrorizing other university students by stealing things, hijacking laundry machines, pissing on the floor... it makes me laugh, not only because I lack empathy from an underdeveloped pre-frontal cortex, but also because it's just such a ridiculous situation for supposedly grown adults to find themselves in. How seriously can you take such things, even when they happen directly to you? 

...the answer is very. Whoever had the bright idea to run off with an almost-full jumbo bottle of orange juice thinking that I wouldn't notice or wouldn't care enough to chase after them... they sound ridiculous and pathetic. 

But on Sunday, at 1 PM,  I was also feeling ridiculous and pathetic. And this illegitimate child had done the equivalent of taking away my comfort blanket. 

Who steals orange juice? Who even drinks that much orange juice without being intensely psychologically unwell??? 

These questions, along with a hundred self-loathing rantings directed at myself, are what inspired Chapter 3: Building a Food Safe. 

Chapter 3 - Building a Food Safe

Let's talk about how to keep our food safe. 

A simple idea would be to simply buy a minifridge and keep it within your private room. If your food still gets stolen at this point, then we may have bigger problems here that relate to fundamental safety. 

However, I am a tryhard tech kid who barely knows how to properly boot up a computer. I toyed with the idea of building a safe for my food. The safe would go into a public fridge, and would be unlocked by my student card, or any card that had a barcode on it. 

This brings up the question: do we implement a barcode scanner from scratch? Do we learn anything useful from doing so? 

The answer to both of the above is "no" because I am lazy, and I will likely get a desk job once I graduate anyway, making the study of barcodes largely useless along with 50% of my degree. 

However, I did do research on barcode scanning, and if you go deep enough down this rabbithole, you can uncover some interesting observations about the way that a computer -- and even humans -- process data. 

So, let's descend into this one step at a time, in the next blog post. Strap in and get ready, because we're going to cover the following points: 

1) The basis of barcode scanning: light detection, and how to convey patterns using light (or the lack thereof)

2) The amount of data required to convey an increasing number of patterns, and how we can work to minimize that. 

3) The implications of this data-crunching on how computers and humans process data in general. 

It's still going to be fun and light-hearted, and I'm going to throw in some real-life examples that I've seen. 

Hope you enjoyed this installment, and stay tuned! :) Thank you for sticking around. 

Comments