|
Another good reason to buy SQL Server, or ORACLE, etc.
Anyone who relies on MySql to run their vital business infrastructure deserves no less than burning at the stake.
|
|
|
|
|
Michael K Gray wrote: Another good reason to buy SQL Server, or ORACLE, etc.
That's plain wrong. It all depends on the business model and on the app using the database.
Besides, MySQL does have its strengths - it beats any commercial offering from MS or Oracle when 90% of the workload is reads performed by a server with limited hardware (depending on the table type being used).
|
|
|
|
|
We have (for many years now) a worse problem in Or-ache-le.
A query should return 3000 rows. It just returns 1200 and does not generate any error.
A corrupted value in a key terminated the retrieval, but it still returned success.
|
|
|
|
|
I'm a bit surprised there isn't an embedded String.Concatenate call in there as well.
DateTime dt = DateTime.Now;
string year = dt.Year.ToString();
string month = dt.Month.ToString();
string day = dt.Day.ToString();
if (month.Length == 1){ month = "0" + month; }
if (day.Length == 1){ day = "0" + day; }
string DocumentName = string.Format("Application - [{0}] - " + year + month + day, this.Person.RegistrationNo.ToString());
I'm thinking that there is a ToString() call missing just before the final ; too.
Oh - and this one too.
TRIMSDK.Location trimLocation = trimLocation = trimManager.FindLocationFromNickname(string.Format("{0}", this.Person.RegistrationNo.GetValueOrDefault(0).ToString()));
I think I need a Rum!
modified 15-Aug-12 23:47pm.
|
|
|
|
|
RCoate wrote: if (month.Length == 1){ month = "0" + month; }
if (day.Length == 1){ day = "0" + day; }
Now if that had been done with a StringBuilder... I would have been impressed!
|
|
|
|
|
var sbMonth = new StringBuilder();
if (month.Length == 1)
{
sbMonth.Append("0");
}
sbMonth.Append(month);
Awesome! I knew there was another method missing!
|
|
|
|
|
|
Got your insert right here.
var sbMonth = new StringBuilder();
sbMonth.Append(month);
if (month.Length == 1)
{
sbMonth.Insert(0, "0");
}
I'm sure if the genius who wrote this was aware of Insert and string builders, it would have been used.
Can't complain too much. At least the code actually produces the required outcome. I can't always claim that.
|
|
|
|
|
String.Remove() and String.Insert() - I use these a lot. BTW, I hardly use StringBuilder() , but that's just my style.
|
|
|
|
|
var sbMonth = new StringBuilder();
try
{
int x = 1 / month.Length -1;
sbMonth = AppendMonth(sbMonth);
}
catch
{
sbMonth = AppendMonth(sbMonth, "0" + month);
}
private StringBuilder AppendMonth(StringBuilder sb, string s)
{
string x = sb.Append(s).ToString();
StringBuilder y = new StringBuilder();
return y.Append(x);
}
Giraffes are not real.
|
|
|
|
|
Yep. That's worse.
|
|
|
|
|
I'm so sorry... I just couldn't stop.
Giraffes are not real.
|
|
|
|
|
ok, now where's my mind bleach?
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
|
|
|
|
|
Here you go![^]
I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image.
Stephen Hawking
|
|
|
|
|
Thanks!
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
|
|
|
|
|
You're welcome!
I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image.
Stephen Hawking
|
|
|
|
|
You need to understand that a thing like this,
string DocumentName = string.Format("Application - [{0}] - {1:yyyyMMdd}", Person.RegistrationNo, DateTime.Now);
was not easy to understand and it could trick less experienced developers!!!
Cheers!!!
|
|
|
|
|
Joke? That's far easier to read than what was originally posted.
|
|
|
|
|
Well it is flagged as a joke, also I hope my tone was sarcastic enough.
Cheers
|
|
|
|
|
Okay, just checking
|
|
|
|
|
I would think this is how it's supposed to be done.
string Daternator()
{
DateTime dt = DateTime.Now;
string result = "";
for (int i = 0; i < 3; i++)
{
if (i == 0)
result += dt.Year.ToString() + ", ";
else if (i == 1)
result += dt.Month.ToString() + ", ";
else if (i == 2)
result += dt.Day.ToString() + ", ";
}
result = result.Remove(result.LastIndexOf(" "), 1);
result = result.Remove(result.LastIndexOf(","), 1);
Start:
MatchCollection mc = Regex.Matches(result, @"\b(\d)\b");
foreach (Match m in mc)
{
if (m.Success)
{
result = result.Insert(m.Index, "0");
goto Start;
}
}
return string.Format("Application - [{0}] - " + result, this.Person.RegistrationNo.ToString());
}
modified 21-Oct-12 5:28am.
|
|
|
|
|
|
LiveFreeCodeHard wrote: CodeHard
Your name starts making sense now.
|
|
|
|
|
And I thought the WTF was a "maximum" function which takes a string and an int, until I saw the comment...
|
|
|
|
|
Hey all, here's an interlude to the regularly scheduled 'weird, wide world of windows'
my $olddatemails = `ls -t Mailed20??????`;
my $datemailed = "";
$datemailed = $1 if ($olddatemails =~ /(20\d\d\d\d\d\d)/s);
die if ($datemailed eq "");
...
$newdate = $datemailed;
while ($parse =~ s/Mailed(20\d\d)(\d\d)(\d\d).*?\n//s)
{
$newdate = $1 . $2 . $3;
}
`mv "Mailed$datemailed" "Mailed$newdate"` if ($datemailed lt $newdate);
How many tautologies and inconsistencies can you count???
|
|
|
|