warning: Creating default object from empty value in /home3/johnlayt/public_html/modules/taxonomy/taxonomy.pages.inc on line 34.

Always carry your towel!

Just a quickie to say I arrived in Tampere last night, which is great.  What is not so great is that my luggage didn't :-)  So if you see a slightly dishevelled and smelly character wandering the halls of TOAS, that would be me.  Or one of the other 6 guys whose luggage also didn't make it.

Which is where Douglas Adams comes into it, as TOAS does not supply a towel, you must bring one with you!  Don't forget, as without a towel you can't convince strag's to lend you any of the other stuff you need when your luggage has been lost :-)

I'm in room 424 if anyone's looking for me.  Perhaps we should all stick our names on the doors?

Repost: Holidays in KDE SC 4.5

[Update: It seems this little blog and the weight of PlanetKDE was enough to bring my webhost to its knees and lead them to suspend my account.  I've changed the PNG's to JPG's so hopefully that reduces the load enough to keep me on their good side.  You should see the bandwidth graph spiking at 7-8pm Europe time :-) ]

I've blogged previously about the changes I've been making to the KHolidays library. The main improvement is the ability to calculate holidays using alternative calendar systems, such as the Hebrew, Hijri/Islamic or Jalali/Persian calendars. The holiday region files are also able to be split into geographical sub-regions such as States and Provinces, and embed metadata such as the language they are available in. Due to restricted time I wasn't able to complete all the new features I wanted, such as holiday classifications and multiple holiday regions, which would have allowed a better means of separating and controlling the display of different holiday types (e.g. civil and religious). Those will have to wait for SC 4.6, but the backend changes I have made are now visible to users so I thought I would show the results so far.

To do so I'll be using the Plasma calendar widget, which has seen some new features of it's own. The two big ones are displaying your PIM Events and To-do's via Akonadi (implemented by Frederick Gladhorn), and a new information pop-up that appears when you mouse-over a date rather than having to click it (implemented by Aaron Seigo). It will also try auto-detecting a default holiday region to use (also by Aaron). You can see the net effect effect here (ignore the plasmoidviewer frame :-):

Calendar Plasmoid in KDE SC 4.5Plasma calendar holiday popup

Here you can see a number of things at a glance:

  • Today is marked with a black halo
  • A selected date is marked with a blue halo
  • Holidays that are days off are marked with a red halo
  • Holidays that are not a day off are marked with a green halo
  • Events and To-do's and marked with a bold day number
  • The pop-up lists all holidays, Events, and Todo's for the day you hover over

There's still some polishing work and bug fixing to be done on this for SC 4.5 (e.g. the Event start and end date are not really needed), and we're likely to be looking at the whole appearance of the calendar in SC 4.6, so keep that in mind when commenting on the appearance :-).

The details for today also show up when you hover over the panel clock:

Plasma clock with todays holidays and events

The configuration hasn't changed much, other than displaying the language that the holiday region is available in which is useful for people living in multilingual countries. As already mentioned, in SC 4.6 the config will be a lot more flexible with the ability to choose multiple holiday regions and holiday classifications, and how these will affect the display of the holidays.

Holiday config dialog

New region files have been added for the following:

  • Israel, in English and Hebrew
  • Iran, in English and Farsi
  • Ireland, in Irish (thanks to Kevin Scannell)
  • Belarus (thanks to Andrey Yurkovsky)
  • Separate files for several French departments: French Guiana, Guadeloupe, Martinique, New Caledonia, French Polynesia, Réunion, Wallis and Futuna, and Mayotte (thanks to Pierre Buard)
  • Separate files for England and Wales, Northern Ireland, and Scotland (thanks to David Jarvie)
  • Separate files for all the Australian states: QLD, NSW, ACT, VIC, TAS, NT, SA, WA

Looking at some of these will illustrate the new features.

The file format supports optional holidays, which is useful in defining substitute holidays:

Substitute holidays

Here you can see holidays calculated in alternative calendar systems such as Hebrew, Jalali and Hijri, and displayed on either a Gregorian, Hebrew or Jalali calender:

Israel Hebrew HolidaysIsrael Gregorian Holidays

Iran Jalali HolidaysIran Gregorian Holiday

