Sunday, December 2, 2012

AGU Fall Meeting Poster

It's been a busy week, but my poster for AGU is finally printed and ready to go. Here's a small copy of it:

Note, ImageMagick doesn't seem to convert to colours exactly correct, so you may want to check out the PDF. If you want to have a look at the full PDF, check out the ePoster at the AGU. That page has the abstract, and you can click "View ePoster" for the poster.

This poster was the result of a monster-combination of Scribus, LaTeX, GMT, and even a bit of Inkscape. But at least I didn't use PowerPoint! I was planning to write some information about the process, but that's turning into a rather large post. I want to post this one before AGU and I'll write separate posts about the process later.

Wednesday, June 13, 2012

Missing Library in Rhythmbox on F17

One of the bugs I encountered after upgrading to Fedora 17 is that my music library seemed to have disappeared in Rhythmbox. In fact, everything appeared in the Missing Files view. The strange thing is that all the files appeared exactly where Rhythmbox thought they should be. In fact, I could even play them directly from the Missing Files view!

Anyway, after a bit of searching, it appears that I am facing this bug. You see, on my laptop, I encrypt the /home directory. Back on Fedora 16, some bug in gvfs or udisks caused things to think that that directory was a removable partition. Something must have been fixed in Fedora 17, because it's no longer marked that way (which is good, because I hate seeing it in nautilus.) However, Rhythmbox still thinks those files should be on a separate partition and doesn't correctly update itself (the aforementioned bug.)

This is pretty easy to fix, in fact. Since /home is now no longer considered a separate mount point, you just have to remove those indicators from Rhythmbox's config. The config is an XML file that's been pretty-printed, so the offending information appears on a single line (per file entry). That makes fixing it a pretty simple thing to do:

$ cd ~/.local/share/rhythmbox/
$ cp rhythmdb.xml rhythmdb.xml.backup
$ sed -i -e '/<mountpoint>/d' rhythmdb.xml

Friday, June 8, 2012

The Fedora 17 "Beefy Miracle"

So, a new release of Fedora was set free just last week, the so-called "Beefy Miracle". A couple of releases ago (or maybe last release), I had really thought I might wait at least a month after a release before upgrading. Turns out my curiosity got the best of me, and I went and upgraded my laptop mere days after the release.

Fortunately, this release has been much much better right out of the box. Having read the release notes, I was prepared for the one major bug, namely the kernel being stuck at an old version. Since it only affected shutdown, it wasn't too big of a deal, just a bit annoying.

Being the third release with GNOME3, it's finally starting to come together into something usable. With the right extensions, it's even better than GNOME2 was. I can't say exactly what changes went into it, but I guess it's a lot of behind the scenes changes to make things Just Work.

