How to Heat Your Livingroom with Computers

It’s time I explained what all this cluster computer stuff is about. It’s kind of an insane project, but bare with me. Some of you may have played the Wikipedia game “Seven Steps to Jesus.” Basically, it’s a special case of the Wikipedia game Wikirace, where you try to get from one article to another as quickly as possible. In Seven Steps to Jesus, you try to get to the Wikipedia article about Jesus in seven clicks or less. Why Jesus? Why seven? Who knows, who cares. But the point is, that it’s fun for about ten minutes.

This ridiculous game wandered into my mind the other day, and I started thinking, “I wonder how you could create a computer program that would play Seven Steps to Jesus…” The answer depends. If you give the program access to the entire Wikipedia database, then the task is trivial. It’s very simple and quite fast to spit out the minimum number of steps from one article to another. But what if you don’t give the program access to the entire Wikipedia database? What if it has to go to an article, and choose which link to click just like humans do: with “intuition?”*

As you might have guessed, the task becomes more complicated. Now we’re talking about machine learning (FUN!) I started to think about how you could train an AI to assign a “relatedness” value to every given article on Wikipedia by giving it access to the Wikipedia database, and having it traverse the links from one article to another. If you’ve taken a class on AI, you know that eventually, this relatedness value will converge to the shortest path. Basically, this program will do nothing useful… except heat my living room.

Except! Except that I’m going to train an RL agent in parallel. That’s the only thing that might be novel about this (other than the fact that I’m introducing the “Seven Steps to Jesus” task to the AI world.) Ordinarily, you would want the agent to learn sequentially, because if the links change, you want the agent to learn with the changes. But in this case, I really don’t give a damn about sequential updates. Also, this task is stationary (the distance between any two articles in my downloaded Wikipedia database will never change,) so updating sequentially doesn’t matter all that much.

So what you should get from this, is that this project is a HUGE waste of time. But it’s fun, and I’m learning about graph databases, and RMI, and I got to build and run a computing cluster. Maybe there’s a real task for which this approach is suited. I’m not sure though. Usually in RL, you have to run a trial many times in order to test an approach, so there’s really no point in distributing the actual processing. In other words, if you’re going to run 100 trials of your schmancy new algorithm, you might as well just run one trial on five different machines until you finish, rather than splitting up the computation (which adds overhead,) into five different parts.

The point is, I’m having fun. Leave me alone.

Discipline Week Update: Today was day four of Discipline Week, and so far so good. I’ve been trying to avoid napping, because I want to really embrace this 7am to 11pm schedule I’ve got going, but today I really needed a nap. I ended up sleeping for maybe an hour and a half, which is really too much, but we’ll see how things go tomorrow. I’ll write a more detailed post tomorrow about how Discipline Week is going, but I thought I’d let you know that it’s still a thing, and it’s going well!

*Yes, there are algorithms that do this quickly, but you’re still missing the point: the point is, this will be fun. Fun, I tell you, FUN!

Advertisements

The Student Diet: Lose Weight, Eat Wrong, and Get Out of Shape

There are lots of silver bullet diet blog posts out there, but as we all should know by now, silver bullet cures don’t exist. However, I recently discovered a MIRACLE DIET CURE that will help you LOSE WEIGHT and LOOK GOOD and all that. Here it is.

