I applied as a GSOC mentor for the first time. I'll be mentoring Gentoo/Java IDE integration project. I'm personally interested in this project since I use Eclipse for Java development on my Gentoo box and I think many people like me can benefit from the outcome. Although I'm not a Netbeans user, the same applies for it as well. Yes I'm tired of defining user libraries (additionally pointing to their sources, jni libs, javadocs)
So let's see if anyone applies for this project (A few already contacted by mail)
Years later discontinuing GMSO , a GNOME application to query inklevels of various printers, I started rewriting it in Java using Java-Gnome and JNI to interface with native libraries. The project’s home page is hosted at Google (http:/mso.googlecode.com) and the source branches are hosted at Launchpad.
The project currently consists of 3 components
See the homepage for screenshots, downloads and javadoc of the libraries. The source code be browsed at Launchpad. Looking for the future I may be adding additional GUI’s based on the libraries (Java Swing, SWT, QT ….)
Last week has mostly been taken up with QCon London. I really had a great time and I would like to give a big thanks to Google for supporting my travel and registration costs.
QCon is a conference focusing on 19 different tracks. Some to mention: Architectures You’ve Always Wondered About, Software Craftsmanship, Functional programming, Irresponsible Architectures and Unusual Architects, Pragmatic Cloud Computing, Agile Evolution, How do you test that? and Browser as a Platform. I attended to one or two talks from almost every track except .Net and Java oriented ones. Keynotes from Dan Ingalls (Forty Years of Fun with Computers), Ralph Johnson (Living and working with aging software) and Robert Martin, aka Uncle Bob (Bad Code, Craftsmanship, Engineering, and Certification) were inspring.
I also got the chance to chat with Dan Ingalls (principal architect of five generations of Smalltalk). I asked him if he follows a method while working (like Pomodore that Dan North recommended in his “Simplicity – the way of the unusual architect” talk). Hopefully, we share a similar characteristic: we can’t work if we don’t like the job but when we like it, we can’t stop working from morning till night. He recommended me to go where I think I would have the most fun. If something bothers you, it is ok: “If it’s hot, it is hot. If it’s not, it is not!” There’s always something to do when you can’t work; empty the rubbish or wash the dishes. And when you concentrate, start to work again -but know yourself very well.
We also talked about the lack of women in computing. He shared some of his observations; for example in a conference about Wikipedia, he observed there are almost same number of women and men. But when it comes to more technical and less social conferences and events, there are really very few women participating. He also added maybe there’s a genetic factor about this. He has two boys who cannot stop being “boys” –always breaking/fixing things but in fact, that’s what all about the computers!
There are lots of ideas and keys to share, here are some main ideas:
From Uncle Bob’s keynote (slides are available here):
Architectures You’ve Always Wondered About was one of the tracks I wondered about =] Some gems from (Facebook: Architecture and Design) by Aditya Agarwal (Director of Engineering at Facebook):
Agarwal said despite being a small team (over 1 million active users per engineer) they do great because of the Facebook culture. There are three very important things in FB:
Agarwal also gave some important tips for MySQL. They have about 6k server-years of runtime experience without data loss or corruption (can you believe it?!) Here are my notes:
There are 1,200,000 photo requests a second in Facebook and scaling takes iteration. They serve 20 billion photos in 4 resolutions = 80 billion photos (which would wrap around the earth more then 10 times!)
There are 400 million unique home pages and 50 million operations per second in Facebook. They have a love-hate relationship with memcache; it is easy to corrupt and has a limited data model. But it is simply crucial and it does what it does, really good.
At the end of the talk, I asked to Agarwal about their operating system choice and he told me they are probably going to use Centos.
One of the most interesting talks was Building Skype. Learnings from almost five years as a Skype Architect by Andres Kütt (architect of Skype). First, some stats:
Points Kütt made:
Dan Ingalls keynote was very entertaining. He showed his early codes and he made all the demonstration in Squeak and also shared demonstrations of lively kernel. One wise quote from Ingalls talk:
We’re bad at learning the lessons from the past because:
I have a lot more notes in my Moleskine but I need to take some time to transfer them into the blog.
I also had the chance to visit the gorgeous O’Reilly stand and buy some books (I even have Erlang Programming and 97 Things Every Project Manager Should Know signed by the authors!)
I had a great time and I look forward to being back the next time. Thanks to Google, again!
In my last post, I wrote that I am going to work on Machine Learning for my master’s thesis. I am coding an interactive machine learning framework which enables users to run basic/advanced machine learning algorithms online.
In fact, component based frameworks for collecting together data input/output, pre-processing, classification, clustering, regression and visualization schemes and alike have been implemented before in various languages, for use on different platforms, and operated on a variety of data formats. But unfortunately, due to platform depended solutions, it is difficult to try out and compare different machine learning algorithms quickly and easily.
Hopefully, with ML-LAB will provide a sophisticated and easy-to-use wireable interface for creating the workflow. You can upload a dataset, and put a classification algorithm (currently supports K-NN, Naive Bayes and ID3) after it, then wire it to a dimensionality reduction algorithm (PCA, LDA or Isomap), and if you want to, you can wire the results to another algorithm, … It has no connection limits, you can create a workflow with a hundred connections for a single dataset.
The collection of machine learning algorithms are purely implemented in Python and Django is used for interface and matplotlib for the graphics. I’m sharing some screenshots of it, you’ll notice it looks like Yahoo! Pipes a lot. Hopefully, it will be online at www.ml-lab.com after the core library finished.
You can follow ML-Lab on twitter! http://twitter.com/ml_lab
Yesterday I read an article about IT concepts that non IT people do not get [1]. One of the listing is about Hierarchical or nested directories. Or with Microsoft terminology; Hierarchical folders.
It Says:
Hierarchical folders are a great idea – don’t get me wrong – but they’re a good example of a neat metaphor overextended and hence confused. Most people are familiar with cardboard folders that can store bits of paper – and equally most people are happy to store their files in folders on their PC. Where it all goes wrong is with folders within folders, as this very rarely happens in the real world. Many users are simply unaware that they can create additional folders inside “My Documents” – hence the usual tendency to find hundreds or even thousands of files, all at the same folder level.
Yes, in my humble opinion and my experience with non-it people, they do not get it. They just stack files in the My Documents folder. First a file hierarchy is not a concept they are familiar with and second it’s unnatural to put folders into other folders. In physical terms they do not fit in. They do not assemble a Matryoshka Doll relation.
But there is one concept that exists and non-it people are familiar with. Folder Tabs. Any people interacting with papers and paper archives knows about them. They are natural and non it people have a habit using them. Even these tabs are used as bookmarks for books. You must have seen some researcher on tv networks looking in their books for some evidence they had bookmarked with colorful stickers like tabs.
So why not getting this concept into user interface design?
Below you can see a mock-up of Nautilus Directory Tab implementation.
A Folder Tab is a folder bookmarking mechanism. A Folder Tab holds some files together.
A Folder Tab is a virtual indexing structure. File systems do not have to constitute a Tab Foldering feature.
A Folder Tab may be a meta data on files or can be implemented as hidden inner folders.
For a Folder Tab implementation User interaction must be minimum or unneeded. So Auto indexing alphabetically or by file types may be used as an implementation measure to gain zero-configuration.
A file in a folder can be moved between Folder Tabs.
An implementation may choose to have files to have ability to be moved to non-existing Folder Tabs. And a new Folder Tab will be created.
A copy operation can be implemented as a “Copy and Rename” operation or a “Soft Link or Shortcut create” operation.
In a browser all Folder Tabs can be opened or closed separately.
I believe implementing this kind of concept can make users life easier. Automatic tabbing feature can be a life saver. Consider looking a long time Windows and Office users My Documents directory. You can taste the situation. A mess, but with with automatic tabbing folder you can close all tabs and look in folder tabs named Office Files or Folder Tab: A Letter. It can even reduce number of file searches made.
[1] http://www.hackification.com/2009/09/28/ten-it-concepts-that-non-it-people-dont-get/
I’ll be unavailable for a period of time, so my Java-Gnome development will halt during that period. As a result I’m looking for contributors to continue my incomplete branches.
Vte: http://research.operationaldynamics.com/bzr/java-gnome/hackers/serkan/vte/
VTE library provides a terminal widget which powers Gnome Terminal and other GTK+ terminal emulators. The purpose of this branch to add coverage of VTE API.
Sexy: http://research.operationaldynamics.com/bzr/java-gnome/hackers/serkan/sexy/
Libsexy provides additional widgets for GTK+. The purpose of this branch to add coverage of widgets provided by Libsexy.
Gerrorcode: http://research.operationaldynamics.com/bzr/java-gnome/hackers/serkan/gerrorcode/
Current implementation of GlibException doesn’t capture error code and error domain associated with a GError. The purpose of this branch is to add necessary native and Java bits to provide those these two properties.
Linkbutton: http://research.operationaldynamics.com/bzr/java-gnome/hackers/serkan/linkbutton/
LinkButton is a widget providing an HTML anchor like link. The purpose of this branch is to cover LinkButton.
And thanks in advance to people who take over the development of the branches. And special thanks to Andrew Cowie who helped throughout my Java-Gnome development.
This tutorial will start with a sample top artists (i.e favorite artists) file from http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=Firari&api_key=b25b959554ed76058ac220b7b2e0a026. It will follow several steps to write a dynamic client GTK UI for the topartists service. Project depends on java-gnome (4.0.12+), jsr311-api (aka jax-rs), jersey-core and jersey-client libraries. Note that there’s a Java library for accessing Last.FM web services available at http://www.u-mass.de/lastfm Project files can be downloaded as a tarball.
Step 1: Generating XML schema from the sample XML
I downloaded a sample file from the the given URL. I used Trang to reverse engineer the XSD from XML. The command line tool just takes 2 arguments, the input xml and the output xsd files. Here’s the generated XSD file.
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="lfm"> <xs:complexType> <xs:sequence> <xs:element ref="topartists"/> </xs:sequence> <xs:attribute name="status" use="required" type="xs:NCName"/> </xs:complexType> </xs:element> <xs:element name="topartists"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" ref="artist"/> </xs:sequence> <xs:attribute name="type" use="required" type="xs:NCName"/> <xs:attribute name="user" use="required" type="xs:NCName"/> </xs:complexType> </xs:element> <xs:element name="artist"> <xs:complexType> <xs:sequence> <xs:element ref="name"/> <xs:element ref="playcount"/> <xs:element ref="mbid"/> <xs:element ref="url"/> <xs:element ref="streamable"/> <xs:element maxOccurs="unbounded" ref="image"/> </xs:sequence> <xs:attribute name="rank" use="required" type="xs:integer"/> </xs:complexType> </xs:element> <xs:element name="name" type="xs:string"/> <xs:element name="playcount" type="xs:integer"/> <xs:element name="mbid" type="xs:string"/> <xs:element name="url" type="xs:anyURI"/> <xs:element name="streamable" type="xs:integer"/> <xs:element name="image"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:anyURI"> <xs:attribute name="size" use="required" type="xs:NCName"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:schema>
Step 2: Generating data classes for mapping the xml
xjc (JAXB Binding Compiler) is used to generate the classes in generated package. Jersey can utilize JAXB to map the result XML to data classes.
Step 3: Writing code to query Last.FM web service
public static Lfm queryTopArtists(String userName) { final Client client; final WebResource webResource; final MultivaluedMap queryParams; final Lfm result; client = Client.create(); webResource = client.resource("http://ws.audioscrobbler.com/2.0"); queryParams = new MultivaluedMapImpl(); queryParams.add("method", "user.gettopartists"); queryParams.add("user", userName); queryParams.add("api_key", "b25b959554ed76058ac220b7b2e0a026"); result = webResource.queryParams(queryParams).get(Lfm.class); return result; }
Here we’re building the HTTP request along with the parameters in the query string. And finally we’re calling the service and mapping the result to Lfm class which corresponds to XML’s root element lfm.
Step 4: The GTK+ GUI
Here were initializing the table and its data model.
/* * Initialize the table with its DataColumn's. */ model = new ListStore(new DataColumn[] { rank = new DataColumnString(), artistImage = new DataColumnPixbuf(), artist = new DataColumnString(), playCount = new DataColumnString(), percent = new DataColumnInteger() }); view = new TreeView(model);
Here we’re creating the view columns and binding their properties to data model. Note that were’re binding 2 properties of the CellRendererProgress to different columns in the data model.
/* * Create TreeViewColumns and bind the DataColumn's to their properties. */ vertical = view.appendColumn(); vertical.setTitle("Rank"); rendererText = new CellRendererText(vertical); rendererText.setText(rank); vertical = view.appendColumn(); rendererPixbuf = new CellRendererPixbuf(vertical); rendererPixbuf.setPixbuf(artistImage); vertical = view.appendColumn(); vertical.setTitle("Artist"); rendererText = new CellRendererText(vertical); rendererText.setText(artist); vertical = view.appendColumn(); vertical.setTitle("# of times played"); rendererProgress = new CellRendererProgress(vertical); /* * It's nice that in GTK+ we can bind multiple DataColumn's to * properties of a single TreeViewColumn. */ rendererProgress.setText(playCount); rendererProgress.setValue(percent);
Here we’re querying the service (i.e calling the utility method we wrote) and populating the table. The image data will be fetched asynchroniously by AsyncImageLoader which is a subclass of Thread (Its code wil follow)
/* * Query Last.FM user.gettopartists method JAX-RS handles the Webservice * call and JAXB handles the unmarshalling of the XML response. */ result = LastFMUtil.queryTopArtists("Firari"); /* * Add the properties of Artist items as TreeView rows. */ if (result.getStatus().equals("ok")) { final List<Artist> topArtists = result.getTopartists().getArtist(); /* * Determining maximum playcount from top of the list. * It will be used to calculate the percentage of the ProgressBar's. */ maxPlayCount = topArtists.get(0).getPlaycount().floatValue(); for (final Artist artistItem : topArtists) { final TreeIter row = model.appendRow(); model.setValue(row, rank, artistItem.getRank().toString()); /* * Asynchronously load the image data and set it as the image * column. The first image URL is the "small" one. */ new AsyncImageLoader(model, row, artistImage, artistItem.getImage().get(0).getValue()).start(); model.setValue(row, artist, artistItem.getName()); model.setValue(row, playCount, artistItem.getPlaycount().toString()); model.setValue(row, percent, Math.round(artistItem.getPlaycount().intValue() / maxPlayCount * 100)); } }
Here’s the code for AsyncImageLoader.
class AsyncImageLoader extends Thread { private ListStore model; private TreeIter row; private DataColumnPixbuf artistImage; private String url; public AsyncImageLoader(ListStore model, TreeIter row, DataColumnPixbuf artistImage, String url) { super(); this.model = model; this.row = row; this.artistImage = artistImage; this.url = url; } @Override public void run() { try { /* * Fetch the image data and set it as the image column of the * specified row. */ URL artistImageURL = new URL(url); URLConnection artistImageConnection = artistImageURL .openConnection(); DataInputStream in = new DataInputStream(artistImageConnection .getInputStream()); byte[] artistImageData = new byte[artistImageConnection .getContentLength()]; in.readFully(artistImageData); /* * The image will have 32 pixels height. */ model.setValue(row, artistImage, new Pixbuf(artistImageData, -1, 32, true)); } catch (IOException e) { e.printStackTrace(); } } }
Here’s a screenshot of the running application.

