Searchbar in Firefox

Introduction

One of the hot topics of the last years is usability. Consistency can help improving the usability, but I think Firefox 3 fails in consistency when you use the searchbar on three different operation systems: Linux, Windows and Mac OSX.

Example 1: Windows

On Windows shows the searchbar like this:

Firefox searchbox Windows Vista

I really like this layout. You can argue about the position of the buttons: “Next” on the right seems to make more sense, while “Next” on the left will make it easier to push it.

Example 2: Linux

Next image shows how the searchbar looks on Linux (OpenSUSE 11 with KDE3 in my case).

Firefox searchbox Linux (OpenSUSE 11 KDE3)

This layout is quite good. The icons are really clear what the buttons do and the position of the buttons makes sense.

Example 3: Mac OSX

On Mac OSX 10.5 the seachbar looks like this:

Firefox searchbox on Mac OSX 10.5

In my opinion, this layout stinks. The position of the buttons is incorrect, because the button shape makes the “Previous” button look like “Next” and vice versa.

Conclusion

I know there are limit on these different OS’s about what you can do with the default UI elements (for example on Mac OSX). But I think the people at Mozilla should try harder to make the user clear what the buttons do and at least change which the position of the two buttons.


Install git on a shared webhost

Introduction

Recently I ran into an article about using git to upload your site (see links at the bottom how to). But off course, this requires to have git installed on your hosting. My host (via TurtleHost.be) does not have it. So I was thinking, why not install it myself. Idea sounded more simple than doing it… .

Requirements

Finding git

Before we can download git, we need to know which Linux distribution your server is using. This is required so the git executable will be able to use the correct libraries. To find out which kernel your server is running, log in to your server via ssh and type the command:

