Mike Rooney

programming and philosophy

Lightweight Personal Finance Just Got Easier With wxBanker in Jaunty!

| Comments

wxBanker, your (hopefully) favorite lightweight personal finance application, has recently been accepted into Jaunty! Aren’t familiar with it? Check out the screenshots! It took a few months of getting over the debian packaging learning curve, and about as much work getting and responding to the reviews from MOTUs, but I did it. I plan on doing a quick point release this week and releasing wxBanker 0.4.0.3, which will sport updated translations in 15 languages (thanks translators!) as well as a minor bug fix or three. Once I get that out and into Jaunty, I’ll turn my complete focus (I hope) to the 0.5 series. If you’d like to translate wxBanker to your own language or improve a few of the lacking existing translations (Bosnian, Dutch, and Portuguese particularly), I’d love it! Head over to https://launchpad.net/~wxbanker-translators and join the fun!

The 0.5 series is a refactor and a bit of a painful one, as I didn’t have a great handle on how to efficiently and smoothly refactor. I could probably do a much better job managing it now, but that’s how experience works. All in all it is a much cleaner structure and led to more and better tests, which should allow more agile development and protect against future regressions. Some of the main upcoming features I’d like to get in are transaction tagging, recurring transactions, reporting, online syncing (via mint.com), and csv imports. I’d love for at least a few of those to make it into 0.5, and there is good progress on some of them including csv imports thanks to an impressive branch from Karel. On the other hand 0.5 has already been ongoing for about 3 months and I might cut a release into a PPA and get feedback while I add new features, sorting out any 0.5 issues and leading to a robust 0.6 release.

Overall I have learned a TON from this project, in no small part thanks to Launchpad. wxBanker started out as a terminal application which stored everything in a pickled linked tuple that I used for myself and added features as I needed them. Eventually I added a GUI (in wxPython) and registered the project on Launchpad, to get free hosted version control as well as more formal bug tracking (instead of a text file :). The combination of Launchpad and [wx]Python being cross-platform made it accessible to everyone, and took it from a project used only by myself to a project available in 15 languages with code contributions from multiple people.

So in conclusion, thanks everyone, enjoy wxBanker 0.4.0.3 in Jaunty, and look forward to future versions in my PPA. If you’re not on Jaunty yet, you can install 0.4 from my PPA, which I’ll be updating to 0.4.0.3 as soon as I release it. I’d love for any of your contributions, suggestions, questions, or criticisms to end up on Launchpad. I’d love to make it as usable and intuitive as possible, so anything that is unclear or confusing would be awesome to hear.

Comments

Anonymous
I completely agree - having used a bunch of personal management tools I would love to have the power of wxBanker for my personal finances if only for the easy upload. You can get information about Money exchange at here:interchangefx.co.uk
Michael
David: Glad to hear it! I just updated the PPA so you can grab 0.4.0.4 in Intrepid or Jaunty. If you are patching any bugs, 0.4 is a good place, and I will port them forward. Otherwise for new features, 0.5 is a good place for the work.

There is no need to wait though; that code should be released soon and I’d love more testers so feel free to do a “bzr branch lp:wxbanker/0.5” and run from there, filing any bugs on launchpad and adding any cool features!
David
Good to hear you’ve been working on it. Been keeping an eye on it over the past months, and hadn’t noticed any new releases. I’ve been putting off sorting out my personal finances for way too long, so tonight’s the night :-) Will send some patches your way if I come up with any improvements, but maybe I should wait for 0.5 if it’s undergoing a major change in codebase?
Michael
It is definitely in my plans to get wxBanker into Debian as well, and Ubuntu prefers it as well. I am not sure of the process involved but I will probably take a look at it after I release 0.4.0.3. I am glad it interests you!

It is a fairly simple package, you could probably download the deb and use it fine in Debian, or just download the source and “python setup.py install” yourself :)
Anonymous
Can you add that to Debian too? Please don’t leave Debian users out in the cold yet again Ubuntu!

Playing Spelunky in Ubuntu With Wine and Compiz

| Comments

Spelunky is an awesomely addictive indie game, which I highly recommend checking out. It is sort of like Mario meets Nethack. As a side-scrolling, cave-adventuring character, you must venture deeper into the cave, defeating enemies, saving damsels, and collecting money and other fun items. A unique aspect that it takes from roguelike games is that there is really no concept of saving; each “play” typically lasts only a few minutes (much less at first), but you can get shortcuts to different zones to skip ahead once you get better. Also like Nethack, it is a surprisingly rich, detailed, and polished game for all its simplicity.



