Personal Workflow Blog

To content | To menu | To search

Tuesday, 8 September 2009

Databases: Efficient Case-insensitive searches with Function-based Indexing

Doing a case insensitive search is a very common task, but is quite hard to optimize correctly. But since it's done via a UPPER(MY_COLUMN) = UPPER('MY_DATA'), it doesn't use the index that could be on MY_COLUMN.

Different RDMS means different approaches.

Continue reading...

Monday, 7 September 2009

Overloading a method is hard : a common pitfall

As I said in my equality article, overloading in Java[1] is resolved by the static type of the argument, not the run-time type.

It's a generic problem of most compiled OO languages since usually overloading resolution happens at compile-time and not at runtime.

Now, that militates for the well known idiom :

Never overload a method with one that has the same number of parameters.

Actually, it should be enough to overload a method with one that accept parameters that are not inheritance-related : String and Number would be OK, but MyClass and Object would not.

Notes

[1] It's not really a Java-ism, it's the same in other languages, such as C++ .

Monday, 10 August 2009

A Simple Dns Server for a SOHO Network

I'm in search of a very simple DNS Server for a small network. It should be :

  • recursive & caching (can be used as a proxy)
  • very simple administration (parsing /etc/hosts would be perfect, raw DNS zones like BIND would be a little bit overkill)
  • quite lightweight (aka no dependency on an SQL engine like MySQL, such as MyDNS)
  • Seamless integration to Windows lookups (nmblookup) via proxying functions (DNS to/from NMB)

Friday, 31 July 2009

Databases: Better Defer Constraints than Avoid Them

Constraints are considered a Good Thing. They enable to rely more heavily on the validity of the database. It is quite important to note that validity is in terms of modeling and not in terms of business [1].

The biggest complains we can have about constraints is that it is sometimes quite annoying to do some updates while consistently validating the constraints. You have to care about the order of the operations you do.

Notes

[1] I'll write an article about this later

Continue reading...

Wednesday, 15 July 2009

Checked or Unchecked Exceptions for Legacy Code ?

This question can almost trigger a religious war. On Internet no fixed consensus on the matter seems to exists. But most of the articles there have usually something in common : they are always mostly applicable when you start a new application.

Is the situation the same when you have a certain amount of existing code to maintain ?

Continue reading...

- page 4 of 10 -