Emacs PSA: Use the kill ring in CUA mode4

Rather than write a real blog post, here’s a quick PSA.

In Emacs, any text you cut is stored on what’s called the “kill ring”. After you paste (aka “yank” in Emacs terminology) something, you can press M-y (yank-pop) to cycle through things that are stored on the kill ring. It’s a pretty basic thing, but I’ve only just started using it, and up until now the kill ring has been an endless source of frustration for me. So, I figured it’s worth posting.

Much to my surprise, M-y still works with CUA mode - it just calls cua-paste-pop instead. I had avoided using the kill ring mainly because I didn’t think it would work with CUA mode.

My frustration with the kill ring is that years of living with Windows has taught me that the backspace key is just delete in reverse. Normally (or at least, in CUA mode) Emacs respects this on Windows. Yet fgallina’s Python mode, and Markdown mode remap backspace so that it “kills” instead of just deleting.

Imagine my frustration every time I go to paste a bit of code, and instead an empty line is inserted, or a single character that I happened to press backspace on, instead of what I actually wanted. This was happening on at least once per day before I went looking to see if I could cycle the kill ring in CUA mode.

Side note: Both of those modes remap backspace for the same reason - to provide “smart” indentation handling. Really wish they would respect CUA mode, but I have no idea how to beg for something like that now that fgallina’s python.el is officially part of Emacs. May request a change in Markdown mode, though.

The misery of exporting Org files to S5

In my last post, I mentioned that exporting from Org was a big reason for using it to present. I personally feel like video content is a complete waste of time, so I definitely want my presentation to be available in a format other than video. Because it’s been around for a while, I had read in a few places about slideshows using S5. And I knew that it was possible to export to S5 from Org (note: old info). Surely this would be easy and the output would be perfect on the first try! That turned out to be the exact opposite of what happened. In the end, it took at least five or six hours of fiddling in order to get everything working. Admittedly, if I knew more about HTML and CSS - in other words, if I were the sort of person S5 seems to be designed for - it would likely have been much easier. Likewise, the most up-to-date export tool, ox-s5, seems to be aimed at people who already know a lot about S5. Maybe you can see where this is going.

Rather than rant about how I stayed up until 2am the night before (or the morning of?) my 21st birthday messing with HTML in a text editor, I’m just going to list off a bunch of lessons I learned, to hopefully save future users a bit of pain.

Getting the basics to work

The first issue is the customization variables that ox-s5 offers. Don’t use ‘em. I know, we wouldn’t use Emacs if we didn’t want to change settings - but no. You don’t want to change these settings. The only one you’ll want to change is to specify your theme file, and while there are many wrong ways to do this (and I tried them all), the right way is to specify a CSS file. The exact filename depends on the theme you’re using. For me, I used (setq org-s5-theme-file "railscast/pretty.css"). That’s a relative link, which were the only kind I could get to work, to the railscast theme from the org-s5 repository.

The setting that really messed with me was org-s5-ui-url. It doesn’t seem to do anything other than break your slideshow. I tried settings a direct link to the ui folder, as in C:/Users/Matt/s5/ui - didn’t work. Perhaps it was being interpreted as a relative link, I don’t know. Given that I had no idea what I was doing, I spent a while re-exporting my slideshow, opening it in one folder, moving it and opening it in another folder, over and over in a pitiful attempt to make things work.

When I stopped customizing this variable and reset its value to ui, all of a sudden I had a semi-working presentation! The HTML file has to be kept beside the S5 ui directory in order to work, but whatever. Also note that the ui directory has to contain both the theme you want to use and the default theme, as most themes seem to reference the default theme.

Once I had something being exported, the first thing I changed was to tag parts of my Org file as :noexport:. Just write that beside a heading, and it won’t appear in exported documents. Useful for embedded code blocks that you use to process results and such.