It’s called the “Student Diet,” or as I frequently refer to it, the “I’m too lazy and/or busy to get up and get food” diet. It’s a simple diet, and all you have to do is follow these basic principles:

  1. You are here. Food is there. Do you really want to get up out of your chair and go get it? No. No, you don’t. You want to keep browsing Reddit. So by all means, continue.
  2. Food is Expensive. The average per-capita monthly food expenditure in Canada is around $205 per month. That is entirely too much. That’s money you could spend on a new phone, books, movies, music, vacations, rent, or anything else that isn’t food. So the next time you look in your fridge, don’t see a delicious buffet of delectable treats: see a lot of money that’s about to be converted into people-dung.
  3. Stop complaining and drink your caffeine. It’s a well-known fact that caffeine boosts your metabolism, but most people forget that caffeine also makes you more tired later. The more tired you are, the lazier you are, and the lazier you are, the less you feel like getting up to eat. So drink your coffee*. Also I read somewhere that coffee prevents Alzheimer’s, though for the life of me I can’t remember where**.
  4. Transportation is expensive, so hoof it, weakling. Gas, bus fairs, train tickets, rental cars, taxis – they all have one thing in common: they’re expensive. Know what’s not expensive? Your feet. Back in the days before cars, people who wanted to get places had to walk. Embrace your roots and get moving. If you must, save up your money and buy a bike. This should cost you a few months of bus fairs, one train ticket, or two tanks of gas. Yeah, gas is expensive***.
  5. Beans are life, Beans are happiness, Beans are easy to cook. Ok, so you’re really lazy, but you’re pretty hungry. You want to save money, but you have to eat something eventually. What do you eat? Beans. Dried beans, more specifically. You can buy dry beans in – like – 15 lb bags, and one bag should last you for a few months. They take an hour to reconstitute, they’re super cheap, and they have a lot of fiber and nutrients and things doctors say you need to eat and that don’t cause cancer. And remember: Beans, beans, they’re good for your heart, the more you eat…
  6. Sleep it off. Apparently a lack of sleep can cause weight retention. Now, I might have trouble getting myself to go out and lift weights or run, but one thing I can always do is sleep. Having a rough night? Sleep in until 1 tomorrow. Getting bored at the party? Go home and sleep, even though it’s only 9pm. I like to get a good 10 hours of sleep once or twice a week during finals. Also, you dream more the longer you sleep (this is actually true,) so if you want to spend more time in crazy dreamland, sleep more. Finally, it’s a true fact that when you’re sleeping, you’re not eating, unless you’re eating spiders which are high in protein and low in fat (i.e. they’re good for you; eat more spiders.)

Many of you are probably following this diet already, since I imagine that most of my reading audience is made up of students. The great thing about the student diet is that it takes advantage of your lower nature: the desire to spend less energy doing less, and save money while you’re doing it. Harness your inner couch potato, sleep more, do less, and start losing weight today!

Also, this is a horrible idea, don’t actually do it.

 

*It’s worth noting that if you drink too much coffee, you’ll be dead, and then you’ll lose weight like CRAZY. But you’ll also be dead, so maybe take it easy on the caffeine.

**This is such an obvious joke, I know, but I seriously can’t remember; it was a few years ago. Which probably means that by now “scientists” have published another study showing a correlation between coffee and increased incidence of Alzheimer’s, because publish or perish dictates that you should publish whatever research you have, even if it’s stupid and counterproductive.

***And don’t start whining about “winter” and “ice” and “snow.” Ever heard of snow shoes? Know what they’re for? Get some; use them.

Summer Recovery

I have a theory about summer. First, it’s important to relax during summer so that when school again you don’t burn out in the first week. That doesn’t necessarily mean not working, but it means doing a job you enjoy, if you can, and taking plenty of time for yourself. Second, to relax, you have to procrastinate to the extreme, and you have to forgive yourself for it. For me, the second part is less of a choice and more of an inevitability; my urge to procrastinate increases by 100 fold while my work ethic for things I don’t necessarily have to do decreases by about as much. I know that I’m adequately relaxing when I forget what day of the week it is.

This leads to a few rather tumultuous weeks of staying up until 3 or 4 am, starting a ton of projects and finishing only one or two, forgetting to post on my blog… that sort of thing. I’m usually quite a tired, sleep-deprived mess for the first few weeks of the summer, and I don’t really go out of the house during those few weeks of detox unless I have to.

A funny thing happens after a while though. Not all at once, but in bursts, I start accomplishing things that I’m supposed to do. It starts with cleaning my room, and usually progresses to either filing papers or cleaning my fish tank. After a few bursts of this, I’ve usually got my life in fairly good order, and when I start to get tired of organizing, the joy of how freaking clean my room is usually inspires me to keep going. It usually takes until the end of the summer, cleaning on and off as I feel like it, for me to get myself in complete order (though every year it seems to happen faster,) but it usually takes one swirling fury of organization before the term starts to get myself in order for doing school work again.

I don’t know if this is a good life practice, or if it’s going to help or hinder me in the long run, but it’s the way I work, and I don’t seem to have any choice in the matter. People seem to think that disorganization is a thing to fight and get rid of; it’s like a tumor that will debilitate you for your whole life if you don’t excise it at a young age. And while I agree that children should be taught how to organize themselves and their things, I don’t believe in the campaign against disorganization that seems to exist today. Disorganization does not create failure or even disorder; some people can work in a very orderly manner even though they have papers and books and pens all over their desks. Sometimes people need to find their own level of organization and live within it.

Remember Kids: Electricity is Dangerous

Here's the camera with case, screen, and most of the buttons removed. The most important tools when taking almost anything apart are screwdrivers and a Swiss Army Knife.

