November 2015

Weekly review: Week ending October 30, 2015

November 1, 2015 - Categories: review, weekly

This was a good week for making things. I coded a bunch of patterns and capabilities in the Python-based sewing pattern generator I’ve been tinkering around with. Now that I can easily rescale patterns and set measurements from the command-line, I can create paper models to test ideas. It was fun doing the math for rotating points and doing simple dart manipulation, too. In addition to programming, I also finished the mass production phase of one of my sewing projects. Yay!

Good cooking this week, too. We tried this General Tsao Chicken recipe – our first time to double-fry – and it was yummmmmy. I made a pan of lasagna, too.

The Latin 101 video course I’d checked out from the library turned out to have a few errors in the guidebook, so I’ve been using a combination of that and Wheelock’s Latin for practice. It’s fun feeling things start to make sense.

W- and I started a new playthrough of Borderlands 2, the shooter/RPG we’ve been playing for a few months now. We picked different characters, so we’ve been adapting to the new playstyles required.

Some fuzziness and tiredness, but such is life. Taking it easy. =)

2015-11-01b Week ending 2015-10-30 -- index card #journal #weekly output

Blog posts

Sketches

Link round-up

  • Business (29.7h – 17%)
    • Earn (10.0h – 33% of Business)
      • Attend scraper meeting
      • Prepare invoice
    • Build (13.3h – 44% of Business)
      • Drawing (1.0h)
      • Paperwork (0.4h)
        • Include September bank statements
        • Finalize return
    • Connect (6.3h – 21% of Business)
  • Relationships (3.1h – 1%)
  • Discretionary – Productive (16.4h – 9%)
    • Emacs (2.6h – 1% of all)
      • Do another Emacs review
      • Do another Emacs review
    • Sewing (5.0h)
      • Add scale to tmtp
      • Try papercraft tmtp with my measurements
      • Programmatically rescaling and manipulating the darts in sewing patterns
      • Add SVG splitter to tmtp
      • Add seam allowances to tmtp
      • Sanity-check with someone else’s basic bodice block instructions
      • Python + sewing: Making basic shapes and splitting up larger patterns
      • Circle skirt pattern
      • Box tote pattern
      • Sew box tote prototype
    • Writing (2.0h)
    • Do a chapter of Wheelock’s Latin
    • Send in form
  • Discretionary – Play (17.1h – 10%)
  • Personal routines (30.7h – 18%)
  • Unpaid work (9.9h – 5%)
  • Sleep (61.1h – 36% – average of 8.7 per day)

2015-11-02 Emacs News

November 2, 2015 - Categories: emacs, emacs-news, review

Previous roundup – Links from reddit.com/r/emacs, planet.emacsen.org, and Youtube

Monthly review: October 2015

November 3, 2015 - Categories: monthly, review

What a month for learning and making. =)

I think I’m starting to get the hang of asynchronous programming using the Q library for Javascript, with its ability to defer execution and pass values along. After I sorted out the mistakes I made while coding – such as returning the deferred object instead of the promise, or doing a convoluted promise instead of using q(…) to simplify handling either return values or promises – things made sense.

I used d3 to sketch one of the little visualizations I’ve been thinking about doing for my consulting client for a while now. It was well-received. I should get back to it and make it interactive.

Also, tech-wise: nudged by John Wiegley, I’ve started summarizing new Emacs-related resources from planet.emacsen.org, reddit.com/r/emacs, and Youtube.

I’ve been getting my business papers together in preparation for another tax return, and my notes from last year have been helpful. I’ve added more notes, so maybe next year will be even easier. The more I write down, the better things are for my future self.

In terms of sewing, I’ve gotten a bit more comfortable with the mathematics and programming involved in creating parametric sewing patterns using the Python framework I started playing around with some time ago. I’ve also moved into the mass production phase for some of the projects I’ve been working – well, not really mass production, but quite a few multiples of patterns that look like they’ll work out nicely.

Slow and steady progress through the Latin textbooks. I’m starting to get the hang of the first to third declensions, I think, and some of the types of verbs as well. It’s amusing to discover these little things about the phrases we’re so familiar with. In caveat emptor, caveat is the subjuctive of caveo (beware), so caveat is “let him/her/it beware”. Cave – from cave canem – is the imperative, “Beware!” Little things. =)

We cleared out the garden and got it ready for winter. The irrigation system was very helpful, keeping things surprisingly alive and thriving despite my neglect. We didn’t get as much out of it as we probably could have, but it was nice to have had a few bitter melons, a good supply of peas, and the surprise of a huge bok choy.

Lots of playing Borderlands 2: going through the downloadable content, and trying out a new character. W- and I have settled into a comfortable routine of playing an hour or two (and sometimes more) of Borderlands late at night, and then reading a bit before bed.

It’s been great being able to think clearly again, mostly. It’s probably more likely for me to assume fuzziness rather than clarity as the default. I wonder what I can put into place now so that later will be easier.

Let’s see what November will be like. It’s pretty cool to see the progression of months, each an unexpectedly full gift. Day by day, I know it adds up, but it’s still surprising.

2015-11-01c October 2015 -- index card #journal #monthly #review output

Blog posts

Sketches

Time

Category Last month % This month % Avg h per week Delta (h/wk)
Business – Earn 5.9 11.2 19 8.9
Business – Connect 0.5 1.1 2 1.0
Discretionary – Family 2.1 2.6 4 0.8
Personal 19.7 20.0 34 0.5
Business – Build 3.1 3.2 5 0.2
Discretionary – Social 0.4 0 0 -0.7
Discretionary – Productive 11.7 11.2 19 -0.8
Discretionary – Play 8.3 6.9 12 -2.4
Unpaid work 7.8 6.3 11 -2.5
Sleep 40.5 37.4 63 -5.2

A lot more consulting than I expected. The projects were useful and fun, so it was easy to work on that instead of other things. I thought I spent more time cooking and tidying, too, but the numbers don’t agree. Mmm. My time sense is a bit off for month-long spans, even though the days and the weeks make sense. Ah well, that’s why there’s data! =)

Capturing links quickly with emacsclient, org-protocol, and Chrome Shortcut Manager on Microsoft Windows 8

November 4, 2015 - Categories: emacs, org

UPDATE 2015-11-30: Well, that bitrotted quickly! Chrome Shortcut Manager is no longer available, but maybe Shortkeys will work instead.

Since I’ll be snipping lots of Emacs-related resources and organizing them into Emacs news roundups, I figured it was time to get org-protocol working.

Step 1: Get emacsclient to work

I was getting the error “No connection could be made because the target machine actively refused it.” I needed to change my Windows Firewall rules. From the Windows Firewall screen, I clicked on Advanced settings and chose Inbound Rules. On the Programs and Services tab, I confirmed that the right Emacs binary was selecI looked for the rules for GNU Emacs, consolidating them down to two rules (UDP and TCP). I limited the scope to local/remote 127.0.0.1. On the advanced tab, I selected all the profiles and changed edge traversal to blocked.

I was still getting the error despite a fresh M-x server-start. After I deleted the contents of ~/.emacs.d/server and did another M-x server-start. When I ran emacsclient test.txt from the command-line, it correctly opened the file in my existing Emacs instance. Hooray!