There are still a few things that need work, of course. I'm still not a big fan of the grey theme, but at least the window decoration is not huge anymore. It's still a bit difficult to find good complete themes that fix that. Also, it seems they introduced a fade-out of windows that are not in focus. It's sort of like it's disabled-in-appearance-only. I'm sort of yes-no on this change. It seems like it might be good for accessibility, but they don't seem to have tried this out all too much. Sometimes widgets remain faded even when the rest of the application is back in focus. Using some dialogs (like gedit's Replace) do weird things.

One last point is going to be about the wallpaper. I know I don't see it all too much, but the last three releases have had wallpapers that are really quite nice. Fedora's wallpapers have been traditionally mostly blue, the trademark colour. This one deviates a bit with a splash of pink, but I think it's just enough to make it pop. And who could not like fireworks?

Thursday, May 31, 2012

"Video" Editing in Linux

Video editing is one of those domains for which there are some expensive options and several attempts at open source alternatives. Unfortunately, few efforts have even gotten past the first few months.

A couple months ago, I had to do some "video" editing. I put that in quotes because in fact, it was more of a slideshow. I had done something similar a few years ago in PowerPoint. After the pain of that experience, I was quite certain I didn't want to do it that way again. I looked for some alternatives, but pretty much knew what my list of prerequisites was:

  1. Background music and voiceover audio
  2. Easy positioning of audio clips (Possibly meaning multi-track editing)
  3. Good set of transitions
  4. HD output, if possible, since all my photos were high resolution already

Weighing the Options

I know there are dedicated slideshow tools out there, like Imagination, but I wasn't sure how to get points 1 and 2 taken care of. I was pretty much certain that I'd have to use a video editor of some sort. There are really only about three or four I'd expect to work.

I was originally thinking of OpenShot, but annoyingly, you can't drag multiple clips from the Project to the Timeline. This might seem like a small issue, but for a slideshow of a few hundred images, it becomes a bit tedious. That's one of the reasons I didn't like PowerPoint, since you had to create a slide per picture and then add it. Overall, OpenShot just seemed to be a bit too simplified to be usable. On the upside, it did seem to have a good selection of transition effects.

The next option was PiTiVi. A long time ago, when I had to settle for PowerPoint, I had looked at PiTiVi. It was really just not ready to use for much of anything then. Just loading files used to cause a caught-in-abrt-but-not-totally-fatal exception. Nowadays, it's become much more polished. The UI looks much nicer with a good layout of controls. Unfortunately, it's limited in the transition aspect. Basically, you've got crossfading and that's about it. With no transition wipes, that pretty much cut out PiTiVi, although I really do like the direction it's going.

A possible contender?

The final choice was Kdenlive. Kdenlive uses the same video processing toolkit as OpenShot (MLT), but has been around since before OpenShot and PiTiVi. I can't say whether this longer development time is the sole reason or not, but it's certainly turned out to be the best of the three at this time. It's obviously multi-track (points 1 and 2), there's a good selection of transitions (point 3), and it'll render almost whatever resolution you want (point 4).

Now, does editing real video have its issues? I can't exactly say, but for what I had to do, I found Kdenlive to be extremely stable. In the course of this project, I saw maybe two crashes. That's two crashes too many, but video editing seems to be a tricky art (likely due to there being too many video specs, with poor descriptions, and poorer implementations). Actually, I did have to insert two real video clips, and they didn't cause any trouble.

Kdenlive was certainly up to the task for this slideshow/video project. It was perhaps of a moderate size, a few hundred images, two video clips, a dozen music tracks, plus 15-20 audio voice clips, resulting in about 25 minutes of final video.

Alas, it's not quite perfect...

Let's not say that Kdenlive doesn't still have its rough edges. It did appear to use a large amount of RAM, but I think that's because the project was 1080p, and I wasn't using proxies. Randomly (but thankfully not too many times), an invisible spacer would insert itself on a track and shift all the subsequent clips. Eventually, I did find the Lock Track button, and then could shift the incorrect track back. Once, a clip became half-deleted, getting in the way of other clips, but staying immovable and un-deletable until I re-opened the file.

While there are many to choose from, there are twenty transitions that are just named numerically, meaning you have to pick a point in the middle of a transition, look at the result, and guess which direction it's going (it doesn't auto-preview the whole thing, for example). What would be really useful is a "base" transition set, with an editor to tweak a few settings. For example, if you had a expanding star, the editor could enable you to position that star over some important object instead of dead-centre.

The other transitions that were missing were some good 3D effects. I tried following these instructions to create a page curl effect, but ended up keying every frame of the overlay position just to make sure it looked good. For another effect, I used a rotate about Z to create a sort of full page flip, but the Z rotate doesn't seem to cause any perspective changes (the far end does not shrink in height and the near end does not grow in height). It didn't look too bad in the end, but it could have been easier to do.

Wrapping up

In the end, I managed to finish my project relatively easily with Kdenlive. OpenShot is really just not up there at this time, although it does have a nice set of 3D titles in Blender. PiTiVi is also moving along quite nicely, and if it wasn't for the lack of transitions, I might have used it. Kdenlive seems to be the best choice right now. But everything's under rapid development, so this might change any time soon.

Saturday, July 9, 2011

Fixing the Toaster

Sometimes, things just break. Maybe it's planned obsolescence; I don't really know. But I don't want to be wasting things just because they "seem" to not work anymore.

Speaking of things not working, our toaster-oven (a Bravetti) recently stopped turning on. (You didn't see that coming, did you?) Turning on the timer didn't light the lamp, and didn't electrify the elements. A bit of a problem when you want to toast things (pizza in a microwave just isn't the same!)

