Showing posts with label case. Show all posts
Showing posts with label case. Show all posts

Thursday, December 25, 2008

Case senstive SELECTs

While working with the legacy code and migration process to REST on Ruby on Rails (from the mix of shell scripts, C and other types of binaries), I've got into trouble debugging one part of the code that was ultimately going into loop.

What it worked out to, is that we had a number of case sensitive IDs, like JONHSMITH, JohnSmith and johnsmith, reflecting the different types of account information. I'm not going to guess you why did it happen, but it always does, if there is a possibility of human interaction with the naming process ;)

What was more important is how to make the code work and to stay away of any table alterations. While there a huge amount of discussion in the Internet about that, the easiest way that I found to be is just using BINARY operator for a SELECT clause.

For example, SELECT * FROM accounts WHERE BINARY user LIKE 'JohnSmith'; gives you exactly JohnSmith's record.

You can take your time and refactor the code and table structure later, after the things are working and nobody's trying to ask you the same question for many times per day ;)

Thursday, July 31, 2008

Blomus

I haven't blogged anything for a while: it wasn't right time or right mood for that. A lot of things happening, however, not sure this is a good place to talk about them. The most of them are pretty personal.

Well, speaking about other things, I received my Blomus business card case today. I found it originally at Amazon, but end up ordering at other place. I wasn't very sure did I make the right choice, as it didn't look attractive enough on the Web. But I liked it European roots though.

It arrived today. It was a long story as well - the Fedex driver turned around while me watching at him, got back to his car and marked that he couldn't deliver the package. I called the Fedex, received the standard "Sorry", but was advised to wait for it until tomorrow. When I insisted that I want more then "Sorry", I've got connected with the local Fedex guy who finally instructed the driver to come back. No appologizes from the side of driver, except, "Didn't I call you and you never picked up the phone? Oh, maybe I called the other guy."

Anyway, now it's here. I paid for it barely $20 with shipping and handling costs included. I didn't expected too much, but the fancy design. But I was wrong. First of all, it was nice boxed.


When I opened it, it was looking great, well done and actually much thinner that it feels to be on the photo.



The Blomus logo has got a perfect placement as well. Very small, but very nice.


It opens and closes perfectly. And it fits about 12 pretty thick business cards.


Well, it might take more, but I'd better not do it. You can also check out my photoset at Flickr. This Blomus business card case worked out to be the best one I saw anywhere so far. It feels so solid and so nice that you want to have it with you all the time. ;)

My curiosity is killing me as I really want to see (and try) how the other one from Blomus looks like. You can find it at Amazon as well. I had many doubts about which one to choose. I don't have any concerns now, but I still pretty interested about the other one. ;)

So that's for now, still waiting a few more surprises to arrive, so I'll keep you updated.