Step 2: Load org-protocol

I added org-protocol to the org-modules variable so that Org would load it when Emacs reaches the (org-load-modules-maybe t) in my config. Since I didn’t want to restart Emacs, I also evaluated (load-library "org-protocol") to load it.

Step 3: Register the protocol

I ran an org-protocol.reg that set up the appropriate org protocol entry:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\org-protocol]
"URL Protocol"=""
@="URL:Org Protocol"

[HKEY_CLASSES_ROOT\org-protocol\shell]

[HKEY_CLASSES_ROOT\org-protocol\shell\open]

[HKEY_CLASSES_ROOT\org-protocol\shell\open\command]
@="\"c:\\Program Files (x86)\\GNU Emacs 24.4\\bin\\emacsclientw.exe\"  \"%1\""

You can find a similar one in the org-protocol documentation.

Step 4: Add support to Chrome

I wanted something a bit different from the org-capture extensions available for Chrome. In particular, I wanted:

  • a keyboard-friendly way to quickly store a link
  • a keyboard-friendly way to capture a link with some notes

The Shortcut Manager extension for Chrome lets you specify your own keyboard shortcuts for running short Javascript. Inline Javascript doesn’t work on all sites. For example, Github blocks it with the following error: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src assets-cdn.github.com". Either the 'unsafe-inline' keyword, a hash ('...'), or a nonce ('nonce-...') is required to enable inline execution. Still, it works for many sites, so it’s a start. Here are the shortcuts I put together.

l Store link
L Store link (prompt for title, default to selection or document title)
c Capture link (prompt for template)

You can import them by going to Chrome’s More Tools > Extensions screen and choosing the Options link for Shortcut Manager. From there, use Import settings.

// ==UserScript==
// @ShortcutManager
// @name Store link
// @namespace XPrUJhE4wRsC
// @key l
// @include *
// ==/UserScript==
var storeLink = function(){
  var selection = window.getSelection().toString();
  var uri = 'org-protocol://store-link://' +
        encodeURIComponent(window.location.href) + '/' +
        encodeURIComponent(selection || document.title);
  window.location = uri;
  return uri;
};
storeLink();

// ==UserScript==
// @ShortcutManager
// @name Capture link
// @namespace XPrUJhE4wRsC
// @key c
// @include *
// ==/UserScript==
var captureLink =function(){
  var uri = 'org-protocol://capture://' +
        encodeURIComponent(window.location.href) + '/' +
        encodeURIComponent(document.title) + '/' +
        encodeURIComponent(window.getSelection().toString());
  window.location = uri;
  return uri;
};
captureLink();


// ==UserScript==
// @ShortcutManager
// @name Store link with prompt
// @namespace XPrUJhE4wRsC
// @key Shift+l
// @include *
// ==/UserScript==
var storeLinkWithPrompt = function(){
  var selection = window.getSelection().toString();
  var uri = 'org-protocol://store-link://' +
        encodeURIComponent(window.location.href) + '/' +
        encodeURIComponent(window.prompt('Title', selection || document.title));
  window.location = uri;
  return uri;
};
storeLinkWithPrompt();

Shortcut Manager looks like a really useful extension. Here are some other shortcuts I set up:

x close the current tab
r reload (cacheless)
t open a new tab
n select the right tab
p select the left tab
b back
f forward

Step 5: Add shortcuts for managing stored links

I added my/org-insert-link and org-insert-last-stored-link to my main hydra, which is on my hh keychord. my/org-insert-link is like org-insert-link, except it adds a newline if the cursor is at an Org link so that we don’t trigger org-insert-link‘s behaviour of editing links.