After this, I needed to tweak exported HTML file, which is unfortunate. Most of the changes I made could be automated, if I knew enough Emacs Lisp; for now, perhaps some kind soul will incorporate them into ox-s5. So, what did I change?

Simple HTML changes

I deleted the table of contents. org-present considers every top-level heading as a slide, and nothing else (this is kind of annoying). ox-s5 exports a table of contents containing every heading in your file. These two facts don’t play well together, because org-present encourages having a lot of headings, which then gives you a TOC that’s too large to display on one screen. Aside from that, the table of contents doesnt’ even provide links to specific slides, and S5 advances slides when you click, so it’s useless twice-over. Would be nice if there were an option in ox-s5 to turn off the TOC.

The next issue is that some part of the exporting toolchain considers the underscore character as a marker for subscripting. So if I mention, in plain text, a function called waste_time, I get wastetime in the HTML output. It’s hard to say if this is a bug, a misfeature, or what - at any rate, I had to regex replace <sub>(.+?)</sub> with _\1.

I didn’t like the section numbers being beside my headings, so I removed those. Regex replace <span class="section-number.+?</span> " with nothing (trailing quote mark intentional, I think). Unsure if this can be customized already, but it would be nice to have a choice.

Aesthetic changes

In a few cases, when a slide got too long to show on my (admittedly small) laptop screen, I had to add an extra <div> around half the content, and specify class="slide". For a few of my headings, I also deleted the slide class, so that S5 would skip over them. If you know as little about HTML as I did at the time, that’s probably hard to visualize - so check out the source to see what I mean.

The exported HTML has some CSS embedded in it, and I tweaked things there rather than modifying the theme file (at least, originally - some things are in the theme file now). First thing: When you have code blocks in your source, ox-s5 will show the programming language name when you mouse over them. Only for a few predefined languages, though - and it should really decide what languages to use based on org-babel-load-languages. I added this rule: pre.src-python:before { content: 'Python'; } to handle Python blocks. Also, the language name doesn’t show up very well on dark backgrounds, so I added color: black; in the existing pre.src:before block.

Another issue I was having was that using the arrow keys to change slides was attempting to scroll the page. So the scroll bars would show up, sometimes content would go off screen in certain browsers if you pressed left/right too much, and it just looked dumb. Adding body { overflow: hidden; } fixed that. This probably deserves to go in the theme file itself, but perhaps ox-s5 could specify it anyway - I can’t imagine why you’d want the scroll bars visible.

Lastly, for aesthetic reasons, I decided to center my headings. So: h1 { text-align: center; } and h2 { text-align: center; } handled that. However, that made my title slide look weird - apparently my theme added some padding to headings. Solution: #slide0 h1 { padding-right: 0; }. This isn’t useful for anyone not using the railscast theme, but since it’s the only good looking theme I could find, I figure it’s worth mentioning.

Indirectly fixing bad behaviour

S5 also has some funky JavaScript code, pre-jQuery, which attempts to hide slides other than the one you’re currently looking at. For my presentation (which had some short slides), and with the theme I was using (which didn’t have large a large header or footer like the default theme), this wasn’t working all the time. Oddly enough, sometimes it would work, for a little while. Anyway, there was no need to fix the JavaScript portion - adding .slide { margin-bottom: 1400px; } solved the issue.

As a bonus, it also fixed the problem I was having where slides at the bottom of the page couldn’t be shown correctly. Presumably, this won’t work perfectly on screens taller than 1400 pixels + length of my content, but I don’t know how big of a number I’d need to use to satisfy people with vertical monitors. This might be worth including in ox-s5’s output by default - I have no idea if it has any adverse effects, though.

Edit: Turns out adding this bottom margin globally messes up the print stylesheet, which would have allowed me to easily convert the slideshow into a PDF using Chrome’s print to PDF option (and presumably other browsers can do it too) - without the pain of exporting from Org to LaTeX. With the margin, each slide winds up being on one page when you try to print (if that’s what you want). Normally, the settings for printing are in a file called print.css. If you put the margin-bottom thing in your main theme file, in my case railscast/pretty.css, it works out fine..