A number of other regions have been reviewed for accuracy with the help of the i18n teams, and this is where you can also help. If you have SC 4.5 Beta 2, you can check your national holidays in the Plasma calender for the next few years and raise a bug under kdepimlibs/KHolidays if you find any mistakes (you could also browse the region rule files at websvn). If your country, region or language isn't supported, also raise a wish requesting support. Please try include a link to a definitive source for your holiday rules, preferably in English so I can read it, otherwise I'll need your help in translating.

In particular, the Iran files are entirely a copy-and-paste from Wikipedia, I'd be grateful if someone could check them. Note that the Islamic holidays are calculated using the Civil version of the calendar so may differ by 1 day from the actual lunar calculations.  I'd also welcome lists of holidays for any other countries using alternative calendars to ensure the code works in as many cases as possible.


#include <KDE/KLongTimeNoBlog>

It's been a quiet few months on the blogging and KDE front, with very little time to achieve what I wanted for SC 4.5. I've spent a fair amount of time away from home on some archaeology projects, with limited connectivity and after a day in the field little energy left for hacking.  The last couple of weeks I've been trying to catch up and make sure what I did get it into SC 4.5 actually works :-)  I'll post a couple of blogs in quick order about what I did get finished.  I really need to clear out my draft e-mail folder, there's a few offline replies there I forgot to send :-)

One consequence of being away is my blog got overwhelmed with more than 12,000 spam comments in about 2 months! I guess the Drupal captcha has been defeated, so I've upgraded to the latest Drupal and installed reCaptcha which hopefully will fix that problem.

I've just booked my tickets and accomodation for Tampere, so:

Going to Akademy 2010

(and as a bonus to Estonia too, seeing as it's only a 2 hour ferry from Helsinki)

Which has got me to thinking about what I want to achieve while there. Code is good, but it's facetime that is the true value of Akademy. There's quite a few topics I'd like to talk to various people about, a couple of which probably deserve a full BoF session. I'll try blog about them in the next few weeks, but here's a short list for now:

  • Bof on Localisation on other desktops/platforms: how to get KDE to respect the locale settings when running apps on Windows, OSX, and non-KDE POSIX desktops (Gnome, XFCE, etc).
  • BoF on Astronomical calculations: There's a couple of places in KDE already doing some basic astro calculations, such as sunrise/sunset times and moon phases, and I need some for lunar calendar systems and holidays.  Do we continue with a piecemeal approach, do we write a new shared KDE library, or do we depend on an external library?
  • BoF on Location services: Again, we have independent implementations in 3 or 4 different places, and I need some basic location info for the astro calculations for calendars and holidays which is lower in the stack than any of them.  Is it time to co-ordinate these efforts?
  • BoF on Printing: Yes, it's still painful and I'm taking far too long to sort it out. We need to 'make a plan', especially with the Qt'ies around features in the dialog, but also co-ordination around the new config tools.
  • Sorting out how to use the isocodes project as a source for country, region and currency codes and their translations.
  • What next for the Plasma calendar widget?
  • More improvements in KHolidays
  • Alternative calendars in KOrganizer / kdepim

Good thing Akademy lasts a whole week, eh? :-)

Swimming Upstream

After a pleasant break during KDE 4.4 when I worked on stuff I wanted to do, I guess it's time to drag myself back to my penance, err I mean Printing, and trying to get the needed features up-streamed into Qt.  This primarily means taking the big mess of code I did last year, adding support across all the official Qt platforms and automated unit tests, and breaking it up into nice small bite-sized pieces to feed to the Trolls via Gitorious merge requests.

My first merge request for the Current Page option in the print dialog has already been accepted and will be in Qt 4.7.  This was a very simple change to do, but was a good way to test out the process as to took a few iterations to change it to how Qt wanted it.  Note that any apps that wish to use the feature will need to enable the option as it can't be turned on by default.

