National Carbon Price in Canada: give private industry entrepreneurs the clarity they crave [Sep 2016]

With the Trudeau government already struggling to keep up with its numerous promises, many environmentalists will follow the Green Party’s Elizabeth May and decry the Liberal government’s embrace of Harper’s weak and cynical carbon emissions targets.

Quite incompatible with the 1.5 or 2 degree warming targets from the Paris agreement, and seemingly oblivious to the daily barrage of news about how quickly climate changes are happening here and now, and already costing us billions of dollars today, the announcement from Environment Minister McKenna last week was that Canada will leave its 2030 target at about 10% below our 1990 level.

Instead, Ottawa will impose a national floor to the carbon price, meaning provinces can, but must, choose to impose a tax or cap and trade system, each keeping its own revenues for itself.

In fact, the government had no choice but to embrace a price, rather than an emissions cap. With Quebec and soon Ontario bound to an international cap and trade agreement with California, neither province has the autonomy any more to regulate the quantity of emissions from within its borders. Instead, there is certainty only in the combined emissions across all regions in the agreement. Moreover, because California is cheaply reducing its reliance on natural gas, Quebec is likely for the foreseeable future to emit correspondingly more than its own announced targets. Likewise, Canada can no longer aim to cap its national emissions.

This arrangement, it turns out, is the best one for the economy and for the climate.

Basic environmental economics tells us we need price certainty in the short term and certainty about the quantity of emissions cuts only later, in the long term. The right policy now is therefore a rising carbon tax or other rising price floor.

However, Trudeau’s policy will only be as good as the clarity of price increases that are laid out initially. Current prices in Canada, from about 17$ in Quebec to 30$ per tonne in B.C., are still only symbolic. Equivalent to 7 cents per litre on gas, B.C.’s tax is smaller than the fluctuations you’ll see at the pump between last week and next week.

Price certainty in a national price floor means a predictable schedule of rising prices over time.

By mid-century, the price on carbon will be $100-$300. The sooner we start on a predictable ramp to get there, the more that entrenched capital will embrace what should be decades of boom time towards a golden age of a renewable, reliable, and inexpensive energy system.

While Saskatchewan Premier Brad Wall rails against any tax targeting the energy sector more than others, the energy sector is no longer synonymous with oil. Without subsidies or distortions, solar and wind have already become competitive with gas and coal, but their prices are still dropping fast. Traditional energy giants are investing their capital where future profits are to be made, and a lack of clarity about future prices only holds them back.

Meanwhile, BC’s previous government, which brought in their revenue-neutral carbon tax, was then an innovator and leader in climate policy. But with Victoria having stalled that tax at a still mostly-symbolic level of $30/tonne, while turning on the taps for natural gas and coal extraction, the province’s legacy is now worse than if it had never imposed a tax. This is because for businesses in other jurisdictions BC now provides a precedent of governments rolling back the wedge between fossil and clean energy.

Canada’s renewable energy potential, compared with current demand

Canada has more than enough renewable energy potential to meet all its energy needs. So does, individually, each province, with the possible exceptions of Alberta and Ontario, which can easily share with neighbours. Canada’s premiers have the opportunity to get on board not only to make a uniform playing field across the country, but to give private industry entrepreneurs the clarity they crave.

Links: my 2016 Oct 3 TV interview with Catherine Murray on ‘Business Day PM’ on the Business News Network

Advertisements
Posted in policy, Uncategorized | Leave a comment

Keeping your fingers and toes warm in cold weather: a guide for endurance skiers with poor circulation

In recent years I have had severe trouble keeping my finger tips and toes warm while outside in winter.
I blame it on too much cold-weather camping and letting my extremities get numb in my younger days, but it may be as much genetic as anything.
In any case, it has made my winter outdoor activities, especially cross-country skiing, difficult and often desperate. As soon as my fingers or toes get a bit cold, they stay that way even if my core temperature is so high that my palms are sweating profusely.

In late 2016, in preparation for skiing the 160 km Canadian Ski Marathon for the third time, I gathered all my best ideas for keeping my distal phalanges warm. Below, I outline what I tried and what worked best.

20161229-coldhands-00004

My old approach

I learned years ago that I could always force warm blood into my fingers by spinning my arms around in giant circles, using centrifugal pressure to reopen all the stubborn arterioles that have clamped shut. I can even do the same thing (but it’s slower) for my toes, by maniacally swinging a leg back and forth.

med_2013-01-01-DSC01616-crop.jpeg.gif

Alas, I have developed chronic rotator cuff tendonosis in both shoulders, and a tear in one labrum, and I can’t think how I could have damaged the labrum except through my aggressive arm swinging.

Reynaud’s disease

