return to OCLUG Web Site
A Django site.
May 15, 2012

CREDIL news feed
credil
CREDIL: News
» CREDIL - Reminder: Lunch & Learn on Thursday, May 17th, 2012

Thursday, May 17th, 2012 will be our next Lunch-and-Learn topic at CREDIL. Brenda will be discussing "VoxForge" which is a free speech corpus and acoustic model repository for open source speech recognition engines (http://www.voxforge.org/).

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


Digital Copyright Canada
digitalcopyright
Digital Copyright Canada
» Bill C-11 3'rd reading on Monday May 14.

The order paper for Monday May 14 included C-11 3'rd reading "debate".

There were motions to make amendments in the Order paper: Report Stage of Bills. These were from Mr. Bellavance (Richmond—Arthabaska) of the Bloc and Ms. May (Saanich—Gulf Islands) of the Greens, neither of which had party representatives in the committee studying the bill.

There are many more motions from Ms. May than the earlier list I commented on.

read more

May 10, 2012

Michael P. Soulier
msoulier
But I Digress
» Post-transaction events in Django

So, at work I’m using Django quite a bit, and I ran into a problem where I need the database transaction to be committed, and then I need to trigger additional server-side code that will act on that data.

Putting all of this into the view function with a manually managed transaction sucks, far too much code. There’s transaction middleware, but by then your view function has returned. What to do?

Simple. I added my own middleware, and I return a new property that I tag into the HttpResponse object. Python is flexible enough to allow this hack.

MIDDLEWARE_CLASSES = (
    'teleworker.lib.middleware.MslEventMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.transaction.TransactionMiddleware',

So in my MslEventMiddleware, I look for a new property in the response, and if it’s present, I execute the requested command, which will happen after the TransactionMiddleware has called commit.

    def process_response(self, request, response):
        if hasattr(response, 'mslevent'):
           msl.event(response.mslevent)

Simple enough. Although a real post-processing API in Django would be helpful.


May 7, 2012

Michael P. Soulier
msoulier
But I Digress
» Eclipse is still mean to me

So in working on Android programming I’ve been working through O’Reilly’s book on the subject, or one of them at least, and I’m at the stage of including the jtwitter library to talk to twitter. So, I add it as a library in eclipse, and everything builds, and then when the app runs I get a spectacular backtrace with a NoClassDefFoundError exception on the very library that I just included, winterwell.jtwitter.Twitter. Umm, ok. Is it added or not?

Trying a variety of configuration changes, I’m unable to get it working, but I finally came across this post on stack overflow about moving the jar to the top of the classpath order. So under Build Path -> Order and Export, I move the jtwitter.jar to the top of the list.

Voila. It’s working now. Seems rather braindead to me, as should Java not simply search the entire classpath until it finds the the requested import? I don’t understand why this works, and that isn’t good, ’cause it’ll just happen again. If someone has an explanation I’d appreciate it.

Cheers.


May 4, 2012

Digital Copyright Canada
digitalcopyright
Digital Copyright Canada
» International Day Against DRM — May 4, 2012

It is fitting that the GOSLING 10-year anniversary coincides with the International Day Against DRM — May 4, 2012. My focus in GOSLING has been how the government regulates software, including how the government protects or rejects software choice. DRM (Digital "Rights" Management, Digital Restrictions Management, Dishonest Relationship Misinformation) easily represents the greatest threat to the rights of technology owners, including the right of technology owners to make their own software choices.

read more

» Public service workers develop means to save taxpayers $1B

OTTAWA-GATINEAU, May 4 2012 - A flock of geeks that includes workers in both government and the private sector are claiming that the Government of Canada can pull $1 billion a year out of federal IT spending, and at the same time generate more Canadian jobs, and provide better public service.

Participants in GOSLING (Getting Open Source Logic INto Governments) describe themselves as "a voluntary, informal knowledge-sharing community of practice, involving civil servants and other citizens who actively assist the engagement of free/libre open source methods and software solutions in government operations." The GOSLING community refers to the adoption of open source methods within the public sector as "Government Official Open Source Engagement" (GOOSE).

At GOSLING's 10th Anniversary Party at the Parliament Pub on Wellington at Metcalfe on Friday afternoon, they're celebrating the arrival of "Intellectual Resources Canada (IRCan)" to self-sustained full operation after a highly successful money-saving proof-of-concept period assisted for several years by CIO Branch, Treasury Board Secretariat.

read more


Michael P. Soulier
msoulier
But I Digress
» Blogging in the mobile age

What a strange world where I am writing a blog post on my phone. Kinda slow going, even using this cool Swype app to speed things up. Mind you, I suck at it…

Perhaps a Bluetooth keyboard will be needed.

Anyone else phone-blogging?


May 3, 2012

Michael P. Soulier
msoulier
But I Digress
» Eclipse, you could be nicer to me

So I’m playing in Eclipse going through Android development HOWTOs. Yes, I know. Java. Thankfully there’s a scripting layer for Android, but I want to learn it all before I choose a toolset for a particular problem. Besides, Java ain’t all bad, just mostly.

Anywho, I fired up the HelloWorld tutorial, made my project, and very quickly found that Eclipse’s wonderful generated code that was going to save me all this work of typing Java didn’t compile. I got, “main cannot be resolved or is not a field”. Huh? The main it’s referring to is my main.xml file (can’t have too much XML eh Java?) describing the Android UI layout, under res/layouts/main.xml. Invoked through the ubiguitous Android R object. What do you mean it’s not there, you stupid machine??

So I do what any modern programmer does, after swearing at my screen repeatedly, I look up the error in google, and voila, I’m not alone. This post was particularly helpful. Apparently, it’s an Android SDK issue, which Eclipse invokes to create the project. Yo, Google! Get off your butts and fix it! Seems to me that you have time…


May 1, 2012

Digital Copyright Canada
digitalcopyright
Digital Copyright Canada
» Not so special 301 report

The yearly joke from the USTR of their so-called "Special 301 report" came out yesterday. Not surprisingly, they kept Canada on their Priority Watch List in order to keep up their special interest lobbying efforts.

Does this mean Canada is a "piracy haven"? Not in the slightest.

It only means that the USTR continues to echo the unfounded lobbying rhetoric from the IIPA which isn't as interested in promoting the rights and interests of creators and innovators as they are protecting their members from legitimate competition.

read more

April 28, 2012

CREDIL news feed
credil
CREDIL: News
» CREDIL - Gosling 10th Anniversary next Friday

The gaggle will be meeting as usual on Friday May 4 - celebrating 10 years of history. Come on out to the Parliament Pub around 16:30-ish and join the group. http://www.goslingcommunity.org/ There are some regulars, and sometimes there are new people to meet ... like today I met someone who has been living a self-described "hermit" life for the last couple of years, but who wants to get out and engage more with communities of practice. He has been writing some gov't ministers on various topics (and getting answers!), so it was interesting to hear from him, and I hope we see him again.

April 26, 2012

Ian Ward
excess
» Gerbi CMS

Gerbi CMS (nee django-page-cms) is a multilingual content management system written in Python and based on the Django web framework. It's currently my favourite CMS software and use it for a number of web sites I administer.

I'll be giving a talk about Gerbi CMS at the next OCLUG meeting resembling this article.

April 25, 2012

Digital Copyright Canada
digitalcopyright
Digital Copyright Canada
» Why aren't we protecting the rights of cell phone owners?

I have sent in my comments to the CRTC on the development of a national code for wireless services. My submission is focused on the rights of cell phone owners.

Available as: PDF, Google Doc.

read more

» Green Party C-11 Amendments

On March 30, 2012, Ms. May (MP for Saanich--Gulf Islands, Leader of the green Party) added a few motions to the Notice Paper, Report Stage of Bills.  I will offer my own quick comments on these motions in the hope that they are useful for the ongoing debate.

read more

April 19, 2012

Ottawa Android
ottawaandroid
Ottawa Android
» Change of Meeting Date?

From the Mailing List: I’ve mentioned this in the past and was wondering if anyone would be interested in changing the meeting dates.  I’m personally interested because our meetings also occur on the same day as the Dirty Rectangles fellows … Continue reading


Jean Richard
geemoo
Geemoo dot ca
» New Udev, Old Xilinx

I updated my system lately and rebooted to find that the udev rules I was using to make my jtag programmer work, no longer worked. I had been getting messages about the rules being old and being deprecated soon for some time now, but it seemed that "Real Soon Now" had suddenly became "Now".

The new rules look like this:

SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0007", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode" SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0009", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode" SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="000d", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode" SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="000f", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode" SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0013", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode" SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0015", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode" SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0008", MODE="666"

April 18, 2012

CREDIL news feed
credil
CREDIL: News
» CREDIL - Reminder: Lunch & Learn on Thursday, April 19th, 2012

Tomorrow, will be our next Lunch-and-Learn topic at CREDIL. Mouse will be discussing "Lisp and why one would want to learn it".

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

April 13, 2012

Digital Copyright Canada
digitalcopyright
Digital Copyright Canada
» CIPPIC Acting for Defendant Geolytica in Postal Code Database Copyright Lawsuit

CIPPIC has filed a Statement of Defense on behalf of its client, Geolytica, in response to a lawsuit filed by the Canada Post Corporation in the Federal Court of Canada (File No. T-519-12) claiming that it owns copyright in its database of postal codes and that Geolytica has infringed that copyright by "crowd-sourcing" data for its own database of postal codes mapped to street addresses.

I have been watching this closely as it is linked to the Postal codes by federal ridings file (PCFRF) issue which we have an MP letter for. The electoral district boundary files are already publicly available, and it has been Canada Post's attempt to keep the postal code boundaries proprietary that has been at the root of this problem. Once the geodata for postal codes are properly publicly released, deriving the PCFRF from the two geodata files will be easy.

read more

April 12, 2012

Digital Copyright Canada
digitalcopyright
Digital Copyright Canada
» Crack the Coursepack

Crack the Coursepack is a public legal education project about Canadian copyright law, created in the context of Prof. Tina Piper’s Intellectual & Industrial Property class at the McGill Faculty of Law.

» It's not the science, but the fiction.

In the Ottawa GOSLING forum, in response to someone who suggested that opponents to nuclear power didn't care about the science, I wrote the following:

Issues with nuclear power are similar to GMO's. The problem isn't the science, but the inability of our governance structures to manage the complexities and the risks when mismanaged. After watching the C-11 committee hearings my belief in the ability of our governments to make sane decisions about technology is even lower than it was before, and I've always been an opponent of nuclear power and GMO's for governance reasons. The lack of basic science and technology literacy in government is extreme: I think they believe Harry Potter was a documentary.

GMO's = Genetically modified organism

read more

April 9, 2012

Ian Ward
excess
» Paranoid Django Templates

If you've ever wanted to know if a Django template is using a variable it shouldn't be, or not using a variable it should, this code will make both cases fail loudly. Django's default template behaviour is to silently replace missing variables with an empty string, and ignore unused variables.

To use this code you can either:

  1. wrap your Context (or RequestContext) object in your view with a ParanoidContextProxy that will fail on any attempt to access a missing variable, or
  2. use the paranoid_render_to_response function (or similar) to also require that every variable you pass be used in the template.