|
The real beauty of it is will be that HE has to sell it to the accountants. I used to dream of jobs like that.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Sounds excellent, but you probably would like to see *something* go into production. Draw up a plan for the Kitchen Project. Anticipate changes. Break the plan up into phases. Phase 1- Awesome Blender. If management and/or priorities change in time, the result might not be the Kitchen, but likely the Blender, Refrigerator, and Microwave.
|
|
|
|
|
When you have a string interning problem.
FML.
*headdesk*
*headdesk*
*headdesk*
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
You let interns pull your strings?
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
apparently that's what happens when you use == where you meant object.Equals()
God bless .NET
the string.Interns aren't even cute.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I've never used that feature of .Net, mostly because I wasn't aware that it even existed, but now that I know, I can't think of any code I've written in the past 13 years that would actually benefit from it.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
it's not that it benefited from it, but my code was getting artifacts because of it.
calling string intern simply allowed me to verify the nature of the problem.
The problem is this - and it's rare, in practice, but it smacked me right between the eyes:
say i have an identifier of type *object* - yes, object
and i need to compare it with other identifiers of object.
This works as expected with object.Equals, but not with ==
The latter strictly does reference comparisons.
This introduces a weird thing with strings.
check this out
object id = "foo";
object foo = Console.ReadLine(); // type "foo" into this
if(id==(object)"foo") ;// evals to true
if(foo==(object)"foo") ;// evals to false!
if(id==foo) ;// evals to false
if(Equals(id,foo)) ;// evals to true
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
not in this case. i fixed it.
the symbols are object for very specific reason and i don't need such a general case comparison. They will be integer, or string, or in one case a very custom type that is only handled in one scenario.
it's weird, but the algorithm behind it is such that the weirdness is unavoidable.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
That's a hacky way to do a sum type and the OO Police would like to know your location.
|
|
|
|
|
LOL. It's not a sum type.
It's ... hard to explain. It has to do with LALR and LL table generation, and the mechanics behind it.
I represent a CFG using a series of arbitrary symbols ids.
Users will probably only plug strings in here, but behind the scenes this CFG needs to be able to hold ints, and a special augmented symbol identifier <first#>ID<follows#>
However, as long as the user doesn't demand the impossible of the CFG they aren't limited to strings.
All that's required is an object to have identity equality semantics or at least be consistent in terms of refs it passes around and for the object to be able to get a hashcode off of it.
So object is okay here. There are caveats, but honestly, it was C#'s string optimization + a bug in my code that was causing me headaches. It all works fine now.
This is a *very* rare and very specific corner case for a very ugly/convoluted series of algorithms used to generate parsers.
So some rules will be bent. Others will be folded, spindled and otherwise mutilated.
So far I've never seen one even "readable" implementation of these algorithms, but mine is coming close.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Yeah, the interns at work always gave me problems, too. If you touch them, they report you for harassment.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
i feel like my code would have, if it had an HR department. Glad I didn't implement that.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Yeah, I was the smartest kid in my social group, but I was/am a loner.Figure that.
It always amazed me that ((/3)*3) != 1 on a finite precision machine and we could still actually do useful calculations.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
codewitch honey crisis wrote: When you have a string interning problem.
FML.
Sounds like an interesting challenging life though!
|
|
|
|
|
lol. yeah i guess. if debugging is interesting and challenging. I fixed it though so yay.
I had an == in a couple of places where I meant Equals - yes it was that simple, as the trickiest bugs often are.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
modified 7-May-19 8:37am.
|
|
|
|
|
Or in java, if you have the same class loaded by 2 different class loaders!
You also end up with multiple instances of statics, etc.
which means
One singleton per class loader...
|
|
|
|
|
That's weird. I always side eye java for some of its dark corners - they type system is dodgy, IMO.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I should add- I blame myself for the problem. I can clearly explain and understand why this problem occurred. It even makes sense, once you understand the twists and turns involved. It's not due to a hack, or a weird type system. It's due to the fact that object - the root type in the heirarchy - has no == overload associated - because it wouldn't make sense with it so == will only do reference comparisons, just like C++ on an object.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Friction operating fictional beast (6)
|
|
|
|
|
Friction DRAG
operating ON
fictional beast
DRAGON
Got the answer immediately - took me a while to work out why ...
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Ya
|
|
|
|
|
OriginalGriff wrote: GɸT the answer immediately FTFY!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
I've never watched an episode - but I suspected it might have been involved, since it was broadcast yesterday.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Tim Deveaux wrote: CCC V VI MMXIX
Did I start something?
Socialism is the Axe Body Spray of political ideologies: It never does what it claims to do, but people too young to know better keep buying it anyway. (Glenn Reynolds)
|
|
|
|