It’s Kite Aerial Photography season, people. Let’s get this ish started. Today I bought a camera, and as soon as I got home, I tore it apart. The goal was simple: get in, solder a few wires, and get out before I screwed things up completely. And that’s exactly what I did… sort of.

Ok, so I didn’t tear it apart; I was actually more careful while taking this camera apart than I’ve ever been while taking anything apart before. After all, digital cameras aren’t cheap, and I’m not about to go out and buy a whole new camera if I wreck this one. Right off the bat I knew that there would be two beasts lurking inside the tiny, unassuming black box I had just brought home: 1) wire tapes, and 2) a very large capacitor. Wire tapes, for those who don’t know, are my arch nemesis when it comes to electronics. They’re little tiny tape-like things inside most popular electronics today, and they have a bunch of tiny wires in them. Tiny wires break. Tiny wires breaking ruins the device they’re in. Tiny wires, breaking, make me angry. The plan was just to be super careful and hopefully not break any wire tapes. The other beastie, the very large capacitor, is something I’ve never had trouble with before, but I’m always leery of just in case. And just so I don’t leave you in suspense: this time, it gave me trouble. The capacitor bit me.

I’ve taken this camera apart about four times so far. Each time I realized that the wire tape that controls the buttons wasn’t plugged in properly, so I had to take it apart and try again. But to test the buttons, you have to turn the camera on, and you have to press the buttons. When pressing the buttons you occasionally take a picture, and when you do that you sometimes trigger the flash. Now let’s dive into a some of electrical fundamentals for a second here (I’ll keep the physics babble to a minimum, I promise.) It takes a lot of power to make the flash in your camera do anything useful. Since many cameras aren’t powered by more than 4 volts or so (that’s not a lot,) there has to be a way to get a ton of power to the flash in a really small amount of time (maybe a few hundred microseconds or so.) This is done with a capacitor, which stores energy over a period of time and then dumps it all out when you tell it to, which is how a tiny digital camera has enough power to drive a bright flash. Now in case you hadn’t guessed: the little metal projections protruding from the bottom of the capacitor are not something you want to touch. In fact, it’s a good idea to avoid these things like the plague. The capacitor in your camera will give you a hefty shock. The one in the back of an old tube TV will either kill you, throw you back a few feet, or both. So from all this build up, you can probably tell what I did…

I touched it. I didn’t mean to, but I did. See, once you use the flash once, the camera charges the capacitor in case you need it again. But if you turn the camera off, there’s no point in discharging the capacitor because you don’t get to reuse that power. Well I forgot this fact, and while tinkering with one of the stupid wire tapes I felt a shock in each of my middle fingers, my muscles jolted, and a voice in the back of my brain said, “YOU IDIOT! You touched the terminals on the capacitor!!!” Before I ever realized what was happening I had thrown down the camera and jumped backward. It hurt. And it scared the crap out of me. Not literally.

Now, an ordinary person would have called it a night, and maybe abandoned the project all together, but I’ve dealt with electricity before, and I know that when handled properly it’s nothing to be afraid of. So I dove back in, being careful this time to only touch the camera with one hand at a time. Little did I know that the capacitor had two other terminals which were fairly close together near where I was holding it; I shocked myself again. There was less juice this time, but it still hurt. Fortunately I didn’t shock myself again.

Until I did, and this time I’m not even sure where it came from, but I decided to just give up and go to sleep. I disconnected the battery after the first shock, and apparently the capacitor had enough power to shock me three separate times and scare me each time. The moral of the story: electricity is dangerous, kids. Don’t be stupid.

Those red, janky looking wires are the leads I attached to the buttons so I can control them by remote. That black piece of tape is apparently intended to keep fools like me from shocking themselves on the test points for the flash.

Update: If you want to work with big capacitors safely, you have to drain them first. To do that, you should measure the voltage between the two terminals with a volt meter, and then calculate the required resistance to drain the capacitor without burning out the resistor. The resistance you need is given by: R=V^2/W where V is the voltage across the terminals of the capacitor, and W is the wattage rating of the resistor. Those tiny brown resistors with the colored bands that most of us hobbyists use are 1/4 Watt resistors. Round up on your resistor value. I usually connect each probe on my multimeter to a lead on the resistor and touch the capacitor terminals with the probes so I can watch the voltage decrease. It will probably take 15 minutes or so.

You could probably just short the two terminals, but this way is much less violent.

PSA: If you are ever going to work with a large capacitor (or any sort of high voltage,) make sure that you only work near it with ONE HAND. If you use both hands, the current will ark from one hand to the other, passing through your heart, and could potentially stop your heart. There has to be a lot of voltage to do that, but it’s not worth the risk.

