Kasperian Moving Parts

kinda like Batman, but with a wife and 3 kids

Saturday August 18, 2007
by Jason 'vanRijn' Kasper
0 comments

Wrapping up the Summer of Code

I wrote this for this last week’s commit digest and didn’t want to steal Danny’s thunder, but here’s my thoughts on this year’s SOC KPilot project…

The KPilot summer of code project is winding down to a close, with this Monday being the “pencil’s down” date. Bertjan Broeksema has done an outstanding job and has accomplished all that we said we wanted to on our Summer of Code proposal. The problem that we faced in KPilot was that each of our conduits did a lot of things in common, but all of them had their own code for doing these things. This has made maintenance a much harder job than it should be, and has led to some conduits being less feature-complete than they should be–not to mention having too many bugs from the duplicate code. So the idea was that each of our record-based conduits should be doing the same sorts of things as far as algorithm, process, and flow, and that we should pull as much of this common code out of the conduits and into some base classes as possible. This leaves our conduits to be responsible mainly for data transformation (turning a PC calendar vcal record into something that can be synchronized with a Palm database record), and should address the problems listed above.

But while we were at it (and while we were taking the time to think through and design how KPilot should work), we also put as much effort into making it as hard as possible for our conduits to destroy our user’s data. It’s something that needs to be carefully included in the design process, since it simply doesn’t happen by accident (not destroying data during edge cases, etc.). So we made some intentional design decisions that should hopefully result in fewer “KPilot ate my future” e-mails.

We officially had 3 main goals for our Summer of Code project:

Classdiagram1. Sequence Diagrams and Class Diagrams

We used a loose interpretation of the Rational Unified Process for our project this year. We spent 5 weeks at the beginning of the project, creating the Use Case for our upcoming work, and then laying down some Class and Sequence diagrams which showed how all of the requirements and flows from our Use Case would be realized. We used BOUML for our UML diagrams (I’d have rather used Umbrello, but Bertjan had some difficulties in getting it working on his Gentoo box). All in all, though, I believe we found a good balance between spending enough time to make sure we had a well-thought-out design and having enough time to implement it all.

2. Implementation of the abstract record framework

Since our Use Case focused almost entirely on the functionality required for all of our conduits, Bertjan was able to fairly quickly write the code for the base conduit classes. We found very few design challenges and misses during the code-writing phase, which I credit largely to the thorough work we did on our Use Case and UML models. It goes against the typical Open Source Hacker mindset to spend so much time preparing to code and not actually coding (I mean, coding is the fun part, right?). But Bertjan patiently worked with me through this phase and I think we have some really good quality code as a result. Bertjan also wrote a series of unit tests to help verify his code in the base classes.

exciting new kpilot keyring viewer3. Implementation of a new conduit as proof of concept.

Early on, we weren’t sure which route to go–whether we should try to port one of our existing conduits to the new base classes or whether we should just create a new conduit. As it turns out, we did our SOC work in trunk, which means we didn’t have a very stable code base (we’re still working on getting KPilot stable in trunk) to start from. So we decided to create a new conduit to use as an implementation for our new base classes rather than struggle with porting code and also trying to fit it into the new base system. I’ve been wanting to have a way to sync with the Keyring Palm application (encrypted, multi-purpose Palm database for storing passwords, account numbers, etc.) for a long time now, so we decided to create a new conduit in trunk to test and verify the new base classes. We’re just finishing up a few minor nits with it and hope to have it fully functional by EOD, Monday.

So, to summarize, thanks to this year’s Google Summer of Code KPilot project, we now have a solid base conduit framework that is implemented in a new Keyring conduit. Our next steps in the KPilot team are:

  • stabilize the daemon and user-visible portions of KPilot
  • finish porting the old conduits over to the new KDE4 APIs
  • port the old/existing conduits over to our new base record framework
  • stabilize, test, wash, rinse, repeat
  • look at OpenSync framework again and (now that we have a common conduit framework in KPilot) see if we can leverage OpenSync’s libraries for the underlying syncing algorithms.

