- 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
DBAs aren't legally allowed to be pushovers like that.
Admin
Yes, internationalization really sucks.
Just yesterday, I was diddling around with my environment variables, and added LC_ALL=C there. I thought nothing of it until I went to print using a nice program. Unfortunately the internal workings of Linux and glibc in particular seem to default paper sizes in the "C" locale to being A4 paper.
Now I really don't want to print on skinny/long paper when the nice laser printer only has nice USA letter paper in its trays (all 4 of them), and so the printout was chopped off on the top and had a little extra room on the right margin. I finally figures out that the crazy people in POSIX land seem to like A4 paper, so I had to modify things to get it back.
Of course, there was no place to change the "C" locale as it was wired into the programs, but maybe they would deal with it correctly. Somehow I believe that there IS a multitude of tables that translate nice numbers into words, and it is replicated in so many places that we will never know its true extent.
Note to self: Nice USA letter paper is wonderful!!
Admin
I know right. That table in, and of itself, is hardly a WTF.
Admin
The use of a cheque as method of payment in a supermarket is a good way to make friends - especially with the people in the queue behind you. They will just love you for the time it takes to fiddle out your chequebook, enter the sum and sign it.
For unknown reasons cheques are still in widespread use in the USA; most of Europe these days has moved on to pin secured payment by direct debit card.
Admin
Admin
I was mostly thinking about Postgresql and Mysql(And sqllite, but I don't know if that count as anything).
In postgresql varchar is the same as text, and varchar(n) is implemented as text with a length constraint.
And mysql does almost the same thing, but I can't remember the details.
Are you sure about MS not doing this? I newer really used it in production, but I seems to remember it doing the same. But I might be wrong.
Admin
This is news to me.
Admin
I can actually see some value in having a table like that in the database. But running joins against it all the time is kind of silly. This is data that's not going to be updated frequently, if at all, which makes it a prime candidate for caching. The application, upon startup, should SELECT the entire table and hold its contents in memory, and do the lookups client-side.
Admin
Admin
You would have had to make special cases for both 70's and 90', considering the 70's are "sixty-something" with a something above 9 and the 90's are "four-twenty-something" with a something above 9.
Of course, you could also consider Belgium's French numbers, which do not have this special rule but instead use their own word ("septante" and "nonante" for the 70's and 90's) and the Swiss, which use these and also replace the 80's with "huitante".
So, yeah. Numbers in written French are an awful programming subject.
Admin
Admin
Could be, but I was thinking:
Type SubType Value Text 0 0 1 one 1 0 1 first 1 1 1 1st 0 0 2 two 1 0 2 second 1 1 2 2nd ... 2 0 10 teen ... 0 0 40 forty 0 1 40 forty- 1 0 40 fortieth 1 1 40 40th
The type might be cardinal/ordinal and the subtype might be somehow contextual.
Even if I'm right about that, I cannot explain why it jumps from thirteen to twenty. My table could handle 14-19 except the number 15 cannot be constructed by adding "teen" to "five".
<Sigh>"Who knows what evil lurks in the hearts of men?"
Admin
[quote user="Bananafish"]
oops!
Admin
So what would Bill's code think about "Twenty fourteen"?
And as for writing chec[kq]es at a checkout aisle, that's mostly older women, usually with a deathly fear that someone will smell any cash they are carrying and try to rob them. The big problem is all the fiddly pen writing of ID numbers and stuff, though at least registers in larger supermarkets long ago got dot-matrix printers built in for no other purpose than putting on half of that fiddly writing.
This is one reason why if you have a choice in checkout aisles between being behind a man in one and a woman in another, with about the same amount of merchandise, pick the man, because he is going to pay either cash or credit and then get the hell out of there.
They're still quite reasonable for mailing in payment for monthly bills, but very inconsiderate in checkout lines due to all the manual processing needed at the time of the sale, while people in line are standing behind you waiting.
Admin
A naive SELECT on a table containing hundreds of millions of rows could take several minutes to display the result simply because of data transfer overhead.
Admin
"It took Alan the better part of the day to remove all references to the table before deleting it. Bill, despite his credentials, didn’t think to ask the front-end development team to convert cardinal words to numbers before inserting them into the database. The wizard hadn’t been all-knowing, after all."
No.... you mean the developers who were inserting them in to the database. what, DBAs design tables in all corporations? newsflash: they don't always!
I blame the devs. I blame Bill too if Bill didn't complain about this in addition to his other complaints...
Can the OP add some details to the story?
Example: "A naive SELECT statement took five minutes, returning the following."
then... snip? Not sure what is being alluded to... That Bill made a table with millions of rows to link words to numbers and the result set returning in your management studio took a while to display the results...? or that developers are literally including words like twothousandandthirtyfive which then needs to be translated...
yes, a wtf somewhere... but... where?
Admin
Admin
old vs. young: young. Even if the old person doesn't pay by check, they'll still be at least twice as slow.
buying booze vs. no booze: no booze. Even if they're old enough, they might have forgotten their ID or have lost their drivers license. (No, you cannot buy booze with the paper they send you saying you're temporarily allowed to drive; that just permits you to legally drive yourself to the store. You CAN however buy booze with a nondrivers ID that will cost you about five bucks.)
Admin
A couple of points. One, this is a table with a potentially infinite number of rows. Two, anyone who'd create such a table is unlikely to have any clue about sensible indexing strategies.
Admin
While we're at it:
Given the choice between one shopper with a cart containing fifty items and ten shoppers with five items each, pick the single cart. There's a "per-transaction" overhead in getting the total, making the payment, collecting up the bags (five items will require six bags to take out), and the likelihood of something needing a price-check and shutting down the whole line doubles with each new customer.
Women shopping with kids are okay if the kids are far enough apart in age. If they're too close, they're going to "interact" all over the place and no mother alive can control them, but a toddler and a pre-teen present no particular difficulty.
Admin
I'm surprised at people that don't get a photo ID, since it's so cheap and it's great to have if you're < 40 and physically lose your driver's license.
Admin
If you know most of the checkers and this checker is new, expect it to take them twice as long because they'll still be learning the register, prices, and produce codes.
...and speaking of produce, keying in the codes takes longer and sometimes the wrong code gets keyed in, which may require a manager to void it. So avoid being behind people who have a lot of produce if you can help it.
Admin
Presentation logic in the data storage layer is a WTF. As noted above, application devs often design the tables, and often make a fudge of it.
Admin
Admin
Admin
Admin
It must be Thursday. You never could get the hang of Thursdays.
Admin
In fact, it's easier just to send your spouse to the shop
Admin
Eightteen for me ...
Admin
Silly European. Zero and negative account balances are still balances.
Admin
Also, four score and some years ago four great grandfathers imported four and twenty blackbirds from a middle endian country, had middle endian dates with four great grandmothers, and gave birth to four ingrates.
Admin
Admin
Admin
This is an Erik Gern story?
Where is the pointless embellishment and the incorrect cultural references?
Admin
I am kind of surprised to know such table can become a bottleneck.
First, such a table in likely less than 1K rows, and for any reasonable server that is going to stay in memory.
Plus values in this table is likely never going to change (unless English changes?) so no contention will happen.
I am not saying it is right to use database like that, but I am really interested in the reasoning - how can that table be a bottleneck?
Admin
TRWTF is the table not containing the same thing for UPPERCASE and miXeD-CasE. And misspelled versions thereof.
Admin
Admin
How do "sensible indexing strategies" affect the performance of (according to the article) "a naive SELECT statement" - which will be:
Admin
Admin
But yeah, when I said to avoid produce, I meant anything that would require weighing or looking up a code.
Admin
Oh, and not to mention Roman numerals. How messy it was when movies were copyright MCMXCVII and such; how satisfying to see "MM" instead!
Admin
Belgium has more sensible numbers: trente [30], quarante [40], cinquante [50], soixante [60], septante [70] et nonante [90].
Admin
Captcha: similis... yes, quite similaris.
Admin
I had assumed that we were discussing personal checks, not paychecks.
Admin
No, it is mostly intended for paychecks. That's why those check cashing businesses exist. The people who use them know they're getting ripped off, but they can't use a bank.
Checking accounts aren't free. Most banks require you to maintain a deposit in them. That deposit can be a $100 or more, and when you're literally living paycheck to paycheck you don't have enough money to leave it in deposit. Especially when the bank is also going to charge you $2-$5 to withdraw cash from an ATM. Oh, and if you go below your $100 minimum balance for even a second you can be sure the bank will levy a fee and then apply penalties (as often as daily) and quickly deplete your account.
And all that ignores the fact that people who have had consistent bank problems, have extremely low credit scores, or have no credit scores (having never been in recorded debt) get blackballed by the banking system. You won't be allowed to open an account.
Admin
Actually, in Europe now they're using septante (70), octante (80) and nonante (90).
83 is "octante-trois".
In Quebec we're still doing it the old-fashioned, medieval way.
Admin
That's incredibly unrelated to the discussion at hand.
Admin
Don't checkers just look at the sticker? I mean, that's why every piece of produce has those annoying stickers - the PLU code is right there. (And yes, they're standardized).
Of course, you do run into the ones who don't seem to realize it when they do self-checkout and instead have to browse the produce menu than just typing the 4 digits on the sticker right in front of them.
Admin
The sticker isn't always there. At least where I live, the produce section of the grocery store will have a roll of bags that you can use for any type of produce that isn't already packaged, so you can't have a sticker for it. I've seen some stores that will print a sticker for you based on your input on a machine connected to the stand with the bags, but that's somewhat rarer.
Admin
As one sign stated in NYC in a shop: We have an agreement with the bank:
Checks went away 25 years ago in Sweden and 20 years ago in the Netherlands