Monthly Archives: January 2008

Opera – Bad Request when trying to access some site(s)

Few months ago my Opera stopped working with this site (blog.vyvojar.cz and www.vyvojar.cz) with weird error. I got a “page” saying Bad Request and nothing more. I have no time to try to find what’s wrong and other sites were working. I decided that during some free time, with Michal, we’ll try to find out, what’s wrong. I was pretty sure, that’s something with server. Maybe week or two ago I was playing with Java applet on my old notebook, where Opera is installed too, and the pages were working well. Humm … Today – I don’t know why – I spent some time trying to find some solution. After not more than 20 minutes problem was gone. The problem was in cookies in Opera. Deleting cookies related to this servers solved it. I never thought that cookies will be the cause (if I’m thinking about this, it’s quite obvious, but you know …). So I hope this may help somebody.

[I]

Zařazení něčeho do kategorií …

Dneska jsem se dostal opět k velmi vtipnému řešení problému v relační databázi (to jsem to hezky napsal, ale ve skutečnosti jde o prasácky vyrobenou tabulku(y) vyústivší v prasácké selecty).

No schválně. Jak budete řešit přiřazení položky do kategorií? Ano, například jednoduchá tabulka (id_item, id_kategorie). Ale to je řešení běžné… Vskutku vtipné řešení, je přidat k položce sloupec, který obsahuje znakem, např. ‘|’, oddělené hodnoty. Pak máte velmi výkonný select ‘SELECT * FROM tabulka WHERE (kategorie LIKE ‘%|12345|%’) ORDER BY id’ (nad “select *” se již nepozastavuji).

No to si pak užijeme legrace s sql serverem, že? ;)