MinGW + pkg-config

15 July 2008 tags follow linux , opensource

Just a reminder to myself:

When using pkg-config on windows using mingw getting "Must specify package names" even when just asking pkg-config --help means:
DOES NOT WORK WHEN IN MSYS bin ONLY WORKS IN mingw/bin.

Also remember to add

export PKG_CONFIG_PATH=/lib/pkgconfig/
alias untar='tar -xvzf' 

to

/etc/profile
AND

rename sed.exe to 1sed.exe in /mingw/bin so your environment uses the mingw sed.

open source development tools are pretty much sucky when ported to windows. (GIT,pkg-config come to mind)

Oh, and why isn't there anywere an all-in-one installer for the gnu toolchain?

 

Release 0.28

7 April 2008 tags follow update

So finally a new release. Most of the work has gone into making some final architecture changes. The API has been stable now for quite a while. I found some programs I wrote last year and could update them in less than 2 minutes because of only 2 API changes from widget perspective. So feel free to write your own without fear of rewrite :-)

Changes:

  • Less threads. In fact threads are only used on event if asked like so: widget.addEvent('click',myhandelr,False)
  • Reflow and invalidation now part of mainloop after I figured out how to do this in Win32 (PeekMessage).
  • New look scrollbar and table
  • Relative width and height eg. widget.style.width = '50%' . This saves quite a bit of coding and is more reliable since it's integrated.

So use it and tell me what you think. I have started writing a little personal finance app to showcase uxpython and to feel out where the rough edges are.

Telkom ADSL in 2.5 hours

22 February 2008 tags follow za

Here is a happy story about how good Telkom can be. Last week Friday my phone line was installed (Telkom 2hr earlier than promised) , later that day I completed the adsl online application at http://www.telkom.co.za/edsl/edslff. One of the questions was when you would like the service to be activated, I chose the earliest allowable one week.

So one week goes by without any phone call or correspondence. I assume everything's fine. Then at 12:30 I call the call centre at 10219. Remarkably I only have to wait 10 minutes before someone answers my call. I tell them the story of the online application, they check and there is no such order.

But no worries, the operator creates an order for an 384 ADSL line using self install. They say it's going to be 2 to 3 weeks. The operator helping is very knowledgeable and friendly and the product suggestions he makes are reasonable and not pushy.

So I wait for 2 to 3 weeks... or do I?

NO! My adsl modem is already connected and at 15:15 it syncs! First it connects and disconnects till it settles at 1024. I am frankly astounded, especially after all the Telkom DSL horror stories floating arround.

So following instructions from this blog: http://www.macgeek.co.za/2007/03/19/telkom-adsl-in-7-days/ I fill in the telkom guest account (guest@telkomadsl:guest) and connect. I then verify at www.telkom.co.za/verifyadsl and everything is good to go.

Currently waiting for openweb to process my account so I can actually use the connection. I am going for the 5GB SAIX account at R240, the best deal around. But there only being one week left in the month I signed up for the 1GB IS Fibre.

I am living in Bloemfontein and in a established neighborhood so that is some explanation for the fast response but still pretty impressive. and on a Friday too Telkom also called to survery how the call centre was at 16:45 thus my experience could have been rigged maybe. So from my experience the service was great, now I only complaints are the redundant analog line rental and ridiculous caps. But this is happy story, yes?

0.25 update

10 January 2008 tags follow update

A few days ago I released version 0.25 of uxPython.

What's New:
- Reworked widget loading, using import hooks. Can now get widgets
from multiple directories and zip files.
- Various fixes
- easy_install support. So you can install using "easy_install
uxPython"
- Downloads now hosted on PYPI

I also made significant improvements on the IDE:

  • Supports all widgets that have the required metadata
  • Collapsing panels for sections on the property panel

Some things that did not make the release but will feature in the next. (that is done or started)

  • Datepicker widget
  • JIT performance optimizer (more details later, basically analyses the rendering method and tunes for fastest performance)
  • Started on the manual finally.

 

Stackless Python and uxPython

29 December 2007 tags follow threading , python

Installed Stackless Python and played around a bit.

uxPython currently uses 4 threads - one is the main program and three python threads to service events in the event queue. More can be created in case any of the threads block. I replaced some threading and some "physics" code that ran in the main thread with Stackless tasks and saw no gain or loss in framerate. My program is rendering limited so that is to be expected. In the past when it was using most of it's time locking/releasing stackless would have been awesome.