The unfortunate thing about Spelunky is that only runs in Windows. My initial attempts at running it in Wine proved unsuccessful, but after a while (and playing it on a friend’s machine which gave me enough to interest to keep trying), I figured out just the right combination of tricks to make it quite playable in Ubuntu. Here’s what you need to do:

  • download Spelunky, make sure you are using compiz, and install wine and compizconfig-settings-manager.
  • set wine to run in an emulated desktop window. To do this, run “winecfg”, go to the Graphics tab, and check “Emulate a virtual desktop”. The size isn’t really important; I use 800x600.
  • extract Spelunky and create a file (if it doesn’t exist) called “settings.cfg” and put these contents in it:

1
1
0
0
1
15
15


This is the default settings, tweaked to the only setting that allows it to run in Wine. You can’t configure it normally since it only works in this way, so I had to have my friend change settings on his Windows box and watch what numbers changed. Thankfully for you I have done the hard work.

  • Run Spelunky! Double-clicking it should probably work, but if you want it to play nicely with other applications using audio at the same time, force it to use pulseaudio by running “padsp wine spelunky_0_99_5.exe”. It should show a configuration window, but you can’t really interact with it. Just click in it and hit enter.
  • Now you can play Spelunky, but it is at a 1x zoom level, the only one that plays nicely with Wine. This isn’t very usable! Run “ccsm” (System -> Preferences -> CompizConfig Settings Manager”) and enable “Enhanced Zoom Desktop” from the second group, “Accessibility”. Now you can zoom in by holding your Super key (Windows/Apple/Ubuntu key) and scrolling your mouse wheel in or out. Using this technique you can make Spelunky effectively full screen and if you sit it right in the corner, you will forget you are doing anything strange within a few minutes.

Okay, that’s it! Some initial setup is involved but once you’ve gotten it to work the first time, all you need to do in the future is run Spelunky and zoom in. As for help playing Spelunky, navigate over to the tutorial area once in the game, and you’ll learn everything you need to know! Let me know if it works for you and how much you love Spelunky (it’s worth it, I promise!) and don’t forget to check out more fun indie games on tigdb.

Comments

cyberix
This now works for me with Ubuntu Karmic and my ATI video card using latest proprietary driver. Setting the zoom level to a bigger one worked as well, but for some reason the window is bigger than the picture.

I did not try the compiz trick as the size is already rather good and I don't want to mess it up.
John W
Thank you!!!!
Michael
Relet, make sure to be using a newer version of wine from the PPA I mentioned in comment #7.

As far as slowness, I only tend to experience slowness if running another Wine app at the same time, but it is otherwise quite smooth, so unfortunately I have no other advice besides minimizing other tasks using the CPU.
Anonymous
I used this guide and I was able to play the game, but it goes really slow and it takes forever to do anything. is there any way to fix this?
relet
I get either of the following errors using spelunky 1.0 and wine 1.0.1:

When using the new settings file:
X Error of failed request: GLXBadDrawable
Major opcode of failed request: 128 (GLX)
Minor opcode of failed request: 11 (X_GLXSwapBuffers)
Serial number of failed request: 3528
Current serial number in output stream: 3530

When using the old settings file (a window opens, stays black, and repeats the message on console):

fixme:d3d:IWineD3DSwapChainImpl_Present Unhandled present options 0x32fcbc/0x32fccc

I'll try a newer version of wine next.
cyberix
I can't get the game running by following this guide, I get the following error instead.

err:dmloader:IDirectMusicLoaderImpl_
IDirectMusicLoader_SetObject : could
not attach stream to file
cyberix
This comment has been removed by the author.
Anonymous
Thank you so much for posting this…now I don't have to borrow my wife's laptop to play Spelunky!
Luca
oh never mind upgraded to wine 1.1.20 and it works fine now. thanks!
Luca
oh whoops i forgot to say what it does :P
well the window opens and i get to the configurations screen (which btw you can interact with you just have to click about 100-150 pixels below the actual button). i hit ok and it just closes.
Luca
Doesn’t work for me. i tried what you said. I have Ubuntu 9.04 on a P4 with nvidia 8400 GS
i wonder why…
oh, and i have wine 1.01
Michael
Hi bryn,

I have been using Wine from the PPA: http://launchpad.net/~ubuntu-wine/+archive/ppa

