return to OCLUG Web Site
A Django site.
February 17, 2012

Rob Echlin
echlin
Talk Software
» Your daily tools: Tortoise and ls

Gui is cute, and sometimes productive, but GNU command line saved my sanity today.

Tortoise is a good GUI for using Subversion on Windows. It nicely flags all the files with status symbols on their icons.

Usually.

Sometimes it gets confused when a change is made 2 or more folders deeper, below the one on display. I don’t know whose cache is causing this – Microsoft’s or Tortoise’s, but it’s a minor issue.

It’s been worse since I upgraded to Tortoise 1.7.5. I jumped from 1.6.x to 1.7.5 the other day while writing docs for some tech writers, including how to install Tortoise.

I have several checkouts (OK, working copies) from the same corporate repository, all checked out in C:\svn. (OK, creativity didn’t seem necessary in this case, OK?)

Today the checkout I am most interested in was mostly not displaying its status icons. Yesterday I wasn’t as worried about it. Usually the entire tree was unaccented. Sometimes a folder would light up until I changed something. Then I noticed that all the “.svn” folders were missing, except in the top folder of the tree. Weird. I checked settings on a couple of things to make sure hidden folders were visible. For a while I had a grain of doubt that maybe the .svn folders were really gone.

So I went to the command line. “dir” didn’t see any .svn folders at all. That was because they were “hidden” by a Microsoft flag on them. “dir /ah” showed them, but not any of the other files/folders. Two dir commands required. Painful.

I have GNU Win32 tools installed, which is a port of the regular GNU tools to Windows.

So the answer was “ls -Al”, or “ls -A” for that economical look.

Thanks to all the GNU developers and those who ported and packaged it for Windows. You help me stay sane on the MS platform.

The site to download for Windows is getgnuwin32.sourceforge.net.


Tagged: frustration, Linux, software, tools, Windows

February 10, 2012

Rob Echlin
echlin
Talk Software
» Numeric-only date output? Fail!

Yesterday, I donated blood again.

They have been asking you questions on the computer for the last year or so.
Example: “Have you eaten any pogo sticks in the last 30 days (since 09/01/2012)?”
The accompanying voice asks without telling you what the date was a month ago, fortunately. It was enough of a distraction that they used a different reader or a different room when they added new questions; a computer generated voice would have been actually irritating.

So there was the date, to me it meant Sept 1, and my fast read of it ignored the year which would have made that a future date. The fact that I can’t read is hardly relevant here. :-) The real point is that they used numeric dates, which are always ambiguous.

Take this home and tell your friends:
Complain when computers don’t display or print dates with a 4 digit year and a text month that is at least 3 letters long. Maybe we can get a culture going that actually communicates clearly.

And please take any managers you know from Canadian Blood Services to CapCHI meetings on the third Tuesday of the month at The Code Factory. then buy them a beer afterwards at whatever pub we go to.

Have you ever filled out a date field  in DYM or MYD order? Shame on you! :-)


Tagged: computer, frustration, humor, software, software humor

January 23, 2012

Ian Ward
excess
excess.org - News
» Urwid at Python Malaysia

I'll be giving a introductory-level presentation on Urwid at the Python Malaysia February Meetup in two weeks. I'm covering the basics with a short presentation and there should be plenty of time for questions or digging in deeper on any aspect.

[Update 2012-02-04]: Slides now available

[Update 2012-02-06 added some photos]


Rob Echlin
echlin
Talk Software
» Blog tools in Linux

I decided to look at what blog tools are available in Linux. I want to  use them with my WordPress.com blog, of course, so that is how I tested them.

I have only checked out a couple of tools, but I find them mostly not working very well with WordPress.com. The only one that has worked at all is QTM, so far.

BloGTK

This is the recommended tool for Linux, according to the WordPress site. It won’t install in Oneiric. I expect I could make it work if I fiddled with some settings for apt-get, maybe. But the author is not working on it, so no real desire to try.

gnome-blog

Broken. Intended for Gnome 2. One of the libraries is not compatible with Gnome 3: “python-gnomeapplet”. Maybe there is no concept of applet in Gnome 3?

Drivel

I tried it. Editing a new post worked. There were error messages connecting to WordPress.com. I was not able to post the blog because it could not get permission to write.

QTM

This one was able to post a message, but left the message in the “draft” state on WordPress.com. That may be my fault – there is a “draft/publish” drop down on the app.

Because it was “posted”, it put the file into some sort of archive state, so that the next time I went to edit, I had to fiddle around to be able to see it. Finished editing the post on WordPress.com.