Taking Things Apart

As it turns out, the same thing has happened before. That made this work pretty easy as I knew exactly where to look for the problem. As a plus, this is an easy fix and if it must fail, I'd pick this over some other problem.

First, you need to take out all the screws around the top cover. On this model, they're on the back and on the bottom along the feet. Remove the cover and you can see all the wiring as in the picture.

The top control is temperature, middle is heating mode, and bottom is the timer. Our trouble arises in the timer control. You need to pull off the front dial. It's got some goop in it to hold it in place, so I wedge it out with a flathead screwdriver. Once it's off, take out the two screws holding the timer control onto the panel. Pull out the electrical contacts, and you're good.

So now you have the timer control; what to do with it? Open it up, of course! It's locked up using small bent metal tabs. Simply straighten them up with some pliers and you should be able to pull off the top bit. You need to take all of the shell off, as below.

In the picture to the left are the separated parts of the timer control. At the left is the outer shell with the bell. Then the timer mechanism, a cover and another mounting cover.




In this picture we have the back view of the timer mechanism. Keep in mind the little black arm as that interfaces with the silver arm in the bell.


Cleaning the Contacts

That black plastic bit at the top is the site of all the trouble. Take a look at the contact below, which has become black. I don't know whether this is some kind of galvanic corrosion, but it means the switch just doesn't close.

I can't quite remember what I did the last time, but it may have involved scratching at it with a screwdriver. This time, I used a cone sanding bit on a rotary tool to clean it up entirely. It's a bit difficult to see below, but it's much cleaner now. Note, I didn't clean the mount around the contact, so you can see the difference between before and after there.

Finishing Up

Now that the contacts are clean, it's just a matter of putting everything back together. It's important to get the post on the timer aligned with the lever in the bell, or it won't ring when finished. Then reattach all the casing, bend the tabs, and screw the rest all together. And the final test, of course, is to turn it on and toast some bread!

Thursday, June 30, 2011

Translating for Fun and Profit

Okay, so maybe I'm not entirely sure about the second one, but it certainly could be fun depending on your interests. Writing translations is probably one of the simplest ways to contribute to an open-source project, especially if you don't know/like coding.

There are a couple of things you'll need to do:

  1. Get the stuff to translate.
  2. Translate the stuff.
  3. Send it back and get it merged.

You'll also need some software. I leave it up to you to figure out how to install it, if you need it (it's easy in any Linux distro!)

  1. I'm going to use git, although it may not be necessary depending on the project.
  2. A translation editor. You can use any plain text editor, but using translation software provides a few conveniences.

Choosing a Project

No matter your likes, it shouldn't be too difficult to find some open source software that you find interesting. Just take a look on SourceForge or in any Linux package database. Of course, you'll also need to know another language, especially the technical terms, which may not be so common.

For some reason or other, I recently installed MyPaint. It's pretty fun to draw stuff, though I'm not yet familiar with all the brushes. And it would be easier if I had a tablet instead of a mouse!

Getting the Text

Obviously, the first thing you need is the text that needs to be translated. MyPaint, like many other open-source projects, uses GNU gettext to translate from one locale to another. A locale defines the language and country. For example, "pt" is Portuguese, while "pt_BR" is Brazilian Portuguese.