(defun my/org-insert-link ()
  (interactive)
  (when (org-in-regexp org-bracket-link-regexp 1)
    (goto-char (match-end 0))
    (insert "\n"))
  (call-interactively 'org-insert-link))

(key-chord-define-global "hh"
                         (defhydra my/key-chord-commands ()
                           "Main"
                           ;; ...
                           ("L" my/org-insert-link)
                           ("l" org-insert-last-stored-link)
                           ;; ...
                           ))

This lets me quickly insert a bunch of links with a key sequence like h h l l l l or select a link to insert with h h L. C-y (yank) pulls in the URL of the last stored link, too.

Let’s see how this works out!

Weekly review: Week ending November 6, 2015

November 8, 2015 - Categories: review, weekly

It was warmer and sunnier than usual, which felt great. Lots of long walks, and even a sunny afternoon on the deck.

More interactions with people, too. I made it out to Hacklab and helped with Tuesday’s dinner. On Friday, another friend dropped by and we went for a walk in the park.

Lots of coding this week. More progress on the scraper I’ve been working on, and some ideas for other prototypes my clients want me to build. Whee! Some fun on the Emacs front, too. I finally set up org-protocol, and I’m looking forward to playing with more integration points.

I filed my corporate taxes, yay! I’d done most of the figuring out in September before my fiscal year end, so it was mostly a matter of updating the numbers with the final statements from the bank and doublechecking all the calculations before submitting it to the government. Looks like everything’s good.

I might tilt the balance towards consulting a little bit more over the next couple of months. There are a few projects that might be interesting to pull off, and the team would probably find them very helpful. I can move the time from things like Latin and sewing, which I can reduce without much of a tradeoff.

Onward!

2015-11-08b Week ending 2015-11-06 -- index card #journal #weekly output

Blog posts

Sketches

Focus areas and time review

  • Business (24.9h – 14%)
    • Earn (13.0h – 52% of Business)
      • Prepare invoice
      • Do monthly data dump
      • Start second scraper
      • Draft browsing interface
    • Build (8.4h – 33% of Business)
      • Drawing (0.0h)
      • Paperwork (2.5h)
        • Include September bank statements
        • Do Paypal USD conversion
        • Do HST quicktax calculation
        • Credit personal amounts
        • Doublecheck prepaid expenses
        • Write reimbursement cheque
        • Finalize return
        • File federal return
        • File HST return
        • Set up quarterly payments
    • Connect (3.5h – 14% of Business)
  • Relationships (9.3h – 5%)
    • Have dimsum with family
    • Hang out with Jen
  • Discretionary – Productive (12.3h – 7%)
    • Emacs (2.8h – 1% of all)
      • Do another Emacs review
      • Set up a nested hydra
      • Play with melpa stats
      • Update missing podcast episode
    • Sewing (1.2h)
    • Writing (1.4h)
    • Check out Stoic Week
    • Update Quantified Awesome goals
    • Rake leaves
    • Investigate library xml dump
    • Check out Stoic Week
    • Do another Emacs review
  • Discretionary – Play (26.0h – 15%)
  • Personal routines (21.0h – 12%)
  • Unpaid work (9.4h – 5%)
  • Sleep (66.1h – 39% – average of 9.4 per day)

2015-11-09 Emacs News

November 9, 2015 - Categories: emacs, emacs-news, review

Links from reddit.com/r/emacs, Hacker News, planet.emacsen.org, Youtube, and the Emacs commit log.

Past Emacs News round-ups

Weekly review: Week ending November 13, 2015

November 15, 2015 - Categories: review, weekly

That was a very full week. Lots of coding!

The Toronto Public Library sent some pre-hackathon resources before the weekend’s event. I had fun going through the CSVs and data feeds available on the hackathon data page. The XML file was a little unwieldy and undocumented (20GB uncompressed), so I wrote a few scripts to explore the data. I’m looking forward to digging into that catalogue snapshot over the next few weeks, when things settle down a bit more.

I added some code to my Emacs config to make it easier to create, select, and clock in on tasks. Actually, most of the code was already there, I’d just forgotten it existed. As a result of the code, I’ve been tracking my time and planning my days in even more detail. It’s neat to have the task-level reminders of what I was working on that day, not just the high-level categories I’d been tracking through Quantified Awesome.

I’ve been updating the EmacsWiki too, thanks to requests from johnw and other community members. It’s nice to organize information and flesh out notes.

In terms of consulting, I’ve been working with NodeJS and Angular. Angular programming was a bit slow in the beginning since I hadn’t used it in a while, but every time I try it out, I become a little more comfortable with it. I’ve been getting the hang of using Jasmine to write automated tests for my command-line tools, too, which is a handy practice.

I sewed another peasant top, since they’re so comfortable. A couple more, and I’ll be set for the week.

Social-wise, I’m still feeling rather introverted. I’m okay with that, though, and I don’t want to push myself too far.

I tilted the balance towards work and coding a lot more this week. It was great for momentum, although I ended up being a little tired afterwards. Maybe something in between would be good. I felt like I didn’t get a lot of sleep, although my time records say I did. Maybe it was more about having a series of morning appointments? Anyway, something to play with next week. I’ll take this week a little easier, I think.

2015-11-16c Week ending 2015-11-13 -- index card #journal #weekly output

Blog posts

Sketches

Focus areas and time review

  • Business (37.8h – 22%)
    • Earn (32.1h – 84% of Business)
      • Rewrite to use pg backend
    • Build (4.7h – 12% of Business)
      • Drawing (2.6h)
      • Paperwork (0.0h)
      • Learn how to do a geographic visualization
      • Investigate library xml dump
      • Braindump: exploring neighbourhood libraries, and other notes from the Toronto Public Library Hackathon
      • Convert to client-side code
    • Connect (0.9h – 2% of Business)
  • Relationships (6.8h – 4%)
    • Have dimsum with family
    • Meet with M
  • Discretionary – Productive (8.1h – 4%)
    • Emacs (4.0h – 2% of all)
      • Organize Emacs Hangout
      • Update missing podcast episode
      • Do another Emacs News review
      • Set up Emacs News mailing list
      • Set up hydra for quick logging of Quantified Awesome things
      • Burn backup of Emacsconf videos
      • Figure out what’s going on with my org mode HTML export and targets
      • Update CUSTOM_ID in my config
      • Host Emacs Hangout
    • Rake leaves
    • Check out Stoic Week
    • Memorize Latin pronouns
    • Brainstorm improvements for fuzzy brain
    • Renew pet licence
    • Set up rsync backup
    • Sewing (2.1h)
    • Writing (1.2h)
  • Discretionary – Play (18.2h – 10%)
  • Personal routines (26.2h – 15%)
  • Unpaid work (8.0h – 4%)
  • Sleep (62.9h – 37% – average of 9.0 per day)

Exploring neighbourhood libraries and other notes from the Toronto Public Library Hackathon

November 16, 2015 - Categories: development, geek, kaizen

UPDATE 2015-11-30: Here’s the Toronto Public Library’s recap, along with other videos.

UPDATE 2015-11-27: Here’s the video of my hackathon pitch:

UPDATE 2015-11-18: I figured out how to make this entirely client-side, so you don’t have to run a separate server. First, install either Tampermonkey (Chrome) or Greasemonkey (Firefox). Then install the user script insert-visualize-link.user.js , and the Visualize link should appear next to the library branch options on Toronto Public Library search result pages. See the Github repository for more details.

Yay! My neighbourhood library visualization won at the Toronto Public Library hackathon. It added a Visualize link to the search results page which mapped the number of search results by branch. For example, here’s a visualization of a search that shows items matching “Avengers comics“.

avengers

It’s a handy way to see which branches you might want to go to so that you can browse through what’s there in person.

Librarians could also use it to help them plan their selections, since it’s easy to see the distribution across branches. For example, here’s the visualization for books in Tagalog.

tagalog

The collections roughly match up with Wellbeing Toronto‘s data on Tagalog as the home language, although there are some areas that could probably use collections of their own.

tagalog census

Incidentally, I was delighted to learn that Von Totanes had done a detailed analysis of the library’s Filipino collections in the chapter he wrote in Filipinos in Canada: Disturbing Invisibility (Coloma, McElhinny, and Tungohan, 1992). Von sent me the chapter after I mentioned the hackathon on Facebook; yay people bumping into other people online!

Personally, I’m looking forward to using this visualization to see things like which branches have new videos. Videos released in the past year can only be borrowed in person – you can’t request them online – so it’s good to check branches regularly to see if they’re there. It would be even better if the library search engine had a filter for “On the shelf right now”, but in the meantime, this visualization tool gives me a good idea of our chances of picking up something new to watch while we’re folding laundry. =)

Notes

https://github.com/sachac/explore-neighbourhood-libraries

More notes will probably follow, but here are a few quick drawings:

2015-11-15b Tech - Exploring neighbourhood libraries -- index card #tpl #hackathon

2015-11-15b Tech – Exploring neighbourhood libraries – index card #tpl #hackathon

2015-11-15c Kaizen and the Toronto Public Library hackathon -- index card #tpl #hackathon #kaizen #improvement

2015-11-15c Kaizen and the Toronto Public Library hackathon – index card #tpl #hackathon #kaizen #improvement

2015-11-15d Other reflections from TPL hackathon -- index card #tpl #hackathon #introversion #prototyping #presenting

2015-11-15d Other reflections from TPL hackathon – index card #tpl #hackathon #introversion #prototyping #presenting

2015-11-15e Ideas for following up on TPL hackathon -- index card #prototyping #tpl #hackathon

2015-11-15e Ideas for following up on TPL hackathon – index card #prototyping #tpl #hackathon

 

The code works by extracting the branch names and totals on the left side of search pages and combining those with the locations of the branches (KML). I don’t really need the server component, so I’m thinking of rewriting the script so that it runs entirely client-side – maybe as a Chrome extension or as a user script. That way, other people can play with the idea without running their own server (and without my having to keep a server around), and we can try it out without waiting for the library to integrate it into their website. That said, it would be totally awesome to get it into the interface of the Toronto Public Library! We’ll just have to see if it can happen. =) Happy to chat with library geeks to get this sorted out.

It was fun working on this. W- decided to join me at the last minute, so it turned into a fun weekend of hanging out with my husband at the library. I wanted to keep my weekend flexible and low-key, so I decided not to go through the team matchmaking thing. W- found some comfy chairs in the corner of the area, I plugged in the long extension cord I brought, and we settled in.