Save the Architecture Cafe!

Students protesting the closing of the Arch Cafe, of which I was one.

As a fresh McGill student several weeks ago, I heard that the Architecture Cafe was being shut down because the McGill administration claimed that it was financially unsustainable. My first thought was, “What is the Architecture Cafe?” My second thought was, “Crap! I have an assignment due tomorrow!” I forgot about this cafe business until a week later, when I heard a bit more about the issue. The Architecture cafe was 17 years old, and the last student run cafe on campus. Though I’m not clear on all the details (after all, I only just got involved with the issue,) here’s what I know.

The Arch cafe was the last student run cafeteria on McGill campus before it was shut down. Several years ago, McGill Food Services took over the cafe’s operation, and this year the University is claiming that the cafe is no longer sustainable. Despite reports to the contrary from the student body president[1] that the cafe was actually making money, the administration won’t revisit, or apparently even discuss the issue. The cafe’s management weren’t even allowed to see the cafe’s books while it was running, so how were they supposed to correct any financial problems? The closing coincided with Aramark, a food services company, taking over McGill’s food services contract, which seems a bit suspicious. It’s also curious how quickly this issue is being swept under the rug by the McGill administration. Morton Mendelson, the Deputy Provost of Student Life and Learning at McGill, said “The administration is not willing to revisit this issue,” according to the Montreal Gazette. According to the McGill website, the Deputy Provost of Student Life and Learning is a “central liaison among the University’s senior administration, faculties, student organizations and Senate, with a view to ensuring that impact on student life and learning is factored into decision-making.”  Seems like there isn’t much factoring in of student life going on with this issue, especially with the high prices and low quality of the food at the other McGill cafeterias.

Really McGill? Really?! Don’t be evil. I just got here, I don’t want to hate you. Let’s talk about this and figure out how to make the Architecture Cafe “financially sustainable,” huh? What do you have to lose? On the other hand, keeping us in the dark about why you’re closing the Arch Cafe, not providing us with any details, and hoping that we just go away isn’t going to make anyone happy. And we’re engineers; we can be loud, especially when we’re unhappy.

If you’re a McGill student who is unhappy about the closing of the Arch Cafe, here are some things you can do:

  • Tweet! Blog! Write a clever status message about the Arch Cafe! Let’s make that social media work for us!
  • Join the Facebook Group(1,522 members, as of this writing)
  • Get informed! Ignorance is not bliss, it’s just a good way to get screwed over.
  • Tell McGill (articulately and politely) that you’re angry and disappointed! Find out how at the end in this article: http://mcgilldaily.com/articles/32590.
  • Boycott McGill Food Services (click here to join the Facebook Group 2,134 attending as of this writing.)
  • Buy a Vuvuzella and keep it on hand in case there’s another protest (I intend to do this.)

Further reading:

Gluten Free By Choice?

I recently read an article which claimed that nearly 25% of the US population is “going gluten free,” and that most of them are doing it by choice. Having celiac disease myself, this made me a bit angry. Why on Earth would people go gluten free by choice? No, the food isn’t bad, and there are some really great stuff out there (especially if you have access to a Whole Foods, which I don’t and am bitter about,) but if I had a choice, I can tell you for sure that there wouldn’t be a snowball’s chance in hell of my being on a gluten free diet. Why? Because I freaking love pastry. And bread that doesn’t feel like dirty unless you toast it. And baguettes. And hamburgers with the bun. And eating whatever I feel like at a restaurant. When I eat out, I always eat the same things: (chicken,steak,duck,pork) + (rice, potatoes) + (vegetables, no vegetables) and maybe (ice cream, crème brûlé) for desert. Those are my options. I’m not usually bitter about it, but something about this makes me mad. The idea that my struggle is turning into somebody else’s fad sort of pisses me off. Logically I know that more people eating gluten free foods will create more demand for better, more numerous gluten free foods, but there’s still part of me that finds this annoying.

What annoys me is this attitude: “‘I feel better when I don’t do it. If I go out to a restaurant with friends and I have a beer and a plate of pasta I’m going to feel it the next day. No one wants a gluten hangover,’ said Silvana Nardone, former editor-in-chief of Every Day with Rachael Ray magazine.[1]” Gluten hangover?! Try Osteoporosis in your 30’s. How’s that for a “gluten hangover?” How about intestinal cramps, diarrhea, and lack of nutrient absorption that can cause psychosis* and a ton of other nasty side-effects? Is that the kind of “gluten hangover” your talking about? Didn’t think so. Have you ever considered that you might have a “food hangover” the next day because you’re eating shitty pizza and Budwiser? No, you’re right, that couldn’t have anything to do with it; must be the gluten.