Edit 2: If you scroll using the mouse with the margin active, you wind up in empty space. And the arrow keys stop working. So, uh… don’t do that.


And after all that, I finally had a working slideshow. You can see it here, if you want. I realize that these instructions are probably fairly specific to me, but, if I want to make another slideshow in a few months I’ll be happy I wrote them down. And I guess I did learn a bunch about CSS and HTML from a supa pro web dev friend. It was painful at the time, because nothing worked and I had no idea why, but I’m happy with the end result and happy with what I learned.

…However, while preparing this post, I found org-reveal. Which kind of sucks because it looks amazing. Probably because Reveal.js is more modern, org-reveal offers more control over the structure of the exported presentation, to say nothing of the options for visuals and other fancy junk. I mean, I like the look of my presentation - I’m a minimalist. Which is to say I have no sense of design whatsoever and the less design involved, the better. But the setup of S5 means that nice things require editing HTML and CSS, and I know neither. I have no idea how I’d add transitions between slides, for instance. And I can’t specify those things in my Org buffer, like I could with org-reveal.

In other words, this is probably the only time I’ll ever use ox-s5. But I’m glad it exists. The one downside to Reveal.js is that I think it’s what everyone else uses for their presentations at EdmontonPy, and it likewise only has one good colour theme (the default), so if I had used org-reveal there would have been three nearly-identical slideshows in a row. That just seems weird to me.

For the more visually inclined (not me), impress.js exists, and there’s an older package for using it from within Org. It hasn’t been updated for Org 8’s new export engine, though, and since it’s 3000 lines of code, an update could be non-trivial.

The joy of presenting in Emacs (User group presentation III)

Considering I understood decorators before starting the presentation, I didn’t do a lot of research in terms of “learning new stuff”. What I mainly needed were code samples and practical uses, to make a bit of an argument for using decorators at all. So the research was mainly just reading a bunch of articles online and being sad when the coolest one - automatic timeouts for potentially long functions - wouldn’t work on Windows.

No, the real fun part of preparing the presentation was the software side. I decided pretty quickly that if I was going to give a presentation to a bunch of programmers, I may as well show off a bit - so I’d do the presentation in Emacs. If I used Org mode, I could then export the presentation to a wide variety of formats, theoretically with very little effort. I had found a few packages via ELPA for handling presentations (I have a terrible thing for periodically reading the full list of available packages). Sacha had some information on her blog, too. I settled on org-present, because it was simple enough for me to understand as an Org-mode beginner, without preventing me from editing on the fly.

org-present worked flawlessly, so I don’t have a lot to say about it. Though I do wish it could step into some second-level headings (something like Sacha’s code, which I think uses tags, would be more flexible).

The other fun part of this equation was Org Babel - a built-in part of Org that allows you to execute code snippets and embed the results in your document. It does some other neat things for literate programming, which seems cool, but that’s beside the point. The one little thing about Babel is that, normally, you use it to execute the code snippet that your cursor is inside. Because org-present uses narrowing, I knew that each slide would only have one code block, and I didn’t want to manually move my cursor while presenting. Solution: a macro! Incremental search for an opening parens, hit the keys for Babel execution, and switch to an output buffer. I was pretty happy when I got it working.

One small issue with Babel is how it interacts with the Python interpreter. It’s not bad, it’s just… surprising. Babel lets you create an ongoing, dedicated interpreter session so that variables and functions can continue across multiple discrete code blocks. If you don’t do that, everything works the way you’d expect. If you turn it on, suddenly you may get errors due to invisible whitespace and other dumb junk. If you use the session argument and the :results output option (basically, give me whatever the interpreter prints), you unfortunately wind up receiving the interpreter’s prompt and some other junk in your results.

