|
I always thought it was the lenses/cameras/lighting or something. They always just have "a look" about them, regardless of budget. Still, the show (and books) are worth it, IMO.
Never watched the various CW shows to see if they also have that feel.
TTFN - Kent
|
|
|
|
|
They also picked up Designated Survivor.
|
|
|
|
|
Never watch it and don't know anything about it.
|
|
|
|
|
The ToInt() function:
ToInt(0.6) == 1
And yes, I should use Floor() instead.
But this is what the help text says:
Converts Value to an equivalent 32-bit signed integer.
There's no mention that it does rounding!!!!
Latest Article - A Concise Overview of Threads
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Marc Clifton wrote: Converts Value to an equivalent 32-bit signed integer.
somewhat vague isn't it?
(and btw/otherwise being pedantic: 0.6 is not "equivalent" to 1.0 nor 0.0.)
My take: crap documentation.
Message Signature
(Click to edit ->)
|
|
|
|
|
It seems to be doing exactly what you'd expect it to do... Round a floating point value to the nearest whole number. Since you passed 0.6, you should expect 1.
What happens when you pass it a string? Does it return the value "Idiot"?
".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
|
|
|
|
|
John Simmons / outlaw programmer wrote: It seems to be doing exactly what you'd expect it to do
I disagree because it doesn't say it does rounding. And given that it supports C# for scripting, I would think it's functions act like .NET. So:
> (int)0.6
0
or
Convert.ToInt32(0.6)
1
Oh shyte. My baaaad!
As my wife loves to hear me say:
YOU ARE RIGHT!!!!
Latest Article - A Concise Overview of Threads
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Marc Clifton wrote: YOU ARE RIGHT!!!!
I'm going to show that to my wife so I can proved that I'm right every once in a while. She remains unconvinced.
".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
|
|
|
|
|
Being right when another man is wrong doesn't count.
|
|
|
|
|
I think it's a universal constant that only one man can e right at a time. When it's someone else's turn, I'll gladly pass the torch.
".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
|
|
|
|
|
Not enough this morning?
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Wow! I can't believe I've never noticed that difference between casting and Convert.ToInt32(double) and IConvertible.ToInt32(IFormatProvider) . I would have bet against both. Though, in honesty, I seldom use either of these ToInt32 methods.
I'm glad I read this post. This is almost certain to bite me in the hind quarters at some point in the future. Though, by then I'll probably have forgotten
|
|
|
|
|
John Simmons / outlaw programmer wrote: It seems to be doing exactly what you'd expect it to do
Exactly.
|
|
|
|
|
John Simmons / outlaw programmer wrote: What happens when you pass it a string? Does it return the value "Idiot"?
The compiler complains about some "ID10T" error.
|
|
|
|
|
Why did they feel the need to provide that method? Were the existing Math.Floor , Math.Ceiling and Math.Round options not good enough?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: Why did they feel the need to provide that method?
Because of this:
FormatString('{0:d2}',Floor(sumSum([seconds]) % 60))
Prints nothing in the report.
ToInt() is required:
FormatString('{0:d2}',ToInt(Floor(sumSum([seconds]) % 60)))
Latest Article - A Concise Overview of Threads
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Math.Floor/Ceiling still return a floating point type. He wanted an int.
".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
|
|
|
|
|
Because Convert.ToInt (and ToInt16 , ToInt32 , ToInt64 ) are conversion methods (as the "Convert" suggests); they take arguments that can be numeric (int, long etc) but can also be string, boolean, char, even DateTime etc. The Math.Floor / Round / Ceiling functions are mathematical functions that modify an existing numeric argument.
Whilst the result might be the same, they perform distinctly different purposes. [Plus, what John Simmons says! ]
|
|
|
|
|
in SQL, the statement of SELECT CONVERT(INT, 0.6) simply drops the decimal part and returns 0.
TOMZ_KV
|
|
|
|
|
That's another reason to dislike SQL!
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
I think Marc wrote SQL.
".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
|
|
|
|
|
He worked for IBM then.
TOMZ_KV
|
|
|
|
|
Well, 1 is 'more equivalent' than 0 .
|
|
|
|
|
(*)Inane Coding Style Question of the Day
Have you ever used two underscores ("__ ") in a row in an identifier, and why did you do it?
I have in my current code. I have C# properties that dig in to a structure, providing a 'flat' access API to it. The properties are named Structure__minimum , Structure__maximum , and so on. A single underscore didn't seem to distinguish the values sufficiently, while two seem to emphasize the relationship between the structure and the value being manipulated.
Excuse me a moment while I grab a stick and the bag of marshmallows. Let the flame wars begin!
Yes, I'm bored. I'm also somewhat chemically-enhanced in that I can feel a migraine coming on just in time for the weekend, and have a taken a pre-emptive round of meds .
Software Zen: delete this;
|
|
|
|
|
The only places a double underscore should ever be used is at the beginning or less commonly the end of an identifier!
Anywhere else is wrong.
Because: because!
Message Signature
(Click to edit ->)
|
|
|
|