Archive for the 'Uncategorized' Category

Breaking through Roadblocks

Wednesday, January 2nd, 2013

Hello in 2013! It has been ages since I’ve blogged anything, mainly because I enjoy Google’s social site, google+ way too much, despite, or perhaps due to it being filled mostly with my geek friends.

I decided to post this on wordpress, but it made me think about the possibilities to break the walled garden of g+ and somehow syndicate certain posts on this site. But that is perhaps material for another post.

What I wanted to share are two stumbling blocks, trivial for most of you, but very frustrating until you know the solution. A total must for your typical batch processing is the xargs utility. Used typically with find, it allows you to perform commands on a list of arguments. By default it lists all arguments on one line:

find . | grep svg$ | xargs echo

Now find itself has a million switches to perform filtering, but I prefer not diving into the manpage if given the option :) The default behavior of `xargs` leaves a lot to be desired, because usually there is a big list you are working on, and bash and other shells have a limit on the number of arguments. Additionally, it is very likely you will need another argument to follow the one you got passed. The magical parameter you’re looking for is -i that splits the inline list and calls the provided command separately for each passed argument. You can place that argument anywhere on the commandline using {} brackets:

find . | grep mp4$ | xargs -i ffmpeg -i {} -sameq {}.webm

So while the manpage surely includes this info, I bet someone will find this through a google query and will appreciate it :)

The other big stumbling block that I also hit with ruby is about Xpath queries in python. Big thanks to Patryk Zawadzki for the solution. When parsing inkscape svg xml documents, they actually include numerous namespaced tags, so simple queries like //rect will fail. You need to prepend all elements with the svg namespace (such as //{http://www.w3.org/2000/svg}rect). Full example here:


#!/usr/bin/env python3

import glob
import os
import csv
from xml.etree import ElementTree

members = csv.reader(open('members.csv'))
TEMPLATE = 'template.svg'

for data in members:
  print(data[0])
  svg = ElementTree.parse(TEMPLATE)
  svg.find(".//{http://www.w3.org/2000/svg}text[@id='memno']/{http://www.w3.org/2000/svg}tspan").text = data[0]
  svg.find(".//{http://www.w3.org/2000/svg}text[@id='name']/{http://www.w3.org/2000/svg}tspan").text = data[1]
  svg.find(".//{http://www.w3.org/2000/svg}text[@id='validto']/{http://www.w3.org/2000/svg}tspan").text = data[2]
  svg.write('./out/%s.svg' % (data[0]))
  os.system("inkscape -A ./out/%s.pdf ./out/%s.svg" % (data[0],data[0]))
  os.unlink('./out/%s.svg' % (data[0]))

Update: Turns out the “ evaluation in the xargs example was flawed. Thanks for spotting. Additionally, find itself seems to have an iterator of its own:

find . -name '*.avi' -exec echo ffmpeg -i '{}' -sameq '{}'.webm  ';'

GNOME Asia Summit

Thursday, June 21st, 2012


Had a blast at GNOME Asia Summit in Hong Kong this year. I actually started my Free Software oddyssey in Asia, when I joined Tuomas at Global Linux 2000 in Seoul. Sgi was a big sponsor, to give you an idea how long ago that was ;)

Initially we intended to do a design workshop, but based on the preferences of the audience, we made more of a talk and demo. Allan and Jon explained the process we undertake to design GNOME. Due to popular demand I’ve given some insights on icon design.


Hong Kong City University, the venue for the GNOME Asia Summit.

I have to thank the organizers for setting up a great event, allowing us to spark up the interest in GNOME and address people to take part in the GNOME project in areas other than code. I hope to be able to participate in future events.

After the conference we took the opportunity of being at the same place to sit down and work out the kinks of some designs. We discussed details of the message tray, banner queing, initial setup and a fair bit more*. I have a much better feeling about the app-provided search in shell now too. Another quite fruitful conversation was about the role of the dash in the future. Quite related to the work I’m doing with Joost on the app picker right now. I hope to have more updates soon.

I’m currently populating the photo collection here, but nowhere near getting through the hundreds of photos I took.