People get diagnosed with “Reynaud’s syndrome” when they have fingers and toes which “shut off” and turn white at the first sign of being cold, and don’t rewarm easily. The condition is even sometimes treated with drugs (beta blockers). I learned back in 1995 from Dr Murray Hamlet of the US Army Cold Weather Research Center that you can treat Reynaud’s by retraining your distal arterioles,  by cycling your core temperature while keeping your extremities warm. Translation: strip down when it’s very cold outside and use a hot tub or buckets of hot water to keep your hands and feet warm while letting your body (core) get alternately warm and cold.
Back then, Dr Hamlet said experiments suggested one needed to do 50 of these body temperature cycles in order to train one’s extremities for a season. Fifty cycles is a lot of effort, but I do take the opportunity on the rare occasions I’m at an outdoor hot tub.

I have found that such “training” works both ways. Whenever I let my fingers or thumbs get cold, I feel it for days and they become even more susceptible to “switching off”. I am now careful in the autumn even to avoid taking things out of the freezer without a mitt because my fingers and thumb can turn off nearly on contact.

Physics interlude

You might say there are four ways we lose heat when outside: conduction, radiation, evaporation, and breathing. (You’ll find people listing a slightly different list of three mechanisms that have been repeated for decades, but often the explanations are loose. Moreover, the quantitative details are still being researched; only detailed modeling or experimental testing can  tell you the numbers for different clothing combinations in different situations).

Conduction happens when you’re touching something. If it’s colder than us, we lose heat to it. We sometimes call it convection when that something is air, which moves, and greatly reduces the insulation provided by non-moving air next to our body. Thus we have thick soles on our shoes, wear thick insulation to trap air, and wear shells to prevent wind from refreshing the trapped air. When clothing gets waterlogged, our insulation material effectively changes from air (thermal conductivity ~0.0243 W/mK) to water (thermal conductivity ~0.6 W/mK), meaning wet clothing transports heat away from us much faster than dry.

Interestingly, we are likely in winter to be losing as much heat to radiation as to conduciton. You can think of thermal imaging (infra-red) cameras to visualize the heat energy given off more by warmer things. In fact, everything is radiating this heat energy, but the amount depends very strongly on an object’s temperature, and thus the balance of heat we lose to radiation varies very strongly with the difference in temperature between our outer clothing and the sky, the snow surface, and other objects around us. We deal with this radiation loss in a similar way to the conduction loss — by covering up and increasing the thickness of insulation, so as to reduce the surface temperature of our outermost coverings.

A major determinant of staying warm in winter is reducing heat loss through the third mechanism, evaporation. The amount of heat we lose from one molecule of sweat turning to vapour and leaving our body (2257 J/g) is fifteen times as much energy as it would take to heat that molecule up (4.2 J/g/K * 37 K) all the way from freezing to body temperature! This is one reason (of two) why managing perspiration is the prime focus in learning how to dress for outdoor winter activities. When you wear a permeable shell (a windbreaker) or even semi permeable shell (a goretex jacket), much of your perspiration is leaving, and with it, all that energy (heat). While we’re actually sweating, we want that cooling effect, but we’d like it to stop as soon as we stop sweating.

Actually, I would guess that the vast majority of the evaporation is going on in our lungs, not from our skin or clothing. While we can’t do much to manage our breathing, we lose a lot of water and heat to breathing in the winter. This is because the air is cold and cold air starts out very dry. Thus, when we breathe air in, we not only have to heat it from the outside temperature all the way up to our blood temperature (37 C) but also bring it from essentially zero percent humidity up to 100% humidity at the final, warm temperature.
As mentioned above, this takes a huge amount of energy because we have to evaporate all that water (from our blood) into our lungs.
A friend who spends much of his time at South Pole Station uses a breathing tube running up through his clothing, when it’s -60 outside, to partly pre-heat the air before it reaches his lungs. But he still has to saturate that air with water vapour, starting from completely dry, when it reaches his lungs.

In any case, this post is most concerned about keeping the extremities warm, assuming that we are able to keep our core (including lungs) warm enough.

Down mitts thumbdown-iconthumbdown-iconthumbdown-icon

Surely the warmest possible mittens would be made of down? Only if it’s uncompressed and completely dry. Neither is feasible for cross-country skiing, nor most other activities. Look for other materials if you want to spend a lot on mitts.

Liner gloves thumbdown-icon

Long ago I learned to use layers on my hands the way I do on the rest of my body: thin wicking underlayer, the main insulation, and a shell. However, after trying numerous synthetic glove liners and merino glove liners, I believe they are counterproductive for me. They quickly wear holes in the fingertips, they get damp, and they end up making my fingers colder.

glove-liners

Battery-powered mittens thumbdown-iconthumbdown-iconthumbdown-icon

I tried some of these in a shop. Presumably the target market is those who are afflicted with Reynaud-like symptoms and are desperate enough to shell out hundreds of dollars for a hope. Alas, these may be useful for 20 minute walks to the bus, but even on maximum setting, the power output is not enough to help someone like me. There is a lot more heat in chemical heater packets than in mitten batteries.

“Cotton kills” interlude