I learned a lot from the hackathon mentors. In particular, I picked up some excellent search and RSS tips from Alan Harnum. You can’t search with a blank query, but he showed me how you can start with a text string, narrow the results using the facets on the left side, and then remove the text string from the query in order to end up with a search that uses only the facets. He also showed me that the RSS feed had extra information that wasn’t in the HTML source and that it could be paginated with URL parameters. Most of the RSS feeds I’d explored in the past were nonpaginated subsets of the information presented on the websites, so it was great to learn about the possibilities I had overlooked.

The faceted search was exactly what I needed to list recent videos even if I didn’t know what they were called, so I started thinking of fun tools that would make hunting for popular new videos easier. (There have been quite a few times when I’ve gone to a library at opening time so that I could snag a video that was marked as available the night before!) In addition to checking the specific item’s branch details to see where it was on the shelf and which copies were out on loan, I was also curious about whether we were checking the right library, or if other libraries were getting more new videos than our neighbourhood library was.

W- was curious about the Z39.50 protocol that lets you query a library catalogue. I showed him the little bits I’d figured out last week using yaz-client from the yaz package, and he started digging into the protocol reference. He figured out how to get it to output XML (format xml) and how to search by different attributes. I’m looking forward to reading his notes on that.

Me, I figured that there might be something interesting in the visualization of new videos and other items. I hadn’t played around a lot with geographic visualization, so it was a good excuse to pick up some skills. First, I needed to get the data into the right shape.

Step 1: Extract the data and test that I was reading it correctly

I usually find it easier to start with the data rather than visualizations. I like writing small data transformation functions and tests, since they don’t involve complex external libraries. (If you miss something important when coding a visualization, often nothing happens!)

I wrote a function to extract information from the branch CSV on the hackathon data page, using fast-csv to read it as an array of objects. I tested that with jasmine-node. Tiny, quick accomplishment.

Then I worked on extracting the branch result count from the search results page. This was just a matter of finding the right section, extracting the text, and converting the numbers. I saved a sample results page to my project and used cheerio to parse it. I decided not to hook it up to live search results until I figured out the visualization aspect. No sense in hitting the library website repeatedly or dealing with network delays.

Step 2: Make a simple map that shows library branches

I started with the Google Maps earthquake tutorial. The data I’d extracted had addresses but not coordinates. I tried using the Google geocoder, but with my rapid tests, I ran into rate limits pretty early. Then it occurred to me that with their interest in open data, the library was the sort of place that would probably have a file with branch coordinates in terms of latitude and longitude. The hackathon data page didn’t list any obvious matches, but a search for Toronto Public Library KML (an extension I remembered from W-‘s explorations with GPS and OpenStreetMap) turned up the file I wanted. I wrote a test to make sure this worked as I expected.

Step 3: Combine the data

At first I tried to combine the data on the client side, making one request for the branch information and another request for the results information. It got a bit confusing, though – I need to get the hang of using require in a from-scratch webpage. I decided the easiest way to try my idea out was to just make the server combine the data and return the GeoJSON that the tutorial showed how to visualize. That way, my client-side HTML and JS could stay simple.

Step 4: Fiddle with the visualization options

Decisions, decisions… Red was too negative. Blue and green were hard to see. W- suggested orange, and that worked out well with Google Maps’ colours. Logarithmic scale or linear scale? Based on a maximum? After experimenting with a bunch of options, I decided to go with a linear scale (calculated on the server), since it made sense for the marker for a branch with a thousand items to be significantly bigger than a branch with five hundred items. I played with this a bit until I came up with maximum and minimum sizes that made sense to me.

Step 5: Hook it up to live search data

I needed to pass the URL of the search results, and I knew I wanted to be able to call the visualization from the search results page itself. I used TamperMonkey to inject some Javascript into the Toronto Public Library webpage. The library website didn’t use JQuery, so I looked up the plain-vanilla Javascript way of selecting and modifying elements.

document.querySelector('#refinements-library_branch')
  .parentNode.querySelector('h3').innerHTML =
  'Library Branch <a target="_blank" style="color: white; ' +
  'text-decoration: underline" ' +
  'href="http://localhost:9000/viz.html?url=' +
  encodeURIComponent(location.href) + '">(Visualize)</a>';

Step 6: Tweak the interface

I wanted to display information on hover and filter search results on click. Most of the tutorials I saw focused on how to add event listeners to individual markers, but I eventually found an example that showed how to add a listener to map.data and get the information from the event object. I also found out that you could add a title attribute and get a simple tooltip to display, which was great for confirming that I had the data all lined up properly.

Step 7: Cache the results

Testing with live data was a bit inconvenient because of occasional timeouts from the library website, so I decided to cache search results to the filesystem. I didn’t bother writing code for checking last modification time, since I knew it was just for demos and testing.

Step 8: Prettify the hover

The tooltip provided by title was a little bare, so I decided to spend some time figuring out how to make better information displays before taking screenshots for the presentation. I found an example that showed how to create and move an InfoWindow based on the event’s location instead of relying on marker information, so I used that to show the information with better formatting.

Step 9: Make the presentation

Here’s how I usually plan short presentations:

  1. Figure out the key message and the flow.
  2. Pick a target words-per-minute rate and come up with a word budget.
  3. Draft the script, checking it against my word budget.
  4. Read the script out loud a few times, checking for time, tone, and hard-to-say phrases.
  5. Annotate the script with notes on visual aids.
  6. Make visuals, take screenshots, etc.
  7. Record and edit short videos, splitting them up in Camtasia Studio by using markers so that I can control the pace of the video.
  8. Copy the script (or keywords) into the presenter’s notes.
  9. Test the script for time and flow, and revise as needed.

I considered two options for the flow. I could start with the personal use case (looking for new videos) and then expand from there, tying it into the library’s wider goals. That would be close to how I developed it. Or I could start with one of the hackathon challenges, establish that connection with the library’s goals, and then toss in my personal use case as a possibly amusing conclusion. After chatting about it with W- on the subway ride home from the library, I decided to start with the second approach. I figured that would make it easier for people to connect the dots in terms of relevance.

I used ~140wpm as my target, minus a bit of a buffer for demos and other things that could come up, so roughly 350 words for 3 minutes. I ran through the presentation a few times at home, clocking in at about 2:30. I tend to speak more quickly when I’m nervous, so I rehearsed with a slightly slower pace. That way, I could get a sense of what the pace should sound like. During the actual presentation, though, I was a teensy bit over time – there was a bit of unexpected applause. Also, even though I remembered to slow down, I didn’t breathe as well as I probalby should’ve; I still tend to breathe a little shallowly when I’m on stage. Maybe I should pick a lower WPM for presentations and add explicit breathing reminders. =)

I normally try to start with less material and then add details to fit the time. That way, I can easily adjust if I need to compress my talk, since I’ve added details in terms of priority. I initially had a hard time concisely expressing the problem statement and tying together the three examples I wanted to use, though. It took me a few tries to get things to fit into my word budget and flow in a way that made me happy.