Currently this is 1.1.17 which is an improvement over 1.0.1 in Ubuntu by default.
curious.jp
Michael,
Which build of Wine are you using? I only get music and severe graphical distortion (as well as graphics inverted on the y axis to boot).

Cheers,
Bryn
M-U
To make the size issue better, set the size to fit your monitor, then in appearance change the Desktop to black

Also disable 'Allow Window Manager to decorate windows' but let it be controlled

Now in compiz enable the 'Legacy fullscreen support' and run it

Widescreen users keep reading…
Make the wine virtual desktop have a 4:3(w:h) ratio, do the same steps above, then make a black image(call it ~/black.png), in the decoration plugin, change 'all' to '(all) & !(title=Default - Wine desktop)' in the shadows option, in the window rules plugin add a rule for 'title=Default - Wine desktop' and keep the y 0, but put ('width of monitor'-'width of virtual desktop')/2 as the x value

now when running the app use the following script

#!/bin/bash
IMG=`gconftool-2 -g /desktop/gnome/background/picture_filename`
gconftool-2 -s /desktop/gnome/background/picture_filename –type string $HOME/black.png
CMD TO START APP
gconftool-2 -s /desktop/gnome/background/picture_filename –type string `echo $IMG | sed 's| |\ |g'`
Anonymous
Hehehe it’s like Fred for ZX Sinclair in the mid-80s!

http://www.mobygames.com/game/zx-spectrum/fred

http://www.mobygames.com/game/zx-spectrum/fred/screenshots
Murrquan
Just another reminder to contribute this fix to http://appdb.winehq.org ^.^

And thanks for the link! Now I’m browsing through all their Linux games.
Juanjo
You should try Cave Story:
http://www.miraigamer.net/cavestory/

It’s the best platform game so far.

It’s not FLOSS, but there’s a Linux port that actually works.
Anonymous
Please contribute this information to the WineHQ AppDB!

When It’s Good to Be Bad

| Comments

Jonah wrote a post about how awful the band Brokencyde is, and I mostly agree with the points mentioned. However I would also like to propose that if you aren’t particularly talented, it is more profitable to be epically bad than it is to be just moderately bad or even mediocre. I also think it is more entertaining and useful to society as a whole, thus being the utilitarian venture to embark upon if you aren’t traditionally talented. So let’s begin my defense.

I suspect the magnitude of profitability can perhaps be simplified as the multiplication of two factors: the number of people exposed to your product and the probability that a random person would purchase your product if exposed to it. In this model, a very ubiquitous band that people love is the biggest winner; lots of people are exposed to the product and a good percentage buy it. Mediocre bands do alright but not nearly as well. The percentage of people willing to purchase is on the same order, perhaps half as much or so, but the exposure is WAY less. The market is saturated with mediocre to decent bands and no one has time to find or listen to them all. As a result, these bands aren’t nearly as ubiquitous, leading to sales and thus profits which are orders of magnitude less. As you get worse and worse, your market is more and more saturated, you are less and less interesting, and profits continue to drop, in a roughly linear to inversely square fashion. But it doesn’t approach zero; once you cross a certain threshold of awfulness something magical happens:



You become interesting again! The market actually becomes LESS saturated as it becomes challenging to be worse than that threshold. You have become so awful that you are fascinating and captivating, entertaining and hilarious! Sure, the chance that a random person buys your product has now dropped by an order of magnitude or two, but your exposure increased by many more. You aren’t quite playing with the big dogs, but you can sell leaps and bounds more than the average guy. All for being notably worse than most other bands.

So clearly it can make sense selfishly and financially to be a Brokencyde or a Williang Hung, but are you harming society in the process? I don’t think so. Surely a few people will legitimately be offended and wish such bands didn’t exist, but I think the majority of us are at least entertained by their existence which makes us laugh or smile, have an interesting discussion with friends, or at least have a great gag gift (another unique sales niche these bands get in on). As a result, individual Brokencyde’s of the world increase the overall happiness of society more than an individual “average” band. Sure they’re bad, but would we (or they) want it any other way?

Comments

TheGZeus
Where do we fall?
http://myspace.com/satanistsinlove

Our first album is at least 10 times as bad as anything on there.

Setting Up a Fingerprint Reader With ThinkFinger in Ubuntu 8.10

| Comments