You’ll hear this in any discussion of winter clothing, but the details are more subtle than most accounts you’ll read (see
Rossi et al., Dry and Wet Heat Transfer Through Clothing Dependent on the Clothing Properties Under Cold Conditions, International Journal of Occupational Safety and Ergonomics (JOSE) 2008, Vol. 14, No. 1, 69–76.)
Cotton absorbs a lot of water; i.e., it can get heavy when wet. When a layer of clothing is full of water, the insulator becomes more like water and less like air. That is, because of the high heat conductivity of water, a wet cotton garment conducts heat away from your body fast.
However, this might not make an enormous difference if there are other layers which are not waterlogged (see research article, above). Also, it might not be noticeable while you are exercising hard and generating enough heat to balance the heat loss. The bigger problem with carrying around a lot of water in your clothes happens when the wind picks up suddenly, or your level of activity changes. When the wind increases, the rate of heat loss through evaporation can increase suddenly and, worse, if there’s a lot of water sitting in your clothing, there is a lot of heat to be lost, either suddenly, or incessantly, until all the water is gone. Similarly, if you simply slow down or decrease your aerobic output and heat production, you will stop sweating but if you are wearing lots of water, you won’t stop losing heat through evaporation.
Since your body sweats in order to cool down through evaporation, the ideal clothing will allow that cooling effect (ie transport the water or vapour away) when you are sweating, but it will not have any water left around when you stop sweating.

This is why as a simple rule, we avoid cotton clothing (“cotton kills”) in the winter.  Wool, silk, and certain synthetics don’t have the same problem.

Overboots thumbup-iconthumbup-iconthumbup-icon

For $90 you can get neoprene overboots for your cross-country ski boots. Neoprene insulates and does not breathe, so works against all the heat-loss mechanisms. I wear mine at nearly all temperatures. I have found unfortunately that the stitching on the lower cuff and cross-piece wears out long before anything else, and is hard to fix.

20161229-coldhands-00009.jpeg

(Definitely not meant to be an advertisement for Salomon, a cynical binding oligopolist)

Vapour-barrier liners (VBLs) interlude

A VBL is a waterproof layer worn next to (or close to) the skin, under the insulation layers.
For those used to trying to avoid any buildup of sweat in the winter, VBLs might seem an odd strategy. While accumulating water next to your body increases the conduction of heat away from your body even when you don’t want it, VBLs help keep you warm because they keep your main insulation dry and they completely eliminate evaporative cooling. VBLs are most often worn on feet, but can in principle be worn elsewhere. Yes, foot VBLs smell dogawful, but only when you take them off, while your outer socks stay completely clean and dry.

Vapour-barrier liner socks thumbup-iconthumbup-iconthumbup-icon

For many years I have used non-breathing VBL socks inside my wool socks on multi-day winter trips. These are cheap and need not be much more sophisticated than a robust plastic bag. For a lot more money, you can buy goretex VBL socks:

20161229-coldhands-00010.jpeg
I am now on my second pair of Rocky goretex socks, and I wear them right next to my skin. Using goretex socks limits the rate of evporative heat loss and keeps my warm socks dry. I wear these every time I cross-country ski and think they are a great help. They always wear out in the same place, though: the seam in front of the toes.

Overmitts and cross-country skiing thumbup-iconthumbup-icon

Overmitts can make a huge difference to your warmth, for obvious reasons: they (1) keep your insulation dry if it’s snowing or raining; (2) limit the rate of evaporative heat loss so that it’s not sudden; and (3) act as a wind shell to reduce convective heat loss. They are standard fare for mountaineering and snow-play.

However, for cross-country skiing, they are certainly not common! The old-school way to attach oneself to one’s cross-country ski poles so as to allow poling force-transfer without gripping the poles is as follows:

oldschool-skistrap

(From skixc.com)

It involves sticking your hand through a simple strap (1a), which needs to be snug enough that you can control the pole without grabbing it (3a). Two problems arise for Reynaud’s sufferers: We don’t want to compress our insulation or circulation with the strap, and we want large enough mitts that the strap, which is adjustable but designed for sleek gloves, may not even adjust to be wide enough.

The more modern option includes a harness that distributes the pressure over a larger area of your glove or mitten. These are often quick-release, so that the harness stays on your mitten and unclips from your pole.

DSC00521.JPG
I got a pair like this and modified my overmitts so that I could put the harness snugly on my insulating gloves/mittens but have the overmitts on over the harness. This means the quick-release tab goes through a hole I made in in my overmitts.

DSC00523

DSC00529

The first year that I tried this for the Canadian Ski Marathon, I found that it was sometimes a little fiddly to get the quick-release tab to insert into the pole without my overmitts getting in the way — too fiddly to do while moving.
In many situations this would not be a big deal, but usually by the time I was leaving an aid station, my core temperature had dropped and every few seconds not moving meant colder hands and feet.

Chemical heaters: hands thumbup-iconthumbup-icon

I bought a box of disposable hand-warmers. These react with air and produce heat for as much as 6 hours. Incidentally, these are chemically inocuous; they are essentially iron rapidly undergoing the rusting process. In my desperation (before I discovered a better technique) I have used these heaters extensively with as many as three at once distributed in each mitten during most cross-country ski days.