My next merge request, just submitted, is for Multiple Page Ranges (e.g. "1,3-5,7-9").  The 'fun' and time-consuming part here was to set up a Virtualbox Windows development environment to compile and test the code on that platform (eventually I'll have to set up a Mac one too, but for now I'm not bothering as OS X doesn't support these features).  If it survives the merge review and the Nokia lawyers, it should be in Qt 4.8 (sorry, no sooner than that).

The next few feature submissions in fairly short order should be:

  •   Page Set (Odd/Even pages)
  •   Print Page List to simplify app code
  •   File Printing
  •   Cups options on Unix (n-up, banners, job control, etc)
  •   Server-side page selection
  •   Page Order support on Windows
  •   Application tabs support on Windows and Mac OS X

After that I'll take a break to go back to some coding on KHolidays, KLocale, Calendar Systems, and the Plasma Clock for KDE 4.5, before moving onto the biggie: saving and restoring print settings.

Right now, however, I'm looking for some help on the Page Set code on Windows, so any Windows hackers out there keep reading!

Windows does not provide a built-in option for Page Set, so I need to add a new combo control to their print dialog.  From reading MSDN it appears I need to define a new custom template for the standard Print Properties Sheet:

I think the required steps are:

  •   Copy the PRINTDLGEXORD template from Prnsetup.dlg (to where?) and add the new control
  •   Set the PRINTDLGEX PD_USELARGETEMPLATE flag if the custom template is larger
  •   Create an object in memory from the custom template (how?)
  •   Set the PRINTDLGEX hInstance to the in-memory object
  •   Create a IPrintDialogCallback object (how?)
  •   Use the callback object to set and read the Page Set (how?)

That's the theory, but I have no idea how to actually do this.  It's probably elementary to a Windows hacker, but I'm over my head here :-)

I've coded up what I can and pushed it to Gitorious.  Commit f55cd14a is for the common framework and other platforms, and commit f73119eb sketches out where I think the Windows dialog code needs implementing.  All you need to do is fill in the TODO items :-)

Once this is done, it should then be easy to add support for the Page Order feature by adding a tickbox for "Reverse pages".

It should also help with using the PRINTDLGEX lphPropertyPages feature to implement the QAbstractPrintDialog::setOptionTabs() feature.  Bonus points for figuring out how to make that happen!

So if this looks like something you'd like to help with, drop me a line, I'm john (squiqly thingy) layt (dotty thingy) net.

Oh, and if you do send code, it should be stating the obvious that you must be willing to agree to Nokia's contribution agreement.

Cups half full...

I've just made a change to the CUPS detection code in the print dialog that should now always match when Qt is using CUPS (it detects a specific behaviour of QPrinter when running CUPS as a heuristic, rather than trying to find a CUPS server for itself).  This is to solve the current bug of not detecting when Qt is printing to a remote CUPS server.  I've tested it still works for local servers, but I don't have a real-world remote CUPS server/printer floating around to test on.  If you have a trunk or 4.4 branch checkout and a remote CUPS set-up, could you give this a test for me?  Just make sure you have no local CUPS server running, call up a print dialog, and confirm the odd/even page selector is there and the page selection prints OK.

(Yes, I could fake it using a virtualbox session, but a real-world test would be more reassuring).


FOSDEM Wrap-up

I'm home from my first ever trip to FOSDEM and I'm pleased to say had a great time there, most of all because of the chance to meet up with so many fantastic KDE people.  I've never been to a conference with so many different FOSS groups involved and the vibe from so many geeks was incredible.  It was especially refreshing to see so many female contributors there and so actively involved in their communities.  I had planned to blog more about my impressions while there, but my laptop was quickly expropriated as the booth demo machine, and there was no free wifi at the hotel, so here's a long brain-dump of some random thoughts. You can see a few photos here.

I spent most of my time manning the KDE booth, more than I had planned and I missed a few talks I had wanted to see, but it was a pleasure to be able to interact with so many people, almost all of whom were overwhelmingly positive about KDE4.  I had only one "Amarok 2 sucks" (he didn't have the guts to tell Sven on the 'rok booth to his face though...), and one "I stopped using KDE after 4.0" but who was very keen to give 4.4 a go as he believes our technology is on the right track.  Much of my time seemed to be spent directing traffic.  There was the guy who wanted to get involved with the Windows port who I demo'ed stuff to in Virtualbox and referred to the Windows team.  Several people were eager to point out bugs they had found (directed them to bko). Others wanted to know if an obscure bug was fixed (err, I may be a dev, but I don't know every bug or feature). Someone wanted help with the openBSD packaging (hmm, dunno, Sune wasn't about, try Ade or the freeBSD guys?). Someone else wanted to know how to get the latest version of their app packaged by all the distros (talk to them at their booths just along the hall, or attend the OBS talk in 5 minutes time...).  Someone demanded to know why KDevelop had made certain design choices (palmed off on Milian, sorry!).  Someone else wanted to recruit some KDE devs to work on some desktop stuff (company business cards were quickly produced and handed over).  Someone wanted to know about colour management in KDE, so they got Boud's e-mail address :-)   An openSUSE developer wanted to check if a patch of his worked on my install (it didn't).  And the guy wanting to interview a Dutch-speaker for a podcast was directed towards Jos (poor soul ;-).

The best chat I had was with a guy from the Netherlands who walked up to the table and loudly declared "I Love KDE!" (no, not Paul).  He explained he was asked by a friend to help their mother with some PC problems.  He visited her at her retirement village and replaced Windows with Kubuntu.  A while later she asked him to visit again as some of the other residents wanted this Linux stuff too.  He refused to install it himself but instead he taught them to do it themselves.  Long story short, it spread like wildfire, last time he visited to give a talk there were over 80 very happy users aged 60 to 90 who had their own support community going.  They love Linux for how fast and stable it is, but also because they can play with it.  The beige box is no longer some mystery machine, but something they understand and control, and they are now contributing back to projects like OpenStreetMap and doing translations. Inspirational stuff.

For all the positives however, I think we can do some things better next time.

I know it's been talked about before, but we really do need a small demo machine with nicely pre-configured demo users that can easily be restored once messed up.  The obvious tricks we missed this time were to have an open-pc as our demo machine (cross promotion and sales opportunity there), an N900 running Qt/KDE stuff (the one on the Gnome table was constantly being pawed at), and a netbook to show off the new Plasma Netbook containment (I had planned to bring my eee but it died last week). And the biggest screen we can lay our hands on, with some kind of very flashy demo program running to draw people in (could we steal one from the openSUSE booth???).

We also need to give more thought beforehand to what we want to achieve with the booth.  Are we just there to sell t-shirts?  Or something more?  It's a decision we need to make for each event, and for FOSDEM I don't think the traditional "attract new users with a flashy demo" mode is going to work.  I think we need to focus on attracting new community members and interacting with upstream/downstream projects.  People mostly either wanted swag, or wanted to talk about technical stuff, there were no "What is KDE?" style questions.  These people are either already involved in a FOSS community and wanted to know how we can interact with them, or were looking to get involved.  Saying "visit the website" or "Google it" just doesn't cut it.  The "KDE Handbook" was hugely popular and we need more handouts like it.  We need to have "How can I help? / How to get involved?" handouts pointing potential contributors to the main participation entry points (wiki, mailing list, irc etc).  We may need some kind of (private?) KDE directory to know which person or mailing list project X needs to talk to about problem Y.   Knowing the areas of expertise of each KDE attendee would also be useful so you can grab an expert when needed.

There probably wouldn't be room, but rather than a table cutting us off from the people who wanted to talk, I think a "KDE Kafe" could work well at this sort of event.  Several chairs or beanbags, a few developers/translators/packagers/etc, a few demo workstations and laptops, free coffee for those who stop to talk, and lots of time to talk, network, bug triage and collect brainstorm ideas.

FOSDEM itself is impressively well organised, as you need to be with 5000+ visitors.  I'll just highlight two points, firstly their signage was very good, there was lots of it and it was very big, no getting lost here.  That's something I've always thought we could improve on at Akademy/Desktop Summit.  Not so good was the room allocation, where each project/stream got one room to use regardless of the size of audience each talk was likely to generate.  So talks about "What's in the KDE 4.4 Release" and "What's new in Drupal 7" in smaller lecture rooms were massively overcrowded and had to turn people away while bigger auditoriums next door on obscure topics were sparsely populated.  While staying in one room is good for a stream's more specialised topics, each major stream's keynote talk aimed at the mainstream could be given an auditorium slot.

Free foot massages for booth volunteers would be a welcome feature :-)

