|
RickZeeland wrote: Not my taste as I think the fries are spoilt by covering them with salad could be worse, they might start putting mayonnaise on their french fries.
ahhh, that land where horses have beaks and chickens have paws.
Message Signature
(Click to edit ->)
|
|
|
|
|
ahhh lunch time!
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Isn't it like the anti-turkey day?
Turkeypocalypse?
Turkeygeddon?
Turkeycaust?
Today I'm thankful I'm not a turkey
Happy thanksgiving to you and CP though!
|
|
|
|
|
Sander Rossel wrote: Isn't it like the anti-turkey day?
I guess that in the Soapbox, threads about "Turkey" would not have been about the bird.
|
|
|
|
|
Happy Thanksgiving, Chris. I cannot for the life of me understand how pumpkin pie wouldn't be part of it, but you do you!
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
Chris Maunder wrote: poutine
What you get depends on where you get them. Most people think poutine is french fries with gravy and cheese tcurds.
Real poutine[^]
But I never wave bye bye
|
|
|
|
|
I would image it's a lot like running a bar, except for the fist fights.
Here's to another 20!
Technician
1. A person that fixes stuff you can't.
2. One who does precision guesswork based on unreliable data provided by those of questionable knowledge.
JaxCoder.com
|
|
|
|
|
Chris Maunder wrote: Happy Thanksgiving!
Same to you.
|
|
|
|
|
Chris Maunder wrote: Happy Thanksgiving! And to you, Chris.
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.
Software Zen: delete this;
|
|
|
|
|
Chris Maunder wrote: I just can’t get into
Chris Maunder wrote: Ford F-150’s,
Might I suggest that if you cannot get into a Ford F-150 you lay off the Thanksgiving feast for a while?
I, for one, like Roman Numerals.
|
|
|
|
|
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:
"192.168.14.134 "
vs.
"192.168.14.134"
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!!!
|
|
|
|
|
Yeah, now try other (valid) variants and see what their code does with them.
Edit:
A .net method/property which takes an IP address as a parameter should take a System.Net.IPAddress rather than a string.
modified 14-Oct-19 23:20pm.
|
|
|
|
|
Marc Clifton wrote: 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()
Seriously though...it seems really odd (terrible) that they didn't at least do a String.Trim() on the incoming string since it is such a freebie in almost every language (java, C#, javascript). Many more languages have it of course, but it is just named something slightly different.
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.
|
|
|
|
|
raddevus wrote: ...open input boxes are the best way to break a program. Indeed.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Yep, Little Bobby Tables. The newest on this one is real -- the guy who chose NULL for his license plate:
How a 'NULL' License Plate Landed One Hacker in Ticket Hell | WIRED[^]
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.
|
|
|
|
|
In another jurisdiction, "NO PLATE" had the same effect.
|
|
|
|
|
err,
getting back to the OP message then...
if the guy was smarter he would have chosen (without the quotes) "NULL ", " NULL" or " NULL " as his plate.
(ya jus gotta find one of those forms where you enter each letter into a box - excuse for the last 2 "wanted it centered".
Message Signature
(Click to edit ->)
|
|
|
|
|
Marc Clifton wrote: Yes, I take some responsibility, but not all the responsibility!!!
How does that go again? "Be generous in what you accept for input, but strict about what you output..."?
|
|
|
|
|
|
Stringly typing never seems to get out of fashion.Strict typing can be a pain at times, but in the end it's one of your strongest allies. Taking the lazy way out breeds so many small and large horrors, but why waste a thought on it when they waste other people's time?
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
public class IPAddress
{
public int FirstPart { get; set; }
public int SecondPart { get; set; }
public int ThirdPart { get; set; }
public int FourthPart { get; set; }
public override string ToString()
{
return $"{FirstPart}.{SecondPart}.{ThirdPart}.{FourthPart}";
}
}
|
|
|
|
|
We're going to have to wash your mouth out with SOAP young man...
Software Zen: delete this;
|
|
|
|
|
You should see my IPv6 implementation
|
|
|
|
|
public class IPv6Address : IPAddress
{
public int FourthPartSubPartA { set; get; }
public int FourthPartSubPartB { set; get; }
public override string ToString()
{
return $"{FirstPart}:{SecondPart}:{ThirdPart}:{FourthPart}:{FourthPartSubPartA}:{FourthPartSubPartB}";
}
} Something like this, no?
Software Zen: delete this;
|
|
|
|
|
Those trailing space problems get worse when SQL Server gets involved, or the way we have it set up anyway. While a string with a trailing space is completely different to one without in .NET, TSQL matches them both. Causes a key-caching nightmare when not validated!
Regards,
Rob Philpott.
|
|
|
|