Other options

There is at least one plugin for FireFox for editing blogs. But I was looking for tools for Gnome so I can try out Gnome 3, so I haven’t tried it yet.


Tagged: Gnome3, Linux, software review

December 20, 2011

Ian Ward
excess
excess.org - News
» Super Meat Boy with Reconfigured Keys

The Humble Indie Bundle #4 was nice enough to bring Super Meat Boy and a bunch of other great games to Linux. The SMB people however seem to want to punish you for playing on a keyboard and leave you with SPACE as jump, SHIFT as run, and no way to reconfigure the keys.

Here is a little xmodmap script that makes playing on a keyboard much more enjoyable:

keysym x = space
keysym z = Shift_L

Just save this as xmodmap.meat and then run xmodmap -pke > xmodmap.orig to save your original key settings.

Finally, run xmodmap xmodmap.meat before starting the game, and xmodmap xmodmap.orig when you're done.

December 19, 2011

Ian Ward
excess
excess.org - News
» Unfortunate Python

.red {color:red}

Python is a wonderful language, but some parts should really have bright WARNING signs all over them. There are features that just can't be used safely and others are that are useful but people tend to use in the wrong ways.

This is a rough transcript of the talk I gave at my local Python group on November 15, with some of the audience feed back mixed in. Most of this came from hanging around the Python IRC channel, something I highly recommend.

[update 2011-12-19: improved "array" critique, add "python -i" suggestion to "reload" critique, add html targets to sections]

[update 2011-12-20: include additional links from agentultra and ffrinch]

[update 2012-01-06: added hasattr and find]

[update 2012-04-09: some links and syntax highlighting]

December 8, 2011

Ian Ward
excess
excess.org - News
» Speedometer 2.8 Released

This release adds the long-requested linear scale feature to Speedometer. You can now also adjust the minimum and maximum values displayed, and switch all units shown to bits per second.

November 29, 2011

Ian Ward
excess
excess.org - News
» Urwid 1.0.1 and 0.9.9.3 Released

Urwid maintenance releases 1.0.1 and 0.9.9.3 are now available. This may be the last 0.9.9 release, users are strongly encouraged to upgrade.

September 23, 2011

Ian Ward
excess
excess.org - News
» Urwid 1.0.0 Released

This is a major feature release for Urwid.

Happy 1.0 Urwid! It's been a great nearly-seven years since our first release. Huge thanks to everyone that's contributed code, docs, bug reports and help on the mailing list and IRC.

September 19, 2011

Ian Ward
excess
excess.org - News
» Widgets, Form Fields and Model Fields Explained

In any web application user data must be translated from HTML form data to native types and database types, and back again. Django web applcations are no different.

The "right way" to handle custom types is to extend Django's widgets, form fields and model fields. However, understanding exactly how these types perform each step of the conversion can be confusing. This post will attempt to explain how the data is converted at each stage and offer some advice about creating custom widgets, form fields and model fields.

This article is based on Django 1.3 and assumes the reader has experience creating and using Django forms, models and validation.

July 13, 2011

Ian Ward
excess
excess.org - News
» Urwid 0.9.9.2 Released

This is a maintenance release that fixes a number of bugs that have been found in 0.9.9.1.

June 23, 2011

Ian Ward
excess
excess.org - News
» Recording Both Sides of a Call

I set up a VM to present software to a client remotely, but I needed a way to record both the audio in and out so that I could capture both my presentation and the client's questions. In the past I've used some ALSA configuration magic for audio things advanced enough that they don't have a friendly GUI, but since Pulse Audio is the shiny new thing I decided to go that route.

It turns out to be fairly simple. I create a new null sink (think: fake sound card for output) and attach a loopback from the audio out monitor of the "real" sound card and another from the the audio in of the "real" sound card:

pactl load-module module-null-sink sink_name=bothsides
pactl load-module module-loopback latency_msec=5 sink=bothsides \
      source=alsa_output.pci-0000_00_04.0.analog-stereo.monitor
pactl load-module module-loopback latency_msec=5 sink=bothsides

The alsa_output... source comes from running pactl list and copying the device name. The second loopback automatically uses the only alsa_input... source device. Then I can record from the monitor of this null sink with a command like:

pacat --record -d 2 | sox -t raw -r 44100 -s -L -b 16 -c2 - "recording.wav"

