Click here to Skip to main content
15,895,142 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: if if if if if if Pin
Rajesh R Subramanian11-Sep-07 23:30
professionalRajesh R Subramanian11-Sep-07 23:30 
GeneralRe: if if if if if if Pin
KarstenK12-Sep-07 0:12
mveKarstenK12-Sep-07 0:12 
GeneralRe: if if if if if if Pin
Rajesh R Subramanian12-Sep-07 0:13
professionalRajesh R Subramanian12-Sep-07 0:13 
JokeRe: if if if if if if Pin
Pete O'Hanlon11-Sep-07 5:12
mvePete O'Hanlon11-Sep-07 5:12 
GeneralRe: if if if if if if [modified] Pin
Rajesh R Subramanian11-Sep-07 23:37
professionalRajesh R Subramanian11-Sep-07 23:37 
GeneralRe: if if if if if if Pin
mimante11-Sep-07 22:16
mimante11-Sep-07 22:16 
GeneralRe: if if if if if if Pin
Plasmodium5-Oct-07 13:07
Plasmodium5-Oct-07 13:07 
Generalparsing string for int sqlParameter Pin
Seishin#10-Sep-07 4:54
Seishin#10-Sep-07 4:54 
once i got some code for a webpage.. there was this search 'engine' using one mathod:
<br />
public static dt_Product[] DB_Search(<br />
                           int _CMS_LanguageID,<br />
                           int _SubGroup,<br />
                           int _Make,<br />
                           string _ITEMNMBR,<br />
                           string _KTMDESC)<br />
        {<br />
<br />
            SqlParameter[] p ={<br />
                        new SqlParameter("@CMS_LanguageID", _CMS_LanguageID),<br />
                        new SqlParameter("@SubGroup", _SubGroup),<br />
                        new SqlParameter("@Group", int.Parse("-1")),<br />
                        new SqlParameter("@Make", _Make),<br />
                        new SqlParameter("@ITEMNMBR", _ITEMNMBR),<br />
                        new SqlParameter("@KTMDESC", _KTMDESC),<br />
                        new SqlParameter("@PRICELEVEL", ""),<br />
                        new SqlParameter("@IDSUBCAT_1", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_1_P", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_1_K", int.Parse("-1")),<br />
                        new SqlParameter("@IDSUBCAT_2", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_2_P", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_2_K", int.Parse("-1")),<br />
                        new SqlParameter("@IDSUBCAT_3", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_3_P", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_3_K", int.Parse("-1")),<br />
                        new SqlParameter("@IDSUBCAT_4", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_4_P", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_4_K", int.Parse("-1")),<br />
                        new SqlParameter("@IDSUBCAT_5", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_5_P", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_5_K", int.Parse("-1")),<br />
                        new SqlParameter("@IDSUBCAT_6", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_6_P", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_6_K", int.Parse("-1")),<br />
                        new SqlParameter("@IDSUBCAT_7", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_7_P", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_7_K", int.Parse("-1")),<br />
                        new SqlParameter("@IDSUBCAT_8", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_8_P", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_8_K", int.Parse("-1")),<br />
                        new SqlParameter("@IDSUBCAT_9", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_9_P", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_9_K", int.Parse("-1")),<br />
                        new SqlParameter("@IDSUBCAT_10", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_10_P", int.Parse("-1")),<br />
                        new SqlParameter("@IDVALUE_10_K", int.Parse("-1"))};<br />
<br />
            return (dt_Product[])Data.DataReader.DB_Get(typeof(dt_Product), "Product_Search", p);<br />
        }<br />


another horror i found in their code was the pagination of the search results ..
long story short after completing the search they did a 'for' loop for all of the results and if i % 5 == 0 they put link to i / 5 page.
also they displayed results in another loop which also was for whole collection.. they checked if i was in range of the page...

all i could say then was: damn =_=' ...

life is study!!!

GeneralRe: parsing string for int sqlParameter Pin
PIEBALDconsult10-Sep-07 5:24
mvePIEBALDconsult10-Sep-07 5:24 
GeneralHorror from an article in CP Pin
Ashish Kaila1-Sep-07 8:31
Ashish Kaila1-Sep-07 8:31 
AnswerRe: Horror from an article in CP Pin
DavidNohejl1-Sep-07 9:31
DavidNohejl1-Sep-07 9:31 
GeneralRe: Horror from an article in CP Pin
PIEBALDconsult1-Sep-07 17:31
mvePIEBALDconsult1-Sep-07 17:31 
GeneralRe: Horror from an article in CP [modified] Pin
PIEBALDconsult1-Sep-07 17:16
mvePIEBALDconsult1-Sep-07 17:16 
GeneralRe: Horror from an article in CP Pin
Vasudevan Deepak Kumar1-Sep-07 22:51
Vasudevan Deepak Kumar1-Sep-07 22:51 
GeneralRe: Horror from an article in CP Pin
Rajesh R Subramanian2-Sep-07 20:39
professionalRajesh R Subramanian2-Sep-07 20:39 
GeneralRe: Horror from an article in CP Pin
Drew_Benton6-Sep-07 23:41
Drew_Benton6-Sep-07 23:41 
GeneralRe: Horror from an article in CP Pin
SimmoTech7-Sep-07 21:12
SimmoTech7-Sep-07 21:12 
GeneralRe: Horror from an article in CP Pin
Mushtaque Nizamani8-Sep-07 20:58
Mushtaque Nizamani8-Sep-07 20:58 
GeneralRe: Horror from an article in CP Pin
Pascal Ganaye3-Sep-07 3:45
Pascal Ganaye3-Sep-07 3:45 
GeneralRe: Horror from an article in CP Pin
OR0N4-Sep-07 0:09
OR0N4-Sep-07 0:09 
GeneralRe: Horror from an article in CP Pin
Mike Dimmick5-Sep-07 10:12
Mike Dimmick5-Sep-07 10:12 
JokeRe: Horror from an article in CP Pin
Pete O'Hanlon6-Sep-07 23:47
mvePete O'Hanlon6-Sep-07 23:47 
GeneralOOP 101 Pin
Leisuresuit Larry31-Aug-07 10:58
Leisuresuit Larry31-Aug-07 10:58 
GeneralRe: OOP 101 Pin
PIEBALDconsult31-Aug-07 14:17
mvePIEBALDconsult31-Aug-07 14:17 
GeneralRe: OOP 101 Pin
Andy Brummer31-Aug-07 20:03
sitebuilderAndy Brummer31-Aug-07 20:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.