Fingers crossed, I'll be back next year, if only for the chance to eat waffles and drink beer at 11am while listening to a talk!

I'll take a double major in Plasma and Nepomuk, thanks...

I haven't seen it mentioned anywhere else KDE related, but in Madrid you can now take a uni course in KDE and Gnome programming.  I wonder if there will be guest lectures by Professor Faure and Dr Seigo? ;-)


It's been a few weeks, so what's up in the KDE Clapham office? (I'm pretty sure I'm the only KDE hacker in Clapham so can safely claim 'office' status, if I'm not, meet me for a pint down the Abbeville pronto!).

I'll be at Fosdem this weekend, so if you're there be sure to drop by the KDE stand for a chat, I promise not to bang on about calendars too much :-)  (Well, unless you happen to be a Gtk/Gnome/Evolution hacker wanting to talk about shared standards for calendars and holiday files, then I'm all mouth).  Just don't ask me about license stuff, you'll be wanting that weird bloke down the other end of the hall... I'll be in Brussels from 10am Friday wandering the streets in search of waffles, so if you're getting in early and looking for the same let me know.

Speaking of calendars (yeah, you knew it was coming) I decided on a whim to have a play with KHolidays in kdepimlibs to see if I could hack in support for holidays defined in non-Gregorian calendars, something I've been threatening the PIM guys I'd look at for ages.  After about a weeks intense hacking, cramming on Bison and Flex (blech!), and dredging up long suppressed university lectures on LALR grammars (it's been almost 20 years now!  And no, I didn't  understand Richard's last post either...) I had a new experimental parser working. I waved it in the direction of the PIMsters to see if they were interested and next thing I know I've been anointed a Maintainer.  Whoops, wasn't expecting that :-) So in 4.5 look for some improvements in how we handle holidays, in particular the ability to have non-Gregorian holidays like Jewish and Islamic religious holidays in the Plasma calendar and KOrganizer.

On that front, could I just ask for people in those countries and communities that use a non-Gregorian calendar to drop me a line with a list (or pointers to an official list in English) of both your official public holidays and the main religious holidays, and especially the rules about how they are calculated?  I'm particularly interested in the more complex to define holidays, the ones that need special or long calculations, so I can see if the new code supports them.  (We already have the KOrganizer Jewish Holidays plugin that I can crib from, but that's C++ and I'd like some English explanations).  I'm john @ my domain name.

Oh, if you use the Hebrew calendar, sorry I've messed up the Hebrew numbers support in 4.4, I should have a fix in place before it goes gold.

What else?  Oh yeah, there was some noise around the whole turn-of-the-decade thing, and Ade rightly pointed out we shouldn't be so pedantic about not having a year 0 to count from, especially with those 'lost' 10 days still to be found down the back of your sofa.  In fact it's worse than that.  It wasn't like on 1/1/1 that everyone suddenly woke up and decided "Hey let's start a new millennium!".  Nope, the Romans didn't even use proper year numbering.  It was some bloke called Dionysius Exiguus in 525 who came up with the idea to count consecutively from the birth of Jesus, except he got his maths wrong. And it wasn't until 731 that the Venerable Bede popularised using it. Later Gregory came along and decided to chuck away a few unnecessary leap days.   And somewhere in there New Years Day moved around various dates before settling back to 1st January. And...

So the whole year numbering scheme is entirely arbitrary and retrospective and open to being revised and refactored at will or whim.  As with the millennium, nobody's actually celebrating the passage of a fixed number of years.  No, we're all just looking at that car odometer click over to a neat line of 0's.  That's what we celebrate, and it's as good a reason as any for a beer.  Just imagine if we had evolved fewer fingers, we'd be doing it more often :-)  But if you really insist on being pedantic, then I will just point you at the ISO standard for calendars and dates where they arbitrarily declared the year 0 to exist for their purposes.

Speaking of which, my own clock ticked over to one of those 0's recently.  Life supposedly begins this side of the great divide, I'll let you know...

A reminder on GPL3 code in KDE

[Edit: revised version hiding my blushes by giving the right reason for the policy, it's nothing to do with Qt anymore, D'oh! :-)]

