- 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
The real wtf here is using regex.
Nothing as old as regex are can ever be good.
;-)
Admin
But when his old phone broke and he had to transfer the minutes to a new phone,
Why does he need to interact with the provider for that?
(1) Open up old phone.
(2) Retrieve the SIM.
(3) Insert SIM into new phone.
(4) Profit?
Admin
I personally would not want to try writing a regex to validate any email address. Have you seen some of the more interesting ones?
Here's my favorite:
Admin
none of the regular services in the US use SIMs... do the prepaid?
Admin
I just performed said procedure on my wife's (third) V3 Razr. I live in the middle of the US (Missouri).
I take it from the story, the plain old phone probably does not have a SIM card slot in it.
For the record I have never sent a text message in my life. (But I do have a fancy phone)
Admin
TRWTF is not checking for plural when displaying the number of comments:
[image]
Admin
Depends on the carrier. Anything from T-Mobile or AT&T or one of the sub companies that use their towers would have a SIM. However Verizon, Sprint, US Cellular etc still rely on CDMA for their cellular transmission
Admin
Admin
Or do they use special phones that have SIM functionality built-in? If so, WTF?
Admin
Oh, la de da Mr. Frenchman with your "SIM cards" and "GSM" and "phones that work with multiple providers." Here in AMERICA, our providers give us free phones every two years in exchange for never, ever leaving them. We call that COMMITMENT.
Admin
I'm an American. All of the cell phones I've had over the past six or seven years have had SIM Cards. Yes, both of them.
Admin
Guess it's time to head over to net10 and see what they have...
Admin
Nice to know I'm not the only one with that attitude towards cell phones.
Admin
Could someone explain to me why a simple
/[a-z._-]+@[a-z.-]+.[a-z]{2,3}/i
does not suffice? Granted, it does not check if the email adress is actually valid - then again, I'd rather do that with a verification email.
Admin
Nor should you, when there are existing "solutions". Especially this beauty.
Admin
haha, they also have great comments..
Admin
http://www.info.info
also http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx
Admin
We have a different word for it (says the person who's been with O2 since they were still BT Cellnet).
Also, I suspect, with a name like Henning Makholm, they're Scandinavian.
Admin
I suppose you wanted something more detailed than "it fails to accept a very large number of valid email addresses". Examples would be those that use + signs in the local part, those that use longer TLDs, those that use IDN in the domain names, etc.
Of course, there isn't much call for it, but to take it to an extreme...
"this is " @ valid \\"@[123.123.123.123]
Admin
It rejects well-formed email addresses such as
"John Doe"@example.org
or
[email protected]
Admin
Great! Now my e-mail address is out there for all to see - time to change it to "this is " @ valid \\"2@[123.123.123.123]
Admin
Admin
What??? Most phones in the US use SIMs. AT&T does, and I'm pretty sure it's the biggest cell phone company in the US; and then there's all of the companies that lease AT&T towers, and T-Mobile.
Admin
Me three! I have Boost mobile. The nice part about their service is that their accounts stay active so long as you buy new minutes every three months. Most other services require you to buy new minutes every month to keep the account open. So, since I only use the phone for emergency use, it only costs $20 every 3 months.
Admin
They missed at least one bug in verifyEmail: if the string doesn't contain an @ then nIndex and nLastIndex will be the same but strTkn1 will have length one, so they'll try to access and out-of-bounds array index.
Admin
My parents used to ask me to fix problems with a cell phone my sister gave them. Then I bought a new one and called Verizon and they no longer call me for cell phone suport. Long live Verizon!
Admin
(Shrugs) I don't know Javascript. Or Regex.
Admin
Me four here. When my old phone broke (only calls, SMS and agenda, no color and no camera) I just asked to the sales guy the cheapest phone in the store (29 euros) and even then the thing has some features I won't ever use. I use pre-paid cards which is about 15 euros every 1 to 3 months.
Even worse, the only reason I have a cell phone is because my father wanted it so for possible emergencies. Work became later the second reason. Without those I would happily chuck the thing into the toilet. I don't really like phoning (doesn't help that I also sometimes stutter) and prefer asynchronous communication.
Admin
TRWTF is that half this post is just an ad.
If this becomes a trend I'll probably delete the feed.
Admin
Bah, I only have to recharge my account every year.
Admin
Can someone explain to me why anyone even bothers to "validate" an email address on a web form? Even well-formed addresses may not be valid, in that they may point to a fake domain or user. About the only reason I can see for it is to avoid passing absolute crap to a mail bot. Okay, fine, throw out the truly egregious errors. Otherwise, if it's vaguely plausible let it through and assume the mailer will reject anything it can't understand.
Whenever I run across anything that "requires" an email address but isn't really going to send me anything I need (like a reg key or something) I use "postmaster@{whatever.com}", where "{whatever.com}" is the site asking for the info. Almost always works, and I hope it annoys anyone trying to add me to their mailing list.
Admin
I use .name and .info addresses, and I get very annoyed by ineptly-programmed "address validators" that don't like TLDs longer than 3 characters.
Admin
Admin
I guess string concatenation wasn't his thing either - from the sign-in page:
And that code repeats twice in two different functions...
Admin
D'oh, didn't notice it was different forms in the ifs.
Admin
me (max(also) + 1).
another vote for simple mobile phones. I have my pay-as-you-go plan through 7-11
(which goes over AT&T towers, and uses a SIM)
Admin
<grammar_nazi> Plain Old Regexes </grammar_nazi>
FTFY
Admin
I bought a couple of Net10 phones to use whilst on holiday in the States last year - I don't think they had SIM cards.
Also, it cost $30 for a phone with $30 of airtime. If you don't care about your number it's worth just replacing both every time you run out.
Admin
Admin
Likewise, I rarely use my mobile as a phone. I mostly use it for sending SMSs and e-mails because that means I don't have to talk to people - I don't think I've actually used it to make a call for months.
Admin
Admin
I won't ask what you where doing in the restroom that caused a phone from your shirt pocket to end up in the bowl.
Admin
fred&[email protected] (valid, and an autoresponder... go ahead, try it!)
Admin
Of course, since there is no such thing as an out of bounds array index in Javascript, well, I'm not sure...something something monkeys.
Admin
Admin
Yet another area where you are decades-late yet somehow think to be in advance or something. In the rest of the world, we use SIM-based GSM phones, get them free from the provider and get new ones free every two years too. Plus they roam across country borders and operators, so we have service everywhere, including in most parts of the US as our phones are multi-bands :-)
Admin
I use Net10. It's a wonderful service, but their web site sucks big time.
Wonderful part: They charge 10 cents per minute, and 5 cents per text message. You have to spend at least $15 per month to keep the service active, but if you don't use the time this month, you can roll it over indefinitely. I probably average $20 per month, which is less than half what I spent with my previous provider, not even counting what they charged if I went over my allotted time for the month. Someone who's on the phone a lot -- salesmen or really chatty people -- are probably better off with a plan that gives unlimited time for a fixed monthly fee, but for me who uses a phone rather infrequently, this is great. Even my teenage daughter rarely uses more than $15 per month, because she mostly text-messages, so $15 means 300 messages.
The web site, though, is virtually useless. Theoretically you can add minutes to your phone through the web site. In practice, about three out of four times this fails with server errors of one sort or another and I end up calling customer service and talking to a person to buy minutes. I've sent them numerous emails complaining that adding minutes through the web site doesn't work. Their response is always, "We see you have now succeeded in purchasing additional minutes" -- which I did by calling customer service because the web site didn't work -- "so we assume the problem is solved." I've had this exchange several times. Once or twice I wrote back to explain that the problem was not solved but I just worked around it. I got no response.
You can create an account on the web site, and then register all the cell phones your family owns under this account. Sounds handy. Except ... as far as a I can figure out, the only things this does for you are, (a) you can then go back to the web site and get the list of phones that you've registered, and (b) you can cancel the "add a certain number of minutes every month automatically and bill my credit card" feature. You can't add the automatic minutes per month through your account, you have to do that elsewhere. But you can cancel it. A naive person might suppose that once you have registered your phones under an account, that you could add minutes to a phone by, say, selecting that phone from a list, clicking an "add minutes" button, maybe doing something to confirm your credit card, and boom, you're done. Silly silly person. No, even assuming that adding minutes through the web site worked, to do this you must enter the serial number of your phone -- not the phone number, but the serial number -- separately. Even though you've already registered the phone under your account. You can't just select it from the list, you have to re-enter the serial number. And you have to re-enter your credit card information. This is exactly what you have to do if you don't have an account. So what do I gain by setting up an account? See (a) and (b) above. I suppose if I want to add minutes to my daughter's phone when she's not home so that I can't check her phone to get the serial number, I could go to my account, call up the list of phones, copy down her serial number onto a piece of paper, then go to the "add minutes" feature and type it back in. But I could do that by having the serial numbers in a text file on my hard drive. Real handy.
Admin
DOn't try to flush the toilet either, as that might involve bending over near the toilet.
Or don't you flush toilets where you live, Pjt33?
Admin
I assume something like this: [image]
Admin