During the week, there were a few things that I took pictures of in the hopes of documenting on the web. Unfortunately, they were not quite significant enough for a blog posting. As Friday rolled around I had big dreams of another Friday Frolic, but alas, it was not to be. (Actually some of this is a few weeks old, but I didn't want to not post about it)
Welcome to the Saturday Sassafras! ( Sorry, I couldn't come up with a better name )
Jezra.net
Damn those spammers! On Friday morning, I started to receive quite a bit of email spam, in BBCode format, from my contact form. With a bit of the old "copy and paste" I shortly implemented the jezra.net blog captcha for the contact form and booyah!, no more spam.
However, keeping the bots from spamming me is one thing, what I would really like to do is just send them a 404 error code when they get to my site. With this in mind I updated my web framework to log the time and IP addresses of "visitors" that enter nothing in the captcha answer field. My original plan was to check a visitors IP address against the recorded IPs, and if the IP address has 2 or more entries recorded is the last 30 days, they would get a 404; but I think I will just pass a 404 to any visitor that with a user-agent identified as IE6. Why do spam bots love IE6 user agents so much?
Oh yea, I also started using lightbox for displaying screenshot of some projects. Wow, what a segue.
Speaking of projects....
Heybuddy
Heybuddy recently had a new release, 0.1.0 Hudson, that added the much needed "filtering" feature that allows one to filter out dents based on tags and groups mentioned in the dent, as well as by the poster of the dent. As someone that doesn't give a rat's ass about soccer, the filter feature is awesome during the #worldcup.
I'd like to thank Fabsh for the inspiration. I'd also like to thank all of the tester and users of heybuddy for finding bugs and most importantly, for reporting the bugs.
speaking of heybuddy...
Operation "Cool it!"
"Hey buddy, I'm going to the Pick-n-Pull to look for a cooling fan controller module for my car" were the words I heard and I quickly offered my help. Who can resist a trip to a pick-n-pull? Besides, had been over-heating for about 2 years and really needed a new module, but they are $400 for a new one. Two hours and $20 later, we had the part in hand. Cool.
speaking of cool cars....
00000
Look at that picture! Ignore that fact that my 40 horsepower Volkswagen can go over 55MPH, and look at the odometer. Gertie had looped her odometer and we celebrated with an oil change and a new alternator.
speaking of cool....
hotsauce
At the half way point of the year, I though it would be a good idea to take a picture of the hot sauce that I've consumed so far this year. That's 134 oz of TapatÃo and 6 oz of Crystal. Did I mention that I like TapatÃo?
That's about it for now. Expect some code in the future...
Now quit reading and go make things happen!
Working on heybuddy, I have learned a few things.
- I probably should have used Vala
- using threads in python isn't hard
- using threads in a python GTK app isn't hard
- Documentation for pygtk is not the greatest
Why Vala Had I written the program using Vala, Heybuddy would have been a compiled native application and would use less system resources. However, using Python certainly has its advantages; the most notable being that it is quite easy to move Heybuddy to a different architecture ( as long as the operating system on the new architecture has Python and GTK).
Heybuddy on x86, x86-64, ARM, PPC? No problem. Just copy the code and run it.
Threads For a few days, I was tearing out my hair trying to figure out how to properly use threads to fix a major bug in heybuddy.
The problem was this: When heybuddy would request data from the identi.ca server, the user interface would freeze until heybuddy was finished reading the data from the server.
The solution: use seperate threads to show the UI and read data from the server
Unfortunately using threads didn't work. Then I learned some stuff.
When using python threading with a GTK application, threads will not work without first calling the function gobject.threads_init() or gtk.gdk.threads_init().
One more time:
When using python threading with a GTK application, threads will not work without first calling the function gobject.threads_init() or gtk.gdk.threads_init().
This however, turned up a new problem. The server data reading thread was emitting signals for the main thread to process and this would sometimes happen when the main thread was updating the GUI and there would be a resulting crash of the application. The work around for this was to use gobject.idle_add( handle_the_signal_stuff ) which will allow the main thread to do the handling of the signal stuff when the main thread isn't busy and thus segfaults are averted. YEA!
links in labels Although it isn't in the pygtk pango reference it is possible to put links in a labels markup. For example:
label=gtk.Label() markup="Visit <a href='http://www.jezra.net'>Jezra's Website</a>" label.set_markup(markup)
This will put a clickable link in the text of a GTK label. Sweet!
OK, that's enough for me. I have some bugs to fix.
Now quit reading, and go write something.
question: why do they have two? is one going to be deprecated in later versions? I know I got a depreciated warning, not on the init.threads, but when trying to force the UI into a separate thread (not the way to go).
For the past few months, I've been using indenti.ca to micro-blog and while there are plenty of applications available to access the identi.ca data from my laptop or desktop, I couldn't find anything that would run well on my Nokia N810 pocket computer.
Originally, I had planned to write a client in Vala, but since there is already a wonderful Vala denting client named Pino and since I hadn't written anything in Python for a while, I decided to use Python and develop a client in such a way that it might be easy to port to other languages: specifically Vala and possibly Java.
A couple of hours here and there with Geany and I had a pretty decent denting client in need of a name. Luckily I have a buddy who, aside from needing to blog about his photos, needs a denting client named after him.
Hey Buddy! I wrote an identi.ca client and named it after you. Well, sort of.... it's called heybuddy
In the wild
Jake Hume (http://blog.fragdev.com/) took this picture of heybuddy running on his N810. Sweet!
Although I don't have any plans for making packages of heybuddy for various Linux distributions, fellow Linux Outlaw and heybuddy user timttmy has created a heybuddy AUR package for Arch Linux
What I've learned
- simple little projects are rarely simple or little
- I still can't get threading to work in a python app
- there is a correct way to authenticate an identi.ca user via the urllib2 python module, the short cut I tried to take showed me the error of my ways
- the documentation for gtk.keysyms seems to be non-existent
- The majority of heybuddy user's live in apple growing country
- I ♥ scrumpy
Now quit reading, and go say "hey buddy" to your buddy!
clean. a little... gray. but clean.