If your laptop has a fingerprint reader installed in it, there’s a decent chance you can set it up very easily in Ubuntu to login and [gk]sudo. Since the manpage isn’t particularly helpful, I’ll guide you through setting it up with the ThinkFinger library, which is compatible with most popular readers installed in Lenovo/Thinkpads, Dells, and Toshibas.
  1. Install the necessary libraries: sudo apt-get install thinkfinger-tools libpam-thinkfinger
  2. Integrate thinkfinger with PAM (Pluggable Authentication Modules): sudo /usr/lib/pam-thinkfinger/pam-thinkfinger-enable
  3. Now acquire your fingerprint: run tf-tool –acquire. If you get an error here (not a failed swipe, you just need to swipe better), running it with sudo might be necessary. If you still get an error that thinkfinger can’t interact with your reader, it probably isn’t supported, sorry! Otherwise, keep swiping your finger until you get two successful swipes.
  4. Finally, make sure it worked: run tf-tool –verify and swipe your finger. Try this a few times, and if it doesn’t have a good success rate, do another acquire (the previous step), perhaps slower and more intentionally.

Now you can log in by swiping your finger at the password prompt, and more usefully in my opinion, swipe your finger instead of entering the root password at terminal and graphical password prompts. This is one of those little things that, once you get used to it, is hard to ever live without. Check it out:


By the way, while there may be valid security concerns with fingerprint readers, don’t listen to the critics who say you can just breathe on it to get a swipe. 2D fingerprint scanners may work this way, but laptop fingerprint readers take a reading in both space and time. Try using tf-tool –verify and finding out for yourself; you can blow and breathe on your fingerprint reader all day without getting it to even recognize a scan, let alone a failed one.

Comments

Anonymous
My Lenovo T61 is Running Ubuntu 10.4 and thanks to your instructions swiping is now working smoothly!

Thanks so much, Jose.
Fingerprint readers
thanks for giving the steps in setting up the fingerprint readers.
Chris
Clear, concise and it works! Many thanks.
Michael
Anonmyous: the theme is Dust: https://wiki.ubuntu.com/Artwork/Incoming/DustTheme

Ryan: yeah, Dell is doing a pretty slick job of properly supporting Ubuntu. As a result I am on an M1330 right now (though not with Ubuntu pre-installed, this was a refurb).

crashsystems, Aigarius: if someone has a copy of my fingerprint, then they basically have a copy of my password. It wouldn’t surprise me if that works. So does having a copy of your text password, which I could get much easier than a scan of your fingerprint, just by looking over your shoulder.

Dread Knight, that will take care of logging in via fingerprint, but won’t help for those times when you have to type in your password once logged in, such as terminal and graphical sudos including updates. This is really the main feature IMO.
Dread Knight
I just use the thing from BIOS that prompts me to swipe when i start tablet pc and i can also enter my password.
Works good in combination with auto-logic in my Kubuntu Jaunty :P
Aigarius
Most of those systems are easily fooled with a black and white printout of your fingerprint. Could you try it and see if it works?
Anonymous
I tried on a HP DV6000 and all I got was “Initializing…USB device not found”

When I ran “lsusb” I saw:
Bus 005 Device 002: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint Sensor


I guess this “thinkFinger” program only works with “Thomson Microelectronics”. I hope someone will come up with a unified framework for these kinds of readers.
Mattias
The fedora people have put some work to get fprint (a dbus based fingerprint reader integration) to work well with Gnome. They have made some about-me integration aso. So it might be worth looking at that also.
crashsystems
While I don’t know about the whole breathing thing, the gelatin finger trick should be sufficient to trick the sensor.

Of course, an attacker using such techniques is going to be more than just some random person who walks by your laptop and decided to mess with it. This means that they are after data on your laptop, and not having the fingerprint reader would not be a deterrent to them. Against such attacks, only good crypto can keep you safe, such as encrypted LVM or Jaunty’s upcoming encfs encrypted home feature.
ryan
Dell’s Ubuntu installations pre-configure this option, at least they did on my M1530.

Very slick.
Anonymous
Hey that theme looks great, what’s the name?

Typing on the Toilet

| Comments

Yes, I’m blogging from the toilet, but there’s no need for your mind to be in the gutter. I just moved in to a new apartment and haven’t set up internet yet, and as it turns out the bathroom is the only place that gets an unencrypted wireless signal.

Overall I accomplished quite a bit today. I worked a 10-hour day at work, came home and made myself a nice dinner, and did a complete move from start to finish, including all packing and cleaning at the first place, and unpacking into the other. This whole moving process took only 2.5 hours as well, so that’s got to be _some_ kind of world record. Granted, the two places are a few hundred feet apart, but I still feel accomplished.