Licensing and license compatability is hard, and I'm no expert (that would be Ade...), but I do know that krazy is telling me there is an increasing amount of code turning up in KDE that is licensed only under GPL3 which is a no-no according to the KDE Licensing Policy.  The policy is in place because we need to keep our code base consistent and internally compatible while still allowing us to link to GPL2 only libraries if needed.

I'll be nudging people to get fixes made, but please remember that any new app code needs to be (GPL2+ || (GPL2+ && GPL3+)).  Any new library code (kdelibs, kdepimlibs, kdebase-runtime) needs to be (LGPL2.1+ || (LGPL2.1+ && LGPL3+) || BSD || MIT || X11) where appropriate.  This is just a high-level summary, read the Licensing Policy for the exact details, start the New Year with a refresher course :-).  Contact the licensing mailing list if you need expert advice.

Don't forget you must also include a copyright statement in the form "Copyright <year> <name of author> <e-mail>".  Although not explained in the policy, there's a few important criteria this needs to meet to carry maximum legal weight (at least according to discussions on the licensing list):

  • You must write the word Copyright, writing (c) has no legal standing, and the symbol © only has standing in some jurisdictions.
  • The <year> is the year you wote or changed the code, not the year you committed or released it.
  • Write out every year you modify the code, don't use a range like 2008-2010 as this apparently carries less weight legally.
  • The author must be a person or a legal entity such as a company or non-profit.  You cannot just say "The KFoo Team" as this has no legal weight, you have to name each author individually and the years that they modified the code.

