Wednesday, May 26, 2010

MySQL User Access Setup

Setting up a database to be populated by Hibernate or some other O/R mapping tool usually requires the following inital setup when working with MySQL:
  1. Create the database, e.g.

    mysqladmin -u root -p create foo

  2. Create a user and grant full access to the database from any machine, e.g.

    grant all on foo.* to 'homer'@'%' identified by 'simpson';
    grant all on foo.* to 'homer'@'localhost' identified by 'simpson';

  3. You can always undo these permissions, e.g.

    revoke all on foo.* from 'homer'@'%';
    revoke all on foo.* from 'homer'@'localhost';

Of course, there is a ton of documentation available to grant more fine-grained privileges and much more.

Monday, May 24, 2010

Subversion Patches

Sometimes I need to create a patch for the local changes of my Subversion working copy. This can be achieved very easily using the following command (typically issued from the root directory of the checkout):

svn diff > ~/local_changes.diff

The patch can then be applied on a different working copy by applying the command:

patch -p0 -i ~/local_changes.diff

The command output will tell which parts of the patch have been applied successfully and which ones, if any, have failed.

If you work with IntelliJ IDEA, I suggest you both create and apply the patch with IDEA, since patches created by Subversion do not work well when applied in IDEA.

Sunday, December 30, 2007

Google Browser Sync

I came across the very useful Google Browser Sync Firefox extension which allows me to easily keep my bookmarks in sync between my desktop machine and my laptop. This totally transparent extension continuously synchronizes my browser settings – including bookmarks, history, persistent cookies, and saved passwords – across my computers. It also allows me to restore open tabs and windows across different machines and browser sessions.

Sunday, May 13, 2007

MySQL Query Analysis

While reading an article on MySQL Query Optimization, I came across the EXPLAIN keyword. It's a built-in feature of MySQL that allows you to get some information on how a given query is used. This is of great help while optimizing queries to find out whether indexes are applied properly.

Thursday, February 22, 2007

Temporary Email Addresses

For almost every online service offered by a website, you need to open an account with that website. They want your email address, your location, your salary, your favorite's pet name - you name it. That's when temporary email addresses come in very handy.
They allow you to provide an online service provider with a valid email address without having to reveal your true email address.

Wednesday, February 21, 2007

Code As Design

An interesting collection of articles on Code as Design by Jack W. Reeves.

Saturday, February 17, 2007

Subversion Repository

Subversion is one of the most beautiful pieces of software that I have ever worked with. This open-source version control system is well designed, it's robust and scalable, it's powerful while still user-friendly, and it's also very well documented.

Setting up a minimally configured subversion repository can be very easy:
  1. Download subversion from the tigris website

    http://subversion.tigris.org/

  2. Create a subversion repository at your desired location by applying the command svnadmin create <location>, e.g.

    svnadmin create c:\server\subversion\repos

  3. Optionally configure authentication and access-control in the svnserve.conf file which is located in the conf folder directly under the repository root, e.g.

    c:\server\subversion\repos\conf\svnserve.conf

  4. Star the svnserve server process by applying the command svnserve -d -r <location>, e.g.

    svnserve -d -r c:\server\subversion\repos

  5. You can then access the repository from a subversion client using the svn protocol, e.g.

    svn import c:\projects\foo svn://localhost/foo/trunk

You can learn all the details about subversion from the book Version Control with Subversion which is also accessible online.

Friday, July 07, 2006

Unit Conversions

Growing up with the metric system, I'm still not used to think in Feet, Fahrenheit, and Ounces. While googling for yet another conversion tool, I've found out about Google Calculator which supports all kinds of conversions. Do a Google search for

5250 meters in feet

and you will get the answer right from the Google Calculator: 5250 meters = 17224.4094 feet. This also works for other types of conversion like 46 celsius in fahrenheit or 2 ounces in grams.

The Google Currency Converter works very similarly. Search for

1 USD in CHF

and Google will tell you how many Swiss Francs a US Dollar is currently worth.

Thursday, May 04, 2006

Time Zones Anomalies

Working with time zones is tricky per se, and even more when using the Calendar classes that ship with the JDK. But when the Aussies Down Under decide to extend the Daylight Savings Time (DST) in 2006, due to the Commonwealth Games, things get simply confusing. Luckily, Sun incorporated this anomaly in their JDK Updates for 1.3.x, 1.4.x, and 5.x.

It might be worth to take a look at alternatives to deal with times and dates in Java applications, for example, the Joda-Time library is a real jewel.

Thursday, January 19, 2006

Firefox Hidden Preferences

Recently, I came across the about:config URL which reveals many hidden Firefox preferences. Details about their meaning can be found in MozillaZine.