In the Ubuntu world, I just noticed in Jaunty that when you switch backgrounds it does a rather sexy fade transition from the old background to the one. If you haven’t seen it yet I would definitely recommend checking it out in a VM with Jaunty Alpha 4. Now all we need is more than two wallpapers that ship with Ubuntu! Install gnome-backgrounds by default, anyone? If you don’t know about those, please install that package and check them out too, and subscribe to the linked bug report to get it more attention!

On a sadder note, recent Intrepid updates broke my fingerprint reader <--> PAM integration; did this happen to anyone else? There was one particular update asking me what I wanted to do about pam settings and I click the recommended suggestion, to use the new ones, but now pam doesn’t understand that I have a fingerprint reader to use to login/[gk]sudo, et cetera. Granted, it is only a one-liner to re-configure this, but it seems quite suboptimal!

Okay, good night/morning/afternoon everyone :)

Comments

egometry
toilet-blogging?

That, my friend, is the shit.
Michael
Also thanks Marius for the bug report link, I’ve subscribed and attempted to do some basic triage. You are correct, I do use thinkfinger. So it is thinkfinger’s fault then (its pam module), and not pam?
Michael
Thanks Anonymous, I must admit I had a good to laugh to hear that someone actually had a goal to do one day blog from the toilet :)

And you are correct, no heavy stuff. My queen bed and lounge chair are my only furniture, and they are both made by AeroBed :) I just deflated them, put them in a suitcase, wheeled them over, and re-inflated them!
Anonymous
Well I have to admit when I read your header I though ‘Yes at least someone did it!’
Did what you might ask, I’ve always thought about a toilet-net . Some years ago it was a TV but nowadays I would like to have web access.
So for me it is still a someday want to to sit on the toilet and blog instead of reading a book. :-)

BTW: congrats to your quick move, I take it you did not have to move much stuff, heavy stuff like furniture.
Marius Gedminas
It will be more convenient if I make the link clickable (stupid Blogger is acting stupid again): #273522
Marius Gedminas
If you’re talking about thinkfinger, there’s an open bug on launchpad: https://bugs.launchpad.net/ubuntu/+source/thinkfinger/+bug/273522

Failing Tests: When Are They Okay?

| Comments

As a developer on a team, when (if ever) is it reasonable to check in something which breaks one or more tests and causes the build to fail?

The most important aspect of a build seems to be that it accurately represents the health of your product. In an ideal world, if all the tests pass, I should be comfortable deploying that code. In a perhaps more realistic world, I should either be comfortable deploying to a part of the system (small random %, special testers group, etc), or at least be comfortable sending it off to QA with the expectation that it will pass (and be surprised if it doesn’t). Conversely if the build fails I shouldn’t be suspecting that one of the tests must have randomly failed or that someone forget to update a test to reflect application changes; I should be wondering what is wrong with the product.

But if you have set release dates, say every two weeks, is a broken build in week 1 a problem? Is it okay for developers to be using TDD and checking in the tests first, or checking in incomplete or broken code so that others can collaborate on it? In some ways it definitely seems reasonable to allow for this. After all, the release date is in the future and it is quite expected that features aren’t completed yet or that bugs aren’t fixed yet. You should be encouraged to commit early and often and you don’t want to have to jump through hoops to collaborate.

However there seem to be disadvantages to this type of workflow. First of all, if a build is broken, it can’t break. What am I talking about? If I check in my expected-to-fail test or my half-finished code and the build is failing, the next time someone unexpectedly breaks something, it isn’t nearly as obvious. A passing test suite changing to a failing suite, in a good environment, should be blindingly visible. But what about a failing test suite continuing to fail, albeit in more ways? That’s more subtle. From the second that happens you’re accumulating debt and the faster you find it, the easier it will be to fix. But if you can’t check in broken code, how do you easily collaborate with someone else on it over time?

Another problem that can arise is the accumulation of potential debt by replacing functional code with incomplete code. If you aren’t able to make the timeline or the feature gets dropped for release, you now have a reverse merge on your hands. This could be particularly time consuming if others have been working in the same files that your work touches. On the other hand if you had been implementing it side-by-side and waiting to actually replace it until it worked, it would be no problem to ship the code in that state at any point if need be. Your deployment is more flexible and less error prone.


