- 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
\a\w\e\s\o\m\e
Admin
Did I get first?
Admin
Not bad, it not only recognizes the Canadian A1A 1A1 format, but it doesn't accept illegal letters for the first digit for it.
Now if only whoever coded the American half did any testing whatsoever. (Or even saw the [0-9]s in the Canadian half, which may be techncially narrower than \d, but what keyboard uses digits outside the 0-9 range?)
Admin
My keyboard has A to F for when I want to write hex.
Admin
Perfect example of why regular expressions are NOT for everything.
Seriously, you really aren't validating a zip code, that would take a lookup into a zip code list or somethign and matching it against the city entered. What you are really doing is simply limiting input, should be an easy task even with regex.
Admin
TRWTF is entering 'ddddd' instead of just disabling JavaScript.
Admin
The Other Real WTF is this being a Feature Article instead of a CodeSOD.
Admin
That is what you get for using DotNetNuke for your CMS.
Admin
Ah, zip codes. Sometimes I long for those days where you could enter an international address on site from an American company, but you still needed to provide a zip code. And a state.
In fact, the hλlf-wits at Valve insist to this very day that I fill in a state, which I dutifully fill in as 'n/a'. Please note that the country I live in has just over 420,000 inhabitants, and has no need for states. But on the other hand, our postal codes are so accurate that I suspect that each house has its own postal code.
Admin
Those would be xdigits, not digits.
Also note that the regex allows for the Canadian postal code of |0|-0|0.
Admin
But my zip code is 908765
Admin
So... you're from the Nation of Brunei, the Abode of Peace?
Admin
Actually, I keep seeing more errors in the Canadian half the more I look at it. It correctly blocks D, F, I, O, Q, and U out of the first letter (because those letters look too much like other letters), but doesn't do so for the other two letter positions. Yet the first letter can still be "d" - wait, why is lowercase allowed at all?
Admin
Admin
Admin
I thought that too. Brunei does of course have districts, he could use that instead.
Admin
Admin
Pet peeve of mine; over-validation. Who friggin cares what they enter for zip? If you intend to send out spam mail later; clean addresses then.
Admin
TRWTF is not changing your own oil! They use crap oil sometimes recycled at quickie oil change places. Plus it's good for us nerds to get our hands dirty once in a while.
Admin
Admin
Post code so accurate they even go down to each dog kennel.
Possibly with extension for each flea as well
Admin
In my country, if you want oil change, you go to place you have make purchase of car. Once YOU GIVE them your car, all thing are fixed if you want or not.
No zip code bull crap.
Admin
The ones which really grind me are digit-only phone number and credit card fields. Really, can't the programmer figure out how how strip non-digits out of a text string so I can enter '(123)456-7890' or '1234 5678 9012 3456'?
Admin
Who needs IPv6? Let's just give every device a post code!
Admin
Admin
Admin
I was really impressed to learn that the postal barcode you see on letters (in the USA, anyway) contains a planet code. "Wow, that's some really progressive future-proofing!" I thought. Imagine my disappointment when I learned that it was something quite more mundane than sending postcards to Mars.
Admin
WTF 1: the developer didn't test it. WTF 2: QA didn't test it. WTF 3: IT IS STILL THERE!
Admin
Admin
Admin
It's also what you get for hiring DotNetNuke developers to do your website. sigh
Admin
I still don't even know what DotNetNuke is
Admin
I just tried their form. Lol, they got a booking from a Fred Bloggs...
I had to enter a valid phone number. They didn't accept 123 456 7890 or some random digits so I just entered their number.
I tried 12302 as a zip which was their zip and it got rejected. I tried ddddd and it worked.
Admin
I enter 00000 as the zip code, and if the state is drop-down, I pick CA. Then I put in the street as per normal with the postal code at the end:
1234 Fake Street V8V 8V8 Fake City, BC, Canada CA 00000
If they give you two lines for the address: 1234 Fake Street (address one) Fake City, BC (address two) V8V 8V8 (city) CA 00000
Of course, it's dumb to do this because the shippers will ream you at the border. I bought a $49 housing for my camera and paid a total of $33 in shipping after FedEx was done with it.
Admin
I bow to your supreme knowledge of geography, Jahanpanah! Tussi great ho! Camels are part of Rajasthan not Andhra Pradesh, you buffoon!
Admin
Admin
TRWTF is assholes who think changing their own oil somehow makes them superior.
My time is worth more than the cost of having somebody else do it.
Admin
just enter a real address, just not yours but theirs.
Admin
FTFY
Admin
the 'planet' you are referring to is actually an acronym PLANET that stands for: 'Postal Alpha Numeric Encoding Technique' and encodes digits 0-9 much as the now deprecated POSTNET (i.e. also an acronym and not a planet, or a galaxy, or a black hole) did.
CAPTCHA: EARTH is a Planet; PLANET is an acronym
Admin
When you consider the time it takes to drive to the Qwiklube and wait for them to get around to changing it, it is probably faster to change your own oil than to have someone else do it. That is assuming you know what you are doing, of course.
Admin
I work on my own cars: swapping engines, adding performance parts, etc.
But I DO NOT change the oil in my daily drivers. (I change it on my car with big mods because I don't trust them enough.)
It's not worth the time and effort. I'll make an appointment, drop it off, work on a project or read a book while they're dealing with it, and then drive back to what I was doing.
Admin
Admin
The real WTF is taking a car to Midas.
Admin
Two observations.
I don't know if this got fixed since the story went live or the code varies for different browsers, Midas locations, etc, but I've checked appointment booking pages for two locations next to me and they both contained regexp's starting with "(^[0-9]{5}(-[0-9]{4})", not "(^d{5}(-d{4})".
I'm not familiar with modern web development tools, but that code did not look to me like it was written by a person. Maybe the regexp was somehow autogenerated too? What would the original human programmer input look like? Any experts here?
Admin
What?! So if two people live in the same house, you have to share a postal code?
Admin
Go back to your side of the Atlantic, Lëtzebuergian, and take your funny ümlauts with you! ;-)
Admin
I agree. This is what's so great about Agile. A minor feature such as zip code validation would probably never even make the product backlog, and if it did, it would receive the proper attention to have it done right.
Admin
FedEx's reaming is at least $25+tax. UPS' is much worse. That $49 item you bought would've been $50 from UPS, minimum (I've seen it higher).
The best shipment is via DHL (if supported) or USPS - $5+tax, and sometimes Canada Post doesn't even bother charging you!
Unless you really need it, if they only offer UPS, go to a competitor. UPS is popular because they make up for their low-cost service by gouging the recipient with various fees and taxes.
FedEx's is $25 flat, UPS is anywhere from 30-200% from experience (yes, 200%...).
That doesn't work if the form requires javascript to submit it. Some onSubmit handlers work that way, annoyingly. Other forms require it or other form things break, horrendously.
It's one of the nicer things with Chrome - you can easily manipulate the stuff live and make changes. I'm sure firefox can do it, but I haven't figured out how.
Admin
On a side note, does that mean I have successfully Trolled Nagesh?