Anyway, once I sorted out the script, I came up with some ideas for the visuals. I didn’t want a lot of words on the screen, since it’s hard to read and listen at the same time. Doodles work well for me. I sketched a few images and created a simple sequence. I took screenshots for the key parts I wanted to demonstrate, just in case I didn’t get around to doing a live demo or recording video. That way, I didn’t have to worry about scrambling to finish my presentation. I could start with something simple but presentable, and then I could add more frills if I had time.

Once the static slides were in place, I recorded and edited videos demonstrating the capabilities. Video is a nice way to give people a more real sense of how something works without risking as many technical issues as a live demo would.

I had started with just my regular resolution (1366×768 on my laptop) and a regular browser window, but the resulting video was not as sharp as it could have been. Since the presentation template had 4:3 aspect ratio, I redid the video with 1024×768 resolution and a full-screen browser in order to minimize the need for resizing.

I sped up boring parts of the video and added markers where I wanted to split it into slides. Camtasia Studio rendered the video into separate files based on my markers. I added the videos to individual slides, setting them to play automatically. I like the approach of splitting up videos onto separate slides because it allows me to narrate at my own pace instead of speeding up or slowing down to match the animation.

I copied the segments of my script to the presenter notes for each slide, and I used Presenter View to run through it a few more times so that I could check whether the pace worked and whether the visuals made sense. Seemed all right, yay!

Just in time, too. I had a quick lunch and headed off to the library for the conclusion of the hackathon.

There wsa a bit of time before the presentations started. I talked to Alan again to show him what I’d made, hear about what he had been working on, and pick his brain to figure out which terms might resonate with the internal jargon of the library – little things, like what they call the people who decide what kinds of books should be in which libraries, or what they call the things that libraries lend. (Items? Resources? Items.) Based on his feedback, I edited my script to change “library administrators” to “selection committees”. I don’t know if it made a difference, but it was a good excuse to learn more about the language people used.

I tested that the presentation displayed fine on the big screen, too. It turned out that the display was capable of widescreen input at a higher resolution than what I’d set, but 1024×768 was pretty safe and didn’t look too fuzzy, so I left it as it was. I used my presentation remote to flip through the slides while confirming that things looked okay from the back of the room (colours, size, important information not getting cut off by people’s heads, etc.). The hover text was a bit small, but it gave the general idea.

And then it was presentation time. I was third, which was great because once I finished, I could focus on other people’s presentations and learn from their ideas. Based on W-‘s cellphone video, it looks like I remembered to use the microphone so that the library could record, and I remembered to look up from my presenter notes and gesture from time to time (hard when you’re hidden behind the podium, but we do what we can!). I stayed pretty close to my script, but I hope I kept the script conversational enough that it sounded more like me instead of a book. I didn’t have the mental bandwidth to keep an eye on the timer in the center of the presenter view, but fortunately the time worked out reasonably well. I concluded just as the organizer was getting up to nudge me along, and I’d managed to get to all the points I wanted to along the way. Whew!

Anyway, that’s a quick braindump of the project and what it was like to hack it together. I’ll probably write some more about following up on ideas and about other people’s presentations, but I wanted to get this post out there while the experience was fresh in my head. It was fun. I hope the Toronto Public Library will take the hackathon ideas forward, and I hope they’ll get enough out of the hackathon that they’ll organize another one! =)

2015-11-16 Emacs News

November 16, 2015 - Categories: emacs, emacs-news

Links from reddit.com/r/emacs, Hacker News, planet.emacsen.org, Youtube, the Emacs commit log, and the changes to the Emacs NEWS file.

Past Emacs News round-ups

2015-11-18 Emacs Hangout

November 18, 2015 - Categories: emacs

Coding, e-mail, LaTeX, and more. Enjoy!

Event page: https://plus.google.com/events/cpef1jv0oq673aneiigh7q5n7lk

Timestamps:

  • 0:02 Podcasts
  • 0:03 sweetgreen – ordering salad
  • 0:14 Windows
  • 0:16 exwm – emacs window manager
  • 0:18 Android development
  • 0:21 Org Mode
  • 0:25 mail, search, notmuch, mairix, filtering, Gmail tabs
  • 0:37 TRAMP, rsync, firestarter, mosh
  • 0:43 stumpwm, conkeror
  • 0:47 concurrency, guile
  • 0:51 dash
  • 0:52 packages
  • 0:53 edit with Emacs (Chrome extension), Cocoa text system on Mac OS X
  • 0:57 railwaycat, spaceline (modeline from spacemacs)
  • 1:04 preview latex, knitr, sweave, Org tables in LaTeX
  • 1:09 spacemacs, vim
  • 1:16 multiple cursors, keyboard macros
  • 1:18 eshell, shells
  • 1:19 volatile-highlights, undo tree
  • 1:21 beacon-mode
  • 1:24 helm-show-kill-ring
  • 1:25 experimenting with versions of code, git-timemachine, undo-tree timestamps and diffs

Text chat:

me 9:30 PM notmuch, mairix
Will Monroe 9:31 PM thanks!
Puneeth Chaganti 9:33 PM Hi everyone.
me 9:34 PM nnmail-split-methods
Puneeth Chaganti 9:36 PM I use imapfilter for my non-gmail account.
Diego Berrocal 9:36 PM what about the gmail one?
Will Monroe 9:36 PM these are excellent suggestions for a new gnus user Puneeth, thank you for org2blog!
Puneeth Chaganti 9:37 PM I don’t yet use gmail with mu4e. Just not sure how long downloading all my mail would take.
Diego Berrocal 9:38 PM https://mosh.mit.edu/#techinfo ^ better ssh
Will Monroe 9:39 PM Puneeth, I’ve used mu4e with offlineimap to download lots of gmail. It did take a lot of time for ~4GB to download.
Puneeth Chaganti 9:40 PM Yeah, I’m also subscribed to a lot of lists that are filterd out using email filters, but I’m afraid getting new mail also would be really slow. I have a better internet connection these days. May be I should try.
Diego Berrocal 9:41 PM doesn’t gnus freeze your emacs sometimes?
me 9:41 PM I’ve been using gmane.org for many mailing lists. The web interface has been a bit wonky, but the NNTP through Gnus seems okay.
Diego Berrocal 9:41 PM it did on me last time I used it (years ago) Link to Window Manager: https://github.com/ch11ng/exwm
Puneeth Chaganti 9:44 PM http://conkeror.org/
Will Monroe 9:46 PM Bye everyone! It was nice talking with you.
Daniel Gopar 9:48 PM Diego do you have an example of using firestarter with rsync? Do you have your init.el uploaded in Github or somwhere?
Diego Berrocal 9:49 PM unfortunately it’s not in my config anymore I’ll try to make a blog post
Daniel Gopar 9:50 PM sweet \o/ Let me know if you end up creating a post
Diego Berrocal 9:50 PM yeah \o/
Puneeth Chaganti 9:52 PM Yes, I found it useful too. Thanks for doing those posts, Sacha
me 9:53 PM
Diego Berrocal 9:53 PM not more scrolling through MELPA twitter now edit-with-emacs ^
Bryan Maass 9:54 PM edit-with-emacs
Howard Melman 9:56 PM https://github.com/jrus/cocoa-text-system
Bryan Maass 9:56 PM https://www.hcs.harvard.edu/~jrus/site/cocoa-text.html
me 9:58 PM Reddit discussion of spaceline
me 9:59 PM http://emacsthemes.com/
Bryan Garza 10:03 PM https://github.com/kuanyui/moe-theme.el
me 10:07 PM (org) Tables in arbitrary syntax From Joseph: yihui.name/knitr
Bryan Garza 10:19 PM https://www.masteringemacs.org/article/complete-guide-mastering-eshell https://github.com/k-talo/volatile-highlights.el https://github.com/Malabarba/beacon
Diego Berrocal 10:25 PM git-timemachine
me 10:27 PM (setq undo-tree-visualizer-timestamps t)<br> (setq undo-tree-visualizer-diff t)
Daniel Gopar 10:28 PM Diego can you put a link to your site?
Diego Berrocal 10:30 PM cestdiego.github.io ^

