Telemeter plasmoid update

This week I’ve been plasmafying my telemeter widget. I’m documenting the stuff I learn along the way in my personal page over at the kde community wiki.

Here’s a first screenshot of the plasmoid in action in its natural habitat:

Telemeter plasmoid

Notice the change in looks (ditched the qneedleindicator in favor of a native plasmoid widget Plasma::Meter). I’ll do a blog post later to detail the changes. It shows a fetch error as it accesses the webservice with invalid credentials.

Tip of the day: boot your computer using keyboard

About a year ago, I assembled a new main rig. I put (almost) all hard drives I had into it with the idea to make a “global backup”. This meant I had to leave my super-silencing case open until the backup was done. However, a year later, I’m still “in the process”. 😉

dsc01173.JPG

Since I also removed my front panel for some eSata modding, I have to turn my computer on using a pointy device aka “nail” (on the corner of the white table above). After doing that for a year, every day, knowing that my motherboard supports booting by key stroke, I decided to turn that feature on yesterday. Pressing spacebar boots my computer now. You should try it too, you’ll be surprised how much satisfaction it gives. 🙂

Project announcement: Telemeter widget / plasmoid

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:

Telemeter widget

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.

Fullscreen games and Nvidia TwinView

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:

cl_master master.urbanterror.info

Last problem solved. 🙂

Project announcement: ClockCalendarWidget

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.

ClockCalendarWidget

Project announcement: Vocabulary trainer

This year I followed a course in Spanish. Ever since I was a kid, when I had to study, I invented ways to not have to study. When learning a new language, what better excuse could I find than to develop a vocabulary trainer? 🙂
This is how the voctrainer project got started on the eve of the first semestrial exams. It was very basic and non-functional for other people, but at least I felt I didn’t entirely waste my study time. 😉 After the exams, development stalled but at the end of the year, once again, I managed to program instead of study. I believe it is now in a usable state, at least, when you know how to use it. 😉

Let me explain the purpose of this program and why I couldn’t just use existing soft.

First of all, it doesn’t replace existing soft (in my world: Parley and KWordQuiz) but rather supplements it. Parley is my preferred vocabulary trainer so I use it to enter my words and train in dedicated mode. Dedicated training takes time and requires you to focus and not do anything else. Wouldn’t it be cool if you could train your vocabulary during the day while working or eating or on your cell phone while watching tv? It’s what I like to call “passive learning”. =)

This is where voctrainer comes in. It is a small light-weight tool dedicated to training (no entry/grading) without requiring your dedicated time. 😉
Currently, its main features are:

  • Kvtml format: use the vocabularies you created in Parley/KWordquiz. Only the enabled (with a checkbox) ones are trained.
  • Automatic mode: cycles through your word list using configurable time delays, no interaction needed. Put it in a corner of your screen.
  • Popup option: useful when you want to be welcomed by a new word every hour/day, for example. Good to keep you in the game during holidays.
  • Manual mode: go through your word list at your own pace using mouse/keyboard, optionally skipping solutions.
  • Auto font size: useful when you put it full screen so you can still read it from a large distance while cooking/eating/doing the dishes..
  • Written in Qt: runs on all platforms without loads of dependencies (like KDE)
  • Lean and mean: you should be able to run it off your smartphone (didn’t try this scenario, since I don’t own a smartphone yet 😉 ) Uses QXmlStreamReader for fast yet memory conservative parsing.

Currently, configuration is done through the config file (located in $HOME/.config/Mattiesworld) but a gui dialog is coming. I also plan on supporting 2 configurable profiles: normal and fullscreen.

VocTrainer is open source and still fully in development over at gitorious.

VocTrainer