Monday, January 09, 2006

Resolving Acronyms

I often receive emails loaded with acronyms that I don't understand. For example, IMHO, HTH, AFAIK, OOTO, etc. In order to resolve such acronyms, the Canonical Abbreviation/Acronym List compiled by James Marshall is very helpful.

Sunday, December 18, 2005

Firefox Keyword Searches

Using LEO on a daily base, I tried to find a way to optimize looking up a translation through Firefox. I already knew that I can use a URL like 'g java' to do a Google search on 'Java', and I wanted to achieve the same functionality for LEO using 'l haus' since these keyword searches are super convenient.

Surprisingly, it only took two minutes to google the web and find and apply a solution:
http://kb.mozillazine.org/Using_keyword_searches

Bookmark Name: LEO
Location: http://dict.leo.org/?search=%s
Keyword: l

This makes Ctrl-T Ctrl-L my favorite keyboard shortcut.

Sunday, May 08, 2005

Hiring Process

Recently, I got involved in the hiring process at the company I work for, mainly having to interview candidates. While preparing, I also went through some online resources.
  • The Guerilla Guide to Interviewing had some interesting points. Smart and gets things done is definitely a critical criteria to keep in mind. Joel's overly self-conscious writing style can be a bit tiring after a while, though. His Growing a Team section has more interesting articles on this topic, i.e. the article on a Programmer's Perspective.
  • The TSS article Hiring the Phantom Java Architect is worth reading before actually posting a vacant Java developer/architect job description. I don't really agree with the author on the architect/developer distinction he makes, but knowing what exactly you are seeking for is surely crucial.
  • I don't think I would ask such kind of questions myself, but the Technical Interview Questions are quite fun to solve (or at least to try to solve). Find some the solutions in Joel's Forum.