For more information about Emacs Hangouts, see http://sachachua.com/blog/tag/emacs-hangout

Mail with Gnus on Windows

November 20, 2015 - Categories: emacs

Update 2015-11-26: fixed link to my config. Thanks, Thomas!

I use Gmail for my mail because it:

  • synchronizes with my phone, which is handy for notifications and quick replies
  • filters most of the spam for me
  • works with a few interesting extensions such as Boomerang for Gmail

However, I like the way the Gnus mail/news client in Emacs gives me a much more keyboard-friendly way to manage lots of mail, and I can even write code to partially automate some of my common operations.

I used to have my config in in ~/.gnus, but people might find it handy, so I’ve added it to my public Emacs configuration.

I like using Gmane to read mailing lists, and I use IMAP to read my Gmail.

(setq gnus-select-method '(nnnil ""))
(setq gnus-secondary-select-methods
      '((nntp "news.gmane.org")
        (nnimap "imap.gmail.com"
                (nnimap-address "imap.gmail.com")
                (nnimap-server-port 993)
                (nnimap-stream ssl)
                (nnimap-authenticator login))))

I have two-factor authentication enabled for Gmail, so I set up an app-specific password for Gnus. I have an ~/.authinfo file set up with something like:

machine imap.gmail.com login [email protected] password mysecretapppassword
machine imap.gmail.com login [email protected] password mysecretapppassword port 993
machine smtp.gmail.com login [email protected] password mysecretapppassword port 587

(I should probably get around to using GPG to automatically encrypt and decrypt this file.)

Sending e-mail on Windows was a bit of a pain. Fortunately, I eventually found something that works. I’ve configured emailrelay to accept the mail and forward it to Gmail. The server starts with this batch file:

start "emailrelay" "C:\Program Files (x86)\emailrelay\emailrelay.exe" --as-proxy smtp.gmail.com:25 --client-auth "C:/sacha/.emailrelay" --client-tls --log --pid-file "C:\Program Files (x86)\emailrelay\emailrelay.pid" --spool-dir C:\sacha\tmp\emailrelay

Sending queued mail works with this batch file:

"c:\Program Files (x86)\emailrelay\emailrelay.exe" --as-client smtp.gmail.com:587 --client-auth c:\sacha\.emailrelay --client-tls --spool-dir c:\sacha\tmp\emailrelay

I should probably get around to using --as-proxy properly, since it still seems to hold mail until I explicitly send it.

Some more config. Not sure how much of this is needed.

(setq message-send-mail-function 'smtpmail-send-it
      smtpmail-starttls-credentials '(("localhost" 25 "[email protected]" nil))
      smtpmail-auth-credentials '(("localhost" 25 "[email protected]" nil))
      smtpmail-default-smtp-server "localhost"
      smtpmail-smtp-server "localhost"
      smtpmail-smtp-service 25
      smtpmail-local-domain "local.sachachua.com")
(setq send-mail-function 'smtpmail-send-it)
(setq smtpmail-smtp-server "127.0.0.1")
(setq smtpmail-smtp-service 25)
(setq user-mail-address "[email protected]")

Hide HTML mail. I need to fiddle with this some more, since Gnus still tries to display them. Sometimes my Gnus crashes when it tries to display HTML mail.

(setq mm-discouraged-alternatives
      '("text/html" "text/richtext")
      mm-automatic-display
      (-difference mm-automatic-display '("text/html" "text/enriched" "text/richtext")))

Hide quoted text.

(setq gnus-treat-hide-citation t)

Get smarter about filtering depending on what I reed or mark. I use ! (tick) for marking threads as something that interests me.

(setq gnus-use-adaptive-scoring t)
(setq gnus-default-adaptive-score-alist
     '((gnus-unread-mark)
       (gnus-ticked-mark (subject 10))
       (gnus-killed-mark (subject -5))
       (gnus-catchup-mark (subject -1))))

Weekly review: Week ending November 20, 2015

November 22, 2015 - Categories: review, weekly

This week was a good week for learning more about coding. The Toronto Public Library hackathon turned out to be an excellent excuse to dig into geographic visualizations and user scripts, and I picked up a few search tips from the mentors there. My tiny hack for displaying branch search results on a map of neighbourhood libraries won the best idea prize at the hackathon, yay! I spent some time after the hackathon cleaning up my code and turning it into something I can use without having a server running. I’m starting to really like this practice of having lots of small tests, too – hooray for Jasmine! =) See my notes for more details.

Lots of Emacs-related stuff. Another edition of Emacs News, another Emacs Hangout, and lots of editing of the EmacsWiki. It’s a good community, and it’s nice to be able to help out.

Ups and downs, energy-wise, but W- thoughtfully stepped in with some mid-week cooking. He’s so awesome. I’ll probably take it easy for the next few weeks instead of tilting the balance towards consulting. Still, there’s plenty to do and plenty to learn. =)

2015-11-23a Week ending 2015-11-20 -- index card #journal #weekly output

Blog posts

Sketches

Focus areas and time review

  • Business (34.9h – 20%)
    • Earn (12.0h – 34% of Business)
      • Earn: E1: 1-2 days of consulting
      • Rewrite to use pg backend
      • Earn: E1: 1-2 days of consulting
    • Build (18.0h – 51% of Business)
      • Drawing (2.8h)
      • Paperwork (0.0h)
      • Exploring neighbourhood libraries, and other notes from the Toronto Public Library Hackathon
      • Convert to client-side code
    • Connect (5.0h – 14% of Business)
  • Relationships (3.5h – 2%)
    • Meet with M
    • G.t.
  • Discretionary – Productive (11.9h – 7%)
    • Emacs (9.6h – 5% of all)
      • Do another Emacs News review
      • Announce Emacs Hangout
      • Host Emacs Hangout
      • Queue Emacs News updates
      • Fix refiling from agenda
      • Clock into existing or new task
      • Write about setup for e-mail
      • Figure out what’s going on with my org mode HTML export and targets
        • Update CUSTOM_ID in my config
      • Write starter guide for Emacs community
      • Write GetHelp page
      • Check out yaoddmuse – johnw
      • Tell Gnus to never show HTML mail
      • Do another Emacs News review
    • Catalogue filing cabinet
    • Set up rsync backup
    • Memorize pronouns
    • Re-memorize declensions
    • Sewing (0.0h)
    • Writing (2.2h)
  • Discretionary – Play (10.0h – 5%)
  • Personal routines (31.3h – 18%)
  • Unpaid work (11.2h – 6%)
  • Sleep (64.0h – 38% – average of 9.1 per day)

