|
|
public static string Pluralise(string text, int count, string culture = "en-US")
{
if (text.Length > 5 && text.EndsWithIgnoreCase(" need"))
{
string start = text.Substring(0, text.Length - 5);
if (count == 1)
return start + " needs";
return Pluralise(start, count, culture) + " need";
}
if (count == 1)
return text;
return PluralizationService.CreateService(new CultureInfo(culture)).Pluralize(text);
}
I'll go have a stern word with myself about this one...
cheers
Chris Maunder
|
|
|
|
|
Chris Maunder wrote: I'll go have a stern word with myself about this one...
Chris Maunder wrote: Pluralise For spelling this wrong, no doubt.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Pluralise is correct English. Pluralize, as is commonly the case, is a US bastardisation of English.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
If the English knew how to speak and spell properly, we would have never left.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
It was as if millions of non-English speaking users cried out in anguish, and were suddenly silenced...
Software Zen: delete this;
|
|
|
|
|
if (startupFailure)
{
startupFailure = true;
}
I must have been doing something else at some point, and this is all that is left now.
Marc
|
|
|
|
|
Debugging purposes? Sometimes these instructions remain...
DURA LEX, SED LEX
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver
When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani
|
|
|
|
|
Marc Clifton wrote: startupFailure = true; Just to be sure.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Schrodinger's cat override?
Just to be sure...
|
|
|
|
|
Since the language is not known I can only assume an untyped or weakly typed language and startupFailure might be true for an unbelievable amount of values. You're just putting that right with your assignment (again assuming true is a boolean literal).
Nothing weird to see here, run along!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Ah. Here's my version:
if (startupFailure)
{
DoSomething();
}
{
DoSomethingElse();
}
Software Zen: delete this;
|
|
|
|
|
It just made me think of a new pattern: the Failure Swallowing pattern (a behavioural one).
bool failure;
try {
}
catch {
failure = false;
}
finally {
failure = false;
}
if (failure) {
failure = false;
}
And here is it; you will never see any error anymore.
Loneliness and cheeseburgers are a dangerous mix.
|
|
|
|
|
Just a bit too verbose
private void AddYaxisChannelForMathChannelInFramesBasedTimeline(PlaybackChannelMathChannelItemViewModel viewmodel)
{
.
.
.
}
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Scandalous!
The 'a' in 'Yaxis' should be a capital letter!
|
|
|
|
|
Snap![^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Well, it was an obvious mistake!
|
|
|
|
|
Thats a wonderful observation !!!
|
|
|
|
|
I love that it's a private function.
That's solidly self-commenting code though.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Never touch anyone else's private parts, unless you really really really trust each other
Kitty at my foot and I waAAAant to touch it...
|
|
|
|
|
That's terrible - the method name should obviously be:
AddYAxisChannelForMathChannelInFramesBasedTimeline
It's "Y Axis", not "Yaxis".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Verbose, yes, but far better than:
private void DoSomething(MyType data)
{
.
.
.
}
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
My week was made today while working on one of our old production applications. Trying to hunt down a particularly obtuse relation, among the piles of tables, I found this gem:
x.dbo.tbl50
number float notnull
SELECT * FROM [x].dbo.tbl50
number
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Nathan Minier wrote: tbl50 At least it is descriptive.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|