So an ideal notice would look like "Copyright 2003, 2004, 2005, 2009 Joe Bloggs joe.bloggs@kde.org". 

I see a few people trying to beat the email harvesters by writing "joe.bloggs kde org", I guess that's still acceptable if a little futile? Please try make the email an address that will last a while: University, work, and even ISP addresses have natural life-spans far shorter than your code and someone may need to reach you 5-10 years later.  The kdemail forwarder is a good option if you are not an ev member with a kde.org address (hmm, about time I joined!).

Krazy is your friend for checking stuff like this, remember to look a couple of days after any commit to see if you've missed something :-)  I wonder if we could have an svn hook that runs krazy and apidox over only the files changed by a commit and e-mails the result to the committer? Or if all the checks would be too inefficient, at least an important subset?  All I know is most people forget to check krazy and apidox, so any automation would be good.

Happy New Year y'all!

Jalali Calendar updated

I've almost completed my QA review of the code in the existing Calendar Systems, with the Hijri / Islamic calendar passing relatively unscathed but some possible optimisations noted (it uses recursion where direct calculation may be faster).  The Jalali calendar (aka Iranian or Persian, as used in Iran and Afganistan) has proven somewhat harder and needed a lot of research.

The basic problem is that the Jalali is a purely Solar calendar with the first day of the year being officially defined in relation to the vernal equinox and solar noon at the reference longitude for Iran Standard Time (52°30' E).  There is no offically defined rule for calculating leap years, nor can there be, a leap year is just any year in which there are 366 days between successive vernal equinoxes.  The upshot is there is no simple arithmetic method to calculate when leap years should occur, for complete accuracy you must correctly calculate the vernal equinox.

There are two popular approximations for sequences of leap years, the 33 year cycle and the 2820 year cycle (aka the Birashk method), but these each return wrong results in various and different years, and there is much debate on which is better.  Most implementations choose to use one of these for efficiency and simplicity regardless of accuracy, Microsoft has chosen the 33 year cycle which is more accurate in years immediately around AD 2000, many FOSS projects have gone with the 2820 year cycle due to Emacs implementing it first.  I haven't confirmed which Apple supports.

In KDE we have been using the 2820 year cycle when calculating date conversions, but were using the 33 year cycle when calculating leap years, leading to some quirky errors. I've fixed that to always use the 2830 year cycle, and now restrict the valid date range to the years AP 1244 to 1530 (roughly AD 1865 to 2152), a useful range of modern dates during which the 2830 year cycle is only wrong twice (AP 1404 and 1437, roughly 2004 and 2058).  I've added special exceptions to cover these two cases so we now exactly match the true astronomical calendar for the entire supported period.

In 4.5 we should begin to support astronomical calendars properly, so we will switch Jalali to correctly calculating the equinox and thus extend the supported date range.  We will also provide reference implementations of the 33 and 2820 year cycle calendars to allow for interoperation with systems that use them.

The final calendar for QA is the Hebrew calendar, which looks to have had some bad bugs creep in.

Syndicate content