|
I take it the person in question has departed the company?
The only instant messaging I do involves my middle finger.
|
|
|
|
|
Obviously.
Unfortunately he had enough time to wreck havoc in the company code base.
|
|
|
|
|
Guy Lavi wrote: Obviously.
Because you aren't on remand awaiting a murder trial?
The only instant messaging I do involves my middle finger.
|
|
|
|
|
Exactly!
|
|
|
|
|
I thought, if the person was still there, he would be banging this person's head against the wall instead of his own.
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
OriginalGriff wrote: A registry logger? I could top that, believe it or not, if it wasn't for the non disclosure agreement of one of my former employers.
|
|
|
|
|
You made it up!!!
It can't be.
If it's true it can be easily will a gold medal.
I can't understand why such a creative people was send on his way. Company's greatest lost...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
This is "the pearl".
His code contains many more of these gems.
|
|
|
|
|
|
I can imagine a few situations in which this could actually make sense. But of course, it is not meant to be permanently turned on, especially if a lot of exceptions are caught.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
|
I found this code in the My.Power extension for Visual Studio:
Public ReadOnly Property BatteryPercent()
Get
If SystemInformation.PowerStatus.BatteryLifePercent.ToString = "1" Then
Return "100%"
ElseIf SystemInformation.PowerStatus.BatteryLifePercent.ToString = "0.99" Then
Return "99%"
ElseIf SystemInformation.PowerStatus.BatteryLifePercent.ToString = "0.98" Then
Return "98%"
ElseIf SystemInformation.PowerStatus.BatteryLifePercent.ToString = "0.97" Then
Return "97%"
ElseIf SystemInformation.PowerStatus.BatteryLifePercent.ToString = "0.96" Then
Return "96%"
...
ElseIf SystemInformation.PowerStatus.BatteryLifePercent.ToString = "0.06" Then
Return "6%"
ElseIf SystemInformation.PowerStatus.BatteryLifePercent.ToString = "0.05" Then
Return "5%"
ElseIf SystemInformation.PowerStatus.BatteryLifePercent.ToString = "0.04" Then
Return "4%"
ElseIf SystemInformation.PowerStatus.BatteryLifePercent.ToString = "0.03" Then
Return "3%"
ElseIf SystemInformation.PowerStatus.BatteryLifePercent.ToString = "0.02" Then
Return "2%"
ElseIf SystemInformation.PowerStatus.BatteryLifePercent.ToString = "0.01" Then
Return "1%"
Else
Return "NA"
End If
End Get
End Property
What idiot would write this?
How about:
If SystemInformation.PowerStatus.BatteryLifePercent <= 0 OrElse _
SystemInformation.PowerStatus.BatteryLifePercent > 1 OrElse _
IsNothing(SystemInformation.PowerStatus.BatteryLifePercent) OrElse _
Single.IsNaN(SystemInformation.PowerStatus.BatteryLifePercent) OrElse _
Single.IsInfinity(SystemInformation.PowerStatus.BatteryLifePercent) Then
Return "NA"
Else
Return FormatNumber(SystemInformation.PowerStatus.BatteryLifePercent * 100, 0) & "%"
End If
P.S. Code shortened by about 96%
modified 6-Oct-13 3:59am.
|
|
|
|
|
Don't call him idiot! He had a bad day week year decade!
(And he didn't published it on VS Galery...)
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
I guess that coder works for the Department Of Redundancy Department.
I wonder if the Government of the US Government has a Department Of Redundancy Department. It sure seems like a lot of things come from there.
Keep Clam And Proofread
--
√(-1) 23 ∑ π...
And it was delicious.
|
|
|
|
|
Wow, you can say that again.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Great code.
SystemInformation.PowerStatus.BatteryLifePercent is a float .
And if the battery is empty, he'll say it's not available...
|
|
|
|
|
Is the VB.NET equivalent of a float a Double (64-bit float) or a Single (32-bit float)?
|
|
|
|
|
The idiot! That should so obviously be a Select Case ...
The only instant messaging I do involves my middle finger.
|
|
|
|
|
Good thing the battery can't give 110% like some developers do.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I wonder what he would have done if they suddenly wanted to display the battery life at 0.1% accuracy...
.
|
|
|
|
|
An idiot did not write this, for I'm sure they used copy/paste to comprise most of it with assistance from type-ahead.
Besides, being the float that it is, he merely wanted to float himself more hours to enable himself to float (er, buy a boat) on the lake.
Thus, he used the float associatively correct.
|
|
|
|
|
A padded number in a file name!
int fileCount = Directory.GetFiles("[censored]", "*.csv", SearchOption.AllDirectories).Length + 1;
string fileCountStr = (fileCount <= 999 ? fileCount <= 99 ? fileCount <= 9 ? "000" : "00" : "0" : "") + fileCount;
I think this should win an award for readability in a triply-nested ternary condition .
|
|
|
|
|
And what about when someone deletes 085.csv ?
speramus in juniperus
|
|
|
|
|
Oh, don't worry. None of the accounts have delete permissions.
|
|
|
|
|
It's so good to know that the hard work of the developers of String.PadLeft[^] and Int32.ToString[^] is providing so much joy to so many, other than you.
By the way, what language is that? It can't be C#, or did you also override the + operator?
|
|
|
|