2015-11-23 Emacs News

November 23, 2015 - Categories: emacs, emacs-news

Links from reddit.com/r/emacs, Hacker News, planet.emacsen.org, Youtube, the Emacs commit log, the changes to the Emacs NEWS file, and emacs-devel

Past Emacs News round-ups

Org Mode tables and fill-in quizzes – Latin verb conjugation drills in Emacs

November 26, 2015 - Categories: emacs, org

I was looking for a Latin verb conjugation drill similar to these ones for and nouns and pronouns. I liked the instant feedback and the ability to quickly get hints. I couldn’t find an online drill I liked, though, so I made my own with Emacs and Org. (Because… why not?)

I wrote some code that would take a table like this:

present – 1st sing. – ago / agere agO
present – 2nd sing. – ago / agere agis
present – 3rd sing. – ago / agere agit
present – 1st plu. – ago / agere agimus
present – 2nd plu. – ago / agere agitis
present – 3rd plu. – ago / agere agunt
imperfect – 1st sing. – ago / agere agEbam
imperfect – 2nd sing. – ago / agere agEbAs
imperfect – 3rd sing. – ago / agere agEbat
imperfect – 1st plu. – ago / agere agEbAmus
imperfect – 2nd plu. – ago / agere agEbAtis
imperfect – 3rd plu. – ago / agere agEbant
future – 1st sing. – ago / agere agam
future – 2nd sing. – ago / agere agEs
future – 3rd sing. – ago / agere agEt
future – 1st plu. – ago / agere agEmus
future – 2nd plu. – ago / agere agEtis
future – 3rd plu. – ago / agere agent

I can call my/make-fill-in-quiz to get a quiz buffer that looks like this. If I get stuck, ? shows me a hint in the echo area.

latin-verb-drills-0

To make it easier, I’ve left case-fold-search set to nil so that I don’t have to match the case (uppercase vowels = macrons), but I can set case-fold-search to t if I want to make sure I’ve got the macrons in the right places.