Luckily, a recent addition to Babel allows you to set a function or block of code to perform post-processing on your results. So I wrote a bit of Emacs Lisp to do a regex-replace of “»>” (the default prompt) - check the org source in the presentation repo if you’re interested.

Also, if you’re using fgallina’s python mode (the default as of version 24.3), I’d also recommend not editing code directly within your Org buffer - use C-c ' org-edit-src-code instead. I had an issue where it would continually indent my code, causing the interpreter to spit out errors,and various other buggy behaviour - and it worked fine if I used org-edit-src-code. So do that.

In sum

I know that doesn’t sound like a whole lot of fun. And why didn’t I just make a slideshow like a normal person? Here’s a few completely biased reasons for doing things this way:

  • I didn’t have to touch PowerPoint or fiddle with Prezi (those are the only two things I’ve made presentations in before, and they’re both time-consuming in their own ways - when I started, I didn’t know about slid.es, which everyone else seems to use)
  • I didn’t have to worry about formatting my code or getting syntax highlighting, or embedding screenshots from my editor
  • I got live code evaluation, which I think is inherently great for presenting code - “here’s some code, this is what it’s supposed to do, now let’s see the results”
  • I got free export to a wide variety of formats
  • My presentation is just a plain text file, and it’s easy to search through (for me in the future as a reference, or for others who find it on GitHub)
  • I learned a bunch about Org and a smattering of Emacs Lisp
  • My presentation didn’t look exactly like the other two presentations that were given (the default theme for reveal.js is practically the only good one, but hey, you can have custom transitions so your presentation looks a little bit different from everyone else)

So I’ll admit that those aren’t convincing arguments for why anyone else should present in Emacs, but it’s good enough for me. And you really can’t ignore the emotional value of having a slideshow that didn’t involve PowerPoint.

User group presentation II

The experience

As for the presentation itself, I think it went reasonably well. There were some technical difficulties, which have are on tape for all of eternity. I had about 30 minutes allotted, so it was basically just me talking at the audience and hoping it stuck. Speaking of which, it was a smaller group than normal, because PyCon Canada was at the same time. I think there was a decent mix of experience levels - some very experienced, and at least two early year undergrads.

I would have liked to interact with them a bit more, take more questions about what was or wasn’t making sense - but that’s what tutorials are for. I didn’t spend a lot of time going over the code, but much like the professors who page through slides faster than you can take notes, I knew they could look up the slides later. And I have links to all the stuff that I read to learn about the topic, so there’s that too. I included a couple of plugs for Matt’s book, for obvious reasons. If anything, the best thing I could do is convince them to read that.

Hmm, what else. One person asked me about how I did the presentation in Emacs - I’ll talk more about that in another post. A professor in the computer science department at UofA congratulated me on doing it in the first place, and we chatted about his experience doing live coding. I saw him at a PhD thesis presentation later in the week - hilariously enough, he has either the same laptop as I do (the tablet version, too) or the model from the year prior. I’ll probably write up some notes about that presentation, but, that’s a tale for another time.

