How should i know it was garbage, if i didnt look?
Posts made by duckie
-
Obvious comments
I often tend to overuse comments in my code, but this is just too much... From codeplex.com/ard
(large codeblock here)
<FONT size=2></FONT><FONT color=#008000 size=2>'This piece of code executes when the execution of the code above i</FONT><FONT color=#008000 size=2>s complete.</FONT>
(another large codeblock here)
<FONT color=#008000 size=2><FONT color=#000000></FONT></FONT>
<FONT color=#008000 size=2><FONT color=#000000>I really love this, "important stuff". Wouldnt want the CPU to mess with us</FONT></FONT>
<FONT size=2></FONT><FONT color=#008000 size=2>'Some very important security stuff!!!
</FONT><FONT size=2></FONT><FONT color=#008000 size=2>'Clears username, servername and password from CPU
</FONT><FONT size=2>ServerName.Text = </FONT><FONT color=#a31515 size=2>""
</FONT><FONT size=2>UserName.Text = </FONT><FONT color=#a31515 size=2>""
</FONT><FONT size=2>PassWord.Text = </FONT><FONT color=#a31515 size=2>""</FONT>
<FONT color=#a31515 size=2><FONT color=#000000></FONT></FONT><FONT color=#a31515 size=2><FONT color=#000000>Many more in the code. Great project, implemented bad.</FONT>
</FONT> -
RE: Dont trust the framework, to do the work(.net)
You are right, but wouldnt that be a WTF in the SP? ;-)
-
RE: Dont trust the framework, to do the work(.net)
He catches the exception, but he doesnt handle it anyway. Then why do it? And by saying Throw Exception, he removes the Call-stack. He should simply have written, throw, even better, he shouldn't have catched it in the first place
He also used exceptions for logik, which is a no-go
-
Dont trust the framework, to do the work(.net)
Dont trust the framework, to do the work
I just got some ugly outsourced code in my mail, that i was assigned to work on. Its clear the developer didnt know how the framework, works.. the code is from a webservice, that CRUDs some data from a sql-server. Aparently he was affraid of the SqlClient, so he made sure nothing bad happend
He used a variable, to state if a connection was open or not:
objCon = SqlCon();
intConState=1;intConState=2;
objCon.Close();
intConState=3;Whenever the connection was requested, he tried to open it:
private SqlConnection SqlCon()
{
SqlConnection objCon = new SqlConnection();
try
{
objCon.ConnectionString = m_strSQLCon;
objCon.Open();
}
catch(System.Exception objException)
{
throw objException;
}
return objCon;
}
When Calling a single stored procedure, he used a transactionIf a client requested some data, he didnt trust the build-in serialization and passed objects, so he did it himself.. Loaded the result from the sqlserver to a dataset, wrote the xml from the dataset (using WriteXml) to a memorystream. Loaded the xml into a XmlDocument, and finally returned it as a string using XmlDoc.OuterXml .. On the clientside he parsed the xmldocument manually.
-
Balls.. Balls?
Pretty lame, but i had a laugh when finding it :)
dim balls as Integer()()
-
RE: [video] Japanese Spiderman
Thats no WTF... more a OMG .. They tend to screw western things up... Just like we do with their stuff
-
RE: GAIM wtf
The real WTF is whining about about gaims security. They make good points on their password-faq:
"Lastly, you can not store passwords at all. This is Gaim's default,
and by far the most secure of all of the options."
It aint their fault you use a insecure setup. You could encrypt your filesystem - problem solved. -
RE: Not entertained
@Walrusman said:
<font face="Verdana" size="2">
This is the kind of bland story you tell your best friend over a pint and have a good moan about; not something to attempt to share with the rest of the DailyWTF community when there is clearly not a comical or shocking WTF in there at all!
</font>
What a incredible lame answer. Where/who says a WTF has to be funny? Who says a wtf has to be code? This has been discussed earlier.
@Walrusman said:<font face="Verdana" size="2">
Who cares if this is a 100% true story, this site is about entertainment and not about producing law documents. If the story was truly shocking and eye opening then perhaps it required the "this is 100000% true" statement at the beginning.
</font>
I for one care. I think it was a good story, and i have had a similar experience (same kind of work, same kind of people). The morale is clear and simple - get stuff on paper - get a contract before you do anything.
<font face="Verdana" size="2">
</font>@Walrusman said:
<font face="Verdana" size="2">My advice: find somewhere else to whinge.
</font>
<font face="Verdana" size="2">If you dont like the post, move on.</font> -
RE: Dell Battery Replacement Program
It aint made-up. Its in the Dell-instructions for the serviceguys
-
RE: Dell Battery Replacement Program
@cconroy said:
Dear Customer,
Thank you for /verb/ing a /product name/ from us. If you're not /adverb/ly /adjective/ with the results, feel free to /verb/ it /direction/ your /body part/.
/Adverb/ly,
Dell Customer Service
Ok, my turn first
verb1 = fu*k
product name = bastard
adverb1 = extreme
adjective = happy
verb2 = shove
direction = up
body part = ass
adverb2 = "kissmyass"
-
RE: Opera: 9 to 90 in 30 seconds!
You mean the one and only new feature of Version 90
-
RE: MSDN... WTF?
Linq = Language Integrated Query, that says it all
2800_Part-2-of-my-LINQ-series_2900.aspx
Linq will come in the version after 3.0. Linq is just some of the new parts, you should also look into DLinq and XLinq (http://msdn.microsoft.com/data/ref/linq/)
The great thing about linq is, that it is easy to implement it in your own projects.
For a sample:
About .net 3.0, it has been discussed and explained many times, gooogle it up :-) -
RE: Sure ? SURE ?!
He should :-)
He has been coding for big companies several times i've heard (oracle maybe? :D)
I was to modify that application (actually quite small... ) for a other client, and belive me, its was impossible..
No libraries, just applications.. no classes, just forms.. no objects, datasets work fiiine.
He doesnt use app.config, or ini's.. noooo no, all hardcoded... .Or,
hardcoded is too strong a word! the first client had several computers
it had to be installed on, and of course the settings wasnt allways the
same! No problemo.. He just edited the source, and build it for that
specific computer.. I cant imagine the nightmares im gonna get!
Luckily, i convinced my boss, we could at well throw it all out.. I
belive he used over 100 hours, on a small project transfering data from
one database (Onlineshop) to a other (ERP)..
-
RE: Sure ? SURE ?!
And the last part is used for filling sql-parameters, using this fantastic method:
</FONT><FONT color=#0000ff size=2>Private</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Function</FONT><FONT size=2> FillParameter(</FONT><FONT color=#0000ff size=2>ByVal</FONT><FONT size=2> p </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> SqlParameter, _
</FONT><FONT color=#0000ff size=2>ByVal</FONT><FONT size=2> pn </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>String</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>ByVal</FONT><FONT size=2> pt </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>String</FONT><FONT size=2>, _
</FONT><FONT color=#0000ff size=2>ByVal</FONT><FONT size=2> ps </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Integer</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>ByVal</FONT><FONT size=2> pv </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Object</FONT><FONT size=2>) _
</FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> SqlParameter
</FONT><FONT color=#0000ff size=2>Try
</FONT><FONT size=2></FONT><FONT color=#0000ff size=2>With</FONT><FONT size=2> p
.ParameterName = pn
</FONT><FONT color=#0000ff size=2>Select</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Case</FONT><FONT size=2> pt
</FONT><FONT color=#0000ff size=2>Case</FONT><FONT size=2> "nv"
.SqlDbType = SqlDbType.NVarChar
</FONT><FONT color=#0000ff size=2>If</FONT><FONT size=2> ps > 0 </FONT><FONT color=#0000ff size=2>Then</FONT><FONT size=2> .Size = ps
</FONT><FONT color=#008000 size=2>'pv.GetType(System.String)
</FONT><FONT size=2></FONT><FONT color=#0000ff size=2>If</FONT><FONT size=2> Len(</FONT><FONT color=#0000ff size=2>CType</FONT><FONT size=2>(pv, </FONT><FONT color=#0000ff size=2>String</FONT><FONT size=2>)) > 20 </FONT><FONT color=#0000ff size=2>Then</FONT><FONT size=2> pv = Mid(</FONT><FONT color=#0000ff size=2>CType</FONT><FONT size=2>(pv, </FONT><FONT color=#0000ff size=2>String</FONT><FONT size=2>), 1, 20)
</FONT><FONT color=#0000ff size=2>Case</FONT><FONT size=2> "nt"
.SqlDbType = SqlDbType.NText
</FONT><FONT color=#0000ff size=2>Case</FONT><FONT size=2> "dt"
.SqlDbType = SqlDbType.DateTime
</FONT><FONT color=#0000ff size=2>Case</FONT><FONT size=2> "fl"
.SqlDbType = SqlDbType.Float
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Select
</FONT><FONT size=2>.Value = pv
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>With
</FONT><FONT size=2>FyldParameter = p
</FONT><FONT color=#0000ff size=2>Catch</FONT><FONT size=2> ex </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> Exception
MessageBox.Show(ex.Message)
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Try
</FONT><FONT size=2></FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Function
</FONT> -
Sure ? SURE ?!<FONT size=2>posted in Side Bar WTF
I am looking at some code a older employee at my company made (vb.net) :
IsRegistered = IIf(value <> 0, </FONT><FONT color=#0000ff size=2>True</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>)</FONT>
<FONT style="BACKGROUND-COLOR: #000000" size=2></FONT><FONT color=#0000ff size=2><FONT color=#000000>And just why was that nesecary ?</FONT></FONT>
<FONT size=2></FONT>
<FONT size=2>Now this is just fucking ugly :</FONT>
<FONT size=2></FONT>
<FONT size=2></FONT><FONT color=#0000ff size=2>Dim</FONT><FONT size=2> pPara(25) </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> SqlParameter
</FONT><FONT color=#0000ff size=2>Dim</FONT><FONT size=2> cSource() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>String</FONT><FONT size=2> = {"nv", "dt", "nv", _
"nv", "nv", "nv", _
"nv", "nv", "nv", _
"nv", "nv", "nv", _
"nv", "nv", "nv", _
"nt", "nv", "nv", _
"nv", "nv", "nv", _
"nv", "nv", "nv", "nv"}
</FONT><FONT color=#0000ff size=2>Dim</FONT><FONT size=2> iSource() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Integer</FONT><FONT size=2> = {20, 0, 40, 60, 60, _
40, 20, 255, 60, 60, _
60, 20, 40, 40, 40, _
0, 40, 60, 60, 60, _
60, 60, 60, 60, 255}
</FONT><FONT color=#0000ff size=2>Dim</FONT><FONT size=2> aSource() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>String</FONT><FONT size=2> = {"OrderNo", "OrderDate", "OptionalText1", _
"OrderText", "Name", "City", _
"Customer", "Email", "Address1", _
"Address2", "Address3", "RecvNo", _
"OptionalText2", "OptionalText3", "OptionalText4", _
"Remarks", "OptionalText5", "Ship1", _
"Ship2", "Ship3", "Ship4", _
"Ship5", "Ship6", "Ship7", _
"ShipEmail"}
</FONT><FONT color=#0000ff size=2>Dim</FONT><FONT size=2> bSource() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>String</FONT><FONT size=2> = {"@OrderNo", "@OrderDate", "@OptionalText1", _
"@OrderText", "@Name", "@City", _
"@Customer", "@Email", "@Address1", _
"@Address2", "@Address3", "@RecvNo", _
"@OptionalText2", "@OptionalText3", "@OptionalText4", _
"@Remarks", "@OptionalText5", "@Ship1", _
"@Ship2", "@Ship3", "@Ship4", _
"@Ship5", "@Ship6", "@Ship7", _
"@ShipEmail"}
</FONT><FONT color=#0000ff size=2>Dim</FONT><FONT size=2> bOk() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Boolean</FONT><FONT size=2> = {</FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, _
</FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, _
</FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, _
</FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, _
</FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, _
</FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>, _
</FONT><FONT color=#0000ff size=2>False</FONT><FONT size=2>}
</FONT><FONT color=#0000ff><FONT color=#000000></FONT></FONT>