The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
Chris, you can't get into Ford F-150's? I guess it depends on what you need. I remember an interview with an American farmer in The Economist, somewhere in the late '90s. He was rather blunt: "Pickup trucks built this country. I ain't hauling pigshit in a car." I was surprised that this made it verbatim into what is a rather staid publication.
Thank you and the rest of the CP staff for making codeproject.com a nice place to hang my programming hat. The folks here and the articles they freely provide have helped me out more times than I can count. We do appreciate the hard work you, the staff, and the hamsters put in.
So I just spent an hour figuring out why I was getting an exception in my application when using a third party library to communicate to a credit card processing machine. I was getting a general exception back from the third party library, but the test software that comes with the library was working just fine.
Short answer, when I C&P'd my router's public IP address into the dialog box, there was a space at the end of the IP address. Took a while to spot:
Sigh. OK, so now I make sure to trim the IP address string (the third party library expects a string) and I suppose I should do some regex validation.
Still, why couldn't I get back an exception like "malformed IP address"? Why is the library so sensitive to an space at the end of string? Yes, I take some responsibility, but not all the responsibility!!!
when I C&P'd my router's public IP address into the dialog box
Copy & Paste, indeed! I expect more from you. You should be typing more. Trim()
I never trust user input because I used to do a lot of testing and open input boxes are the best way to break a program.
Summary, every time a cop didn't have the license plate for the ticket a NULL got entered into the database for the license plate. That meant all ticket fines got assigned to the owner with the license plate of NULL.
I faced something similar yesterday in one of my scripts. The string '1E2-' was validating as numeric...which it is...in hex!
To be fair, if the expression had been entered correctly as either '1' (a single position) or '1E2:-' (an expression) it would have been OK. However, it should have reported the expression error (missing param separator) instead of saving the incorrect value. It was a 10 minute fix and I caught it before the customer!
"Go forth into the source" - Neal Morse
Last Visit: 17-Nov-19 2:54 Last Update: 17-Nov-19 2:54