|
V. wrote: you were bitten by a king cobra
Well, it certainly can't be any of the Debbie movies, because then it would have been the other way around!
Anything that is unrelated to elephants is irrelephant Anonymous ----- Do not argue with an idiot. He will drag you down to his level and beat you with experience Greg King ----- I always wanted to be somebody, but now I realize I should have been more specific. Lily Tomlin, Actress
|
|
|
|
|
V. wrote: wonder who would say that kind of thing, that way.
Tom Hanks.
V. wrote: But more importantly: Which movie?
The Money Pit.
|
|
|
|
|
Clumsily Enable Depth Sex For The Superfluous (III, XI)
|
|
|
|
|
Tom Lawton wrote: Clumsily Enable Depth Sex For The Superfluous Secundis(III, XI, I)
FTFY!
The only instant messaging I do involves my middle finger.
|
|
|
|
|
Nursing Home on the Run
You know the world is going crazy when the best rapper is a white guy, the best golfer is a black guy, the tallest guy in the NBA is Chinese, the Swiss hold the America's Cup, France is accusing the U.S. of arrogance, Germany doesn't want to go to war, and the three most powerful men in America are named "Bush", "Dick", and "Colon."
|
|
|
|
|
Luis Suarez, 30 days in the desert.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Well, it wasn't the real Chuck - he wouldn't boast!
The only instant messaging I do involves my middle finger.
|
|
|
|
|
Chuck? Mmm. Sounds familiar.
Loading signature...
. . . Please Wait . . .
|
|
|
|
|
Carry on... Up the Jungle
--- or ---
Anybody, any time, talking to Ms H.
speramus in juniperus
|
|
|
|
|
Interview with Bear Grylls
Microsoft ... the only place where VARIANT_TRUE != true
|
|
|
|
|
|
According to this the internet is irrelevant
Clickey[/\]
itnews: Meanwhile, dial-up access is still being used, albeit only by 3 percent of connected adults, the survey said. Does that count as being hipster?
Zickuhr: We've found that most offline adults either don't see the Internet as relevant to them, or feel that it would be too difficult to start If only they knew how addictive it is afterall
Loading signature...
. . . Please Wait . . .
|
|
|
|
|
What is internet?
Signature construction in progress. Sorry for the inconvenience.
Damn you have the perfect signature - CBadger
|
|
|
|
|
I have no Idea but to know I am immortalized by the great walterhevedeich in his signature is better than internet
Loading signature...
. . . Please Wait . . .
|
|
|
|
|
"the Internet is irrelevant and too technical, survey says"
Bloody cr@p reporters.
"The survey" didn't say anything of the kind. It was the opinion of an undisclosed percentage of 3% of the respondents.
That means that at least 97% disagree with the statement, so the survey says bollocks to the headline.
There should be laws against reporting such outrageous distortions -- or, at very least, it should be a sackable offence.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Sex and drama sells so they probably ran out of sex scandals
Mmm sex scandal in the IT world... Imagine that!
Loading signature...
. . . Please Wait . . .
|
|
|
|
|
CBadger wrote: Mmm sex scandal in the IT world... Imagine that! Hmmmm...FB ?
Microsoft ... the only place where VARIANT_TRUE != true
|
|
|
|
|
What did Mark do now again?
I told him not to have proof on FB!
Loading signature...
. . . Please Wait . . .
|
|
|
|
|
CBadger wrote: Mmm sex scandal in the IT world... Imagine that!
make your statements as precise as possible.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Mark_Wallace wrote: make your statements as precise as possible.
Mmm, sexual intercourse between two consenting adults of the age group older than 18, one of the female genitalia considered beautiful in the eyes of the world view and the other of male genitalia build like what is considered and commonly in world view referenced as Information Technological working man, where in the world view considering male Information Technological working adults being of less likely to be in the situation of sexual intercourse as described above, insinuating the common outlook that males of that way of life has only sexual intercourse with himself.
Better Mark?
Loading signature...
. . . Please Wait . . .
|
|
|
|
|
So I've been enjoying myself at work today: I wrote something to take a number and convert it into English, e.g. "12324.56" becomes "twelve thousand, three hundred and twenty-four point five six". I know this is an old problem: I remember having done this something like 30 years ago, as part of a computer science class, but I actually needed it for something today: in doing it, I was amazed at how many ways there are to achieve it in C# (the last time I wrote it, it was in Algol-60!), and how many little optimizations I was able to add as I sat there looking at each iteration of the code.
I ended up trying to keep the code as terse as I could but also as fast as I could, without having too many IFs and things all over the place. I ended up using a bunch of enums and letting the runtime make words out of them, rather than having strings for it: I'm not sure it makes a huge difference, but it just seemed more elegant, somehow.
Of course, in a problem like this, there's always the part about trying to stop it saying things like, "two thousand, zero hundred and onety-zero", so part of the fun was trying not to write anything too specific to avoid things like that: in my mind, if I got the algorithm right, that stuff would just sort of work...
It's nice having a bit of time on one's hands at work, for a change.
Anyway, I had a lot of fun, so I thought I'd share: if anyone else has a better method (and I'm sure they do) then why not join in...? Meanwhile, here's my version:
public static class Numeric
{
private enum Digit
{
zero = 0, one = 1, two = 2, three = 3, four = 4,
five = 5, six = 6, seven = 7, eight = 8, nine = 9
}
private enum Teen
{
ten = 10, eleven = 11, twelve = 12, thirteen = 13, fourteen = 14,
fifteen = 15, sixteen = 16, seventeen = 17, eighteen = 18, nineteen = 19
}
private enum Ten
{
twenty = 2, thirty = 3, forty = 4, fifty = 5,
sixty = 6, seventy = 7, eighty = 8, ninety = 9
}
private enum PowerOfTen
{
hundred = 0, thousand = 1, million = 2, billion = 3,
trillion = 4, quadrillion = 5, quintillion = 6
}
private static int PowersOfTen = Enum.GetValues(typeof(PowerOfTen)).Length;
public static string ToWords(double N)
{
string Prefix = N < 0 ? "minus " : "";
string Significand = Digit.zero.ToString();
string Mantissa = "";
if ((N = Math.Abs(N)) > 0)
{
if (N != Math.Floor(N))
{
Mantissa = " point";
foreach (char C in N.ToString().Substring(N.ToString().IndexOf('.') + 1))
Mantissa += " " + ((Digit)(int.Parse(C.ToString())));
}
int n = Convert.ToInt32(N = Math.Floor(N)) % 100;
Significand = n == 0 ? ""
: n < 10 ? ((Digit)n).ToString()
: n < 20 ? ((Teen)n).ToString()
: (Ten)(n / 10) + "-" + (Digit)(n % 10);
if ((N = Math.Floor(N / 100D)) > 0)
{
string EW = "";
for (int i = 0; (N > 0) && (i < PowersOfTen); i++)
{
double p = Math.Pow(10, (i << 1) + 1);
n = Convert.ToInt32(N % p);
if (n > 0)
EW = ToWords(n) + " " + (PowerOfTen)i + (EW.Length == 0 ? "" : ", " + EW);
N = Math.Floor(N / p);
}
if (EW.Length > 0)
Significand = EW + (Significand.Length == 0 ? "" : " and " + Significand);
}
}
return Prefix + (Significand + Mantissa).Trim();
}
}
|
|
|
|
|
Probably would have been better posting this as a Tip/Trick rather than in the Lounge...
|
|
|
|
|
|
Yes, a few of these (though not in English) usually show up about this time each year as first-year students post their first quarter accomplishments.
Why not one big enum?
Don't use Convert!
You don't support milliard.
|
|
|
|
|
Really? Convert's slow? Thanks!
|
|
|
|
|