20161229-coldhands-00008.jpeg

However, they are are not ideal. It is my finger tips and thumb which go numb, and it’s not possible to keep a heater against each finger. I stuff one half-way up my thumb and have one on the palm of my hand, and fold my fingers down onto/near the heater, as needed, to keep them warm. I’ve also tried putting another one at the end of my thumb, but because the heaters are air-breathing, they do not do much when they are compressed/stuffed in a tight spot. Moreover, if parts of my hands are sweating, they can get damp, and thus end up holding moisture next to my skin.

Switching “off” and reusing disposable heaters

The best trick I have learned with them is that, while disposable, they are not single-use. Because they are air breathing, you can simply turn them off and restart them later. when I return from a short ski, I simply put them in a plastic bag and suck out what air I can from the bag as I tie a knot in the bag. You will notice it stop producing heat quite quickly. Like this, you can store them for as long as you like. I have reused one a year later and it quickly gets as hot as it was when first put in the bag.

DSC00545.JPG

 

I also experimented with devising special wrist bands with a pocket for a heat packet, thinking that I could warm up the blood entering my hand through my wrist enough to keep all my arterioles open. This has not been very effective.

Chemical heaters: feet thumbup-iconthumbup-icon

You can also buy the same kind of heaters for your feet. These are designed for the less-aerobic environment of boots, and they are adhesive, made to stick under your foot. It would be hard to replace them in the middle of a 9-hour Canadian Ski Marathon day, but because staying warm at the start in the mornings can be desperate, I start out with them.

Super-fat enormous expensive mittens thumbup-iconthumbup-icon

The nature of this blog is that I decided to try everything I could think of to find a way to keep my fingers warm, and that included expensive options. So I bought the warmest mitts I could imagine skiing with, even if they were stupidly expensive.

The two pairs I kept were these fat mitts (~$100) :

kombi-mitt.pngand these polar, double-mitten jobs (~$250) that are so fat the thumbs are really not prehensile:

black-diamond-absolute-mittens.png

Here is how they look next to a xc-ski glove from my younger and warmer days:

gloves-and-mitts.jpeg

But how could I maintain a sporty connection to my poles wearing such fatties? The harnesses on my quick-release poles were much too small to fit on either of those pairs of mitts. After asking in vain at several stores for another pair of the harnesses, I contacted Komperdell (who makes them) directly and they kindly sent me a set for free! These I modified by restitching the adjustable strap that goes between thumb and forefinger and connects to the quick-release tab, so that their new range would fit both my large and my enormous mittens.

DSC00541.JPG

This has worked perfectly. I skied the CSM TdB Gold wearing the enormous mittens. Because those mittens have a warm inner “lobster” mitten, I even had the option of leaving the outers clipped to my poles at aid stations and pulling out the inner mittens.

However, none of this would be so useful without my final trick…

Surgical gloves thumbup-iconthumbup-iconthumbup-icon

Even while my thumb and fingers are freezing, the rest of my hands can be sweating madly. This means that on a day-long outing, my gloves and mittens get damp and therefore become less effective insulators.
Having had success with VBL socks, I looked into who was making and using VBL gloves. Not finding much, I simply bought a box of nitrile (as opposed to latex) surgical gloves.

nitrile-gloves-box.jpeg

These I adore. The expected benefits were to keep my mittens dry and to stop almost all evaporative heat loss from my hands. However, there is an added benefit. My sweat can actually accumulate enough that the liquid water bathes my fingers and acts to equalize the skin temperature between my finger tips and the rest of my hands. I wear these gloves very frequently in winter, even when running in above-zero temperatures.
These gloves are also extremely robust (I use each many times) and a box ($15) should last you or your family for years. I do replace a glove as soon as it develops even a small hole, which so far has been in the finger tips.
On the down side, I haven’t found long-cuff nitrile gloves [Update — actually, these exist! and can be found e.g. for $18/box of 50 for 8 mm thickness, or 50$ for 200 of 6mm], so they don’t completely cover my wrists, and sometimes they ride up my palms a little, and therefore don’t protect my entire mitten from sweat.

Stephenson’s Warmlite Vapor Barrier Gloves thumbdown-iconthumbdown-icon

Stephenson’s (warmlite.com) is a legendary name in cold weather gear, and they sell the only VBL gloves I’ve found (US$22):

Stephensons-warmlite-VBL-gloves
Compared with my surgical glove solution, they are looser and have cuffs.
On receiving them, I was completely astonished to find that the cuffs appeared to be made of cotton.
I approached the company to find out how that was possible, and here’s what transpired:

Email conversation with Stephenson’s Warmlite

Date: Wed, 17 Feb 2016 10:35:26 -0500
From: Jane-Warmlite
To: Christopher Barrington-Leigh
Subject: Re: Transaction Report

Hi Chris,

