LibreOffice Tutorial Videos
A user just asked on IRC how to print a serie of descriptions of photos, when he has a list in a spreadsheet. I answered that Mail Merge is what he is searching for - but he did not know what Mail Merge was. I found a very helpful video showing the mail merge in LibreOffice, so I want to share it with you :-)
[There is also a shortcut to Mail Merge when you understand the concept, try Tools -> Mail Merge Wizard..., of course.]
There are more LibreOffice videos out there, backed up by this nicely structured webpage. Might be worth watching the other videos too :-)
Java API to write LDTP (GUI Automation) tests
Ruby: Why to use symbols as Hash keys ( and why not )
I have often read that for hash keys it is better to use symbols than strings. So I was interested why and what is performance impact. It is quite easy to create a test scenario to measure it. The blog post also contains technical explanation and shows potential security problem.
My test scenario is quite easy. Let’s create simple hash and lookup for a key in the hash. Lets have the keys of four different kind: short string, short symbol, long string and long symbol. For measuring I use internal ruby measuring library Benchmark. Here is code:
require "benchmark"
precomputed_string = "Very long string value"*1000
precomputed_symbol = precomputed_string.to_sym
MAP = {
"key1" => true,
:key2 => true,
precomputed_string => true,
precomputed_symbol => true
}
Benchmark.bm(20) do |x|
x.report("string") do
10000000.times { MAP["key1"] }
end
x.report("symbol") do
10000000.times { MAP[:key2] }
end
x.report("long string/100") do
100000.times { MAP[precomputed_string] }
end
x.report("long symbol") do
10000000.times { MAP[precomputed_symbol] }
end
end
Please note that for long string key I’m using less iterations, because it would be too. And here is result from my machine:
string 4.360000 0.000000 4.360000 ( 4.365123)
symbol 2.870000 0.000000 2.870000 ( 2.868708)
long string/100 8.460000 0.000000 8.460000 ( 8.471581)
long symbol 2.890000 0.000000 2.890000 ( 2.884652)
As you can see, even for short string it is faster to use symbol then string. For longer symbol keys, the time does not grow, so the speed of hash lookup doesn’t depend on key length. As you can see, the situation is different for string keys.
Why it is? The reason is hidden in the hash implementation. Hash uses a hashing function for the lookup ( ted mI agree that it is little confusing to name in ruby Map as Hash). Symbols have this value “precomputed”, but for string you need to compute it again for whole string. For symbol its hash value is simple object_id which never changes, but string have different object for each instance ( string is not immutable like in java ), so to compare if two strings have same hash you need to compute it. Short demonstration about object_id difference:
"test".object_id
"test".object_id
:test.object_id
:test.object_id
So should you use symbol always? There is one disadvantage. To keep symbol value always same (in one ruby process), unused symbol is not removed during run of garbage collector. Here’s the code that demonstrates it:
#for string
def test val
map = {}
1000.times do |i|
value = val*(i+1)
map[value] = true
end
return nil
end
100.times do |i|
test "test#{i}"
GC.start
end
puts `cat /proc/#{$$}/status | grep 'VmSize:'`
#for symbol
def test val
map = {}
1000.times do |i|
value = val*(i+1)
map[value.to_sym] = true
end
end
100.times do |i|
test "test#{i}"
GC.start
end
puts `cat /proc/#{$$}/status | grep 'VmSize:'`
My results:
String: VmSize: 24856 kB
Symbol: VmSize: 343324 kB
So it is a trade-off between memory and speed. It is very important for long running tasks to have control about what is stored in symbols. Consider this code snapshot for long running server:
#get option value
VALUE_TO_DB_MAP = { :external => 1, :internal => 2, :both => 3 }
def update params
db_value = VALUE_TO_DB_MAP[params[:option1].to_sym]
end
And now consider what happens if attacker sends there non-friendly long string. He can easily cause DOS from one machine.
I welcome any questions or suggestions in your comments.
ownCloud 4 and ownCloud Client 1.0.2 released
It’s release day today: This morning, ownCloud 4 was released! With a very cool set of features it’s even more useful and again more fun to use.
Along with that I am happy to let you know that we also released the ownCloud Desktop Client in version 1.0.2.
It is a maintenance release with a couple of important bugfixes, such as the cross platform filename encoding problem I was already talking about. Apart from that big blocker a couple of smaller, but annoying problems were fixed. Also the GUI was polished, text changes here and there and a new icon set that looks more cool and more like ownCloud.
Version 1.0.2 is also the version that is released on all big desktop platforms the first time. Now we also offer a dmg for MacOSX as well as a Windows Installer and packages for the major Linux distributions. Have fun!
If you want to talk about ownCloud, file synchronization or such, we have a booth on Linuxtag in Berlin and I will be there. I am looking forward to meeting you.
The Usual KDE Beginners Desktop

