|
I think you aren't familiar with IT bosses 
|
|
|
|
|
Watch out you're next for management.
Peter Wasser
Art is making something out of nothing and selling it.
Frank Zappa
|
|
|
|
|
I will gladly deny. I am not that kind of person to lead others. I prefer solitary work.
Microsoft ... the only place where VARIANT_TRUE != true
|
|
|
|
|
I had an issue with my Enterprise IM and created a support ticket. When nobody from support contacted me for over 24 hours, I walked down to the floor where the support guys were located only to be told by one of them "I did not find you online since yesterday, I had been waiting for a confirmation from you through IM".
It was one of those "God, I do not want to live in this World..." moments 
|
|
|
|
|
I know you don't get these very often, so please enjoy . And hi to everyone - forums look great these days.
my $select = "";
my (@fields) = ("field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9", "field10", "field11", "field12", "field13", "field14", "field15", "field16", "field17", "field18");
foreach my $f (@fields)
{
$select .= "$f,";
}
chop $select;
For those unfamiliar, @name= array variable, $name = scalar variable. 'chop' is interpreted as a function call with the intentional side effect of removing the last character from the scalar you pass it.
As a bonus, plaintext strings surrounded by double quotes must be parsed by the interpreter (this is Perl) and variable names within them are replaced with values.
|
|
|
|
|
That is, he creates one big string containing the values of $field1 to $field18 separated by a comma?
|
|
|
|
|
Not quite...
the "$f," only interpolates the value of the f scalar... so the result is the single string:
'field1,field2,field3,field4,field5,field6,field7,field8,field9,field10,field11,field12,field13,field14,field15,field16,field17,field18'
Seriously pointless!
|
|
|
|
|
He made a perfect example of code reuse! Spared 17 times the $ sign!!!
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 was half expecting a musical reference...
|
|
|
|
|
A musical reference, and no code[^]?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
SELECT ISNULL(NULL,'') as [Email]
There's something oddly zen-like about it 
|
|
|
|
|
Getting information off the Internet is like taking a drink from a fire hydrant.
- Mitchell Kapor
|
|
|
|
|
Maybe someone wanted to make sure that a mapping framework (like .net EntityFramework) made a nullable string out of it 
|
|
|
|
|
Ed Bouras wrote: zen-like Yes: [Email] will always be an empty string, not null (except when ISNULL evaluates NULL as something different from NULL). String.Empty and NULL is an enormous difference for MS SQLServer and most (or all?) object-oriented programming languages. But not for zen-lacking Oracle.
|
|
|
|
|
Bernhard Hiller wrote: String.Empty and NULL is an enormous difference
Yes, obviously.
And I wish XML would recognize that too.
This space intentionally left blank.
|
|
|
|
|
|
Hence the post in this forum.
Honestly this was probably done in haste and without care for proper coding as part of a set of replacements in the stored proc of the "Email" field with NULL. Things do happen fast and furious around here and there is no dba to oversee/filter.
I found it humorous enough to share with those who like to smack themselves in the forehead 
|
|
|
|
|
This probably came up for .. historic reason!
|
|
|
|
|
|
|
After long though i decided to share this wonderful gem in c#
Today cannot get "better".
public enumType GetValueByInfo(string name, string id)
{
enumType result = enumDictionary[id];
return result;
}
And the enumDictionary is just declared Dictionary<string, enumtype=""> with (string, enumType) pairs
The names are changed.
This beautiful thing is written in c# from someone else than me, a colleague who worked longer than me in the firm. He is working mainly with c# projects i am working mainly with vc++ and MFC(oh the joy) When i have to change something my boss always says to me to write it in the same manner like the things are done in the project.
The worst part is this gem is written in my dll (the dll i should be working but all other are adding things but me)
I hate when someone else is touching my code.
Microsoft ... the only place where VARIANT_TRUE != true
|
|
|
|
|
haha awesome!
I would be interested to see, in the places where this is being called, the variety of values being supplied for name.
Well fads they come and fads they go.
And God I love that rock and roll!
Well the point was fast but it was too blunt to miss.
Life handed us a paycheck, we said, "We worked harder than this!"
|
|
|
|
|
I would like to see this working with a string which is not set as key in the dictionary.
Microsoft ... the only place where VARIANT_TRUE != true
|
|
|
|
|
Just supplying the correct name and an empty id string should do the trick.
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
Time to institute code reviews.
/ravi
|
|
|
|