No not at all. The cuffs on the gloves will be inside of your over mitten or glove. I’ve been here 36 years and not one person in all of these years has even
mentioned a problem with the cuffs getting wet. If it is cold enough to need a vb glove your hands won’t be sweating enough to contaminate the cuffs.

Jane

On 2/17/2016 9:47 AM, Christopher Barrington-Leigh wrote:
> Hi Jane,
> Doesn’t that imply that we should all be fine wearing cotton underwear in the winter?
>
> Chris
>
> On Tue, 16 Feb 2016, Jane-Warmlite wrote:
>
> > Because it is never worn outside of any clothing and therefore not exposed to any weather – Jane
> >
> >
> >
> > On 2/16/2016 10:16 AM, Christopher Barrington-Leigh wrote:
> > > Hi Jane,
> > > Hm, that’s what it looks like.
> > >
> > > Since that is one of the more counter-intuitive things I’ve ever read (the last thing I would ever imagine YOUR company to do is to make a VBL glove using
> > > cotton), would you care to explain why cotton is a good idea here?
> > >
> > > Thanks,
> > > Chris
> > >
> > > On Tue, 16 Feb 2016, Jane-Warmlite wrote:
> > >
> > > > The cuffs are made from cotton – Jane
> > > >
> > > >
> > > > On 2/12/2016 5:39 PM, Christopher Barrington-Leigh wrote:
> > > > > Hi Jane,
> > > > >
> > > > > May I ask what are the cuffs of the gloves made of?
> > > > > There is no material information attached to the glove, though I saw some description of the FUZZY fabric in the accompanying printout.
> > > > >

 

That’s right, Jane from Warmlite says that if you’re using VBLs, you won’t be sweating. Sorry, but that’s absurd; VBLs would not be desirable nor interesting if not for sweat.
In any case, when using these in cold weather, I find the cuffs become stiff and icy just as you would imagine they would. I haven’t yet replaced the cuffs with something synthetic, but that would be worthwhile (and make them more usable), as it would wick away the excess sweat further from my mittens.

Summary and conclusion

Using nitrile gloves along with my really fat mittens has kept my fingers warm.
I carry chemical heaters to use outside my surgical gloves for security. Above all, I have learned that for me it is important to avoid letting my fingers get cold in the autumn and early winter, even before the coldest times, because every time they go numb, they become even more prone to switching off in the ensuing weeks. Because I have figured out how to re-use the chemical heaters, I get a full 4-8 hours out of each, which means I don’t go through too many of them, and I can take the approach in the early season of trying to keep my fingers warmer than anything else. When I get back indoors I literally pour the accumulated sweat out of my surgical gloves.

I have also learned to put on, or even leave on, a bit more core clothing than I will want when I’m going at full/steady pace, because keeping one’s core warm is of course the first line of defence against cold extremities. The cost of this policy is a bit more sweat in my under layers, but at all temperatures other than summer my clothing includes a light wind shell with full hood, so I can manage damp clothing if the wind picks up.

As for my toes, they are harder, but the rule of never letting them get cold even in mild weather, and the policy of keeping my core warm as I am starting out, are key. I use my sock VBLs liberally, and occasionally still start out with chemical heaters underfoot.

I hope this helps someone else in my situation enjoy their old (or new) pastime. And if you’re still young (or old), never tolerate numbness!

97n13

In my younger days, wearing leather gloves at the South Pole

Posted in Alpine, outdoors, Product review, skiing, Uncategorized | Tagged , , , , | 1 Comment

Ubuntu on Lenovo Thinkpad T450s

Lenovo’s T450s is another piece of high-production-volume hardware from a vendor with a fairly good reputation for Linux support … but a host of serious problems under Ubuntu’s flagship “Long-term-support” operating system.  I’d love to be in touch with others running this machine, to know whether these are all common symptoms for you:

Hardware-ish Problems as of June 2016:

Beyond that, there are various software problems with Ubuntu 16.04. I have filed bugs about apt-mark hold, banshee, biber [update: fix released], etc. But these are not particular to my hardware.

Also, for some bizarre reason, although I more or less maxed out the specs on this machine, the keyboard backlight does not work, which apparently means I bought one without! Careful not to do that.

 

Posted in GNU/linux, hardware, Product review, Ubuntu, Uncategorized | 2 Comments

GNU/Linux at McGill: Calling all users! Please join a support discussion board

A theme among my posts since 2011 has been the challenges of being a GNU/Linux desktop user at McGill University  but outside the departments (Math, Physics, Computer Science?) which support the OS.  I believe those departments have eschewed the central university’s services and support and run their own.

leaf graphicMcGill ICS (IT services) staff are always very friendly in trying to help, but that fact is that unless the University  breaks out of its full-body embrace with Microsoft software, a self-fulfilling prophecy is that there are not many of us open-source OS users who rely on central university services (email and printing and VPN) or support. Because it’s really frustrating.