Another drawback is that Psyco does not work with Stackless, Psyco gives about 20% more performance while Stackless gives about 0% more in my test case.

Conclusion: Stackless is great for what it is designed for BUT if you don't have many threads and scheduling problems it won't provide any value.

Components

28 December 2007 tags follow update

I am busy refactoring the existing codebase to support dynamically loaded widgets. Have had some trouble with especially inheritance giving me a head ache.

It works with multiple locations eg. default, application specific, etc. and gets interface information from a 3 line xml file. Might support xml-less format in the future.

After this work I can hopefully return to fixing the IDE and getting two showcase applications (Contact Manager and Personal Finance) off the ground and working.

Threading tip: SQLAlchemy / Elixir

22 December 2007 tags follow sql

I was having some trouble saving new object in SQLAlchemy / Elixir when created in a different thread than the one that loaded the collection. The errors I got were "object already attached to session". First I tried to have one global session but sqlite complained terribly. Then after some searching I found out the recommended approach in SQLAlchemy.

session.merge(object) #move object to session of current thread
object.flush() #flush/save as normal as object is now in correct session

and deleting works like this:

td = object
td.expunge()
session.merge(td)

td.update()
td.delete()

session.flush()

Stupid oversight I know, but it's not exactly spelled out in the documentation.

 

Progress update

20 December 2007 tags follow update

This week I slightly reworked the event system. Specifically I added a method where no event can block execution no matter how long it takes to resume. For example a click handler that "accidentally" sleeps forever. The cost is a little bit of extra memory for every frozen event but I think it is worth it.

Something that I wanted in the framework was asynchronous events. In Java Swing and .Net you have normal event handlers that block and async / InvokeLater handlers that don't. The problem is that it is too much work and unelegant to, for instance, update a progress bar when running a long running operation. In uxpython you can just update the value attribute of the progress bar with no extra work. Pure "get out of your way" -ness.

I am planning a showcase application along the likes of the Healthcare demo for WPF. To showcase how good application in uxPython can look and perform. Currently leaning in the direction of a Customer application, but if anyone has a better suggestion please let me know :-)

 

GTK backend

14 December 2007 tags follow gtk , linux

I have released version 0.02 of uxpython.

Changes

  • GTK backend - windows and linux
  • Works on Linux using GTK
  • Lots of stability fixes
  • Less threading

 

Problems

Very slow mouse events on GTK on Linux
- don't know why, works 100% on GTK on Windows
- can someone take a look with more Linux/GTK experience?
- tested on VirtualBox Virtual Machine Ubuntu 7.04

Bandwidth

11 December 2007 tags follow site , linux

This blog and the uxpython website is running on a lovely Xen server from FrogFoot networks here in sunny South Africa. The problem however is that in South Africa bandwidth is terribly expensive. $12 USD per gig in fact. No i'm serious!

My bandwidth for the last four days has been 1591 MB so it does not bode well for my end of month bill. So first I signed up with Amazon S3 and looked into that. But then I remembered about Coral Content Distribution Network, a free CDN hosted on PlanetLab servers. It's rediculously easy to implement just append .nyud.net to your hostname and it just works! So I'll see how much of a difference it makes over the next few days. Otherwise it's back to S3 which is a great but not free and lots more complicated.

P.S. Work is going swimmingly on the GTK backend of uxpython. Now is going quite fast.

Little tip, if your pyGTK program will use threads to call queue_draw_area enable thread use by:
gtk.gdk.threads_init() #somewhere at the beginning
gtk.gdk.threads_enter()
gtk.main()
gtk.gdk.threads_leave()

and that's all that was needed for my case. YMMV.

 

 

uxpython on gtk

10 December 2007

Ok so today I rewrote my GTK backend and it is now working. It is however quite a bit less responsive than the Win32 version ( on WindowsXP). Tomorrow I will test it further and bring it up to function parity. After that I plan to fix the stability issues in the designer.

I still hope to bring out a source version later this week that people can actually use and not just look at :-) That and the GTK backend so the many many linux python users can use it too. Consider it payback for every linux only, compile from source python module out there

First Entry

9 December 2007

In the beginning....

This blog is the place where I will discuss my adventures in programming. Useful code snippets. Things I have learned. Or the struggles or triumfs I have with my two projects uxPython and SaturnCMS.

Enjoy.