cat /etc/*-release

On my server this returned CentOS release 5.3 (Final). Next thing we need to know if your server is running 32bit or 64bit. This we can verify with the command:

uname -p

x86_64 indicates the server has 64bit kernel running. i386/i486/i586/i686 means it is a 32bit kernel.

Downloading git

Next we need to download git from somewhere. Probably you can find it by searching it on a RPM repository. I found one on rpm.pbone.net. This site has a great search engine where you can find git version for your server distro. After finding a download link, again log in to your server via ssh and type the following commands:

mkdir ~/git-download
cd ~/git-download
wget ftp://the.download.link/of/repo/containing/git-1.6.x.x.rpm

Now you have the .rpm on your server.

Installing git

This rpm needs to be installed, but you won’t be able to use the regular rpm installer because this requires root access. You can extract the rpm file with the command:

rpm2cpio git-1.6.x.x.rpm | cpio -imdv

This will create a usr/ directory in currect directory. You best move this directory to your home root:

mv usr ~/usr

Now we are almost there, we only need to add the directory to $PATH variable. Doing this will make it possible to execute the command git from anywhere. Open your ~/.bashrc file with your favorite editor (vim or pico) and add the following line:

export PATH=$PATH:$HOME/usr/bin:$HOME/usr/libexec/git-core

And that’s it. To activate this change, run source ~/.bashrc or log out and in again.

Note

You can use git just by typing the git command. But git init might give a warning:

warning: templates not found /usr/share/git-core/templates

To avoid this warning I’ve added an alias to ~/.bashrc:

alias git-init='git init --template=$HOME/usr/share/git-core/templates'

This git-init command is an alternative to git init and will take the correct path for templates.

Possible problems

One problem caused me a headache when using git to upload my site was het error:

git: 'index-pack' is not a git-command.

The reason for this problem was that $HOME/usr/libexec/git-core was not added to the $PATH variable.

Further reading

So now you have git up and running on your server and you can use it to upload your site. Read about it:


Link two static libraries in one application

Introduction

This is a technical post about compiling a C/C++ application using gcc. This post requires understanding of C programming and building it.

I’m about to discribe a problem that made my loose several hours searching for the problem, while the solution was quite simple.

Situation

I was working on an application that uses two static libraries, or so called archives. My application uses functions from one library, while that library uses functions from another library. This situation sound complex, but I’ll explain using an example.

Example

The application helloWorld.app uses two archives libArchive1.a and libArchive2.a.

libArchive1.a

This first archive is build from: libArchive1/libArchive1.h

#include <string>
std::string GetHello();

libArchive1/libArchive1.c

#include "libArchive1.h"
std::string GetHello() { return std::string("Hello "); }

You can compile these files to an archive using these 2 commands:

g++ -c libArchive1/libArchive1.c -o libArchive1/libArchive1.o
ar rcs libArchive1/libArchive1.a libArchive1/libArchive1.o

libArchive2.a

Similar library to libArchive1.a with use of the GetHello() function: libArchive2/libArchive2.h

#include "libArchive1.h"
std::string GetHelloWorld();

libArchive2/libArchive2.c

#include "libArchive2.h"
std::string GetHelloWorld() { return GetHello() + std::string("World!\n"); }

Compile by:

g++ -c libArchive2/libArchive2.c -IlibArchive1 -o libArchive2/libArchive2.o
ar rcs libArchive2/libArchive2.a libArchive2/libArchive2.o

This will require to provide the parameter -I so the compiler knows where to get the file libArchive1.h.

helloWorld.app

Small application printing “Hello World!” to stdout using the GetHelloWorld() function. printHelloWorld.c

#include <iostream>         // for cout
#include "libArchive2.h"
int main(int argc, char* argv[]) {
   std::cout << GetHelloWorld();
   return 0;
}

Now here is where the problem did arise, compiling the application. This is what I did:

g++ helloWorldApp/printHelloWorld.c -IlibArchive1 -IlibArchive2 -LlibArchive1 -LlibArchive2 -lArchive1 -lArchive2 -o helloWorld.app

The arguments -lArchive1 and -lArchive2 will tell the compiler to link in libArchive1 and libArchive1. But I got the following error: undefined reference to GetHello()

After a long search (the application I was working on was a lot more complex, so many things could have been wrong), I found the order of importing libraries with the -l argument matter. So after switching the order of -lArchive1 -lArchive2, the application got compiled and did print the text “Hello World!” when running it.

Conclusion

The order of importing libraries matter. As far as I know it is a compiler bug and seems to be solved in newer versions (on Mac OSX 10.5 it works, on OpenSUSE 11 the error occurs). Anyhow, if you have problem with this place the least depended library last in the argument list:

g++ appHelloWorld/printHelloWorld.c -IlibArchive1 -IlibArchive2 -LlibArchive1 -LlibArchive2 -lArchive2 -lArchive1 -o helloWorldApp

This will sound really technical for a lot of people, but it took me too long solving it to not share it with you. I hope someone will benefit from it.

You can download the source code of this example here.

Further Reading


Export mails from Outlook to Mac Mail

Problem

Recently I’ve bought a new iMac. Real great machine, but I used to be a Windows Vista user, so I needed to export files and settings to Mac. Most of it was no problem, the only problem was: Email. On Windows I did use Microsoft Outlook to access my Hotmail, Gmail and own domain email account.

Most of you know, Outlook uses .pst files to store the mails locally. But you can’t import them directly into Mac Mail. So I needed to export them to a format Mac Mail knows. There are several (paid) tools available to convert Outlook mails to Mac Mail, but I didn’t want to pay for a tool I only use once.

Solution

Mac Mail support import from Mozilla Thunderbird. Thunderbird is a free mail client and works on both Windows and Mac. And the major upside, Thunderbird support import from Outlook. So I ran into an article how to import emails from Outlook to Thunderbird. And this is how I did do it:

  1. Install Thunderbird on your Windows machine (Outlook needs to be running on the machine when you import to Thunderbird)
  2. Import the messages using Tools -> Import -> Mail.
  3. Close Thunderbird and copy the Thunderbird Profile directory from C:\Users\<Windows user name>\AppData\Roaming\Thunderbird\Profiles\<Profile name>\ to your Mac (I used a Windows shared folder to do this)
  4. Import the Thunderbird files to Mac Mail using File -> Import Mailboxes

And now you have a “On my Mac” folder in Mac Mail, where the imported mails are stored.

Additional

Recently Hotmail has enabled POP3. So you can easily use this to access your Hotmail accounts via Mac Mail, or any other mail client. These are the settings (from LifeHacker.com):

POP server: pop3.live.com (Port 995)

POP SSL required? Yes

User name: Your Windows Live ID, for example yourname@hotmail.com

Password: The password you usually use to sign in to Hotmail or Windows Live

SMTP server: smtp.live.com (Port 25)

Authentication required? Yes (this matches your POP username and password)

TLS/SSL required? Yes


Post some tweets in an irregular language

Problem

Most people use one main language (e.g. English) to post there tweets. But sometimes you really want to post a tweet in a different language. If you just post the tweet in that “irregular” language, most of your followers would not understand the tweet. So you don’t want to bother those people with those tweets. Some people use a second Twitter account to post in another language, but this isn’t very convenient because you’ll have to which between accounts.

Solution

Recently Twitter has changed behavior of @reply system. This change caused that tweets starting with an @username you don’t follow, would not appear in your timeline. A lot of people (including me) really didn’t agree with this change, and protested using the #fixreplies hashtag.

But maybe this #fixreplies problem can solve the language problem. If for every used language a user would exist, users can post a tweet in a irregular language starting with this username. If your friends follow this user too, which means they understand that language too, they will see this tweet, otherwise they don’t.

A tweet in Dutch

Language Users

As test I’ve created the @lang_nl user, use this one if you want to tweet in Dutch (Nederlands). If you need another language, feel free to create one. But try to use the same name convention, meaning: @lang_[language_code], with [language_code] the code taken from ISO 639-2 Language Code List, and leave a comment which user you’ve created.


Search

Meta

About