* I’m sure Allan will be doing a post on this too and he usually does a much better job writting a summary.

R.I.P. Gorilla

Wednesday, September 14th, 2011

Someone asked me the other day if I plan to resume work on my pet project, Gorilla. I thought it’s worth replying in public.

Continuing to embrace the unique Gorilla style I would be undoing hundreds of hours of work we invested in the Tango project. I am happy to see people willingly or inadvertently staying within the boundaries set by the guidelines. There is nothing worse than getting a fan mail from someone who has assembled a “theme” composed of all the clashing styles you have created.

Gorilla, you’re my (the?) first SVG icon set, you are my darling. But the world is better without you. Rest in peace.

On Design

Tuesday, October 12th, 2010

The amazing Aza Raskin has published a great article on how to be a designer. I hereby want everyone of you to go read it. To justify this pointer as a blog post, I’ll add a little anecdote.

Czechs don’t seem to appreciate design all that much. I get a feeling that complexity seems to be favoured here. If something is easy to use it’s not as good as something that has an LCD and many toggles. Just a few years ago I know I didn’t appreciate design. I apologise for my young arrogance, but when I first came to the US I recall myself thinking how stupid must the average American be to have a huge push handle on doors with the words PUSH on them to figure out how to open it. And then I came back home, wiggling those pull handles forward and backward to figure out just which way the doors would open.

SUSE Studio Posters

Tuesday, June 2nd, 2009

Linuxtag is happening in Berlin later this month and SUSE Studio is going to be there.

As a byproduct of revamping the website I’ve created a set of posters for the show. Come see us and feel free to decorate your office :)

While it is noteworthy how much the PDF export improved in Inkscape, Evince chokes a bit on the embedded bitmaps and doesn’t handle masks. Have to suggest Acrobat reader this time :/

jeos

jeos

jeos

jeos

Sad

Thursday, December 11th, 2008
Vitezny unor -- petice proti komunistum

Interesting Statistics

Thursday, April 10th, 2008
jimmac@hal:~> history | awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
206 git
173 cd
71 ls
56 rug
42 ssh
27 vim
25 gvim
25 git-svn
24 sudo
23 less

Inkscape in Highres

Thursday, January 17th, 2008

Yet another highres icon, shaking in excitement to get converted to the icns format.

Still holding my breath for the patch.

Disaster Moments

Friday, January 11th, 2008

I’ve been struggling to get Linux installed on my macbook pro running 10.4. OpenSUSE installed fine, but rEFIt wouldn’t boot it from either USB or Firewire drive. So I shrunk my HFS+ partition using diskutil patched by the expired beta of Apple Bootcamp. Installed openSUSE, with the rescueCD workaround to get MBR updated and booted. Thinking I am done I ejected the DVD, but then I realized I’ll probably need something installed without grabbing it off the net, I put it back in. Well I though I have, but instead I put in the damn PowerPC DVDRW I failed with on the iMac. It is cursed. Like seriously cursed.

Slot-loading My Ass!

The mac wouldn’t boot. If I let it boot, it showed the rEFIt logo and spin the drive and that’s it. Woudln’t even dim the screen if I closed it. Took about 10seconds holding the power button to actually shut down. I couldn’t eject it holding eject button. It was just a grey screen waiting for the drive before I could do anything useful. Time to disassemble, I thought. Luckily I still had my miniscule Phillips and Torx screwdrivers from my PSP experiments.

Slot-loading My Ass!

So I opened the machine up and disconnected the drive. Booted to OSX. Removed rEFIt. Power down. Attached connector. Booted to OSX. System info shows that no drive connected. Powered off. Made sure the connector is really attached properly. Rebooted. No drive. Wha? Rebooted using the option key to ‘Windows’ (insert MS&Novell deal jokes here). No CD drive under Linux either. Wow. That DVD is really damn cursed. It makes whole drives disappear. Turned off and continued disassembly. Finally got the DVD out and put the machine back together.

How does that make me feel about slot loading drives, Apple? Gah. Now I need to find a way to ritually destroy the damned DVDRW. Suggestions welcome.

Yo MacHeads?!

Friday, January 4th, 2008

Do what you gotta do!

@