So how can you balance these tensions in an agile environment? I’d love any feedback that anyone has to provide. What are the reasons for prioritizing a passing build that I missed, and what other drawbacks exist?

Comments

bobthevirus
I’d suggest that this is one of the great advantages of dvcs. The cheap branching means that you can have your non-passing tests for undeveloped features in separate branches, merging each branch when, and only when, it goes green.
Marius Gedminas
I started writing an answer, and then it became long and transformed into a blog post: keep the buildbot green!.

Also, Blogger ate my first attempt to post a comment here, and I felt somewhat better about deciding to do a post rather than answer here.
Andy Friesen
I agree with Hitchens.

If your build is red, your first priority should be doing whatever it takes to make the build green.

If the bug you have found is serious, then that probably means that your team’s highest priority should be fixing the bug.

If it is not so serious, then you should back out the test until you have reason to believe it will pass.

Either way, you do not want to allow unrelated commits while the build is red. Red means that your application has burst beyond your control, and building further functionality atop a system that is already out of control is simply not a sustainable way to develop.
oliver
I think it’s important to always have a “stable” development version in VCS which is known to build and pass all tests and which most likely works correctly. This makes it easier to quickly make a release, or to give somebody a “preview release” which contains the latest features.

For this, the possibly-broken code must be separated from the stable version. Possible ways:
- develop on a branch until all tests pass, then merge it into HEAD
- set a “stable” tag in VCS which is moved up whenever a new feature is deemed stable
- add Make system switches to disable the possibly-buggy features; that way, you can have a “stable” build config which always works (also useful as autobuild/autotest target), and a “bleeding-edge” build config which is probably broken for quite a while.

IMO the latter two ways have the big advantage of making it easy for all developers to test some new unstable feature without having to manually merge its branch first.
Hitchens
Hey Rooney! Since you asked for feedback, here’s my take: it should never be ok for a build to be red. If you check in code and it goes red, you should back it out immediately. If people are willing to collaborate on finding out why it was red, well, the code’s still in source control, right? They can get it by reverting your revert.

If a test goes red but there’s nothing wrong with your production, then that’s an opportunity for you to learn how to write tests better! It’s obviously testing something you don’t care about, so you go in and rewrite it so that it only asserts on the things that matter.

The Joy of Trivial Wrappers in Python

| Comments

Python is a great language, but if you have ever tried to do anything web-related beyond a basic page fetch, it gets complicated quickly. What are single actions in your mind become multiple operations in Python.

Take for example POSTing some variables to a page. You are going to have to import both urllib and urllib2, and know what is in each of these. Use urllib.urlencode to encode your post variables, then pass them into urllib2.urlopen to get a connection object, then read that. Yikes! Oh, does the site require cookies? That’s another import and three lines of code; I hope you like reading up on CookiePolicy’s!

Attempting to accomplish this task with built-in modules will likely result in something similar to:

import urllib, urllib2
from cookielib import CookieJar, DefaultCookiePolicy

