MySQL configuration tips and tricks

A web developer often has to access different MySQL databases for different projects. To quickly navigate through them, I like to use project-specific MySQL configuration snippets and aliases. My projects usually have some kind of a namespace, a 2-3 character code specific to that project. Just to give an example, let’s call my project Xylophone Ytterbium Zeta, and its namespace code is XYZ.

I would create a my.cnf file in my project’s directory with the following content:

host = localhost
user = xyzuser
password = xyzpassword
database = xyzdatabase

If I now run:

$ mysql --defaults-file=~/projects/xyz/my.cnf

I will be logged into the project’s database immediately, without having to enter my credentials.

However, the --defaults-file argument is quite a long argument to type in every time, so I would create a bash alias, so that all I need to do is:

$ myxyz

to get into the database. To create this bash alias, I’d simply add the following line to my ~/.bash_aliases file:

alias myxyz="mysql --defaults-file=~/projects/xyz/my.cnf"

Of course your .bash_rc file needs to know about this file, so check if you have the following snippet in there:

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

The latest Ubuntu versions should have that already prepared for you.

A meaningful silence

Translated from Dutch. Original article by Gaston Dorren.

When I told my friends that I had joined a sign language course, there were two kinds of surprising reactions. Firstly, they showed much more interest than when I was learning Danish, Spanish, Russian, Norwegian, Romanian or Czech. (No, I don’t speak those languages. And yes, my friends got a lot to digest.) Sign languages seem to entice a lot of curiosity.

Secondly, even though my friend circles consist of a lot of master degree holders, and a doctor, I heard quite a few distressingly misinformed remarks about sign language. Despite so much evangelism in the beginning of the eighties by linguists and sign language advocates, many of the first misconceptions are still around. This is why I have set myself a simple goal: I will summarize seven common, but incorrect assumptions, and will deal with every one of them.

Continue reading A meaningful silence

Multi-lingual views in Zend Framework 1

Ever felt like this?

Build us a multilingual website

If so, do read on. Because it has become easier.

Do you want to quickly organize your multi-language website in Zend Framework, such that you can easily add languages without breaking the website? And from there, progressively translate pieces of your website? Imagine a website where you have a handful of static content – think of about pages, policy pages and disclaimer pages – and you want to easily add translated pages to your system, without having to go through programming the logic of selecting the right view for these pages.

Look no further, for the ZF1E library offers exactly that solution. Using the built-in MultiLanguage resource, it will determine which language part of your website your visitor is accessing, and grab the correct view for that language.

Continue reading Multi-lingual views in Zend Framework 1

Taking the JLPT exams – what if you are deaf?

In my previous post, I gave some advice on learning Japanese. Now, if you want to get an official recognition for your learning Japanese, you can take the Japanese Language Proficiency Test, JLPT for short (日本語能力試験, nihongo nõryoku shiken).

Actually, now that it is April, it is the time of the year to apply for the summer JLPT. In Japan, the registration forms should be available at many bookstores, and it needs to be filled in and posted by April 30th.

The test used to be in four levels, but it has been expanded to five levels in 2010:

  • N5 – the ability to understand some basic Japanese
  • N4 – the ability to understand basic Japanese
  • N3 – the ability to understand Japanese in everyday situations to a certain degree
  • N2 – the ability to understand Japanese in everyday situations and in a variety of circumstances, to a certain degree
  • N1 – the ability to understand Japanese in a variety of circumstances

When you are thinking about moving to and working in Japan, I suggest you try to pass the N2 or N1 levels: many companies ask for these. They will be OK with N2, but some may prefer N1. Having at least N2 will greatly increase your chances of getting employed in Japan.

Continue reading Taking the JLPT exams – what if you are deaf?

Learning Japanese – some advice for the deaf

Recently, I became acquainted with a British fellow, who has serious plans of moving to and working in Japan. There is nothing special about this – there are many people thinking about living in another country, and there are many expatriates sharing their experiences – except for the fact that this fellow and I are both deaf. He noticed on my public resume that I have passed the Japanese Language Proficiency Test, level 2 (old system, equivalent to the current N2), and asked me how I learned Japanese. I pointed him to an article I wrote a few years ago on another website, which I am reposting here with some edits. He told me he has been looking for this kind of information since a long time ago. The reason is that most language learning websites also suggest listening to audio tapes, and other methods which are not really suited to deaf people who also want to learn the language.

So here is my advice. Please note that this advice is by no means limited to deaf students – I believe everybody who wants to learn the Japanese language, will benefit from this article.

Continue reading Learning Japanese – some advice for the deaf