return to OCLUG Web Site
A Django site.
June 23, 2013

Brenda Butler
bjb
linuxbutler
» EFF save podcasting campaign

The EFF is raising funds to pay for a challenge to Personal Audio’s patent, that they are using to squeeze podcasters. Now might be a good time to contribute, or even join and make regular contributions.

It looks like they’ve already raised their goal, but it doesn’t hurt to support or join the EFF in this and other causes.

Also, in order to make their case that the patent is baseless, they have issued a call for prior art. If you can contribute information to their case, that will also help to win this case.

» prism-break

A site that promotes alternatives to the software and cloud services that the US government (and others) uses as its own databases for mining.

http://prism-break.org

» python's setuptools

One of the nice things about the Ottawa Python Author’s Group irc channel (oftc.net, #opag) is that they occasionally mention a great but under-advertized reference, like this one for setuptools:

http://peak.telecommunity.com/DevCenter/setuptools#basic-use

Thanks Ian!

June 19, 2013

CREDIL news feed
credil
CREDIL: News
» CREDIL - Lunch-and-Learn: Time logging

Our next Lunch-and-Learn topic at CREDIL Lunch-and-Learn will be on "Logging time", to be presented by Michael Richardson on Thursday, June 20th, 2013.


Ian Ward
excess
excess.org - News
» Sean Zicari's Curses and Urwid Talk

Sean Zicari gave a Curses and Urwid presentation at the recent PyCon US in Santa Clara.


» data.gc.ca

A site I've been working on for the past few months has just launched. data.gc.ca "2.0" is a completely rewritten version of the Open Data portal for the Government of Canada.

I worked on the CKAN portion of the site responsible for the data catalogue. CKAN is an open source Data Portal application written in Python. I built a fully bilingual schema with many additional fields for our datasets. I also optimized, fixed and improved many parts of CKAN itself.

Our team built templates based on the Web Experience Toolkit (WET). WET provides building blocks for creating accessible, mobile-friendly web sites. These templates include a map widget for our geospatial datasets and an interactive data table for previews of tabular data.

All of our work is available on the open-data github page and is released under a permissive license.

data.gc.ca might just be the largest, most fully bilingual and most accessible CKAN site anywhere. More to come!

» Write the Docs

I will be attending the Write the Docs conference in Portland on Monday/Tuesday.

I've spent a lot of time with Sphinx this past year working on updating and improving the Urwid documentation. I've found writing documentation is a really hard but also really important and rewarding part of my programming work.


June 5, 2013

Michael P. Soulier
msoulier
But I Digress
» Java, usable but pointlessly difficult

I've been working on a REST client in Java at work lately. I know, it scares me too. I've had to revisit much of my old Java knowledge, and pick up a lot of new chops in Swing, Eclipse, and author a decent JSON-parsing HTTPS client.

Our internal servers use self-signed SSL certs at work, so to talk to them I had to disable any host-certificate checking. Should be a simple boolean in the API right? Wrong. I forgot. Java.

First, you need to install your own trust manager.

import javax.net.ssl.X509TrustManager;
import java.security.cert.X509Certificate;
import javax.net.ssl.SSLContext;
import javax.net.ssl.HttpsURLConnection;

 TrustManager[] trustAllCerts = new TrustManager[] {
         new X509TrustManager() {
     @Override
     public java.security.cert.X509Certificate[] getAcceptedIssuers() {
         return null;
     }
     @Override
     public void checkClientTrusted(X509Certificate[] certs, String authType) {
     }
     @Override
     public void checkServerTrusted(X509Certificate[] certs, String authType) {
     }
 }};
 // Install this trust manager.
 try {
     SSLContext sc = SSLContext.getInstance("SSL");
     sc.init(null, trustAllCerts, new java.security.SecureRandom());
     HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
 }

Then, you need to install a hostname verifier that accepts a bad host, as that's likely wrong too, especially if you access the box by IP address when the IP isn't in the cert.

import javax.net.ssl.HostnameVerifier;

 HttpsURLConnection sconnection = (HttpsURLConnection)request.unwrap();
 sconnection.setHostnameVerifier(new HostnameVerifier() {
     @Override
     public boolean verify(String hostname, SSLSession session) {
         return true;
     }
 });

Usable? Yes. But it's no wonder that Java programmers insist on IDEs when it's so damn wordy. I mean, wouldn't a simple boolean have done here?

» Matplotlib is really cool

Recently at work I needed to produce a pie chart for some data that I had to crawl through using basic scripting. Pulling out the numbers, sorting, filtering, etc., was all tasks that I'm used to doing, but for graphing I normally use Gnuplot. But, Gnuplot can't do pie charts AFAIK, so I needed to look for another way.

I didn't want to use a spreadsheet for the task because I don't find them very scriptable. So, I turned to matplotlib, Python's uber-graphing library.

I found a simple example online, and before I knew it, I had a nice looking pie chart, with very little code.

# make a square figure and axes
figure(1, figsize=(6,6))
ax = axes([0.1, 0.1, 0.8, 0.8])

labels = []
fracs = []

for country in countries:
    count = countries[country]
    labels.append(country)
    fracs.append(count)

pie(fracs, labels=labels, autopct='%1.1f%%', shadow=True)

title('By Country', bbox={'facecolor':'0.8', 'pad':5})

show()
http://www.but-i-digress.ca/static/images/piechart.png

Very impressive. I tried it a few years ago and found it difficult, but it seems to have gotten much simpler. I must delve deeper now.

May 30, 2013

Ottawa Android
ottawaandroid
» 19th June – 6:30pm @ Shopify Offices in Lounge

Details can be found on Reddit

» 15th May – 6:30pm @ Shopify Offices in Lounge

Details can be found on reddit

March 17, 2013

Rob Echlin
echlin
Talk Software
» Editing menus on LXDE

The menus are created from the foo.desktop file for each application.

To find them, you can do a couple of things.

First, using Synaptic package manager, select the package, then click on the “Properites” icon in the toolbar. Use the tab “Installed Files”.

Second, you can use this command line, where the “package-name” needs to be the name of your package. Tab completion works for Bash shell on the name of the package, if you know how it starts.

dpkg -L package-name | grep desktop

I found this out because I needed to change the “EXEC” string in “d2x-rebirth-demo” (the “Descent 2″ rewrite) to:

/usr/local/games/d2x-rebirth/d2x-rebirth -hogdir /usr/local/games/d2x-rebirth/data


March 15, 2013

Ian Ward
excess
excess.org - News
» Painting with Braille

This is something I've been wanting to write for a while.

Unicode page U+2800 has all the combinations of a 2x4 grid of Braille dots. Braille dots that line up neatly with the ones on all sides in most fonts. We can paint with this!

March 12, 2013

Michael P. Soulier
msoulier
But I Digress
» Joysticks on Mac OS X in Flightgear

I like flight simulators. I've played all of the good ones, Flightgear is an open-source flight simulator that isn't bad, and is steadily getting better with every release. While it is available to run on Mac, there's no way to calibrate the Joystick due to a lack of caring on Apple's part.

But, Flightgear is hackable. The joystick file is just a set of XML bindings, those bindings can run code, so using coefficients to the input and controlling the output, in theory I can calibrate the settings myself. So, I did:

<?xml version="1.0"?>

<PropertyList>
    <axis n="0">
        <desc>Aileron</desc>
        <binding>
            <command>nasal</command>
            <script>
                var value = cmdarg().getNode("setting").getValue();
                if (abs(value) &lt; 0.05) {
                    value = 0;
                }
                else {
                    value -= 0.15;
                    value *= 1.5;
                }
                setprop("/controls/flight/aileron", value);
            </script>
        </binding>
    </axis>
    <axis n="1">
        <desc>Elevator</desc>
        <binding>
            <command>nasal</command>
            <script>
                var value = cmdarg().getNode("setting").getValue();
                if (abs(value) &lt; 0.05) {
                    value = 0;
                }
                else {
                    value -= 0.1;
                    value *= -1.5;
                }
                setprop("/controls/flight/elevator", value);
            </script>
        </binding>
    </axis>
    <axis n="2">
        <desc>Rudder</desc>
        <binding>
            <command>nasal</command>
            <script>
                var value = cmdarg().getNode("setting").getValue();
                if (abs(value) &lt; 0.05) {
                    value = 0;
                }
                else {
                    value *= 1.5;
                }
                setprop("/controls/flight/rudder", value);
            </script>
        </binding>
    </axis>
    <axis n="3">
        <desc>Throttle</desc>
        <binding>
            <command>nasal</command>
            <script>
                var value = cmdarg().getNode("setting").getValue();
                value -= 0.5;
                value *= -1.5;
                setprop("/controls/engines/engine/throttle", value);
            </script>
        </binding>
    </axis>

<axis n="4">
    <desc>View Direction</desc>
    <direction>left</direction>
    <low>
    <repeatable>true</repeatable>
    <binding>
        <command>nasal</command>
        <script>view.panViewDir(1)</script>
    </binding>
    </low>
    <high>
    <repeatable>true</repeatable>
    <binding>
        <command>nasal</command>
        <script>view.panViewDir(-1)</script>
    </binding>
    </high>
    <dead-band type="double">0</dead-band>
    <binding>
    <factor type="double">-1</factor>
    </binding>
</axis>
<axis n="5">
    <desc>View Elevation</desc>
    <direction>upward</direction>
    <low>
    <repeatable>true</repeatable>
    <binding>
        <command>nasal</command>
        <script>view.panViewPitch(1)</script>
    </binding>
    </low>
    <high>
    <repeatable>true</repeatable>
    <binding>
        <command>nasal</command>
        <script>view.panViewPitch(-1)</script>
    </binding>
    </high>
    <dead-band type="double">0</dead-band>
    <binding>
    <factor type="double">-1</factor>
    </binding>
</axis>
<button>
    <desc>Brakes</desc>
    <binding>
    <command>nasal</command>
    <script>controls.applyBrakes(1)</script>
    </binding>
    <mod-up>
    <binding>
        <command>nasal</command>
        <script>controls.applyBrakes(0)</script>
    </binding>
    </mod-up>
</button>
<button n="3">
    <desc>Flaps Up</desc>
    <repeatable>false</repeatable>
    <binding>
    <command>nasal</command>
    <script>controls.flapsDown(-1)</script>
    </binding>
    <mod-up>
    <binding>
        <command>nasal</command>
        <script>controls.flapsDown(0)</script>
    </binding>
    </mod-up>
</button>
<button n="4">
    <desc>Flaps Down</desc>
    <repeatable>false</repeatable>
    <binding>
    <command>nasal</command>
    <script>controls.flapsDown(1)</script>
    </binding>
    <mod-up>
    <binding>
        <command>nasal</command>
        <script>controls.flapsDown(0)</script>
    </binding>
    </mod-up>
</button>
<button n="1">
    <desc>Elevator Trim Forward</desc>
    <repeatable>true</repeatable>
    <binding>
    <command>nasal</command>
    <script>controls.elevatorTrim(0.75)</script>
    </binding>
</button>
<button n="2">
    <desc>Elevator Trim Backward</desc>
    <repeatable>true</repeatable>
    <binding>
    <command>nasal</command>
    <script>controls.elevatorTrim(-0.75)</script>
    </binding>
</button>
<name type="string">WingMan Extreme Digital 3D</name>
</PropertyList>

Right now, the calibration is good, but the controls are really jerky and overly sensitive. I'll have to see if I can smooth them out. But, they work.

» Video on Raspbian

Currently our upstairs TV has a raspberry pi attached to it. It's running the basic Raspbian distribution, based on Debian Linux. I'm using it for development as well as for a media center at the moment, so I'm not using RaspBMC, I'm going to order another one has a dedicated media center, but for now I need to be able to play movies off of a usb stick.

I tried VLC, but the performance was horrible. Apparently it doesn't use the native GPU. I read about it online, and thanks to that finally found omxplayer, which does use the native GPU. Unfortunately, it's not all that polished when playing from the command-line. It leaves behind text in the terminal above and below the video at certain aspect ratios, which is visually distracting.

They haven't fixed it yet so I put a wrapper script around it to work around the issue. I plan to put a whole interface around it at some point just for fun, but for now at least I can watch movies without text in the black bars above and below:

#!/bin/sh

setterm -cursor off
clear
omxplayer -o hdmi $1
clear
setterm -cursor on

Simple, but it works.

March 7, 2013

Digital Copyright Canada
digitalcopyright
Digital Copyright Canada
» Ongoing government dishonesty conflating Copyright with Counterfeiting

This isn't a new issue, even if there is a new Conservative Government bill C-56 tabled before parliament. The long and short titles tell a shortform of the dishonesty:

An Act to amend the Copyright Act and the Trade-marks Act and to make consequential amendments to other Acts

Short Title: Combating Counterfeit Products Act

read more

March 4, 2013

CREDIL news feed
credil
CREDIL: News
» CREDIL - Lunch-and-Learn: LVM and Xen

Our next Lunch-and-Learn topic at CREDIL Lunch-and-Learn will be on "LVM and Xen", to be presented by Lucas Bates on Thursday, March 21, 2013.

If you wish to attend the Lunch-and-Learn, please contact us ahead of time so we can ensure there is enough space for everyone.

February 26, 2013

Ian Ward
excess
excess.org - News
» Iterables, Iterators and Generators: Part 2

This is the second part of the talk I gave January 24, 2013 at the Ottawa Python Authors Group.

Part One introduces Python iterables and iterators and generators. This part covers the advanced use of generators while building an interactive two-player network game.

February 12, 2013

Ian Ward
excess
excess.org - News
» Iterables, Iterators and Generators: Part 1

This is part one of a talk I gave January 24, 2013 at the Ottawa Python Authors Group

Part Two is now also available.

Both parts of this presentation are also available as a single IPython Notebook which you can download and run locally, or view with nbviewer.ipython.org. The complete source is available at https://github.com/wardi/iterables-iterators-generators

February 7, 2013

Digital Copyright Canada
digitalcopyright
Digital Copyright Canada
» Commercial infringers demanding government gut laws protecting technology owners.

I sent the following to my MP and to the Minister of Industry:

Mr McGuinty, my MP for Ottawa South,
Cc: The Honourable Christian Paradis, Minister of Industry,

As you know I have spent more than a decade working on protecting technology owners from various forms of infringement of their tangible property rights. Much of the threats to property rights comes from people and organizations falsely claiming such infringements are necessary to protect their rights.

To borrow from a related phrase: One owners right to protect their property ends at my right to protect my property.

read more