cj = CookieJar( DefaultCookiePolicy(rfc2965=True) )
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)
postVars = urllib.urlencode({“username”: x, “password”: y})
conn = urllib2.urlopen(“http://example.com/login.php”, postVars)
htmlResult = conn.read()



Compared to Java or C#, this is probably a terse solution. We are using Python however (for a reason), and that block of code sucks; that’s not how anyone thinks. It is hard to remember, leads to copy-and-paste code, and isn’t particularly readable. It also requires you to work with things you probably don’t care about such as cookie policies, openers, and url encoding. You just want to send a page a message!

After forgetting between projects and having to re-discover how to implement this functionality a few times over already, I finally decided to write something to remember it for me. Suddenly we can write:

import web

web.enablecookies()
htmlResult = web.post(“http://example.com/login.php”, {“username”: x, “password”: y})



The web module is quite short and not even remotely impressive (you could write what I’ve exposed here in 5 or 6 lines), but it takes something I found tedious and verbose and turns it into something simple. It adapts the broken-down functionality of these libraries to the more abstract level that I think on. Everyone thinks (and works) differently, and surely for some people it WOULD make sense (and be necessary) to open connections and read from them (if at all) byte by byte.

My interest in posting this has less to do with this specific example, and more to do with finding out what other “thought adapters” people have written to make something easier, more readable, or more pleasant. I have a few of these and pull them as I need them for various projects. What about you?

Comments

Anonymous
Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!
reedobrien
You should add head, get, put and delete methods. Maybe a few more…
Chad
Whoa, awesome; I didn’t know about that. o_O Thanks!
Anonymous
Check out http://wwwsearch.sourceforge.net/mechanize/ It’s designed to mimic most of the browser’s behavior with minimal coding.
Sin
I’ve made a Future class for myself that take a function, it’s arguments and an optional callback and runs the function in a separate thread. Similar to twisted’s DeferToThread.

I find it easier to reason about async i/o for some reason.

AWN Dock (and Extras) 0.3.2 Released! \o/

| Comments

Avant Window Navigator has released version 0.3.2 today. This includes the release of the core dock, “awn”, and all the applets and plugins, “awn-extras”. There was a combination of about 130 bug fixes and feature requests closed in this release, including a few entirely new applets! One of my favorite new applets, moderately pointless I admit, is the Animal Farm applet which displays a cute animal who gives you a fortune on a click, thereupon changing to a different random animal. Below is a shot of 10 of them running :)


Other fun applets include a new customizable notification tray applet which supports transparency (with GTK 2.15+ in Jaunty), a flexible web comics applet, a new themeable clock, a simple to-do list, as well as plugins for Remember The Milk and Tomboy. Don’t forget that great applets like Pandora, weather, calendar, and shinyswitcher (a desktop switcher) already exist and have been improved as well.


Awn-manager has also gotten a lot of love since the last release; managing themes and launchers should provide a much better user experience. Tons of bugs have been squashed in awn-manager and most changes will be reflected immediately…no need to restart AWN!

For more detailed information please check out Mark Lee’s blog post, one of the main developers. To get it, check out the PPA, and don’t forget to Digg it! I’ll leave you with some more screenshots, all of which, including the ones above, are licensed under the WTFPL.


Comments

Anonymous
I am currently using awn 0.3.2 on jaunty.
How to change awn 0.3.2 to awn curve ?
Thx for help, and sorry my english not so good. I'm from Asia
Michael
Hi Shashank. You can just use the instructions on the wiki: http://wiki.awn-project.org/Installation:Ubuntu#PPA . You will have to uninstall your avant-window-navigator and awn-extras=applets packages currently installed, and then install avant-window-navigator-trunk and awn-extras-applets-trunk, after following the guide. If you have any troubles please stop by #awn on IRC (freenode)!
Shashank
hey! great article!!
i have a question though..
i am currently using 0.2.6 on Intrepid
and would like to know a way to install the 0.3.2 version. can u help me with a detailed process (through Terminal)??
tjhnx in advance!!
Michael
Yes, AWN works quite well on a variety of desktop environments including KDE and XFCE, plays well with most popular compositors as well.
Dread Knight
Very tempting to use this on my KDE4.2 desktop…

Installing New Languages and Running Applications in Them

| Comments

Awhile ago I promised to explain how to run applications in a different locale. This is quite useful as a developer, so that you can more robustly test your localization code. It can also be useful to translators who are translating to a locale which is not their default. Maybe you are learning a new language and want some extra practice in specific applications. Or, you may just want to see what your favorite application looks like in Russian or Hindi :)

There are basically only two steps to this rather simple process.

1. Install the desired languages. Go to System -> Administration -> Language Support. Scroll down the list, checking the “Support” box on the right for any language you want on your system. Once you are done click Apply and the necessary files will be downloaded for you. A logout and login is recommended by the application after this, and while not necessary, I recommend it as well (I’ve had a rare instance or so of segfaults when trying to use the locales before restarting the sesssion). If you want to follow along, ensure Russian is one of your choices.



2. Run the application under a different locale. You need to figure out the locale code that you want to run. In a terminal, run “locale -a” without the quotes, and you will see a list of all locales available on your system. If I want Russian, the one I am looking for in this list is “ru_RU.utf8”. It is usually fairly obvious which one you want. Now, again in a terminal, just add “LC_ALL=ru_RU.utf8” before the application you want to run. If we want a Russian calculator for example, we would execute “LC_ALL=ru_RU.utf8 gcalctool”. Ta-da!




This is a great way as a developer to make sure your applications are correctly detecting locales. I’d love to hear what you think and if there are any other reasons I missed that you may want to do this!

Comments

sebastian-s
Hi!
thanks for the post, just two days ago I was messing around with Evolution and locals. I’m currently on en_AU and Evolution displays the time in 12h (am/pm) format in the email list view. Strangely in the email-detail view (or whatever it’s called) the time is displayed in 24hrs.