MyPaint uses git on Gitorious which makes it pretty easy to get what you need to work on a translation. (Maybe not as easy as translating on LaunchPad or Transifex, but I can't let you go off without learning something).

There are two ways to get the MyPaint source: via git, or via the source package. The MyPaint developers prefer git merge requests, but they'll also accept whole translations directly from the package.

To go the first route, you'll need an account on Gitorious (you can login with OpenID or various other accounts.) Once that's done, you can go to the MyPaint git page. Click the Clone Repository button (see screenshot).

You will then have a personal copy of the code on Gitorious, where you can save all your changes. Using the personal clone URL, you can get a copy of everything with the following command (use your own URL):

git clone git://gitorious.org/~qulogic/mypaint/qulogic-mypaint.git

This will give you a mypaint directory with the source of MyPaint.

Make the Translation

In MyPaint, the translations are in the po directory, which is the common location for many gettext-based projects. These files (*.po) are pretty simple, with a small header at the top describing the language and then the translations. Each translation is given by a msgid and a msgstr which are the original and translated strings, respectively. MyPaint includes a couple commands to start you off.

scons translate=pot
scons translate=<language code>

You'll have to find the correct code for your language from gettext. Once you run the above commands, you will get a <language code>.po file into which the translations will go. First, fill out the translation information at the top of the file for the new language. Then just write out the translations of the msgid in the msgstr sections. Of course, if you have a translation editor, then it'll indicate what you've translated so far, etc., and generally make things easier.

Merging the Translation

Once you've finished writing the translation, there are a couple more steps to getting it merged into the project. Now, assuming you're using git like I started above, you'll need to do the following:

  1. Commit the translations to your repository.
  2. Push the changes to gitorious.
  3. Request a merge from the original project.

Committing translations

The first thing after writing your translation is to commit the result to your repository. I'm not going to explain all of git for you, but basically, as a distributed version control system, you commit changes to your own copy and can share that with everyone else. To commit your changes, you first 'add' the changed files and then 'commit' them.

git add <language code>.po
git commit

Push changes

Now that git has saved your changes as a commit, you need to send those changes to gitorious. This is a simple command to push changes to a remote repository.

git push

Request a Merge

Now that the code is on gitorious, you can request a merge from the upstream project. On gitorious, you just have to click the Request merge button on the right side.

You will get to a page where you can fill in what your changes entail. Just fill in the fields, follow the instructions there, and send off the request.

Now it's just a matter of waiting for your request to be merged!

Wednesday, May 11, 2011

Adventures in GNOME3 Land

Over the past few weekends I've been trying out GNOME3 via the Fedora 15 Beta. I've already read many a blog post in opposition to various things, so I was not overly surprised when I tried it out. Fortunately, I have a pretty boring setup because I only tested on my desktop, meaning I didn't have to worry about external monitors or suspending.

In fact, with respect to working with the whole thing, it wasn't a terrible experience. Granted, I made a couple tweaks right off the bat since I knew about them. I still like my menus and buttons with icons, and the default hinting is terrible on an LCD. I didn't really care about the min/max buttons though.

Because I've been using Compiz and not Metacity, the transition to Mutter and GNOME Shell was pretty easy. One thing I miss is the "Put" plugin, which allowed moving a non-maximized window to any of 9 positions on the screen using the keypad. And the window switching is a bit boring now.

I even reported a bug or two. These are pretty minor, but everyone's reported the major problems by now, I'm sure. It's the little things that people are going to pick out anyway (like the uncanny valley in robotics/CGI.) Overall, I found the experience pleasant, except for two somewhat annoying problems.

Firstly, the default theme is, well... I was going to say terrible, but on second look, it's not that bad, but still not to my taste. To be honest, I've never been crazy about dark themes. But this theme is some weird conglomerate of dark and light that doesn't mesh well at all. The icons are either black and white (I'm not colour blind!) or sometimes washed out. Take, for example, gedit in the screenshot below. Odd transition from menubar to toolbar, the disabled icons/text are hard to see... It just doesn't look good to me.

Secondly, GNOME3 has koumpounophobia. That's a fear of buttons, for those who don't know (not that I did, and it most likely refers to clothing, really.) I don't live in crazy 1990s Mac land; all my mouse have at least two buttons. My desktop mouse identifies itself as having 12 buttons! (though half are for scrolling, technically) Yet for some unknown reason, right-clicking is totally useless on GNOME Shell. You can't right-click any of the applets on the top panel. It's more likely people will right-click it than hold down Alt as a guess, but that "Shut Down" item is hidden behind the "Suspend" item with an Alt-key. A little lower in the stack, GTK+3 decided to drop scroll-on-notebook-changes-tabs. What's even more annoying is if you have a GTK+2 app, it will scroll nicely, but the "new" apps don't. Unless you try in gnome-terminal, where they implemented it themselves. Inconsistency is never good.

So this Fedora 15 Beta is on a separate external drive. I'm not sure if I'll be upgrading straight away once F15 goes gold. I certainly need to find a real theme first, and I suspect when it's released, there'll be a lot more people with criticism that may nudge things along (as opposed to some knee-jerk reactions by a few early-adopters).