All entries for July 2007
July 28, 2007
Earlier this week someone was complaining java didn’t support optional method parameters. In some languages you can assign default values to parameters and if those parameters are not supplied then they will take on their default value. The syntax is usually something like SomeMethod(Param1=”foo”,Param2=2);
Whether this is actually any clearer than method overloading is debatable, personally I find it a little confusing. However, intrigued, I tried to see how close to this syntax it is possible to get in java. The following is as close as I could get, can anyone do better?:
Similar is possible in c# 3.0 with http://compsoc.pastebin.co.uk/20181 (should work with svn mono when compiled like: “gmcs -langversion:linq ./Filename.cs”)
Most people see YaST  as an application used for configuring the operating system. Relatively few people know that it is a development platform with its own language, libraries, and user interface abstraction layer that enables the developer to write a configuration module that will display using Qt when run in KDE, GTK when run in GNOME, ncurses when run on the command line. 
Although there are very nice features of the YaST platform, there are also disadvantages. YCP (The language most  YaST modules are written in is quite archaic in some respects, and there is limited library support. Also as YCP is only used by YaST there is little tool support for developing in it. In an effort to make developing in YCP a little easier for the remainder of its lifetime I wrote some kate-part (Used by kwrite,kate,kdevelop,konqueror etc) syntax highlighting rules for the YCP language. Screenshots: Here -> and here .
To use them simply save http://bw.uwcs.co.uk/kateycp/ycp.xml in ~/.kde/share/apps/katepart/syntax or `kde-config—prefix`/share/apps/katepart/syntax for all users.
It should be possible to create some kdevelop templates for YaST projects, and possibly even a tool for automatically generating the framework for common modules such as wizards.
 Yes modules can be written in Perl too, and now Ruby. At present the user interface components must be written using YCP though. Also I personally dislike Perl and Ruby more than YCP.
Last week I finished my work placement year, and I am now back to being a Student \o/. After losing a couple of days failing to move due to the flooding here in Britain, I have begun catching up on all the things I have had too little time to complete over the past few weeks.
I have spent quite a bit of time re-writing the YaST based wizard I for simple software installation from web pages. Although there are only minor changes to the user interface. It is now considerably more powerful.
The XML format used for the single click install has been discussed over the past few weeks and is now nearly finalised, it should now be potentially usable by other distributions too.
Amongst other improvements it is now possible to:
- Have one “install now” link that will work for multiple distributions & versions.
- Have translatable descriptions/summaries etc.
- Install patterns
- Have conflict resolutions specified in the xml format.
Hopefully the new version will find its way into one of the next openSUSE 10.3 alpha or beta1.
Implementing this was an interesting challenge due to limitations in the YaST platform. Particularly challenging was parsing non-trivial XML and communicating between multiple instances of YaST (One running a limited user, one running as root). The latter was required as we do not want to request root privileges until the user has been able to review the changes that will be made to his or her system.
Next week I am off on holiday, hopefully the rain might stop for at least some of the week.
July 02, 2007
Last week I was privileged to be invited with some other community members to join in Novell hackweek with the SUSE engineers in Nürnberg. During hackweek all the Novell engineers had an entire week to work on whatever projects they wished. You can see some of these at http://idea.opensuse.org
Some of the projects I found most interesting were:
I had a fantastic time during the week, meeting and discussing with many of the people who work at SUSE in Nürnberg, and some of the YaST team from Prague.
It turned out, there were so many people to speak to that I found there was surprisingly little time to actually write code. With the time I did have I worked on the software portal during the week.
For those who are unaware of this project the aim is to index the available metadata from package repositories and other sources, and to marry that trawled content with user-supplied content such as tags, screenshots, comments, improved descriptions etc.
As of the end of hackweek the following were functional to some degree:
- Importing of application details from package repository metadata & buildservice api
- Manual adding/editing of application details
- Screenshots & thumbnailing
Special thanks to Andreas Jaeger and Ralf Flaxa for making our visit possible, and to Adrian Adrian Schröter and Martin Lasarsch and so many others for giving up their time to show us around and look after us during the week.