I was working on spellcheckers in Linux for quite a long time. My interest comes from another project that I’m involved in, Zemberek, a Turkish NLP library which also includes a spellchecker. For Linux part, I was involved in developing its DBus interface as well as porting Enchant plugin to this new interface. I’m also maintaining Gentoo ebuilds for Zemberek packages and helping with Enchant package.
As a result, I gained experience with spellcheckers. At first, I started investigating GtkSpell to add bindings for Java, but I was unable to created usable .defs file from the headers. And after investigating Python bindings and seeing that it was hand-written, I examined another possibility, LibSexy. I started implementing LibSexy Java bindings which is still not complete. And main motivation was SexySpellEntry included in the library. I unfortunately hit a bug with text segmentation with it along with another bug causing a critical error (which ends up in an unchecked Exception in Java) which occurs in GtkSpell as well. (See Gentoo bugs #270179 and #270177) Anyway, later on Andrew helped to start-up the GtkSpell coverage with hand-crafted .defs file.
After a few weeks of development spelling branch is now merged to mainline which will make its way into 4.0.12 release. During the development I discovered that GtkSpell has a fallback mechanism for language of the spellchecker. The order is
lang peremeter passed to functionsLANG environment variableAfter 2 ½ months of work libnotify branch finally made its way to mainline. It’s my biggest contribution to Java-Gnome project. Again thanks to Andrew, Guillaume and Vrexio for their help and aid in the development and the testing. It will close a more than 3 year old ticket reported to Galago Project.
Bleeding-edge testers may grab the mainline branch and others may wait until next version (4.0.12) is released.
Java-Gnome bindings doesn’t support callbacks at the moment. It can generate code for signals only. To add action callbacks, I reimplemented it as action signal. Here’s an example code to show how to add signals:
notification.addAction("a", "Action 1.a", new Notification.Action() { public void onAction(Notification source, String action) { System.out.println("1.a"); } });
The implementation currently has one drawback. Signals are not disconnected properly. This causes two issues. One, signals aren’t disconnected if actions are removed with clearActions(). Two, if actions with same actionIDs are added signals for all are triggered. Andrew will be adding support for signal disconnection to java-gnome and I’ll be using it in libnotify branch.
0.40.6 version of intltool has a nasty bug in handling of LINGUAS variable. It causes localization (i.e .mo files) not to be built if your LINGUAS environment variable is set (I have it set to "tr"). At first, the issue popped up in GNOME packages (nautilus, seahorse and probably quite more that was fixed before I noticed) And now it started hitting other applications with tarballs generated using broken intltool. I first noticed it in Liferea, and then came Geany.
So users, upstream developers and downstream maintainers; if you notice or you're reported of a package that appears untranslated even though the package has translations (langcode.po) please report it (for users), fix your tarball for the next release (upstream), fix your package (downstream)
I’ve been contributing to java-gnome for sometime. It was generally build system and test improvements with little bits of coverage addition that was merged to mainline for now. Although I began libnotify branch later than other two (libsexy and vte) the branch improved way faster than the others. The Bazaar branch has nearly full coverage of the underlying API.
The example included shows a critical low-battery warning with gnome-power-manager icon sitting in the notification area (Assuming you have it installed).

I’ll be implementing the missing action covarage now and try to make it to our next release 4.0.12. And of course thanks goes to our lead Andrew Cowie for his help in development and Guillaume Mazoyer for testing it and providing feedback.
Due to a bug in compileall.py script distributed with Python pyc/pyo files' modification times are earlier than tat of py files. If any Python packages (such as java-config which is used for all Java packages) are used during compile phase the bytecode is regeneretad and sandbox-1.3.3 started catching that as a violation. Sandbx version 1.3.4 and above ignores this problem as a workaround. So if you hit any issues similar to bug 256953 or its duplicates, please update your sanbox. I thank Martin von Gagern for working on fixing the issue and taking it to upstream.
Following up Petteri's post about icedtea6-bin package we now have 1.6.0.12 versions of sun-jdk and sun-jre-bin in tree. This version finally adds long awaited (6 year old bug in sun bug database) 64-bit browser plugin along with 64-bit Javaws. Simply install any of the two with nsplugin USE flag and start running Java applets. Note that it only works with Firefox 3.
The tool Betelgeuse wrote was scanning Java packages for unneeded dependencies. It was scanning the registered jar's for any referenced classes and generated a list of classes in dependent packages/jars to see if any of them are redundant. Back on December I came up with an idea to use that information to dig out for an opposite fact. Packages that reference classes which are not provided by it's dependencies not itself. It was bug #252249 which inspired me. The initial ebuild was definitely missing a dev-java/sun-jai-bin .dependency which I wanted to verify. The intention was to discover missing dependencies. of binary Java packages.
After I got it working without (hopefully) false positives it was then time to see the results. I first ran it in over the packages installed on my system. Thanks to Diego who kindly ran it in his tinderbox which had most of the Java packages in portage installed and posted the output. I was surprised about the outcome. There were many source based packages that it reported to depend on missing classes. Roughly examining the list I saw that some packages installing ant tasks were missing an ant core dependency and fixed a few. Another set of packages seem to package its unit tests (see java-wakeonlan for example) Digging out others I figured out a third kind of problem. Packages missing already generated jars or classes in the final package.env entry. Those (openoffice,xulrunner,java-access-bridge) reported missing classes that was already provided by themselves. They either didn't install the jar at all or installed but not registered them (we have java-pkg_regjar provided by java-utils-2 eclass which registers an already installed jar). But java-access-bridge had an interesting bug which was there for ages. The generated jar misses already compiled classes due to wildcards not being expanded recursively during make and reported the bug to upstream. Mindterm exibits a similar bug. Classes were missed out in jars because they weren't in the hardcoded list of classes to package.
As a final word, I'll be taking next days investigating output generated in Diego's tinderbox, and fixing the packages.
Addition: Add note about net-misc/mindterm bug.
Generally default uppercase/lowercase implementation in class libraries/frameworks respect active locale's behavior. Due to difference in handling of letter I & i [1] applications may fail when locale-aware case conversion is not desired such as parsers, generators etc. The general fix for this issue is to use an English locale in case conversion. I'll give a few example bug reports.
I guess, I can give more if I google, but I think the above examples are enough to show why applications fail with Turkish locale.
1: http://www.i18nguy.com/unicode/turkish-i18n.html
Addition: I traced Bazaar bug to be really a bug in Python itself, see: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=489740 for how Pardus and Debian fixed Turkish locale issues. Thanks to Jesus Rivero for quick follow up after my request of applying these patches in Gentoo. Hopefully they'll soon be incorporated in portage.
Further Addition: Fixes are committed to portage by Ali Polatel. See bug #250075.
Here are 2 tools for generating repository statistics for source trees controlled with CVS and SVN. Both tools can generate stats for subtrees. Here's how to generate stats for a CVS checkout:
cvs log > logfile.log
statcvs logfile.log . -o -output-dir /path/to/statsto generate stats.
and for SVN:
svn log -v --xml > logfile.log
statsvn logfile.log . -output-dir /path/to/statsto generate stats.
Now you can browse, upload, do whatever you want with generated stats. I generated stats for our java-config-2 project. The sample StatSVN output can be viewed at http://dev.gentoo.org/~serkan/statsvn-java-config-2/. Also Jeremy generated CVS stats for gentoo-x86/sys-apps which can be viewed at http://dev.gentoo.org/~darkside/stats/statcvs-sys-apps/.
Further Reading: You can read the following manuals for detailed information.
WARNING: Please do not run cvs log on cvs.gentoo.org. Use rsync to mirror the portage tree from AnonCVS provided by infra and run cvs log on the local mirror.
file-browser-applet in tree introduced support for Super-H hotkey for menu activation via gtkhotkey library in 0.5.8. The dependency was optional
but automagic and the build system of the package is cmake. After examining Diego's documentation for general information and personally getting help from him, I researched for how to fix the issue for cmake. You can see the bug report and my initial patch for the package. After releasing 2 more versions following 0.5.8 a modified version of my patch is committed. The upstream patch still prints out an ugly not found error even if file-browser-applet is compiled with -gtkhotkey. But I bumped and added the upstream patch to portage.
What I learned from this is cmake has an interesting if-then-else syntax that you need to include the control variable near each keyword. What I need to do afterwards is to extend Diego's documentation with a paragraph about cmake.
Edit: I added prelimenary CMake section to Diego's documentation. Please extend it with different possibilities which CMake may cause automagic dependencies.