The -d 2 option selects the new null sink monitor device I created (the index may be different in your case). Last, you may want to use the pavucontrol program to adjust the levels for the input and output so you don't end up with one sounding much louder than the other in the combined recording.

June 14, 2011

Ian Ward
excess
excess.org - News
» Python 3 Argument Sketch Slides

Here are the slides from my Python talk at OLS this afternoon.

May 25, 2011

Ian Ward
excess
excess.org - News
» Python on Android, Django Unit Testing at OPAG

Ottawa Python Authors Group meeting tomorrow Thursday May 26 at 8p.m. Best of all it's not me talking this time!

Hope you can make it out.

May 20, 2011

Ian Ward
excess
excess.org - News
» Python 2 and 3 Slides

Catching up on some more old business: here are the slides from the Python 2 and Python 3 talk I gave at last month's OCLUG meeting.

I am also preparing some Python tutorials for the upcoming 2011 Linux Symposium in Ottawa June 13-15. Hope you can make it.

May 14, 2011

Ian Ward
excess
excess.org - News
» IPv6 Summit Summary

I'm late with this update (busy catching up on other work that I neglected last month) but I must report that the Ottawa IPv6 Summit went far better than I had hoped: Great turn-out, great venue, great talks and great food.

Pictures are now available from Richard Guy Briggs and we're working on putting the talk videos online with the help of ISI Global Webcasting.

The space at Telfer School of Management was ideal, and the Telfer volunteers got everyone registered helped everything run really smoothly all day.

It was tons of work, but I look forward to doing it again. Maybe I'll even catch more than a couple talks in person next time.

April 14, 2011

Ian Ward
excess
excess.org - News
» Ottawa IPv6 Summit Early Registration

Just a reminder that tomorrow is the last day for the early registration discount.

The preliminary schedule has been posted. Register now!

April 4, 2011

Ian Ward
excess
excess.org - News
» Python Talk at OCLUG on Tuesday

I will be giving a talk on Python 2 and Python 3 at the Ottawa Canada Linux Users Group meeting on Tuesday. Hope to see you there.

April 3, 2011

Rob Echlin
echlin
Talk Software
» Learning about Git

Origins

Git was invented by Linus Torvalds to use with the Linux kernel. There were performance and political, aka licensing, issues with the previous version control system that the kernel used.

Selected Features, from Wikipedia

  • Strong support for non-linear development
  • Distributed development
  • Efficient handling of large projects
  • Pluggable merge strategies
  • Toolkit-based design

Description

Git is a distributed system, modeled on a file system with built in versioning. Linus wrote it for speed in the use-cases he cared about with the kernel:

  • Patches supplied by email or grab from other user’s repositories
  • Pick and choose among patches provided
  • Merging many patches per day
  • All users comfortable with the command line

I have used it for about a year, and found it very useful, with a few caveats. I use it at home a lot. It allows me to propagate data between systems very quickly, so I use it as backup for my own work at home. I started with a single repository containing several small unrelated projects and non-software files, such as my career-tools folder which contains resumes, personal cards, graphics and sample letters. I learned the hard way that putting it on a USB key requires keeping free space on the stick greater than the total size of the repository. I haven’t gotten around to breaking it up into a couple dozen separate repositories, but I will. Also, I learned that a 600MB repo takes a long boring while to update on really slow media such as a USB stick.

When using Git, you grab a copy of the whole repository on your local machine. That’s what makes it a “distributed” version control system. You “commit” your changes to your copy of the repository. To share them with others, you then “push” them to a central repository when you are ready, or ask others to “pull” from your repository. This basically means committing all changes twice: locally, then centrally.

At work I used Git with a small team of three people. I learned that, like using a stick-shift transmission, Git requires a commitment to learning that is higher than on an automatic transmission.

Some people use manual transmissions inefficiently and in ways that I cringe at, shifting too often or not often enough, not matching revs, and have no idea how or when to double clutch. Modern car transmissions are designed to survive this treatment. Keep those people away from trucks.

Git is like a manual transmission. You should commit to learning more about it than you think you need to know. There is always more to learn. Also, you can use “work flows” with it that are difficult to do with Subversion or most other VCS’s.

The Linux kernel team has thousands of developers who contribute to it, hundreds who contribute frequently, from sites around the world. Their work flow might not work in a centralized repository. A simplified version of their work flow (assuming the change is perfect) goes like this. You grab a copy of the latest “blessed” kernel code from the canonical git repository on GitHub, make changes, test them, and then tell the person in charge of that part of the kernel. This person grabs the code from your GitHub copy of the kernel repository, or receives it from you by email, examines it, tests it, merges it with other changes in the same part of the code and submits it upstream to one of Linus’s main “lieutenants”. This gatekeeper will similarly examine it, merge it with other changes, test it, and promote it to Linus who may choose to accept it.

