Category: Life

Every other post.

  • 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.

  • A Day of Public Hearings

    A Day of Public Hearings

    I got up early this morning and headed over to the Marriott hotel where I attended the public hearings for Bill 13 & 14. It was a full-day affair, lasting from nine to five. My boss knew I wouldn’t be in today and was very supportive.

    There were 29 groups and individuals scheduled to speak, each in 15 minute blocks. The people would come up, give a speech, sometimes accompanied by slides. Then, if there was any time left, the parliamentarians would be able to ask them questions. Otherwise, it was on to the next block. All three political parties (Liberals, PC, and NDP) were represented.

    I sat and prepared to take notes. My MPP for Ottawa-Centre, Yasir Naqvi, walked in and recognized me from our previous encounter. He asked me if I’d be among those speaking. I told him that I was too late. I nevertheless showed him the speech I had prepared, and he helped me submit it so that all the parliamentarians on the committee would at least be able to read it. He also invited me to attend the press conference he was holding at 1PM. Awesome.

    The deliberations started. First up was the legal counsel for the Coalition for Parental Rights in Education. He indicated that if Bill 13 were to pass, the province could expect years of litigation over claims of infringements on denominational rights. The simple solution was to remove all mention of homophobia and sexual orientation from the bill. He claimed there was preferential treatment by including them, but unsurprisingly did not take issue with the same wording as it applied to discrimination on the basis of race, gender, or disability.

    Next up was the Evangelical Fellowship of Canada. Homophobia, they argued, was a slur to bully those it is used against into silence. This was followed by another speaker, who indicated that homosexuality was intrinsically disordered and that the bill was against the Canadian Charter of Rights and Freedoms that gave precedence to the Christian God, the God of Abraham.

    This was the tone for the day. Nearly all speakers espoused such views, and all against three particular passages of the legislation. The first passage, quoted below, because it includes the word “homophobia”. As hinted above, a number of speakers insisted homophobia didn’t exist. As one person put it, it was an “imagined prejudice.” Or as another stated, it was “a term used by activists and militants to oppose Catholic teachings.” Numerous were the calls for the bill to be amended to remove all references to it.

    The purposes of this Part include the following:

    1.  To create schools in Ontario that are safe, inclusive and accepting of all pupils.

    2.  To encourage a positive school climate and prevent inappropriate behaviour, including bullying, sexual assault, gender-based violence and incidents based on homophobia.

    3.  To address inappropriate pupil behaviour and promote early intervention.

    4.  To provide support to pupils who are impacted by inappropriate behaviour of other pupils.

    5.  To establish disciplinary approaches that promote positive behaviour and use measures that include appropriate consequences and supports for pupils to address inappropriate behaviour.

    6.  To provide pupils with a safe learning environment.

    The second passage that raised the ire of the religious representatives was that quoted below. They interpreted it as meaning that religious groups would not be able to worship in schools, because their views would be inconsistent with the code of conduct. This would be, according to one speaker, a “violation of freedom of conscience, of association, of religion… a clear infringement of the constitution and the charter.”

    If a board enters into an agreement with another person or entity, other than a board, respecting the use of a school operated by the board, the board shall include in the agreement a requirement that the person or entity follow standards that are consistent with the code of conduct.

    The third passage, and the one that elicited a strong reaction from every speaker, was the one cited below. It would put an end to the ban on support groups for queer students that are in place in many Ontario schools.

    Every board shall support pupils who want to establish and lead,

    (a)  activities or organizations that promote gender equity;

    (b)  activities or organizations that promote anti-racism;

    (c)  activities or organizations that promote the awareness and understanding of, and respect for, people with disabilities; or

    (d)  activities or organizations that promote the awareness and understanding of, and respect for, people of all sexual orientations and gender identities, including organizations with the name gay-straight alliance or another name.

    It caused some speakers to label the bill “anti-Christian.” Another claimed that a “radical sexualized agenda” would “seep into the school curriculum in the name of equity, inclusivity and anti-bullying.” Yet another warned that this bill “would cause a Godless society where people would act impurely and on a whim.”

    “I do not accept practising homosexuals, as a Catholic,” stated another. “Homosexuality is intrinsically disordered.” A speaker lamented that not only were they forced to “tolerate” LGBT students, but now they would have to accept them too – and that was just too much. “This is indoctrination” affirmed a few. They all wanted those passages removed.

     

    Not all speakers were like this. Most were, but not all. The Ontario Student Trustee Association said that they had run a survey in 2011 of 7,000 students and 2,000 parents. 88% of students thought a support group like a gay-straight alliance was a good idea, as did 79% of the parents. Kids Help Phone came in support of the bill.

    The Ontario English Catholic Teachers Association stated that gay-straight alliances no more made straight students gay than gay kids straight, alluding to claims that these clubs would confuse children. “Why would anyone want to choose to be called intrinsically disordered, to be forbidden from birth to death to feel an intimate moment?” (A number of speakers had advocated life-long celibacy for gay youth.) “We must set aside what makes us different and embrace what makes us one,” was the conclusion.

    The Youth Service’s Bureau strongly supported the legislation, as they found that the most effective model to support youth was to empower them. Get them involved, with student-run groups like gay-straight alliances. Their representative noted that sexual orientation was a big factor in bullying at the secondary level, with 50% reporting incidences.

    Jer’s Vision meanwhile had two speakers. One had gone to a Catholic school and had wanted to start a GSA, but was not allowed. She stated that students needed help, and schools needed to be accessible by making them safe for students. It was right to let students talk about LGBT issues and that the only way to deal with bullying was to talk about it. “Silence equals death.”

    These views of support were in the minority in the proceedings. A protest had also formed outside to object to Bill 13. The presenters were stacked in a way that did not reflect general opinion. I went up to the Liberal party’s press conference, where advocates for the bill’s passage were able to share their views. There was a law professor from the University of Ottawa, Jer’s Vision, and the Youth Service Bureau.

    There was talk of the research that had shown that gay-straight alliances made schools safer for all students, not just those who participated in the club. Jer’s Vision had engaged with 75,000 youth across Canada, and its representatives discussed the kind of issues that some kids were facing.

    The media asked a few questions and the press conference ended. I re-joined the principle deliberations. More of the same ignorance. Finally, it was down to the last speaker, who called upon the parliamentarians to “come clean” if the bill had as a goal to “promote homosexuality.” She wanted, like so many before her, all references to homophobia, homosexuality, and gay-straight alliances dropped. “Homosexuality is a serious sin. Warning about immoral sexual behaviour shows how much the church cares,” she stated.

    The day was over, and I was exhausted. I tried to be as emotionless as possible as I took notes, but it’s difficult when every person sees you as something nefarious. I feel so sorry for the children of these speakers who might not end up fitting the narrow scope of their parent’s world view.

    The deadline for ammendments to the bill is 5PM on May 24th.

    On May 28th, the bill will be debated, clause by clause in Parliament. If it passes come the parliament’s last session before the summer break on June 7th, it will come into force for September.

    Note about the quotes: I was transcribed all I could during the day, but some quotes might be not word-for-word what was said. Please refer to the hansard for the accurate transcription.

  • Working on Second Book

    Working on Second Book

    I wrote the draft for my second book while in Cuba, and have been spending the last week typing it up.

    The book covers the strategies I used to lose weight. Given how personal weight loss is, this isn’t intended to be a “do this and succeed” guide. Rather, it lists a bunch of strategies I used, with the hopes that perhaps some of them will be of use to others.

    The title “Diets Suck” comes from my realization that most celebrity diets propose temporary fixes, usually in the form of food deprivation, to what is actually a permanent problem. I gained all this weight primarily because of my eating habits. I can change them for a while with a diet, but if I go right back to my old ways after that ends, I’ll gain it all back. Which is what happened in my yo-yo days.

    So instead, I went for making small tweaks to my eating habits that would add up over time. Merely giving up a coke can a week at work, for instance, would reduce my weight by a number of pounds over a year. There would be no going hungry, or denying myself the things I liked. Doing that would not have been sustainable, assuring a sour mood and failure.

    Much of the inspiration for my philosophy came from an interview I saw with Brian Wansink, which you can watch here.

    The book should be out in two months.

    As before, I’ll release a free digital copy and a not-so-free print copy.

  • Bill 13 & 14 Public Hearings in Ottawa

    Bill 13 & 14 Public Hearings in Ottawa

    The Standing Committee on Social Policy will be in Ottawa on May 22nd to hold public hearings on Bill 13 and 14. Among the confirmed speakers will be the Catholic Women’s League of Canada and the Evangelical Fellowship of Canada (“homosexual activists … subvert already weak Catholic sexual teaching in the schools”).

    When: 9:00am, Tuesday, May 22, 2012

    Where: Ottawa Marriott Hotel on 100 Kent St., Victoria North Ballroom (2nd Floor)

    I got in touch to be among the speakers, but I was too late. Nevertheless, I have the following prepared should the opportunity present itself:

    To my esteemed parliamentarians and participants here today,

    My name is Julien McArdle. Full disclosure: I organized in the spring of last year a petition to lift the ban on Gay-Straight Alliances, or GSAs, in the Ottawa Catholic School Board. I amassed over 700 signatures to this effect. The accompanying Facebook group has over 400 followers.

    I’m here today to talk about Bill 13, and more specifically to discuss Gay-Straight Alliances and the clubs like them. I believe it to be the elephant in the room with regards to this bill and the reason why there is such strong opposition from a dedicated minority.

    What I propose is simple: listen to the students. I find that they are so easy to forget when we hold these sessions away, both in time and place, from schools.

    If you listen to the students, they have already spoken. They did so when they tried to set up Gay-Straight Alliances. Let me remind you that it was not the students who subsequently forbade their establishment.

    I must also speak out on the “Respecting Differences” clubs. I would find it a wonderful asset were it not actually utilized as a tool to legitimize the prohibition of genuine support to students. The guidelines for the Respecting Differences group forbid conversations on gender identity. I ask you: how is a group where you can’t even discuss what you’re facing supposed to be of any help? It can not. Imagine how ineffective an anti-racism club would be if its participants were not permitted to talk about issues surrounding race.

    On the matter of religious freedom, an argument oft-cited by opponents, I ask this: how is one’s religious freedoms impinged by the existence of a group whose mandate is to foster understanding? It is not.

    That some speakers before you have made comparisons to slavery and the residential school abuses in reference to a mere support group attests to the toxicity in the public sphere that makes clubs like GSAs so necessary to the young recipients of this ignorance.

    I conclude with a simple message: the beneficiaries of this bill are the students. They have already spoken, they just need for you to listen.

    Thank you very much for your time.

  • Cuba

    Cuba

    I’ve just come back from a week-long escape to Cuba. I decided that I would do this two weeks ago, and organized it all the Monday before my departure.

    The trip was a success. I read an entire book – the Pulitzer-winning The Forever War by Dexter Filkins – and got a head start on The Fate of Africa by Martin Meredith. I wrote, start-to-finish, the draft for my second book. Every day, I went to bed early, woke up late, ate well, swam, read and wrote. There was no computer screen, no work emergency to concern myself with. It was absolutely fantastic.

    I have never had vacation time before that wasn’t a rush to complete objectives – either by juggling family around Christmas or speed-running through cities on travels abroad. To just have all the time in the world was such a wonderful feeling.

    Jay couldn’t come this time round due to school constraints, but we’ve resolved that we’ll go off together once he graduates. I very much look forward to that.