Friday August 17, 2007
by Jason 'vanRijn' Kasper
0 comments

KPilot progress(!!) and a fatal Plucker error

First, Bertjan is doing a wunderbar job with the keyring conduit in KPilot/trunk! I stayed up a bit last night and hacked for a while. Felt darned good. One annoyance that we’ve found, though, is that it looks like KWallet::Wallet (the KDE wallet subsystem) assumes that every program that wants to access the Wallet subsystem will have a top-level window. This assumption is not true with KPilot’s syncing daemon (kpilotDaemon). So I’ve sent an e-mail off to kde-core-devel, and hope to hear something back on it soon, but does anyone in lazy-web-ville know what the Correct (TM) way is to work around this?

Secondly, my darling little Treo 650 just this morning decided to start vomiting on my blue suede shoes every time I tried to open a Plucker document. Mind you, it worked absolutely perfectly fine before today. And I’ve installed no new software, etc., between when it worked and now. The error I was occasionally getting was this: “DataMgr.c,Line:11231, Index out of range”. Helpful, huh? Fortunately, I found another poor soul who has hit the same problem and found a solution. So I downloaded an alternate version of ZLib for my Treo (no idea whether it’s the same one that comes with Plucker–it’s 4 years old), installed it to my Treo and now things seem to work properly again. I’m not sure what the exact problem was, but installing the zlib ARMlet Port seems to have fixed some portion of the problem.

PDA’s are amazingly cool little things, when they work. When they don’t, however, and insist on rebooting themselves without telling you what broke or how to fix it, you quickly start wondering whether they’ll flush cleanly down the toilet or not….

Saturday August 11, 2007
by Jason 'vanRijn' Kasper
0 comments

KPilot, She Progresses

Woohoo! I ate far too much cheesecake, far too late in the evening tonight, and therefore am still up at 2:30 a.m., hacking on KPilot. And oi(!) does it feel good. =:) We now have a working daemon, a working configuration window, a working kpilot main window, logging happening correctly over the DBus, and with the code that I’m about to commit to trunk, we now are able to get through a hotSync without crashing! W[][]t!

Next on my agenda, if Adriaan doesn’t beat me to it, is to rip every hint out of KPilot’s built-in database viewers that makes it look like it could/should/might be able to perform CUD (Creates/Updates/Deletes) actions. Die, devil-bird, die!!

Oh, also, all of the hard work that the talented Mister Broeksema has been putting into both the base conduit code and the keyring conduit code is really starting to look good. I got this -><- close to being able to sync my test keyring database with the new conduit tonight. I’m sure he’ll get it all working proper-like by tomorrow…. =;) In celebration, then, the highlights of my commit comments for tonight:

– replacing many “emit syncDone(this)” with “delayDone()”. I think what
might be happening is that syncDone() is deleting our object, which then
turns up null in our DEBUGKPILOT stream and blows up (short-lived object maybe too-short-lived?).
– adding some safety check in keyringsetup to make sure we have a valid
pointer for the wallet. **note** getting a handle on the wallet will
block our GUI event thread until it’s either successful, or it times out.
kinda weird.
– _not_ running the installer twice in pilotDaemon. there’s no conduit
that queues up things to be installed, it doesn’t make sense, and it was
causing trouble. so out she goes.
– replacing “delete thing” with “thing->deleteLater()” in spots for
safety’s sake
– bumping KPILOT_VERSION to pre2 (gonzo). it’s the muppets, man, and we
have plenty more to go through… plus, it feels like a milestone being
that we’re actually able to get through a hotsync for the first time in
trunk. paaaaaarty time.
– woohoo! hotsyncing now works with null conduit. =;)

And now, to sleep, perchance to dream… of getting to do something very much like this for a living… someday….

Wednesday August 8, 2007
by Jason 'vanRijn' Kasper
0 comments

Good Morning, Vietnam^WPlanetKDE!

Greetings and salutations. And thanks to Chris for adding me to the planet. =:)

