Category: Life

Every other post.

  • Big Changes are Coming

    Big Changes are Coming

    Yesterday, I received this email:

    You have been admitted to the University of Ottawa as a Full-time student to the Faculty of Science, in year 3 of the Honours Bachelor of Science With Specialization in Geology – Physics , offered in English, for the Fall 2012 session.

    I approached my boss today, and let him know of my intent to pursue school. It would be two years of full-time studies. He told me that he’d like to keep me on, perhaps at 20 hours a week. That would be fantastic I replied.

    I’m terrified, to be honest. I know this is something I have to do, but it means moving away from the security of having developed a routine. Worse though is living with the regret of having squandered such an opportunity.

  • Book Progress

    Book Progress

    I received a printed copy of the book I’ve been working on, after the last one had been stolen off of my front porch. It looks good!

    The formatting has mostly worked out. There are artifacting problems in the cover, the kind you’d see around high-contrast edges in a low-quality JPEG image. I also found other sore spots, but all easy to fix.

    I’ve been spending the last week improving how I word paragraphs here and there, but the content is pretty much finalized. I’ll probably order another copy of the book over the coming days with the latest revisions. If it works out, then I’ll push it out.

    I’ve also set up the official website for the book. Once I’m satisfied with the paperback copy, I’ll make an eBook version in the ePub format.

  • 3 Book Reviews: On War & Food

    3 Book Reviews: On War & Food

    I finished reading three books over the course of the last four weeks. The first was The Forever War by Dexter Filkins, which I read in Cuba. The book covers the author’s experience as a foreign correspondent from Taliban-era Afghanistan to Iraq before and after the sectarian violence took hold. Filkins won the Pulitzer prize for this work, and it is well deserved.

    It is an unflinching portrayal of the insanity and misery of war. Steinbeck once said of his war reporting “It is in the things not mentioned that the untruth lies.” For reasons that may be of ratings or propaganda, it is deemed unacceptable to report the full ugliness of war in newspapers and on television. What we get are sanitized versions, which in turns I feel, fuels the desire of those abstracted from its essence to see it as something other than the absolute last resort it should be.

    Dexter Filkin’s work reminded me of another excellent book I had read earlier, Every Man in this Village is a Liar, by Megan Stack. I appreciated both these works for giving me an insight into a world that large-circulation media sees but censors.

    On a more cheerful note, I then read two books on weight loss. The first was the title that inspired much of the approach I took. It’s Mindless Eating: Why We Eat More Than We Think by Brian Wansick. The second was The Volumetrics Weight-Control Plan by Barbara Rolls and David Barnett.

    I had heard of Mindless Eating through an interview on TVO. It was a fascinating interview. Wansink is a researcher for Cornell who studies what makes us eat. He found that it wasn’t just hunger at play, but a whole slew of persuaders which we aren’t aware of.

    For instance, he gave free popcorn to a group of people entering a movie theatre. These people had just eaten dinner. The popcorn was three weeks old and stale. Some people got a large bag of popcorn, while others were issued a small. After weighing the bags at the end of the movie, he found that people who had the large bag had eaten noticeably more on average than those with the small. The size of the bag affected how much people chose to ate.

    In his book, Wansink lists out this and many other fascinating persuaders he and other researchers came to uncover. It’s food psychology. Mindless Eating was a great read. I’d highly recommend it to anyone – not just people who seek to reduce weight. It’s an insight into how our mind works. It’s not meant to be a diet book as the author notes.

    I learned of the Volumetrics book by Barbara Rolls and David Barnett because Wansink talked about it favourably in his own work. It sounded a lot like the approach I was already taking, and it was by another food researcher, so I decided to buy it. The tone in Volumetrics is that of a diet book. The premise is that it’s volume more than the calorie content in food that fills us up. So by capitalizing on this fact, we can satiate our hunger on fewer calories. As an example, a cup of grapes and a quarter cup of raisins both contain the same amount of calories. Raisins are dried grapes after all. But the grapes are likely to be more filling, given that it’s four times as voluminous. You can apply the same logic to making the jump from 2% to 1% milk.

    The book also presents lots of research on how we behave around food and dispels many misconceptions that have been bandied about. Drinking more, for instance, does not reduce hunger. But Rolls and Barnett list why people may think that that’s the case.

    I very much liked the novel information presented, but that is a small component of the work. Half of the book is recipes, which weren’t particularly of interest to me. That whole portion felt like filler. Both books actually had quite a bit of filler – Wansink’s own book used lots of clip-art and liberal spacing to hike up the page count.

    I wouldn’t commit to a calorie restriction diet that goes well below my basal metabolic rate, as was discussed in Volumetrics. I find that’s tantamount to starvation, though its authors would likely disagree with me.

    An interesting read overall, though I’d say it’s more for the weight-loss crowd than general interest.

     

  • Joy of Cooking #2

    Joy of Cooking #2

    I like to cook. Made a maple-syrup pie and whole-wheat garlic basil bread yesterday. Also shown: cinnamon bun cookies, pizza with cheese-stuffed crusts, peanut butter cookies, New-York style cheesecake, layered chicken burger, ham & cheese stuffed Focaccia bread, and chocolate cake with a cheesecake-dip topping.

  • How to Archive a Newscast

    How to Archive a Newscast

    Let’s there’s a newscast that has footage implicating you, and that you want to archive it so that you have totems of your past years down the road. If it comes from a certain Canadian public broadcaster, you can use cURL and rtmpdump to store it.

    First, you go to the page where the stream can be seen.

    You then load up the source code for the page. In Google Chrome, this is done by typing in CTRL-Shift-J or by going into the Tools menu.

    You’ll find a line for the streaming video that’s displayed:

    <param name="flashvars" value="ID=player&RSI=cbc-production&URI=http%3A%2F%2Ffeed.theplatform.com%2Ff%2Fh9dtGB%2Fr3VD0FujBumK&url=http%3A%2F%2Flink.theplatform.com%2Fs%2Fh9dtGB%2FVnA1AdNwKLyHfCVIfJHJA8QY9Me6enym%3FisPLS%3Dfalse%26airdate%3D1337731200000%26mbr%3Dtrue%26site%3Dcbc.news.ca%26zone%3Dnews%26shortClip%3Dfalse%26sport%3Dnot_applicable%26show%3Dcbc_news_ottawa_at_600%26audioonly%3Dfalse%26liveondemand%3Dondemand">

    From that line, you’ll copy the contents of the value attribute:

    ID=player&RSI=cbc-production&URI=http%3A%2F%2Ffeed.theplatform.com%2Ff%2Fh9dtGB%2Fr3VD0FujBumK&url=http%3A%2F%2Flink.theplatform.com%2Fs%2Fh9dtGB%2FVnA1AdNwKLyHfCVIfJHJA8QY9Me6enym%3FisPLS%3Dfalse%26airdate%3D1337731200000%26mbr%3Dtrue%26site%3Dcbc.news.ca%26zone%3Dnews%26shortClip%3Dfalse%26sport%3Dnot_applicable%26show%3Dcbc_news_ottawa_at_600%26audioonly%3Dfalse%26liveondemand%3Dondemand

    There are many websites that will decode the contents for you. It uses what’s known as Percent Encoding to represent symbols and white space. So you pass the contents through such a website:

    The decoded string looks like this:

    ID=player&RSI=cbc-production&URI=http://feed.theplatform.com/f/h9dtGB/r3VD0FujBumK&url=http://link.theplatform.com/s/h9dtGB/VnA1AdNwKLyHfCVIfJHJA8QY9Me6enym?isPLS=false&airdate=1337731200000&mbr=true&site=cbc.news.ca&zone=news&shortClip=false&sport=not_applicable&show=cbc_news_ottawa_at_600&audioonly=false&liveondemand=ondemand

    From this string, you extract the URL:

    http://link.theplatform.com/s/h9dtGB/VnA1AdNwKLyHfCVIfJHJA8QY9Me6enym?isPLS=false&airdate=1337731200000&mbr=true&site=cbc.news.ca&zone=news&shortClip=false&sport=not_applicable&show=cbc_news_ottawa_at_600&audioonly=false&liveondemand=ondemand

    You then call the cURL command to pull in the resource pointed to by the link:

    curl "http://link.theplatform.com/s/h9dtGB/VnA1AdNwKLyHfCVIfJHJA8QY9Me6enym?isPLS=false&airdate=1337731200000&mbr=true&site=cbc.news.ca&zone=news&shortClip=false&sport=not_applicable&show=cbc_news_ottawa_at_600&audioonly=false&liveondemand=ondemand"

    An XML page will spit out:

    This is what the XML document looks like. Each request provides a unique result, as a single-use authentication key is always generated:

    <smil xmlns="http://www.w3.org/2005/SMIL21/Language">
    <head>
    <meta base="rtmp://cp37429.edgefcs.net/ondemand/?auth=daFcQdKcOaMbPbJavbLabboaod9dpbPasbb-bpVonT-b4-nnr_CqvZvkHoyBC&amp;aifp=v0001&amp;slist=netstorage"/>
    </head>
    <body>
    <ref src="http://ad.doubleclick.net/pfadx/cbc.news.ca/news/sz=320x240;show=cbc_news_ottawa_at_600;sport=not_applicable;season=;section=;event=;liveondemand=;shortClip=false;audioonly=false;companions=;playerType=" type="video/x-flv" no-skip="true" tags="preroll">
    </ref>
    <ref src="http://ad.doubleclick.net/pfadx/cbc.news.ca/news/sz=320x240;show=cbc_news_ottawa_at_600;sport=not_applicable;season=;section=;event=;liveondemand=;shortClip=false;audioonly=false;companions=;playerType=" type="video/x-flv" no-skip="true" tags="preroll">
    </ref>
    <switch>
    <video src="netstorage/Ottawa-17_59_48-2012-05-22.mp4" system-bitrate="763019" height="360" width="640"/>
    <ref src="netstorage/Ottawa-17_59_48-2012-05-22.mp4" title="CBC News: Ottawa - May 22, 2012" abstract="CBC TV News, Weather and Sports from Ottawa" copyright="CBC Production" dur="1804069ms" guid="_jgXa48TJCzx8HSS_Jth0STefpFW7OK9" categories="News/Canada/Ottawa" type="video/mp4" height="360" width="640">
    <param name="adCategory" value="news"/>
    <param name="adRules" value="2_2_0"/>
    <param name="adSite" value="cbc.news.ca"/>
    <param name="airDay" value="(not specified)"/>
    <param name="aired" value="false"/>
    <param name="audioVideo" value="Video"/>
    <param name="availableInHD" value="(not specified)"/>
    <param name="availableInMobile" value="false"/>
    <param name="camera" value="(not specified)"/>
    <param name="commentsEnabled" value="Yes"/>
    <param name="contentArea" value="News"/>
    <param name="deletethis_shareable" value="true"/>
    <param name="genre" value="News"/>
    <param name="includesThumbnail" value="false"/>
    <param name="isPLS" value="false"/>
    <param name="isToBeReleased" value="false"/>
    <param name="league" value="(not specified)"/>
    <param name="liveOndemand" value="On-Demand"/>
    <param name="region" value="Ottawa"/>
    <param name="relatedURL1" value="CBC Ottawa|http://www.cbc.ca/ottawa/|_blank"/>
    <param name="shareable" value="Yes"/>
    <param name="show" value="CBC News: Ottawa at 6:00"/>
    <param name="sport" value="(not applicable)"/>
    <param name="sportGroup" value="(not specified)"/>
    <param name="subtitles" value="Yes"/>
    <param name="syndicate" value="Yes"/>
    <param name="type" value="(not specified)"/>
    <param name="unapprovedDate" value="2524626000000"/>
    <param name="configurationError" value="false"/>
    <param name="missingFiles" value="false"/>
    <param name="missingMetadata" value="false"/>
    </ref>
    </switch>
    </body>

    From the feed above, the URL in the base attribute of the meta tag is split up and fed into the parameters of the rtmpdump command, as is the src attribute of the video tag. This produces a command that looks like the following:

    rtmpdump -r "rtmp://cp37429.edgefcs.net" -a "ondemand/?auth=daFcQdKcOaMbPbJavbLabboaod9dpbPasbb-bpVonT-b4-nnr_CqvZvkHoyBC&amp;aifp=v0001&amp;slist=netstorage" -y "mp4:netstorage/Ottawa-17_59_48-2012-05-22.mp4" -o news.mp4

    In the example above, the newscast was set to be stored in a file called “news.mp4.” It’s important to note that the command can only be invoked the once, using up the unique authentication key. If you screw up, you’ll need to request another of those XML documents to get a new key.

    Calling the rtmpdump command downloads the newscast:

    Which takes a while, but eventually finishes:

    You can then watch it on your local computer:

    And there you have it. A moment of your life stored in such a way that it won’t disappear tomorrow.