The thought that bothers me the most, is that one day I’m going to walk into a restaurant, order a burger without the bun, and the waiter is going to say to me, “Oh, you’re trying that new gluten free diet?!” I don’t know how exactly I’ll respond, but I’m pretty sure it’s going to be along the lines of, “No, I’m trying to prevent my immune system from destroying my intestines, and I’ve been doing it since I was 11. Want to like to trade immune systems? What’s you blood type?”

Normally I try not to rant like this in public, and I apologize if I’m just being a troll, but this is actually very annoying. I don’t care that other people want to eat gluten free foods, but the fact that a diet that I have fought to cope with, and that can be very frustrating, is becoming the latest “big thing” really annoys me. It belittles the struggle that I, and everyone else who has Celiac Disease, goes through every meal of every day.

*To be fair, I don’t get the immediate symptoms like the diarrhea and cramps, I just get the fun stuff like psychosis and osteoporosis if I eat the stuff long term. While this sounds like a better deal, it also means that I have no immediate indicator of whether or not I have eaten gluten, and therefore don’t necessarily know when I’ve eaten it. And I do know people who have had serious complications with Celiac, one of whom had frequent blackouts before she went gluten free.

Drinking

A few days ago, I went to a friend’s birthday party at a local bar. Those of you who know me know that I’m not much on drinking. I’ll drink wine, or sake, or even some harder stuff in moderation, but I don’t got drunk, because I don’t have, nor have I ever had, any desire to get drunk. I had also never been to a party at a bar, so I knew from the beginning that this was going to be an informative experience. It was a fun party, and while I did drink a good third of a mixed vodka drink out of a small bucket and I was convinced, at length, to try the mechanical bull, I left the bar with my pride it tact and completely sober.

While I’m sure you’re all fascinated to hear about my party going experiences, that’s not what I want to talk about today. What I want to talk about is the reason I don’t want to get drunk. When I tell people that I don’t like to get drunk, the most common response is, “Ah, you don’t like to lose control,” as if my not wanting to get drunk were some kind of bizarre “control issue.” I’m going to tell you right now: it has nothing to do with control.

The first issue is that I simply do not see the appeal in getting drunk. So you went out, drank enormous amounts of beer and shots, made out with your best friend, puked all over yourself, wet yourself, and you don’t remember any of it, but you have a terrible hangover this morning… and you enjoy this? I realize that not all of those things happen every time people get drunk, but at the very least, drunk people are not their usual selves. Is your usual self or usual life so bad that you have to change it by getting trashed on Saturday night? Or is this what you consider to be “a good time?” (Note: that’s a figurative “you,” not you the reader.) Maybe I’m weird, but I like to do other things with my time. We each get a limited amount of time on this Earth, and I’d like to remember as much of mine as possible. And if I want to alter myself or my personality in any way, I don’t need alcohol to do it.

I’ve also heard the argument, “If you never try it, then how do you know you don’t like it?” People who say this weren’t listening carefully enough to me when I said, “I have no desire to get drunk.” I didn’t say, “I don’t like it,” I said that I simply don’t want to get drunk. I’m not saying that being drunk wouldn’t be fun, or that I wouldn’t like it – I’m saying that I don’t find the idea of getting or being drunk appealing. There’s a difference. For those who think I’m just being pedantic: have you ever tried touching a piece of metal in an electrical socket? No? Then how do you know you won’t enjoy it? (Note that I’m using this example to illustrate a point; don’t go stick you finger in a electrical socket. Having done it accidentally, I can tell you that it’s not pleasant.) Even if you have stuck your finger in an electrical socket (and even if, for some bizarre reason, you actually enjoyed it,) that’s not the point. The point is that there are some things we all avoid doing because they don’t seem appealing to us, and even though those things may be perfectly safe, and other people enjoy them, we don’t want to. Well that’s how I am with getting drunk.

Some of you may see where I’m coming from, and some of you might think I’m just a massive prude, but that’s my choice to make. I don’t mind if anyone else drinks themselves into a stupor, and I don’t think that there’s anything wrong with it, provided that it doesn’t become a problem, but I just don’t really want to try it, and what I do have a problem with is people who try to force me to try it. I don’t judge people for getting drunk, and I’ll even go to parties and be the sober guy, but at this point in my life I choose to drink for nourishment, water, and pleasure, not for getting shit-faced. It’s not a control issue, it’s a matter of choice.