This work flow is very different from a “small” environment where, of maybe a hundred developers on a project, 5 or 20 are working on one part of a project and have that part of the code to themselves. Git works with these teams as well. It is fast and supports complex merges.

Git also supports different work flows that you may not be used to. For instance, I knew a team that used git internally, and then submitted changes centrally to the corporate Subversion repository. This had several advantages. The team leader could filter submissions from new employees. They could do local commits to their own repository frequently, say at 5 minute intervals on a temporary branch, share with their team mates on a common branch when a small change was ready, and not be delayed by the slow submit time to the Subversion server in England. Changes could be “summarized” in the corporate Subversion repository, so that all those unfinished changes in the 5 minute commits were not seen, and failed, by the Continuous Integration server.

Git also supports using a central repository that people can push their changes to. This is a repository that has no “working copy”, just the repository database.

“Tags” and “branches” are a local idea in git. This means you have to push your tags manually so that other people can see them. Also, if you don’t explicitly copy  your branch to the server, git will happily push your changes but you will not be able to find them easily as they are not on a branch on the central repository.

How to lose your changes in git: Create a new branch locally, make changes, push them to the server that does not have that branch, and delete that branch locally, forgetting to merge to a main branch. That’s a bit like trying to shift down from third to second on an uphill, taking too long and then stalling because the truck is going too slow for second gear when you finally complete the shift. In this case, my co-worker recovered because he found the commit ID on a scrollback log in the terminal window where he did the commit.

Git works best when someone on your team is an expert and everyone takes time to learn more than the minimum.

Main Git web pages

  • http://en.wikipedia.org/wiki/Git_(software)
  • http://git-scm.com/
  • http://whygitisbetterthanx.com/
  • http://unspecified.wordpress.com/2010/03/26/why-git-aint-better-than-x/

GUI tools for Git

There are now GUI tools for Windows, and plugins for many IDE’s.

  • http://en.wikipedia.org/wiki/Git_(software)#External_links

 


Tagged: Linux, software, team tools

April 2, 2011

Rob Echlin
echlin
Talk Software
» Learning about Subversion

Origins of Subversion

The Subversion project was initiated by CollabNet in 2000. The goal was to create a new version control system to replace CVS, with some bugs fixed and some features added.

Selected Features (from Wikipedia)

  • The system maintains versioning for directories, renames, and file metadata (but not for timestamps). Users can move and/or copy entire directory-trees very quickly, while retaining full revision history.
  • Versioning of symbolic links.
  • Native support for binary files, with space-efficient binary-diff storage.
  • Branching as a cheap operation, independent of file size (though Subversion itself does not distinguish between a branch and a directory)
  • Natively client–server, layered library design.
  • Client/server protocol sends diffs in both directions.
  • Costs proportional to change size, not to data size.
  • Path-based authorization.
  • Language bindings for C#, PHP, Python, Perl, Ruby, and Java.

Description

Subversion is a centralized system. This is good for a centralized situation. Build teams and product leaders are confident that your code is available as soon as you check it in.

It can scale well. If one server is not powerful enough or if you have developers on multiple continents, you can have a central read/write server with multiple quasi-read-write servers. They send the “write” messages back to the central server. This is fine for most deployments because there are many more read than write transactions.

Before this server architecture was available, I once set up a deployment with one server in England, where part of the development was done, and another server in Canada, where the main team was. The code was split by project into approximately 20 repositories. Each repository was read-only in one site and read/write in the other. Nightly cron jobs synchronized the read-only repositories before the nightly builds.

Support for Subversion

  • has attracted numerous GUI interfaces
  • runs on many OSes
  • integrated into many IDE’s and editors

Main Subversion web pages

  • http://en.wikipedia.org/wiki/Apache_Subversion
  • http://en.wikipedia.org/wiki/Concurrent_Versions_System
  • http://svnbook.red-bean.com/ – “Version Control with Subversion” – best source for users and administrators!

GUI tools for Subversion

There are several GUI tools for interfacing with Subversion, including one for the iPhone, and integration for most IDE’s. See:

  • http://open-tube.com/7-subversion-and-svn-clients-gui-for-the-popular-subversion-and-svn-source-repository

Tagged: software, team tools