Our business app doesn't need your game development skills (using damped springs to place labels on a map)
The problem
Positioning labels on a map, a chart, a plan is a problem every UI developer face at one time or another if he has the chance to work on rich business app. This problem is NP-Hard for non-trivial cases. I faced that issue twice. First while building a silverlight charting library, and then very recently for positioning labels around a pin on a plan. This post isn't about how we solved those two cases. For the charting problem, we went for an algorithmic solution which was working but not optimal. For the second, I don't know how they solved it as I didn't took the job.Solution by Physics system
But the other night, as I contributed Chipmunk bindings to monotouch, one of the reply I got was roughly "I'm not into gaming stuffs, I don't really care. but it looks nice". That got me thinking. First, I'm not a game developer[1][2] neither, and second, you probably should care. One of the most elegant solution I was able to come with for solving a label-positioning problem is to use recipes normally used by game developers. It involves a physics engine, some bodies and some springs.
Let's say every label you want to position is a physics body with a mass (the same for all the labels), a shape (the rectangle bounding box is a good approximation). Let's say then than all those bodies are attached with a (sampling) spring to the pin. If we run a physics engine on this setup, let the springs pull, let the shapes collide, and it'll stabilise itself to a local optimum. With a some luck, or the right amount of initial entropy, you might even reach the global optimum, but that's not important. Multiples pins with labels close to each other? Check. A lot of labels ? Check. Restrict the labels to a zone or avoid some other? Check, just add constraints or shapes to help the collision algorithms.Implementation
But then, how hard is this to implement? If you have a physics engine you can use, this is probably shorter and cleaner to implement than any other method (except the obvious place-at-random-retry-if-it-overlaps). Here's my implementation. It uses monotouch and the chipmunk bindings (What next
Now you can play with the spring parameters and the number of iteration to get the results you expect. You can also use ellipses instead of rectangular bounding boxes. Expect smoother and more natural placement in this case. If you have a lot of labels, use different restLength for the labels you want close to the labels and the one you want a bit farther. A more complex system will take more time (more iterations) to stabilise, so adapt the number of steps, but in any case, keep the dt (time delta) parameter low, experience shows good results between 1/60 and 1/20.Want more than this from me ? Contact me, I'm open for contracting.
[1] I don't like categorisation. Nor being categorised. I'm not an UI dev, I'm not C# dev, I'm not a mobile dev. I'm not even a developer. I have a bagful of hats and wear the ones that gets the job done.
[2] But still, I wrote and tested most of the cocos2d and chipmunk bindings for mono touch, I ported a few games to those platform, and very recently wrote my first game with my 6 y.o. in a day (more on this later).
My openSUSE 12 Journal 11: VirtualBox
At the heart of these changes is the perceived lack of openness & transparency of commercial juggernauts shepherding open source projects. Another example is LibreOffice, being a fork of OpenOffice a few years back, and is now the default in openSUSE distributions.
VirtualBox was originally from Innotek GmbH and they were acquired by Sun Microsystems Inc. in February 2008 which in turn got acquired by Oracle Corporation in January 2010. Virtualbox is not shipped as a default on openSUSE but you can install it very easily because the binaries are available in the default online repositories.
Personally, I think VirtualBox is the 'BEST' virtualization software for the desktop. I would go with KVM or even Xen for enterprise server virtualization. However, for virtualizing Windows or Linux on a desktop for quick testing purposes, I'll pick Virtualbox anytime for its ease of use & free of cost attributes.
Easy Install Method
Read more »
Secure Boot on openSUSE talk at FOSDEM cancelled
for those of you who are attending FOSDEM this year and were planning to attend my talk about Secure Boot on openSUSE on Sunday, I'm sorry to announce I had to cancel my travel to Brussels (and my talk) for family reasons.
Since my slides were already written, I thought I could still share them with you Feel free to ask questions / comments on this blog post.
Package updates in openSUSE 12.3 KDE
During the discussions for the release of openSUSE 12.3, the topic of update notifications and applets was brought up again. Originally openSUSE shipped with a custom update applet, but since it was basically unmaintained, the decision was made to switch to Apper for openSUSE 12.2
The original Apper used in that version had a number of issues, which the upstream developer (Daniel Nicoletti) fixed in a newer version, which also had a lot of other improvments. However we originally couldn’t switch because it depended on a newer, API-incompatible version of PackageKit, meaning that the PK bindings for libzypp (the heart of openSUSE’s package management) needed to be adjusted and ported.
So, for a while it was not clear on how to proceed, until at the recent hackathon, Stephan “coolo” Kulow ported the PK zypp backend to the newer PackageKit version. Once that issue was solved, the KDE team was able to update Apper to the latest version (0.8) and push it to the distribution. So openSUSE 12.3 (KDE) will make use of Apper as main method of notification for updates.
I would like to stress that Apper is not meant as a full blown replacement of YaST or zypper, but mainly as a way to handle distro and maintenance updates, integrated with the KDE Workspaces.
The Apper program is actually divided into two pieces: the main application itself and a plasmoid. We’ve been testing the plasmoid the past weeks and consensus is that it’s not yet ready to be pushed to users, so only the main application will get installed by default. When you have new updates, an icon will pop in the system tray informing you:
[]({{ site.url }}/images/2013/02/apper-notification.png)
Clicking on it will bring up the main interface, where you can review and select the updates:
[]({{ site.url }}/images/2013/02/apper-updates1.png)
Afterwards, the update process will start.
Of course, such an addition means that more testing is required, to ensure that outstanding bugs get fixed before the openSUSE 12.3 release. Therefore, if you are willing to test - jump aboard!
Next stop: FOSDEM 2013
In a couple of hours, I'll be taking the train and heading to Brussels for FOSDEM. I've lost counts of how many FOSDEM I've attended, which is probably a good indication of how great the event is!
As usual, this will be a good place to catch up with friends, but also to talk with tons of different people about so many topics. If you want to chat about OpenStack, SUSE Cloud, openSUSE or GNOME, I'll be glad to join you.
The schedule is quite packed, but from what I can tell so far, I'll be sitting in the cloud devroom on Sunday (don't hesitate to join in order to learn about what's happening in the OpenStack world!). Oh, I'll also give a talk in Janson about challenges that the GNOME project is facing, just before the closing keynote.
And no, I won't have my blue hat, so you'll need to find another way to catch me (hint: I have a SUSE backpack nowadays) ;-)
PHP 5.5 to ship a byte cache soon? Zend Optimizer+ going opensource and into main PHP project
In a recent discussion among php core developers, Zeev Suraski of Zend Technologies offered to open source their proprietary byte cache “Zend Optimizer+”. The main objective is to get a bytecode cache into the PHP distribution and finally into the core. There is a lot of discussion if the 5.5 release should be delayed by two months to include the open-sourced Optimizer+. Some advocate that PHP 5.5 should stick to its original release schedule and Optimizer should go into the master instead, eventually becoming PHP 5.6 : While there is strong support for getting a byte code cache into PHP Core, some are questioning why the php.net project’s native cache extensions “APC” is not the preferred option. PHP Leader Rasmus Lerdorf says ”
You also have to take into account that most sites can’t actually move
to the next release of PHP until APC is stable with it. So effectively
the PHP 5.4 release didn’t happen until APC 3.1.13 in September 2012
which was a full 6 months after PHP 5.4.0. I don’t foresee this getting
any better for PHP 5.5.In order for PHP releases to actually mean something this is a problem
we have to fix. I honestly don’t care which opcode cache implementation
we base a core version on, what I care about is developer buy-in. Dmitry
and Stas being familiar with the code already outnumbers the number of
active core devs working on APC today.I understand some of the skepticism and hurt feelings around this from a
few old-timers, but let’s move on and see if we can finally push out a
release with solid opcode caching right at the release date. From my
perspective anything up to a 6-month delay would beat the current situation.
The APC would then be reduced to a userspace data cache. For Optimizer+ to get into the core, some cleanup and compatibility with ZTS (Thread Safety) needs to be achieved. Traditionally, Zend products only run in PHP’s non-threadsafe mode.
Single file VCS
It is no secret I like version control systems(VCS). As most SysAdmins i believe that pretty much everything should be versioned, any file that we tinker with must always be backed up and versioned somewhere.
I am pretty sure that by now you maintain a lot of stuff in modern vcs like Git repos (or whatever floats your boat), the point is you already use version control. However as you might have guessed even though systems like Git sound (and for certain situations ARE awesome) they tend to not work well for a SysAdmin’s purposes, especially when talking about configurations.
Programmers tend to work on things and files that are interrelated thus it makes lots of sense to have everything under a directory versioned under VCS, which is the way it is currently done by “modern VCS”. In systems administration however that is not the case, most of the time the files in a directory have nothing to do with one another, but are there by convention and you rarely want to version and manage ALL of them.
The best example illustrating the above is the /etc directory. You rarely want to have it all versioned and many of the files there need special treatment (certain exact permissions etc…) making the use of “modern huge full directory oriented VCS” a real pain.
Enter RCS! Despite it’s many and significant disadvantages RCS is a simple and solid VCS with the great virtue of controlling individual files instead of directories or hierarches of them. Thus, its trivial and mindless to use for a file in some system dir (like /etc) and almost forget about it.
here is a list of common operations, done the RCS way.
# RCS operation
# $ Command line
#Initial check-in of file (leaving file active in filesystem)
$ ci -u filename
#Check out with lock
$ co -l filename
#Check in and unlock (leaving file active in filesystem)
$ ci -u filename
#Display version x.y of a file
$ co -px.y filename
#Undo to version x.y (overwrites file active in filesystem with the specified revision)
$ co -rx.y filename
#Diff file active in filesystem and last revision
$ rcsdiff filename
#Diff versions x.y and x.z
$ rcsdiff -rx.y -rx.z filename
#View log of check-ins
$ rlog filename
#Break an RCS lock held by another person on a file
$ rcs -u filename
Job opening for an artist/graphical designer at openSUSE Team at SUSE
- The openSUSE distribution
- Different artwork needed for the project like merchandising, banners, etc.
This work will be done together with the openSUSE community so, besides good technical skills, it will be welcome previous experience in FLOSS communities. We have at SUSE several senior graphical designers, so the candidate will work in coordination with them too.
The candidate might work in Nuremberg, Prague (preferred) or even remotely (if you have previous experience working this way). Must be available to travel internationally three to four times per year, beside some regular visits to our offices in Nuremberg, where most of the openSUSE Team at SUSE currently works.
We are an international team so English is a requirement. Other languages will be welcome. The candidate will give talks, presentations, workshops, etc. so good communication skills will be also required.
We are looking for somebody that can join us soon since we would like to begin working on our release, to be published this fall, as soon as possible.
If you are willing to work at SUSE for openSUSE, please send us your CV through our career website. Please include external and internal (SUSE/openSUSE) references, if you have them, along with links or examples of your work.
My openSUSE 12 Journal - 10: Chinese text input (fcitx)
How do you add secondary language input capabilities?
This section applies to all openSUSE and SUSE Linux Enterprise versions. Thanks to YaST, the way to enable this functionality has remained consistent over the years.
In YaST, find and select Language (under System).In the Secondary Languages section, select and put a check mark next to Simplified Chinese... and any other language of your choice.
Click Ok button and YaST will install the proper software and language package to enable this functionality.
(Optional): You might want to log out and log back in to your account, just to be sure there is a new language input icon in your System Tray. In my experience, the icon shows up without a need to log out and back in again.
Frustration #1: Where is the configuration panel?
Read more »