There are some things they could very easily do better, though. Forcing us to rely on their online “knowledge base” for help with these services is cruel, when they have the ability to marshal community knowledge and support by hosting and advertising a bulletin board / discussion group.  This could accumulate correct information and up-to-date experience.

After the nth iteration of suddenly not being able to print anything, thanks to the Uprint system’s frequent changes and problems with its CUPS service, I need a different approach. I not only literally have to ask colleagues and assistants to print things for me, but waste time ascertaining that the problem must really be with McGill’s system rather than anything on my end.  Yesterday/today ICS was still coy or slow to acknowledge a problem. Only one other user (eventually) reported the same problem. They then took my complaint seriously and restarted their CUPS printer server (but without being transparent about it) and a week’s worth of my print jobs popped up in the print queue.

I would have rather been in touch with that other user from the beginning. Please, if you are a GNU/Linux user on campus, join this Google discussion group using your McGill email address, or with a message to help identify yourself as real faculty/student/staff:

https://groups.google.com/forum/#!forum/linux-at-mcgill

Please spread the word, and recruit your other  Linux friends on campus too.

Posted in Uncategorized | Leave a comment

Composing and typesetting a funding proposal using LyX (SSHRC/ NSERC /CIHR)

This is one of the geekier posts I’ve written, in the sense that the number of people for whom this might be useful is… small and they are not likely to search for it.

In Canada, submitting an application to the government “Tri-Councils” for  funding of  research costs  involves one of a couple of horrid/laborious (soul-crushing) interfaces for entering one’s C.V. information. However, I have nothing useful to say about that task.

On the other hand, the core of the rest of the proposal (for several types of funding) consists of the following:

  • Some parts which are simply small form entry, online
  • Some parts which consist of unformatted text pasted into a textbox, online. The text size is limited in terms of characters,
  • Some parts which are uploaded as PDF files; their length is limited in terms of number of pages.

For instance, for the 2015 SSHRC Insight Grant there are two of the big text-entry boxes and seven separate PDF sections to upload.  One of those is a list of references. I would like to use a citation manager to make citations across the various PDF sections, and to have the reference list coordinated across them. I would like to have a count of how many characters are in drafts of the character-limited sections. I would like to have appropriate headers and footers which indicate the current page and total number of pages within each PDF section. I would like to prepare everything in one file when I’m writing or sharing drafts for comments.

I imagine I could do most of this in LibreOffice or another office suite pretty straightforwardly, but I want to do it in LyX because that has a nice interface to my BibTeX databases, and because of all the other advantages of LaTeX; I think the output from LaTeX still looks vastly nicer than what everyone not using it seems to produce.

So, I made a short Python script which

  • exports my LyX file to LaTeX;
  • counts the characters in each named text box, and display this in red above the box;
  • exports the text contents of each textbox into a separate, named, paste-ready (ie most newlines removed, etc) file;
  • compiles the LaTeX and BibTeX source into one big PDF file; and
  • extracts the appropriate PDF page ranges into named PDF files ready for upload.

Here it is (it makes command line calls for a POSIX system, of course):

#!/usr/bin/python
"""
Compose your funding application in LyX; use this to create the web-ready components.

NSERC, CIHR, SSHRC funding agencies in Canada have funding applications on the WWW that require some text entry (text boxes, with limits by number of characters) and some PDF inclusions (with limits by number of pages). It's nice to draft the whole thing in one document, making use of bibliographic citation and reference automation, etc, so this is for doing that.

Put "\usepackage{color}" in the preamble of your LyX document.
Put, for example,
"begin{countbox}{summary}{3800 characters}" inside an ERT box (ie source code insert)
to note the start of a character-count section, and "end{countbox}" at its end.

Then run this python file on your lyx doc. It will count the characters of each text box region and display them in the compiled pdf.

It will export the text of your text boxes in paste-friendly (removing carriage returns) format.

It will separate out the various PDF submissions which must be separated (some customization needed for this last part).

"""
import sys
infile=sys.argv[1] # '/home/meuser/funding/SSHRC-2015/SSHRCapp.lyx
import os
SP='./tmp/' # Scratch path
pp,ff=os.path.split(infile) # pathname and filename
pp+='/'
os.system("lyx --export-to pdflatex "+SP+ff+".tex "+pp+ff+'.lyx')

# Now parse .tex file; find "boxes" with length limits:

tex=open(SP+ff+'.tex').read()
import re
boxes=re.findall('begin{countbox}{(.*?)}{(.*?)}(.*?)end{countbox}',tex, re.DOTALL)
for onebox in boxes:
 toreplace='begin{countbox}{'+onebox[0]+'}{'+onebox[1]+'}'+onebox[2]+'end{countbox}'
 thetext=onebox[2]
 LL=len(thetext.replace('\n',' '))
 replacement=' {\\LARGE\\color{red} [%d characters/%s]}\n\n'%(LL,onebox[1])+thetext+'\n{\\LARGE\\color{red} END:BOX} \n'
 tex=tex.replace(toreplace,replacement)
 # Also save the text, with newlines removed!
 detexed=thetext.replace('\n\n','|||').replace('\n',' ').replace(' ',' ').replace('|||','\n')
 with open('tmp-'+onebox[0]+'-box.txt','wt') as fout:
 fout.write(detexed)