I thought the meeting started at 6pm, but it was actually 6:30. On the one hand, that gave me enough time to eat at the pub next door. On the other hand, that gave me just enough time to eat at the pub next door. I walked in, asked if they could prepare anything in 15 minutes, the waitress said yes, and it turned out she was right. During a brief moment of sanity, I started by eating the fries first, but it didn’t last - I tried to eat the burger as fast as possible, and in the process, thoroughly burned most of my mouth. I didn’t feel it until afterwards, but, when I did - ow :(

I got really stuffed up for the next few days, which was really annoying. I figure it was some sort of ineffective response to my burned mouth, but who knows. It kept me from talking to the CS professor when I saw him again, because I didn’t want to make anyone sick. I’m not even sure I was sick, except for one day where I felt terrible. Anyway, I’m sure you don’t care about my suffering. I just wanted to write it down while I still remember.

My first user group presentation

It’s pretty hard to believe that the entire summer has gone by, and I’ll be coming home in less than two weeks. But before that, I did something brave! On Monday, I went way outside my comfort zone and gave a talk at EdmontonPy, the local Python user’s group. The talk was about a specific metaprogramming feature in Python called decorators. If you know what that means, or think you’d like to know, you can check out the project page on GitHub, or jump straight into the GitHub repo for extra goodies.

Anyway, I’m not going to reiterate the content of the talk here. The text is online (I even edited a lot of things after the presentation), as is a rough version of my script, and a recording is on YouTube. That basically covers anything anyone could want. I just thought I’d write up my thoughts about the experience.


Towards the end of June, I started wondering whether I should invest more in my programming skills. I was already learning a lot at work, by necessity, but I thought I could be doing more. I searched for “Ottawa Python”, and found Ottawa Python Author’s Group. Obviously, I then checked to see if there was anything for Edmonton - and there was! So I tentatively decided to attend the July meeting, and managed to follow through on it, too (though I came close to turning around a couple times on the way there).

I enjoyed Daniel Nephin’s talk on itertools, and Aden Grue’s talk about Unicode brought up the one or two Unicode pitfalls I was lucky enough not to trip on already. I chatted for a bit with one of the primary organizers, Brian Forst, who also works at the University of Alberta. While I hadn’t asked my supervisors for permission yet, I’d also gotten particularly excited about the idea of going to PyCon Canada. I asked around, and was directed to (I think - correct me if I’m wrong!) Diana Clarke who has been involved in organizing the most recent PyCons. We chatted for a bit about the conference, and she more or less suggested that I might want to wait until next year and apply for funding of some kind. Didn’t matter in the end, though, because the timing was bad (my supervisors would be getting back from month long trips at the same time).

Anyway! So that was all well and good. As I was walking back to the subway station, obviously inspired, I started reading an ebook I’d bought called Guide to: Learning Python Decorators by Matt Harrison. I got the ebook on Amazon fairly cheaply, but I won’t link it ‘cause he deserves a larger cut of the sales. It’s concise, the writing is clear, and organized beautifully.

It’s laid out in such a way that concepts many people struggle with learning - functions as first class objects, closures - seem to just follow naturally from the content of the previous sections. Even though the majority of the book isn’t literally about decorators, the earlier sections make them much easier to understand. Plus, it turns out that closures are pretty simple and they’re actually really useful.

In other words, there may never be a better explanation of decorators than Matt’s book.

Despite the high quality of the book, upon getting home and finishing the book (it’s no longer than it needs to be), I decided I could probably give a talk on the subject. I must have known at the time that I couldn’t possibly present the topic as well as the book had, but I felt like stretching my boundaries, so I sent off an e-mail volunteering to give a talk in August.

I promptly got an e-mail back saying they already had two talks scheduled, but they’d keep me in mind. They had announced the talks for August, right in front of me, and apparently I forgot five minutes later. Oops. But then a few weeks ago I got an e-mail saying the original presenter was too busy to prepare a talk, and they were looking for volunteers. Woo!

Anyway, I’ll post shortly about how it actually went, and then after that will be a bunch of technical notes that will, some day, show up as search results for the people as frustrated as I was when I prepared my presentation.



If I’ve learned anything from video games, it is that when you meet enemies, it means that you’re going in the right direction.

that’s really inspiring

Also, going the wrong way always leads to treasure.

(though this analogy breaks when you remember that video game dungeons only have one exit, I still like the exploring for treasure bit)

Reflecting on the visit pt 2

Honestly, when I was asking people what to do in Edmonton, I didn’t get a lot of suggestions. Whyte Avenue is close to where I live, and to the university, so a lot of people recommended it. There’s the West Edmonton Mall, obviously (look it up - I’ll wait). After that, most people struggled for a few minutes to come up with things. We did wind up collecting some suggestions for nice places to eat, trails to bike down, etc - but never wound up taking advantage of any of those.

        We did explore Whyte Avenue a bit. The Chapters I mentioned in the last post was the farthest we went, though - about fifteen minutes of walking, maybe. Aside from browsing different small shops, we tried and failed repeatedly to get decent sustenance. We got ice cream at a really disappointing Dairy Queen near the University (it’s by Sobeys, don’t go there). We also had an atrocious milkshake from a place called Mike’s Famous that, as I later learned, tends to mostly serve drunk people (also on Whyte Avenue, and best avoided).

        Then we got dinner at an Irish pub, where the wait for food and our bill was long, and the service was… well, there wasn’t really much service at all. Every patron who wandered in spent five minutes looking for a place to sit, because they give you the liberty of seating yourself. We had a nice spot by the entrance, where we got to watch the confusion first-hand. So that was our evening entertainment, free of charge!

        We went to West Edmonton Mall for an entire day, just shopping and looking for stores that Ottawa doesn’t have. I bought a light cotton hoodie to replace my trusty old XKCD one, now stained one time too many. M- felt that green went well with my complexion, and like most things she tells me about fashion, she was right. She mostly browsed, but tried on one extra-small dress at Suzy Shears that didn’t quite fit. One of the cashiers got the item code for us, though, so she could get her mother’s expert opinion on whether it could be altered to fit. Incidentally, the cashier was a neuroscience student at UofA, and generally a lovely person. She told us we seemed like a great couple, which was cute.

        We actually went back a few days later to see the amusement park. Back to the West Edmonton Mall, I mean - you know it has an amusement park inside, right? And a water park, and a hotel, and two mini-putt places. It was Friday when we went, though, which is apparently a bad idea - that’s when nearby schools send their kids on field trips to the park. The folks at the information booth were kind enough to let us transfer our passes to Saturday, actually, which was pretty smart. Otherwise I’d be telling you about how we wasted sixty bucks!

        Instead, I’m here to tell you that it’s a pretty alright amusement park. Admittedly, it was more to M-’s taste than mine. I’m a fan of variety and medium-ish adrenaline - I’m generally satisfied if I do a roller coaster once, and even then I’m not big on the craziest ones. Neither of those things are true of my wonderful partner in crime. There aren’t really that many rides in the amusement park, actually, so M- did a couple things multiple times while I sat aside and read. I went on most of them once, for her sake. Oh, and we bought all the pictures where we were visible, at least one of which shows us grimacing painfully.

        Eventually we moved on to Southgate Mall, where a new Lego store had opened more than a week ago. They were having a grand opening event this particular weekend: visitors could help build an 8-foot tall statue of Yoda. M- and I contributed one “brick” each (mine constructed with painful slowness), which we built according to instructions out of 39 regularly sized bricks. They were having a prize draw for the 50 people with the best estimates on the number of bricks used in the entire statue, and we spent some time trying to calculate the number. Pretty quickly I gave in to pessimism and let her work it out, which I’m not proud of, but there you go. The actual store itself had a two-hour long line to get in, despite being empty when I was there a week ago. Needless to say, we didn’t wait.

        We took buses to travel to/from the malls, which cost $2.50/person each way. You get a three-hour (I think) transfer slip, but unlike in Ottawa, taking a new bus doesn’t renew your transfer. The buses themselves were a bit less… advanced? than Ottawa - ours have a speaker that declares the next stop, a display for the stop name, and have recently moved to an NFC-enabled bus pass. Luckily for us, it’s obvious when you’ve arrived at the West Edmonton Mall, but we could easily have missed our stop if we were going to a street address.

        We also borrowed bikes from two of the linguistics PhD students. However, M- nor I really knew how to adjust them, and both bikes needed it badly. So we never used them. After M- had left, my landlord and I rode the bikes to campus to return them. At this point, I realized that I hadn’t ridden a bike since 6th grade (plus or minus a year). Also, the helmet didn’t seem to fasten correctly. So while we were riding down the back streets, I was utterly terrified of all the potholes. I went pretty slowly the whole way, and in the end I did survive. But I had to be reminded that the bike had handbrakes and kicking the ground wasn’t the best way to slow down.

        Oh! And we also went to the farmer’s market early Saturday morning. Didn’t buy much, but M- grabbed business cards from the interesting spots. I tried to buy Belgian waffles, except they only took cash, and I had none on me. But one of these days I’ll go and stock up and then have waffles and be happy.

Reflecting on the visit pt 1

Surely you’re asking yourself: how was your girlfriend’s visit, Matt? Well, I’ve got two posts lined up to tell you! This one is a bit more personal, the next one is a bit more about the city itself.

        We hadn’t seen each other for just shy of a month and a half. On April 28th, M- went to Paris with her family. We’d spent an hour or two together the night before, after I finished my last term paper. On their way to the airport, they stopped by for a brief visit. I spent the next few days preparing to leave, then I left for Edmonton on May 1st. We didn’t see each other in the flesh until June 9th.

        It was hardest when she was in Paris, when the time zone difference made it hard to exchange e-mail more than once per day. When they got home, things were better - we could text and IM and Skype, without the distractions of Paris (said if flowery French). But even so, we’d never been apart for more than a few days since we met - we bonded quickly, shared most of our classes, and we worked together over the summer in 2012. So this was a test of our relationship!

        For a variety of reasons, the stars didn’t align for M- to start working until late May. I got a bit excited when I heard of the first delay - perhaps she could visit before starting work! I may have been a bit of a pest for a couple of weeks. When the first good sale came up, she booked the nearest flight that had a reasonable arrival/departure time. I wound up with a week for warning of her visit, but it was a lovely surprise.

        To be honest, we didn’t do anything terribly interesting. We curled up on the couch to finish the fourth season of Adventure Time. Over the course of the week, we caught up on the third season of Game of Thrones (her family has HBO!) We spent an hour in Chapters, browsing the manga, sci-fi and fantasy sections at length.

        We tried to play Final Fantasy: The 4 Heroes of Light in co-op again, only to be utterly baffled after being away from it for months. We laid in bed and held hands and chatted about fanfiction for an hour before going to sleep. We learned about communicating expectations, and that opening my e-mail on my phone and saying “hey, did you see this thing I sent you?” is not the best way to guarantee an answer. Read receipts are way better - I’m using Boomerang for Gmail now.

        I managed to convince her to make use of the Pokemon TCG cards I’d bought and left in Ottawa for her (one pack of cards for every week that I’m away!). Or, at least, she decided she could suffer a little to make me happy. At any rate, we played two games, and I was right in the end - she enjoyed herself and asked if we could play again in the future. Though I suspect we’ll need to beef up our decks a bit, because our second game was painfully long. But with that fixed, this may be our activity when we sync up on weekends from now on.

        I think it was good for us to be on our own for a week! We cooked together and did dishes together. We ate more dessert than we should have. It was, generally, a lot like living together. We managed fairly well! Granted, it’s nicer by far to be home with my parents, or with hers. But we didn’t get in each other’s way, and nobody died - both good signs. It was lovely to see her again, truly. I got sad during our last evening together, but like usual, she cheered me up pretty quickly. I did have trouble getting back into the rhythm of a full workday, but now I’m feeling pretty good. Only two months until we see each other again! I can manage that. I think.

A visitor appears!

A week ago (published Tuesday), I wrote:

The hardest part, I think, is being far away from my girlfriend. … She’s going to visit in July, as a birthday gift from her parents.

But then my mom sent me an e-mail about a sale on flights, which I duly forwarded. Then at 9am on June 5th, I received this text message:

How’s this for a visit: June 10th to 16th?

Hmm, let me think about that… I sent back another message to make sure she didn’t mean July, and she said yes. So I replied with the only acceptable answer: that would be fantastic! The final booking is for her to arrive tomorrow morning at 9:30am local time, so I’ll be taking a shuttle to the airport in the morning.

So instead of writing more tumblr posts tomorrow, I’ll be spending time with my beloved. If she’s feeling tired, I might do both of those things at the same time. Anyway, figured y’all Internet folks should know. We’ll be borrowing bikes from some of my colleagues (both of whom said “I really should use my bike more often, but you can borrow it for a week”) and seeing the sights. I’ve got permission to work half-days next week, and there’s some room at the office for her to work on her own stuff.

I’ll put up a list of stuff we did around the city when all’s said and done, assuming we actually do anything. Most people I’ve asked have only been able to think of one or two things to do here, so the least I can do is show that there are, in fact, options.

A month in Edmonton pt 2

        As far as work goes, I’m learning a lot of valuable stuff about natural language processing! I’ve been attending weekly meetings of the NLP research group, and going to AI seminars when the topic seems interesting. I’ll put up some notes from the good ones, I think. Anyway, I’ve been writing a lot of Python code, some of which I think is quite nice. I’ve learned how to process XML data with Python’s iterparse(), which is far more intuitive than any of the DOM-esque approaches I’ve looked at in the past. XML had never really “clicked” with me before this. I’ve also been parsing command line arguments for the first time, using argparse. Similar to the XML thing, I looked at optparse when I first started with Python 2.6, and it seemed sucky. Maybe argparse is a big improvement, or maybe I’m just “better” than I was then - either way, it’s a good skill to have.

        One other thing I’ve learned is that I hate working on things that don’t seem like they’re going to do any good. There was a period of a week or two where I was struggling to get to a point where we could evaluate the real-world performance of some programs we were looking at (more on this in another post). In the interim, I tested the programs on data from English, and the results were really not good. It later turned out that my calculation of the results was wrong (I tried to be Pythonic at the wrong time), and that a non-sensical tweak vastly improved the results.

        But even though the results did get a bit better, I got really demotivated, because I knew I had to keep working on the task. But I also thought that I already knew how it was going to turn out (badly), and felt like I was wasting my time. In the end, things were better than I expected, and we’re back to making forward progress - but it was sucky for a little bit.

        About two weeks ago, I worked up the courage to e-mail the university’s fencing club. I kinda figured I’d never get a response, but it turns out they answer their e-mails pretty quickly! So last week I went out to practice with them, got introduced to everyone, and so on. First, everyone there seems cool (not being facetious, I mean I should hang out with them some time). Second, my co-worker also fences, which is hilariously improbable. Third, man am I out of shape after not fencing for eight months. I could probably fence a few bouts to 15 a year ago, and last week I practically collapsed after five bouts to 3. This week we did drills, and I got some perfectly deserved advice/criticism from the foil coach. But I felt really, really good as I was walking home after practice. It’s nice to be back.

        The hardest part, I think, is being far away from my girlfriend. For as long as we’ve known each other, we’ve generally spent a significant portion of our time together. We text each other daily, chat on the phone every couple of days, and spend an hour or two on Skype watching Adventure Time on the weekends. We’ve got about half of Season 4 left to watch, then it’s probably on to the newest season of Game of Thrones. But anyway, it’s still a lot less time together than I’m used to.

        She’s going to visit in July, as a birthday gift from her parents. Which is sort of the most boring part of the summer, because her birthday is in June, while August has Animethon and my birthday. It’s the best time logistically, but still. I don’t think we’ll be able to scrounge up funds for a second trip, anyway.

        But I’m fine! Life is pretty good. I’ve got summer projects planned, but I don’t know which ones I’ll follow through on. Some things to get ready for September. I’ve got some physical and social activity outside of work. So stop asking me if I regret accepting this job every time we talk! glare