Lately I’ve been running low on my internet download/upload quota. Although my ISP (Telenet) trippled my quota, a combination of new suse release, new steam games and my isp failing to reset my quota (bug in upgrade process I guess), I managed to reach its limit inadvertently at 200 MB left. Since a) my ISP offers a webservice to access your usage data, b) I always wanted to write a useful plasmoid and c) wanted to try out soap services using Qt, I contemplated to write a quota monitor widget / plasmoid. This evening I gave it a shot.
After comparing available c++ toolkits for web services, I stuck to gSOAP rather than QtSoap as gSOAP seems the de facto standard when it comes to soap and cpp. gSOAP has some handy JAXB-ish utils to convert your wsdl into proxy classes. For a moment, I was afraid I would have to give up the nice and easy Qt network support (proxy, ssl,..) but it seems gSOAP has abundant support. All in all, in a few hours I had it up and running. Actually, I lost most of the time finding the relevant webservice url (you have to subscribe to a private wiki although eventually someone mailed it to me through a fairly private mailinglist I found on a user forum). In the meantime I found that putting a #define in my main is not the same as adding it as a compiler flag even when you rebuild everything. Adding a compiler flag the right way using qmake, goes like this:
QMAKE_CXXFLAGS += -DWITH_OPENSSL
When I finally could connect to the webservice, I received bogus data, all 0 usage! Only to find out that this was a problem with my account only. Btw, I good and cross platform tool to try out / debug webservices is SoapUI.
To keep it a little sexy, I threw in the QNeedleIndicator I recently stumbled upon on qt-apps.org and adapted it a bit to my needs and voila, we have an alpha:
It is not a plasmoid yet and credentials are hardcoded so it’s not useful to anybody but I couldn’t wait to blog.
Note that in the screenshot I seem to have plenty of quota left. That’s only because it shows my parent’s account usage.
It is currently developed as a Qt app but I definitely plan on wrapping it in a plasmoid. Maybe I’ll keep the Qt app alive for some poor windows users. After I clean it up a bit I will post the code on gitorious.
Today, I decided to play a game on my suse box for the first time since I have my “new” game rig. I didn’t play any games under linux lately since Microsoft gave us a free windows 7 RC. I decided to play some Urban Terror but a few hurdles needed to be taken first.
First one: some time ago I managed to screw up my glx acceleration, yielding a “Unable to create SDL screen: Could not create GL context” error. So I installed the latest nvidia binary driver which detected the screw up and fixed it for me.
Second: I have 2 monitors connected: one CRT on the left and one LCD on the right. The LCD is the primary (which confuses some apps). Anyway, when starting an SDL game like Urt, it only sees one monitor (the “beauty” of nvidia twinview ) and projects its graphics somewhere half-way the primary screen with all the rest left black. I.e. unusable. As I understand it’s an Nvidia problem as they do not obey the rules of the game (meaning xrandr and consorts) for which they had their reasons too (at least back in the day).
Anyway, to solve it, let’s have a look at my original xorg config, or rather the relevant metamode line:
Option "metamodes" "CRT: 1280x1024_85 +0+0, DFP: 1680x1050_60 +1280+0"
We can see there is one mode defined with my crt on the right and my LCD on the right (+1280). The solution is to simply add a second mode in which we disable the CRT and to switch to that mode using the mode cycle shortcut ctrl+alt+”+” before starting a game. When you’re down switch back to your first mode.
Option "metamodes" "CRT: 1280x1024_85 +0+0, DFP: 1680x1050_60 +1280+0;NULL,DFP:1680x1050_60"
You can add as many modes as you want for your different gaming setups. It’s not ideal, but it does the trick and it even maintains my full desktop resolution (so apps don’t get confused or icons get misplaced) which you can access by “scrolling” on the side.
Third problem: no matter how I tweaked the framerate cap, vertical sync or other graphics settings, I didn’t achieve the smooth framerate I’m used to from Windows or previous linux installs. Somehow the framerate was really high but not entirely smooth. I tried playing online and had a horrible aim. If I didn’t know it ran flawlessly on my old suse box with ATI radeon 9800 pro, I would have stopped looking. Then I realised: let’s try disable desktop compositing. Problem solved! Smooth framerate, 0wnage ensued.
btw: nowadays, Urt’s master server is down. I created an autoexec.cfg in ~/.q3a/q3ut4/ with the line:
Last problem solved.
New version released. Windows binary download available at opendesktop.org!
v0.2 / 2010-07-13
- time label
- remember position/size
- about screen with website links
- right-click on calendar widget to reset day to today
When it’s hot, try a refreshing lemon drink.
I can’t believe I wasn’t aware of this Portal easter egg up until now!
I remember staring at those screens for a few seconds, but didn’t see the ‘recipe’!
Note to self for Portal 2: analyse each byte you encounter.
Although you can hardly call this one a ‘project’, I still categorized it as such as it comes with a matching project on gitorious.
In corporate environments, administrators like to put users in jail, or with an euphemism: a sandbox. At our company, the day has come that we can’t double-click on the system clock to quickly look up a date, do a simple time measurement, etc.. Although I understand it is a bug in Windows XP, it is still annoying as **** since it’s quite handy and why wouldn’t I be allowed to do that when I am adminstrator of my own machine anyway.
A workaround is putting another tool in the system tray which yields the same functionality and why not improve it while we’re at it. Today I created a very basic first version: qt clock example enhanced with seconds hand and put a calendar aside. No configuration at the moment. I created the systray icon in Inkscape and it should scale nicely in larger systray environments.
I plan on making the colors configurable and a written time under the analog clock, with maybe a simple timing functionality as a side dish.