Some of the experiences that I have gained so far from interviewing applicants are
  • make them feel comfortable by letting them talk about their favourite project of the past
  • ask some questions specific to their resume to get a feeling of how well what is written in the resume matches the truth (I'm really disappointed when people put some cool technology in their resume and then you find out that they only used it once for exercise 1.b of their CS course)
  • let them explain how the team setup and the interactions were at the former job and what their role was
  • make them write some code that must actually work (which is a big difference to writing some fuzzy diagrams with arrows, place holders, etc.)
  • ask a technical question that they probably don't have the answer for and see how they approach this situation
  • observe whether they can give precise answers to precise questions
  • I still have a lot more to learn about interviewing efficiently

Saturday, May 07, 2005

Information Flood Management

Today, I almost constantly feel overwhelmed by all the information, messages, and questions I get flooded with each day. Mails, bug reports, blogs, ICQ messages, phone calls, shoulder tapping, etc. I still haven't quite figured out how to manage and control this flood of information input and the right tools are definitely only part of the solution. I think it's more a human problem than a technical problem of how to handle this situation. But the right tools definitely help.

Google I use to actively find information. Their concept of a simple search UI with a smart and powerful search engine behind it has definitely revolutionized the way many search UIs work today. By the way, TwinEngine, formerly known as YaGooHoo!gle, is as simple as it is interesting.

GoogleDesktopSearch is the tool I use to search my local harddisk for mails and documents. It's super-fast and very easy to configure and use (as expected from a Google product). Often, I even prefer this tool to the built-in search of mail and web clients.

Firefox is the browser I use to browse the web. No more IE, no more Opera. Firefox is slim, fast, and I love the Themes/Extensions concept, e.g. the Web Developer extension is great.

OmeaReader by JetBrains is my favourite tool to handle the RSS feeds from blogs and newsletters that I have subscribed to (unfortunately, it only runs on Windows, yet). It's free, fast, and very configurable. The Clipping and Annotation features are cool, too. Thunderbird's RSS support would probably suffice but as a big fan of JetBrains products it's clear I go with OmeaReader.

Tadalist by 37signals is a neat little web application to keep my todos uptodate. I love their idea of removing as many features as possible instead of adding more features than needed. By the way, 37signals is the company that developed the CodeZoo website.

JIRA by Atlassian is what we use for bug tracking at the company I work for. It's the best bug tracking tool out there that I can imagine. Period. One could write a whole separate blog covering the functionality.

Monday, May 02, 2005

Configurator Pattern

Recently, I was refactoring some code which I was not happy with at all: there were many 'if instance of...' statements and I was looking for a way to get rid of them. Since time pressure was high (what a lame excuse), I coded faster than my mind could think about the problem. In the end, I had invented the Configurator Pattern, which can be applied to almost every problem:
public interface Configurator {
Object configure(Object inSource)
}
It allowed me to get rid of the 'instance of' checks and all I had to do is write some detailed JavaDoc for each implementation of the interface to make sure it's clear what the method expects as input parameter and what it returns as result.

Once I was done, I finally took the time to look at the design. I liked it for about 20 seconds (I'm not that fast). After this period of relieve about having found a solution, I entered a much longer period of being puzzled: how could I have gotten so carried away and end up with such an odd solution? I still don't know and I'm still uncomfortable about it... But it was only 9pm, therefore, plenty of time to make history undone and to come up with something to be proud of - which I did, after sitting back and thinking more deeply about what the problem and the context are and only then implementing a satisfying solution I could come up with (it turned out ot be the Visitor pattern, but that's not the essence of this story).

Friday, April 01, 2005

Electronic Communication

When I was an exchange student in Canada more than a decade ago, I used to communicate with my friends and family through letters and - once in a while - through expensive phone calls (that irritating pulse sound chirping every few seconds still makes me shiver).

Today, I'm again far away from home, but it doesn't feel like it from a communication perspective: through email, chat, and internet telephony I stay in touch with friends and family (some of them more than sixty years old!) on a regular base. It's odd, but when I open my chat client and see my friends in Europe being online, I somehow feel quite close to them - even though I only see their name flashing in bold letters.

Recently, I started my own personal blog which allows me to keep my friends and family back home uptodate about what's happening on the other side of the planet.

Thunderbird is my favourite POP email client (yeah, never again Outlook Express). Its spam filter works quite well for me, the search engine is fast, and I love the management of multiple email accounts.

Trillian is definitely my favourite chat client since it allows to transparently merge several chat protocols into one client application. It has a very slick user interface, it's easy to configure and use, and it's even more reliable than some of the standard chat clients.

Skype is a great tool for internet telephony and it works perfectly well right out of the box. Even though I only have a very shabby microphone built-in to my laptop, the quality is highly sufficient. Besides, it's very funny when people look at you with a very puzzled face because they think you are going insane talking to your laptop screen loud and clear.

Blogger.com is an awesome site to have your own free blog and it's very simple to sign up and set up. I think this blogging provider is so successful because they make the process from writing to publishing so straight-forward, they provide text editing that makes you forget that you work with an HTML application, and they still keep many things very configurable for advanced users. By the way, it's now Google-owned.

Tuesday, March 29, 2005

JDJ Running out of Topics

Today, I had the JDJ March issue on my desk and I was stunned by its cover story: "log4j vs. java.util.logging". Has the Java world become that boring? Is an absolutely trivial 3-page story on logging framework comparison the most exciting topic they can come up with today to put on the cover of their Java magazine? I don't think so!

But I don't really care for the JDJ - besides all the online resources like Javlobby, TSS, etc., I prefer the Javamagazin for written material anyways.

Thursday, March 24, 2005

Early Access Programs

The first time I got in touch with the concept of EAP (Early Access Program) was after switching to IntelliJ IDEA back in 2001. Tools like TMate, SmartCVS, Yourkit, etc. have followed this approach as well. I know, the idea of letting people test your software before you release it is not new at all, but these EAPs are based on a different philosophy:
  • everybody can participate
  • participation is free
  • new builds are available almost on a weekly base
  • users report bugs and feature requests
  • bugs get fixed
  • users can vote on feature requests
  • users and developers comment on entered issues
  • forum for questions, opinions, and ideas
Looking at the relased versions of such tools, it becomes obvious that they do benefit from the community feedback and the interaction between users and developers:
  • robust with low bug rate
  • very high usability
  • many nice-to-have features
  • fun to work with
Therefore, I hope that many more tools will follow the JetBrains-style EAP pattern of software development.

But, of course, there is also a downside to using EAP software. Sometimes, builds are not very stable or a working feature is suddenly broken in a later build. I got burnt a few times developing with IDEA 5.0 EAP and finally decided not to use it at work anymore due to critical IDE features being broken which reduced my productivity significantly. From experience, my strategy is now "EAPs @ home - official releases @ work".

Sunday, March 20, 2005

Catching the Thoughts

Everyday, I have many thoughts that pass my mind and soon evaporate. Most of them are nonsense, but some of them I would like to catch and follow up. In addition, expressing thoughts feels relieving and allows room for new thoughts.

Okay, that's the philosophical loosy goosy explanation for the title of this blog. The truth is, after trying more than probably thirty blog names on blogspot.com, that's the best name I could come up with (my favourites were tinythoughts and mindwanderer).

Anyways, I'll use this blog to persist observations, opinions, and ideas on issues from the world of information technology. Feedback is welcome at all times, but, more likely, no third-party person will ever stumble on this blog other than by chance.