As an aside, there must be a cooler way of introducing oneself to an aggregator, but having wasted 10 minutes of my life trying to think of one (and not having actually come up with anything clevererer), I’ll relegate myself to looking like a doofus and stick a big “Hi, my name is” adhesive tag on my forehead….

Hi. My name is Jason ‘vanRijn’ Kasper. The Kasper part comes from a rich Austrian heritage that I have documented somewhere in a closet. The Jason part my parents decided to slap on me for no good reason, other than that they must have foreseen the Friday the 13th movies coming out in my early childhood years. The vanRijn part I slapped on myself after a bitter “hey, that nick is mine… no, it’s mine… no it’s mine… *smurf*” war over my previous nick of Rembrandt on undernet many years ago. As it turns out, “vanRijn” is near-impossible for Americans to pronounce. I get periodic e-mails from random Dutch peoples that I’ve confused; and I’ve had it for so many years as my nick that I figure I might as well keep it for the duration. (I’ll never admit to it, but at one point I tried changing my nick to ZeroCool but was so quickly mocked that I quickly went back to using vanRijn in defeat.)

I am one of the KPilot hackers as of the last couple of years, and while I have been successful in wandering up into the parental KDE PIM code a few times, time and opportunity have not proven to be on my side for that to happen with any regular frequency, unfortunately. I first got involved in KDE PIM as I was looking to scratch my itch of not having a good syncing solution for my Palm device and the memos on it. I asked Adriaan about contributing code for a new memo conduit that is filesystem-based as opposed to knotes-based and he did such a great job of encouraging and mentoring me that I’m still hacking away with him on the ugly duckling of the KDE PIM suite to this day.

I’m currently mentoring the talented Mister Broeksema and am co-laboring with him on this year’s KPilot Google Summer of Code project which involves a serious refactoring/rethinking of how KPilot’s record-based conduits operate. The intention is that this is phase #1 in our 7-step plan to take over the world, wherein we:

  • establish a solid foundation with the common functionality and syncing algorithms pulled up into base, reusable conduit code
  • write a concrete implementation of that common functionality (by way of a Keyring conduit, yay!!)
  • convert our current conduits over to the new base conduit classes
  • and then look at where we can gain synergy with the OpenSync project.

Bertjan is doing an outstanding job of it all, and it’s exciting to see the progress that we’re making. In addition to the SOC work, I’m putting all my available time into getting KPilot ported and functional in the KDE4 environment, which is proving much more difficult than I had thought it would be. The good side of it is that I’m getting to see much more of the KPilot code than I’d previously looked at closely, so I’m able to do spots of cleaning and improving as I go along.

Before joining the KDE PIM team, I was heavily involved in the Blackbox window manager project and wrote and maintained the bbkeys utility (blackbox’s keybindings handler) as well as the bbconf program (the blackbox GUI configurator) and its predecessors, bbkeysConfigGtk (*twitch*) and bbkeysConfigC–and yes, all the cool kids named their blackbox-related programs starting with “bb”.

I am an Open Source developer and hacker by nature, heart, and core. It is what I am most passionate about in this world, outside of my family, and it’s been that way since I first broke into the elementary-school classrooms to hack on Apple ][‘s after hours in my grade-school years. While Open Source development is not yet what I am able to do for a paid profession (but I am earnestly seeking ways to remedy that), I am a very active Open Source evangelist in the corporate/enterprise environments that I work in as an IS Developer/Architect. I insist on being living proof that the FOSS desktop is ready for the enterprise by running and using only it on my work laptop and being quite vocal about it to anyone who’ll listen.

So… anyway… hello, planet. It’s very nice to meet you. =:) And if you don’t mind, I’ll take this sticker off my forehead now….

Friday August 3, 2007
by Jason 'vanRijn' Kasper
2 Comments

Visor Syncing Problems – A Solution