Here’s the code to display the quiz buffer.

     (require 'widget)
     (defun my/check-widget-value (widget &rest ignore)
       "Provide visual feedback for WIDGET."
       (cond
        ((string= (widget-value widget) "?")
         ;; Asking for hint
         (message "%s" (widget-get widget :correct))
         (widget-value-set widget ""))
        ;; Use string-match to obey case-fold-search 
        ((string-match 
          (concat "^"
                  (regexp-quote (widget-get widget :correct))
                  "$")
          (widget-value widget))
         (message "Correct")
         (goto-char (widget-field-start widget))
         (goto-char (line-end-position))
         (insert "✓")
         (widget-forward 1)
         )))

   (defun my/make-fill-in-quiz (&optional quiz-table)
     "Create an fill-in quiz for the Org table at point.
The Org table's first column should have the questions and the second column 
should have the answers."
     (interactive (list (org-babel-read-table)))
     (with-current-buffer (get-buffer-create "*Quiz*")
       (kill-all-local-variables)
       (let ((inhibit-read-only t))
         (erase-buffer))
       (remove-overlays)
       (mapc (lambda (row)
               (widget-insert (car row))
               (widget-insert "\t")
               (widget-create 'editable-field
                              :size 15
                              :correct (cadr row)
                              :notify 'my/check-widget-value)
               (widget-insert "\n"))    
             quiz-table)
       (widget-create 'push-button
                      :table quiz-table
                      :notify (lambda (widget &rest ignore)
                                (my/make-fill-in-quiz (widget-get widget :table))) 
                      "Reset")
       (use-local-map widget-keymap)
       (widget-setup)
       (goto-char (point-min))
       (widget-forward 1)
       (switch-to-buffer (current-buffer))))

Incidentally, I generated the table above from a larger table of Latin verb conjugations in the appendix of Wheelock’s Latin, specified like this:

#+NAME: present-indicative-active
| laudO    | moneO   | agO    | audiO   | capiO   |
| laudAs   | monEs   | agis   | audIs   | capis   |
| laudat   | monet   | agit   | audit   | capit   |
| laudAmus | monEmus | agimus | audImus | capimus |
| laudAtis | monEtis | agitis | audItis | capitis |
| laudant  | monent  | agunt  | audiunt | capiunt |

#+NAME: imperfect-indicative-active
| laudAbam   | monEbam   | agEbam   | audiEbam   | capiEbam   |
| laudAbas   | monEbas   | agEbAs   | audiEbAs   | capiEbas   |
| laudAbat   | monEbat   | agEbat   | audiEbat   | capiEbat   |
| laudAbAmus | monEbAmus | agEbAmus | audiEbAmus | capiEbAmus |
| laudAbAtis | monEbAtis | agEbAtis | audiEbAtis | capiEbAtis |
| laudAbant  | monEbant  | agEbant  | audiEbant  | capiEbant  |

#+NAME: future-indicative-active
| laudAbO    | monEbO    | agam   | audiam     | capiam     |
| laudAbis   | monEbis   | agEs   | audiEs     | capiEs     |
| laudAbit   | monEbit   | agEt   | audiet     | capiet     |
| laudAbimus | monEbimus | agEmus | audiEmus   | capiEmus   |
| laudAbitis | monEbitis | agEtis | audiEtis   | capiEtis   |
| laudAbunt  | monEbunt  | agent  | audient    | capient    |

with the code:

#+begin_src emacs-lisp :var present=present-indicative-active :var imperfect=imperfect-indicative-active :var future=future-indicative-active
  (defun my/label-latin-with-verbs (table verbs persons tense)
    (apply 'append
           (-zip-with (lambda (row person) 
                        (-zip-with (lambda (word verb)
                                     (list word (format "%s - %s - %s" tense person verb)))
                                   row verbs))
                      table (-cycle persons))))
  (apply 'append 
         (mapcar (lambda (tense)
                   (my/label-latin-with-verbs 
                    (symbol-value tense)
                    '("laudo / laudare" "moneo / monEre" "ago / agere" "audiO / audIre" "capiO / capere")
                    '("1st sing." "2nd sing." "3rd sing." "1st plu." "2nd plu." "3rd plu.")
                    (symbol-name tense)))
                 '(present imperfect future)))

#+end_src

This uses dash.el for the -zip-with and -cycle functions. There’s probably a much better way to process the lists, but I’m still getting the hang of thinking properly functionally… =)

Anyway, I’m sure it will be handy for a number of other quiz-like things. org-drill and org-drill-table will probably come in handy for flashcards, too!

Weekly review: Week ending November 27, 2015

November 28, 2015 - Categories: review, weekly

Lots of fun with the prototype I’ve been making on my consulting gig, yay! I’ve been learning more about mobile interfaces with Angular modules like ng-touch, and I might play around with Cordova as well. I missed a meeting because I forgot to check my Outlook calendar before heading out, but ah well.

I figured out how to reflect my HST refund in Quickbooks, and I updated my accounting notes. That should make next year’s paperwork a little bit easier.

Lots of cooking (yum, lasagna!), and a bit of sewing as well. I’m experimenting with ordering fabric from fabric.com, so we’ll see how that goes.

2015-11-29a Week ending 2015-11-27 -- index card #journal #weekly

output

 

Blog posts

Sketches

Focus areas and time review

  • Business (23.7h – 14%)
    • Earn (20.2h – 85% of Business)
      • ☑ [#A] Move to B
      • ☑ Earn: E1: 1-2 days of consulting
      • ☐ Earn: E1: 1-2 days of consulting
      • ☐ Prepare invoice
    • Build (2.4h – 10% of Business)
      • Drawing (1.5h)
      • Paperwork (1.0h)
        • ☑ Update corporate tax installments
    • Connect (1.0h – 4% of Business)
  • Relationships (7.4h – 4%)
    • ☑ Research gear
    • ☑ Buy stuff
  • Discretionary – Productive (17.6h – 10%)
    • Emacs (6.8h – 4% of all)
      • ☑ Improve EmacsWiki
        • ☑ Update information on customizing initfile
      • ☑ Investigate org toc local section
      • ☑ Do another Emacs News review
      • ☐ Do another Emacs News review
    • ☑ Sew another peasant blouse
    • ☑ Catalogue installed programs and clean them up
    • ☑ Sort out backup system for blog
    • Sewing (2.6h)
    • Writing (0.0h)
  • Discretionary – Play (11.8h – 7%)
  • Personal routines (27.8h – 16%)
  • Unpaid work (14.7h – 8%)
  • Sleep (64.9h – 38% – average of 9.3 per day)

Trying out dual-booting Linux again

November 29, 2015 - Categories: geek, linux

After a long, long time being on Windows because of Autodesk Sketchbook Pro – keeping sane with a mishmash of Cygwin and Linux virtual boxes so that I could get around the limits of Windows as a development platform, and grumbling about little things like the slow performance of git and the occasional problem with too-long file paths – I’m giving dual-booting to Linux a try again.

W-‘s good influence here: his new SSD arrived and he decided to allocate some space for dual-booting to Linux. Since we have the same hardware configuration for our laptops, I figured I’d see if the Wacom drivers Just Worked and if the sketching programs on Linux had improved since I last checked them out. Mypaint still didn’t have the selection tools I was looking for, but Krita looks like it might work for my sketches. The interface isn’t as pen-friendly as Autodesk Sketchbook Pro (which I couldn’t get going under WINE), but I might be able to get the hang of using the subset of features I actually rely on.

I had some setup issues in the beginning. The Kubuntu 15 install disk I tried crashed during setup due to a wireless-related issue. I tried ElementaryOS, but found it to be a hassle because the default Elementary theme caused Emacs to crash. (Priorities, priorities.) Frankensteining it back to a basic Ubuntu distribution by removing packages and editing files like /etc/lsb-release didn’t completely solve my problems, so I installed Kubuntu 14 instead. That seems to be working so far.

I ran into a few more issues with applications. Dropbox sync created directories but not the files within them. I’m not sure whether it was the fiddling we did with our network setup (including quite a few reboots of routers and modems) or whether Dropbox sync got fixed after I unlinked my laptop through the web interface and then reconfigured it, but at least my files are downloading now at a decent speed.

The version of Evernote I installed under WINE didn’t allow me to edit notes. Upgrading WINE to 1.7 and downgrading Evernote to 5.8.3 seems to have made Evernote work, though, so now it’s synchronizing the gazillions of notes I’ve accumulated throughout the years.

Postfix Gmail forwarding was straightforward to set up. I successfully sent a test message, and my Gnus config seems to be working fine with direct IMAP access to Gmail. I might give offlineimap a try, maybe with notmuch.

I have an old Truecrypt volume lying around, and the Linux binaries were able to mount it. Hooray!

Git was giving me problems, so I added the git-core repository.

I’ll still probably need to boot into Windows to do my business accounting in Quickbooks, which I use mainly because it imports into Turbotax and therefore saves me from having to figure out all the tax stuff by hand. I don’t do that frequently, though, so it should be okay.

I use a Python script to download Flickr metadata. Turns out the latest version of flickrapi is incompatible with it, so I downgraded flickrapi with:

sudo pip install flickrapi==1.4.5

and that worked.

It turns out it’s the little things you notice. I missed being able to use Win+number to start or switch to applications. Fortunately, the following script worked for me, once I figured out that KDE’s custom keyboard shortcuts wanted full path to the shell command: /home/sacha/bin/focus_or_launch emacs instead of using ~/bin/focus_or_launch emacs. I modified it slightly to only look at –class instead of –name.

#!/bin/bash

# NAME:         focus_or_launch
# VERSION:      0.4
# AUTHOR:       (c) 2014 Glutanimate <https://github.com/Glutanimate/>
#
# DESCRIPTION:  Focus existing app window or launch application if no
#               window found
#
#               Simplified version of a script by Henning Bekel
#               (https://bbs.archlinux.org/viewtopic.php?pid=625009#p625009)
#
# DEPENDENCIES: xdotool
#
# LICENSE:      GNU GPLv3 (http://www.gnu.de/documents/gpl-3.0.en.html)
#
# NOTICE:       THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 
#               EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 
#               PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR 
#               IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
#               AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND 
#               PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE,
#               YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
#
#               IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY 
#               COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS 
#               PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, 
#               INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE 
#               THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED 
#               INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE 
#               PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER 
#               PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# USAGE:        focus_or_launch <command>
# EXAMPLE:      focus_or_launch google-chrome


############# GLOBVAR/PREP ###############

Executable="$1"
ExecutableBase="$(basename "$Executable")"
Usage="\
Usage: $(basename $0) command
E.g.:  $(basename $0) google-chrome\
"

############## USGCHECKS #################

if [[ $# -ne 1 || "$1" =~ ^(-h|--help)$ ]]; then
  echo "$Usage"
  exit 1
fi

################ MAIN ####################

MostRecentWID="$(xdotool search --class "$ExecutableBase" | tail -1 2> /dev/null)"

if [[ -z "$MostRecentWID" ]]; then
  echo "$ExecutableBase not found. Launching new window."
  "$Executable" > /dev/null 2>&1 &
  disown
else
  echo "Focusing existing instance of $ExecutableBase."
  # use brute-force approach if activating most recent WID doesn't work
  xdotool windowactivate "$MostRecentWID" 2>&1 | grep failed \
  && xdotool search --class "$ExecutableBase" windowactivate %@
fi

There are probably a few more things I’ll run into, but it’s a good start. =)

2015-11-30 Emacs News

November 30, 2015 - Categories: emacs, emacs-news

Links from reddit.com/r/emacs, Hacker News, planet.emacsen.org, Youtube, the Emacs commit log, the changes to the Emacs NEWS file, and emacs-devel.

Past Emacs News round-ups