I did some reading about this ‘bug’, which is not a bug for some. [launchpad bug 48128]

In the end I found out that setting the time local to say en_DK (LC_TIME=en_DK.UTF8) gives me 24hrs in Evolution.

Cheers,

seb
Michael
Thanks Sébastien, it is the rather popular Dust theme: https://wiki.ubuntu.com/Artwork/Incoming/DustTheme . Don’t forget to set your panel background, listed under “Other stuff to try”. I also use the Firefox theme.

And if you aren’t using gnome-colors as your icon set, I’d also recommend that :) https://wiki.ubuntu.com/Artwork/Incoming/Jaunty/gnome-colors and give it a vote if you like it.
Sébastien Giguère
Hi! I just remarked that your theme is very nice, can you tell where can i get it? Thanks very much!
Livio
Русский? Such a beautiful language… It seems I’m not alone with my crazyness around this language :D .

How Windows Vista, Digg, and Ubuntu Landed Me a Sweet Job

| Comments

A lot of people criticized Windows Vista when it first came out, and I was one of them. Another large group of people also don’t believe there’s money in open-source. However for me, the existence (and negatives) of Vista and the awesomeness of Ubuntu landed me a sweet job. How?

Around the time that Vista came out, I was using a laptop with a 1.7GHz Pentiun M processor and 1GB of RAM. I got Vista (Business edition) for free through school so I threw it on. I quickly grew to love the new start menu and many of the improved usability features it had. Unfortunately it ran like CRAP. It was so slow and unusable due to my machine specs that it was unbearable. I couldn’t validate purchasing a new laptop at that time since Windows XP ran perfectly fine and really an OS SHOULD be able to run fine on those specs. But I also didn’t want to go back to XP and lose the features that I liked from Vista.

Around that same time I was also browsing Digg and noticed a release announcement for this thing called Ubuntu, Feisty Fawn to be precise. Everyone seemed to be raving about it and I thought since it was free, I might as well give it a try and see if IT can run decently on my machine and allow me to do everything I wanted. As it turns out, it ran quite well and either supported everything I wanted out of the box, or was flexible enough to allow me to do it myself! Even better, it shipped and supported the applications I used on Windows but previously had to install and keep up-to-date myself, like Firefox, Thunderbird, and Pidgin.

Over time I started getting more into contributing to Ubuntu, first by finding bug reports matching problems I had and adding more information, then more general bug triaging help via BugSquad. Eventually I joined the BugControl team and also started contributing to projects like Avant Window Navigator (AWN). At one point the bug bot that announces new bugs in #ubuntu-bugs-announce went down so I wrote a new one (EeeBotu) which lives on to this day happily (I presume) announcing bugs. When I heard that community members could be sponsored to the next UDS (Ubuntu Developers Summit) in California, I excitedly applied and even more excitedly was accepted to attend courtesy of Canonical.

Around THIS period of time I had been applying to various jobs, one such job at a fun startup in California, Genius.com. They had recruited at my college, the Rochester Institute of Technology in Rochester, NY, and had picked some candidates including byself to be flown out for second interviews. Then the downturn in the economy came however, and they decided not to fly anyone out and re-evaluate new hires at a later time.

This was understandable, but I thought that maybe since I was going to be out in California for UDS anyway, they might want to take me up on a free interview. As it turns out they did. I was offered a job, accepted it, and after about a month I can say that it is a pretty sweet job!

So because Vista sucked (at least initially), I gave Ubuntu a try which I heard about on Digg, got involved and was sponsored to attend UDS in California, where I was able to interview at the company I currently work at.

So just remember, there’s a positive side to every negative (thanks Microsoft!), and there IS money in open-source, at least indirectly (a huge thanks to Canonical!). Has Digg found a new business model?

In other news, I’ve joined a pact with 9 other friends to write a blog post a day for a month starting today, so if all goes well you will be hearing many (hopefully) interesting or fun things from me!

Comments

Murrquan
Have fun with your new job! That was a really inspiring story. And thanks for your work with the bugtracking, and with AWN! I use AWN every day now, it’s great ^.^
Joel
Excellent!! Linux is great. I am using PCLinuxOS, a slightly more ‘Windows-XP-ish’ distro, until I can get used to Linux as a whole.
Anonymous
Hope you continue to enjoy your new job. It’s amazing how a chain events leads to an outcome.
pan
congrat on your new (sweet) job.Nice…

I never thought this combination of Vista+digg+ubuntu will work this way.