Category: Life

Every other post.

  • Walmart & Accusations of Shoplifting

    Walmart & Accusations of Shoplifting

    Today my boyfriend and I went out to Walmart so that he could refill a prescription. It was a pretty warm day as far as the weather in March goes, so my significant other wore shorts. He also brought some jeans in his backpack just in case the temperature dropped.

    The Walmart we went to is about an hour away by bus. Sure enough, when we get there, the wind picks up. So my boyfriend goes into the washroom to change into his warmer clothes while I go get some supplies. On my way back to the store’s pharmacy, I see a girl in the main aisle with a shirt that says “Security.” She’s talking to a man in shirt and tie, presumably some manager, and I overhear her say “It’s the one with the belt and the backpack – but she didn’t see him do it.”

    I follow the manager as he walks to the prescription counter, where sure enough my boyfriend – studded belt, backpack, and all – is standing. The manager approaches my boyfriend and asks him if he was filling a prescription, to which my mate replied that he was. The manager talks to the girl behind the desk, and leaves.

    Ten minutes later, the prescription is ready. The pharmacist calls out my boyfriend’s name. The girl at the desk runs back, hushes something in her ear, and comes back to us informing us that it’ll be another five minutes. Minutes pass. She gets a call – and informs us again that it will be another five minutes. Finally, half an hour later, she receives a call that gives her the go ahead: she calls out his name, and gives him the bag with $200 worth of meds.

    Jay had been accused of shoplifting the Old Navy pants he was wearing. That much we know. We presume that the delay was the security person reviewing the footage, seeing if he had in fact picked up anything.

    This delay caused us to miss our bus back, which was rather frustrating. As a “fuck you” to Walmart, we shopped around at other stores, and then came back to eat at their own McDonald’s.

  • Why Math is Important for Programmers

    I was talking to someone the other day on IRC, and they were talking about how he saw his math class as being a waste of time. Too theoretical, not practical. It’s usually hard to see the benefits, until you realize that it opens up opportunities on how to solve problems.

    Take today: I wanted to calculate Pi to a certain number of digits. However, I didn’t know how much computer storage, say, a trillion-digit long number would require. Math to the rescue!

    We know that with one bit of computer storage, we can store a one or a zero. With each additional bit of computer space, the biggest size that that stored number can be doubles. For instance, with three bits you can represent all the numbers from zero up to (but not including) eight, but with four, you can represent all the numbers from zero up to (but not including) sixteen. Thus you can use this formula:

    Where maxval is the biggest number you can store given a number of bits. That maximum value is a decimal number. Keep in mind that all decimal numbers can be represented in the scientific notation:

    Where b corresponds to the length in digits of that number. So maxval, in fact, also equates to the following:

    We’re looking for the number of digits in multiple of tens – and therefore a will always equate to being 1. As such, we can simplify the above formula to:

    And thus, since both the first formula and this last one equal to the same thing, we can stipulate the following:

    Since we want to find out the amount of bits given a known number of digits, we need to rewrite the formula so that we end up with the amount of bits. This is where this rule from high school math comes in handy:

    is the same as

    And using that rule, we can rewrite the formula to figure out the amount of bits as such:

    We could stop there. Given the length of a number in digits, we could figure out how many bits would be required to store it. That said, many calculators don’t have the ability to make calculations with logs at base 2. Most calculators are able to however calculate logs at base 10. This is where another high school trick to change bases of logarithms comes in handy:

    Which is applied to our formula to convert it to the following:

    Finally, the above can be simplified. Keep in mind that:

    So the logarithm in the top portion of the equation actually equals digits in itself:

    Keeping this in mind, the whole formula can be rewritten as such:

    And since a logarithm without an indicated base is assumed to have base 10, the above formula can be further cut down:

    And that’s it! Thanks to a little bit of math, we can figure out how many bits of space would be required to store a certain amount of digits. So, going back to the pi example – how much storage space would be required to store pi to a trillion digits?

    Storing pi to one trillion digits would require approximately 3.3 trillion bits of computer storage, or around 387 gigabytes! Problems like the one exemplified here aren’t uncommon, and a solid foundation in mathematics can go a long ways in opening new doors as to how to solve them.

    So whether you’re taking calculus, linear algebra, numerical analysis and/or statistics – remember: that theory you’re learning will come in handy one day.

  • …then again

    Finding a significant other does have a way of reinvigorating yourself. (See previous post.)

  • Personal Creativity

    A while ago, I had this idea of creating an open-source GIS application. It’s safe to say now that the idea is dead.

    My job title changed some months ago – I went from being a geophysicist to full-time programming. I work with a small R&D team, which can lead to really challenging and satisfying work. Today, for instance, I put the finishing touches on an interpreter for this scripting language I created.

    However, with this transition to the new job, my desire to do creative work (programming included) outside of work hours has all but died. I spend so much time exercising my brain at the job that when I arrive home I just want to sit down and relax. This feeling is the exact opposite of what I had when I wrote Rice Tea, or worked on Docks and the Piracy doc.

    I need to find a way to reinvigorate myself. Or at least not feel so damned drained after work.

    In unrelated news: I now have a significant other.

  • 5 Pounds…

    The weight loss has been slowing down, but I’m still keeping it off (yay!) I’ve lost another 5 pounds since my last posting, for a total of 25 lost pounds. My main target is to shed off another 5 pounds, bringing me back to my 2008 level.

    I know this blog is a me-me-me thing, and I apologize that there’s nothing interesting here. It’s just that I use this as a diary of sorts, and this is important to me.