with open(SP+ff+".tex",'wt') as fout:
 fout.write(tex)

# Now compile and display the PDF:
syscmd='latexmk -pdf -pv -aux-directory='+SP+' -output-directory='+SP+' '+SP+ff+' && cp -a '+SP+ff+'.pdf '+pp
print(syscmd)
os.system(syscmd)

# And now explode out the PDF files. This requires hard-coding the page ranges and section names, below (just once, before submission)
explodePages=[
 [4,9,'details',], # Detailed description
 [11,11,'knowledge',], # KB
 [13,16,'team'], # Team
 [18,19,'budget'],
 [23,26,'contributions'],
 [27,31,'references'],
 ]
from cpblUtilities import fileOlderThan
for sss,ttt,nn in explodePages:
 if fileOlderThan('tmp-pp-%s.pdf'%nn,pp+ff+'.pdf'):
 syscmd=' pdftk '+pp+ff+'.pdf cat %d-%d output tmp-pp-%s.pdf '%(sss,ttt,nn) 
 print(syscmd)
 os.system(syscmd)
 

Posted in Academia, GNU/linux, LaTeX, LyX | Leave a comment

Solving collective action problems is what society does

I taught an introductory undergraduate course in environment, society, and sustainability this past term.  We look at big-picture environmental problems from a mostly-social-science perspective.

Early on, we started to compile a list of collective action problems of all kinds which society has already solved.  I  hope in subsequent years to develop this into a useful online site communicating and animating them: Stay tuned!

As can also happen in the McGill School of Environment’s first natural science course on global environmental problems, some students found the course depressing. The goal of education is empowerment and inspiration to think and act, so hearing that our articulation of the problems we face and the future we have in store had left some feeling helpless was not good news.  Next year we will include a day on the evidence for the power of activism and leadership, but this year I responded rather late simply by writing the following (on behalf of me and my coinstructor):

Neither Kevin nor I are pessimistic about the world!

Many people would rather not understand how things work and how they are working, and your taking the step of doing so is already a positive step for the world.

Please go back to our early exercise on MyCourses to see how many collective action problems our society has solved, simply because we came to understand them. That understanding in each case led to taking the appropriate action. There is actually nothing better (more satisfying individually or more beautiful, socially) than people coming together for collective problem solving!
In countless ways, the world is better now than it ever has been. It is true that many things are likely to change — both good and some bad — in our life times. But that just means that life is full of opportunity to make improvements in whatever that trajectory is. From that I gain comfort.

Personally, I also gain comfort from how endlessly beautiful the natural world is. Even as things change, the cycle of life, the cycle of seasons, the landscape, wildlife, the complexity and unity of it all, being and moving outdoors — all those things I know
are always going to take my breath away with their beauty. They are not going away! The natural world is, in many many ways, very robust. The human world has been, in many many ways, only darker in its past than it is now, when knowledge, rights, and justice are pervasive and there is a growing (and necessary!) sense of global unity that is like the coming of age for our species.

environmentI also know that in such a large world, I cannot make a big difference. So we should not expect that of ourselves. We should try, though, to be part of all the solutions we see — and in effective ways only. There are many people doing that, and there are countless ways to contribute, including through every discipline.

If you are ever feeling down about our prospects as a society or community of species, or your role in helping them, please visit http://www.mcgill.ca/counselling/home which has some great upcoming activities (especially during exams) for de-stressing, as well as more detailed support for keeping one’s perspective bright.

We did not mean to paint an unhappy picture of the world. Rather, our aim is to show that by putting our heads together, we can solve very complex problems! We knew that from science and engineering and space exploration, etc, though human-mediated problems can be another level of tricky.

Keep to your studies, and pursue the work in life that you are going to enjoy day-to-day, in its details. Then you can find a way, within that discipline, to be doing good.

Posted in Academia, McGill University | Tagged , , , , , , | Leave a comment

Review: System76 and their “Sable Touch” desktop computer

It’s still hard to buy a turn-key or supported GNU/Linux computer. I keep trying, and I especially prefer to avoid paying what’s called the Microsoft Tax, i.e. the hardware-bundled cost of Microsoft software, which is how they have built and enforced their monopoly and, from what I can tell, thereby reduced the productivity of billions of people for decades, who have become stuck with software designed to enforce lock-in rather than designed to work well.

But by digressing before having even started, I am avoiding what is also not overall a happy blog post.  In May 2014 I scanned the desktop computer options from the main competition of Zareason and System76, who nowadays look very similar, and found that System76 shipped to Canada.  I thus ordered their Sable Touch: an integrated desktop monitor/computer with a solid state drive, 16GB of RAM, and Ubuntu-ready components.