I’ve been trying to help a KPilot user (Hi Ronny!!) track down a really annoying and fatal bug for more than a year now.  The bug is triggered by trying to sync a Visor handheld with KPilot, and what happens is that KPilot begins to connect to the Visor during a HotSync, but then it fails when trying to read the user information from the Visor; and then the Visor disconnects, but KPilot doesn’t know it and KPilot then goes into a tight, CPU-consuming loop somewhere deep in the bowels of libpisock.  Ronny graciously funded me with a Visor via eBay since I am unable to reproduce this condition with my Treo 650.  Long story short, now that I have a Visor, I’ve been able to reproduce the bug, grr.
Thankfully, David Desrosiers (the author of pilot-link and libpisock) is an amazing guy and extremely helpful, and David happened to remember a bug report that he’d seen which said that the workaround was to set the connection speed on the PC side to higher than 9600.  David explained that this was because the Visors were the first devices that had both USB and serial cradles, and that as a result, there were some funky code on the handheld that actually used the connection speed, whereas the later USB models do not.  So, I tried setting KPilot’s connection speed to 115200, and sure enough the CPU-spinning behavior did not happen anymore.  Fixed!!  Grrr.  Frustrating to have kept Ronny from being able to use his Visor for so stinking long and have it turn out to be something that he could have changed a year ago and gotten things working.  =:/

So, all in all, this has been an interesting case study of how Open Source should work, albeit on a much-more dragged-out timeline, which is entirely my fault, being all busy and hectic and what-not.  Ronny had a problem and asked me for help.  I couldn’t reproduce it because I didn’t same hardware.  Ronny graciously provided me with the hardware to reproduce the problem.  I reproduced it and asked the pilot-link author  for help.  He helped me find a workaround.  Cool!!  And Ronny, thanks again for your help and patience!!!  =:)

Hopefully this will both help the next gal who finds herself unable to sync her Visor, and give me a way to remember what the solution was….

Wednesday July 25, 2007
by Jason 'vanRijn' Kasper
0 comments

What Microsoft Meant Was…

In an effort to catch up reading through the last 2 months of eWeek magazines that I have stacked on my dresser yet never find time to pick up, I read through the May 28 issue this morning and found this very insightful statement by Jason Brooks. The article is called “Free software shines on” and can also be found here

When Microsoft representatives state that everyone must play by the same rules, as they often have during recent months, what the company means is that the business and technological realities under which they’ve built their empire shouldn’t be allowed to change (emphasis mine).

Very true. Very insightful. Nice job as usual, Jason. Of course, I (and all Open Source developers) will strongly disagree with Microsoft on this one. =;) Thomas Jefferson was absolutely right.

“As revolutionary instruments (when nothing but revolution will cure the evils of the State) [secret societies] are necessary and indispensable, and the right to use them is inalienable by the people.” –Thomas Jefferson to William Duane, 1803. FE 8:256

“When patience has begotten false estimates of its motives, when wrongs are pressed because it is believed they will be borne, resistance becomes morality.” –Thomas Jefferson to M. deStael, 1807. ME 11:282

“Rebellion to tyrants is obedience to God.” –Thomas Jefferson: his motto.

Also, welcome back Adriaan! =:)

Tuesday July 24, 2007
by Jason 'vanRijn' Kasper
0 comments

KPilot KDE3, meet KPilot KDE4


KPilot KDE3, meet KPilot KDE4

Originally uploaded by vanRijn

Finally got some time to work on KPilot in trunk late last night. I guess the key thing is… when not sure what to do, just do something. I’ve been feeling very overwhelmed as of late with all that is broken and not working and different and changed, etc., with KPilot in trunk, and have been a bit paralyzed by it all. Of course, having to wait a full 8-hours (I kid you not) for qt-copy, kdesupport, kdelibs, kdepimlibs, kdebase, and then kdepim to compile and install on my blazing-fast T42 Thinkpad is beyond frustrating too. But anyway, I have started looking at the UI for the time being. I’ll work through whatever issues I find as I hit them until I’m reasonably comfortable with it working as it should. Then I’ll move on to kpilotDaemon.