Every now and then I’m visting my best friend’s mom (generation > 50a) to update her old Pentium 4 system with the last opensuse software. Each time, I have to restore her Desktop to provide the basic features like managing opened windows, add the clock again, etc. Each time, I pay carefully attention to lock the screen afterwards. Sometimes I get doubts, that they are just fooling me, but my friend declined this, of course.
This time they disarranged the screen in a very extreme way1. Take it for amusement or for considering a clearer warning of unlocking the screen. I vote for:
You might end with a coruppted system!
Please copy this into the form field below:
I asked my son’s friend and got his permission.
:wink:
-
Did you recognize these empty plasma panels on each edge of the screen which prevents all application to get maximized properly? ↩︎
YaST Development Has Been Moved to GitHub
See also this announcement.
Contributing to YaST has never been easier: Fork for the repository, play with the code, commit it and make a pull request. Meet the YaST guys at irc.freenode.net #yast
Many thanks to the SUSE Systems Management team, and especially to Jens Daniel Schmidt and Bernhard Wiedemann!
A New Font Repository
what do you need when you write some text? Content, of course. Apart from your content you need an additional part to make it a shiny contribution: fonts! If you don’t know already: we have now a new repository dedicated just to fonts.
With the invaluable work and effort from Petr Gajdos, Takashi Iwai, and all the creative designers, we now have more than 100 open source fonts in the M17N:fonts repository. Most fonts are licensed under the OFL or other open/free licenses. Thanks a lot to all! This repository contains fonts like the previously mentioned Exo typeface, the famous Linux Libertine, or fonts from the Google Webfonts page to name a few. With all these fonts available at your hand, you have many choices to make your text readable and attractive as you like, be it on the Web or in print.
Previous to openSUSE 12.1, all the fonts had a terrible naming convention: some contained a “fonts” prefix, other don’t. Now all fonts follow a naming convention to make it easy to find. So don’t be surprised when your font package has been renamed. If you need further information, check out my original idea from FATE#313035. Packagers will probably find the article about Packaging Fonts in the openSUSE Wiki helpful.
The new M17N:fonts repository collects all fonts now and in the future. New fonts will appear and developed there. To use it, add the repository to your list:
zypper ar http://download.opensuse.org/repositories/M17N:/fonts/openSUSE_12.1/M17N:fonts.repo
Currently, the supported distributions are openSUSE 11.4, 12.1, Evergreen 11.1, 11.2, Factory, Tumbleweed, as well as SLE11 SP1 and SP2.
Have fun and be creative with the new fonts! 
Time To Say Sionara
Coding period starts!
Improved Rulers
Recently I was able to spend a bit of time on the UI hacking again; and this time it was the "Rulers" in Writer. Thanks to Mirek M. (BTW, have you seen his Call for GSoC projects designs, and Call for Templates blog entries?) who provided me with a helpful mockup, I was able able to implement the new look quickly and effectively, mostly by removing code :-)
I hope I will be able to do more such changes before the 3.6 feature freeze; I'll keep you informed. And if anybody of you is interested in UI-related hacking, just mail me or ping me on the IRC (kendy on irc.freenode.net), and I'll provide you with code pointers to other interesting areas :-)