What follows is an outline of what happened next, along with a review of the machine.  I don’t like spreading bad news, but when a company under-performs yet feels no obligation to compensate for not fulfilling their end of the bargain, it sends a signal that they were not so surprised by their own failure, or that failures happen too often for them to be able to afford to compensate customers each time. For me, putting something on the line is a reassurance that their own expectations of themselves are high.

Hardware and software review

sabt3-c3fff0d74bad260360caa55ab68595db

Besides the minor hardware problem recounted below, the computer seems nice:

Speed: It powers on from cold to log-in screen in 13 seconds. After typing in my password, I’m fully logged in in another two seconds. I like that.

In addition, launching applications is blazingly fast. I do no know why my comparably configured  Lenovo X230T is ten times slower launching, Libreoffice, for instance.

Configuration:  An important feature of ordering from an Ubuntu supplier is that they support the operating system (or at least kernel) I’m going to use. System76 machines all come with Ubuntu preloaded. This includes their own packages which provide any necessary tweaks to leverage the hardware they sell. (On the other hand, from what I can see, there is nothing actually in this package in the case of the Sable Touch; in that case, it’s a placeholder for their own custom updates.)

Unlike in the past when I ordered from Zareason, however, they do not allow any customization on the installation.  Sadly, like many places, they install their operating system (root directory) on the same partition as all the data (/home), so that if you ever want to reinstall the system, you would be overwriting your data. I cannot understand this habit, and they declined my request to make two partitions. In any case, it takes only 10 minutes, after receiving the machine, to erase everything and reinstall Ubuntu from scratch with the partitions as I like them, including adding System76’s own support repositories.

Ergonomics: The computer comes with a short stand, which does not allow adjustment of the height of the machine, nor its pitch angle.  The computer is heavy enough that you’d need care if shopping for one of the nice desk-mounted mobile display arms. It would be nice if System76 offered more options for the mount, even if just to allow height adjustment.

The screen is also very reflective.

Service: It’s great that System76 makes it straightforward to ship to Canada.  You will pay full duties, which amount to GST and provincial tax, as a C.O.D. cost on delivery.  However,  it took nine weeks for me to get my final machine, as I recount below. Moreover,  they seemed to me very confused about how to deal with, or even to comprehend, what should have been a small problem, and the delays and mistakes on their part only accumulated further as the fiasco continued.

The fiasco

Below the history that follows, I include, for transparency, the order log and the issue log, which contain all our interactions except for some phone calls.

Arrival

I ordered on May 9 and received a Sable Touch on June 4, considerably later than they estimated (but I don’t remember precisely what they promised). There are assembly instructions online, but they hadn’t given a copy in the package, nor mentioned that I should look online. Never mind, the assembly was pretty obvious. There’s a desk platform mount which screws onto the back of the computer.

Problem

But it didn’t. The hole drilled in the mounting plate was misaligned with the hole in the back of the computer. A simple error, but very poor style for them to ship something so shoddily made. In any case, no problem with the computer, so they could just send me a new piece for the stand, or even the whole stand.

Confusion at System76

Next followed a bizarre set of communication in which System76 seemed to be asking how to assemble their own computer, and in which, when I got them on the phone, they had difficulty understanding the simple geometry of what was wrong, even though they ostensibly had a Sable Touch in front of them and even though I had sent them photos detailing the problem.

Strange resolution

Eventually, they chose to send me a new computer rather than any of the obvious things — accept my offer to file or drill out the hole in the plate, or to send me a replacement plate or stand. With dread, I agreed to wait for a new computer and to send back the entire original. They assured me the replacement would arrive without C.O.D. charges, and that they would provide me with a free shipping return label.

Second blunder by System76

But what arrived was a UPS delivery demanding another $300 of tax duties. System76 had messed up the arrangement for sending the computer as a duty-free replacement. The computer was taken away again for another eleven days while System76 tried to fix their mistake, but it took regular prodding from me to get them to give me any update and likely to take action. I even passed on information from UPS to them, since they seemed to have the story wrong at one point.

On July 14, I finally got a working computer, packaged up the old one, and sent it back. During this whole interaction I also found a bug on System76’s support site, so that I had to share the photos they wanted through my own web site, and they also sent me an incorrectly scanned document without checking it.  Overall, there was much to be desired in every aspect of their service and support — except the most important one: they remained positive and helpful when we were interacting.

Conclusion

Now, I have a quite-nice desktop on my hands, and the belief that its hardware will be well supported for my operating system. Unfortunately, it took over two months for me to get my order, which was meant for use by a summer student leaving at the end of July.  System76  refused any compensation for the whole ordeal. This signals to me that they have a low volume and a high error rate, which is a shame, since having good hardware running snappy open source operating systems is rather nice! and I wish it was more easily accessible to the masses.

Logs

Below is the account of the written portion of our rather frustrating communication over those months.

order1 order2 issue1 issue2 issue3 issue4 issue5

Posted in GNU/linux, hardware, Product review, Ubuntu | Tagged , , , | 3 Comments