- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Oh, so the WTF is that php was used instead of asp.NET?
Admin
Admin
"Hi. I can't find Mikael Åkerfeldt's name in your address book."
Now there's a name I never expected to see on TDWTF!
Is Opeth way bigger in Europe than they are in the States? Every time I see a pic of him playing with that band, he's playing a different, really sweet Les Paul.
Admin
I know it's a WTF, but what was the original developer thinking!? Why not make it an array to begin with? Failing that, why not forgo the delimiter and use substring functions? Why not just use raw HTML since the alphabet obviously isn't coming from the database iself? Why? Why? WHY!?
Admin
Telerik FTW.
Admin
He plays a Strat too and various PRS models.
Admin
While the story isn't all that interesting. It is hilarious that no one saw this coming. I don't think they bothered to load test it at all.
Admin
They hired a graphics design shop to build their CMS. I'm thinking they aren't even really aware of what load testing is...
Admin
I'm sure when the build a Swedish CMS they'll include those letter.
For this English based CMS all names would be transcribed into English (rather than transliterated) and you'd only need the standard 26 characters.
Admin
What I LOVE about today's WTF is that it's clean, very easy to read, and so horribly, utterly wrong.
Admin
I want to furtherly illuminate that "letter #26, w and v are the same" thing, in case some didn't get it. Basically it means that for example in dictionaries and such alphabetical listings w and v are treated as alike, so Williams would come before Vilson. This is because Swedes don't used w in the native words and don't have separate sounds for them so looking from dictionary for v or w word, one would have to guess.
The post also shows another Swedish feature: they capitalize only they Nation's name, not the language, as many languages have the name of the country in where they are spoken in, on can retain unambiguity in this way.
Admin
Or you could just cut out the middleman and do this:
foreach(range('A', 'Z') as $letter) {
...
}
Admin
I can't believe nobody's called the believability of this WTF into question! These comments are clearly fake!
DaveE
Admin
Admin
Admin
What's with all this internationalization anyway? Didn't anyone stop to think what a pain that would be? The Bible is written in English. 26 letters ought to be enough for anyone.
Admin
SELECT SUBSTR(LastName), Count() FROM Customers GROUP BY SUBSTR(LastName) HAVING Count() > 0 ORDER BY SUBSTR(LastName)
Then loop over the resulting letters. However, in 120.000 names I would expect to see nearly all possible letters anyway. So you could just create a link for every possible letter (what about Cyrillic?), or the most likely ones (sorry Mr. Åkerfeldt), without checking the address book at all.
Admin
sorry
Admin
[quote=qbolec]hmm actually the strpos takes (haystack, needle, offset), so chances are, that since the haystack = single letter, and offset == 1, then you always get false...[/quote] exactly... So you can rewrite function to something like return A-Z...
Admin
Admin
Spanish has "ch" as a single letter; your solution would put "Chavez" under "C" instead of "Ch"
Admin
Officially, 'ch' hasn't been a single letter in Spanish since 1997, and 'w' has been distinct from 'v' in Swedish since 2006. According to the unimpeachable source that is Wikipedia.
Admin
Why do people do complicated methods just to show valid links, if it is that important either -
1/ Create a separate table with counts for each letter (for the alphabet or lnguage order you require). This ONLY needs updating when a change to the addressbook is made and possibly rechecked once a night or week as a cron job. Then read that table to work out if your letters should be a link or not.
2/ Alternatively just make all links, and if no records found starting at that letter, either advance to next valid letter or redisplay last 50 of previous or blank for empty database.
A hell of a lot less hassle.
Admin
Admin
BTW, if you want some insight into why people complicate things, examine your method 2. What you suggest is way more complicated than simply showing no results for letters that have no entries.
Admin
Admin
[quote]if($has_letter)/[quote]Looks like someone is working the naughty or nice list; and this is definitely naughty.
Admin
Wtf... I can't even figure out what this is doing.
Admin
Has anyone noticed the trackback spam? There's a link to a random wordpress blog.
Admin
So what solution would you think is more efficient? I thought maybe if it comes from a MySQL database you could use the SUBSTR() function from MySQL with DISTINCT and ORDER BY, to get a list. I'm curious if there's a better solution.
Admin
仮他龪 your Åkerfeldt.
Admin
I assume that was in the USA - many Americans still don't know there are other countries with other languages.
Admin
Admin
Pop quiz hotshot. There is a swedish letter that needs to be added to your CMS application. Adding it will be a bitch. If you don't add it, the swedes won't extradite WikiLeaks founder Julian Assange to the US so you can like totally torture him and junk. What do you do? What do you do?
Admin
Well... At least is very readable code.
Admin
Apart from the general idiocy - was anyone else struck by the lack of "break;" after the letter was found?
Admin
A little offtopic.. Is there any reason the Google gadget is not pulling the latest topics since about a week ago?
Admin
Admin
Therefore the very existence of this site.
Addendum : graphists hate these people as much as us developers, because when the "bug" is fixed, they usually add "I don't really like the blue color of the background. Could you make it more... orange ?"
Admin
Admin
Therefore the very existence of this site.
Addendum : graphists hate these people as much as us developers, because when the "bug" is fixed, they usually add "I don't really like the blue color of the background. Could you make it more... orange ?"
Admin
Anybody who has trouble sorting ch as a single letter needs to sit down and have a long, hard think about what it is they're doing in this business.
Admin
Anyway, we don't torture anybody. We just make them think they're drowning, that's all. Totally not torture.
Admin
Admin
The real wtf is letting a sys admin near code
Admin
It must be one where the SELECT clause selects data that does not exist in the database!
Admin
What database is this (a substr with two arguments?)
Also it does not meet the original requirements (be insanely stupid and filter out non-ASCII-alphabet-letters)
Improved version, tested with Sybase and MS-SQL:
Admin
Admin
מייַן כאַווערקראַפט איז פול ילז.
Admin
I wouldn't know. I'm from the USA. They're relatively big among US metal fans as far as I can tell. I'm a big fan.