1. C++ / Говнокод #2711

    +66

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    //Функция перевода с std::string в System::String; .netFramework 3.5  
     
     String^ stringToString(string str)
                   {
                        TextBox^ strS=gcnew TextBox;
                        strS->Clear();
                        string cmps="АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя";
                        TextBox^ cmpS=gcnew TextBox;
                        cmpS->Text="АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя";
                        for(int i=0;i<str.size();i++)
                        {
                             for(int j=0;j<cmps.size();j++)
                             {          
                                  if(str[i]==cmps[j])strS->Text=strS->Text+cmpS->Text->Substring(j,1); 
                             }
                        }
                        return strS->Text;
                   }

    он работает :)))

    idec, 03 Марта 2010

    Комментарии (14)
  2. JavaScript / Говнокод #2710

    +166.3

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    function smla(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':)';}
    function smls(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='>( ';}
    function smld(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':D';}
    function smlf(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='B)';}
    function smlg(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='%)';}
    function smlh(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':(';}
    function smlj(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':o';}
    function smlw(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='^_^';}
    function smlk(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='<_<';}
    function smll(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=';)';}
    function smlq(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':p';}

    Ещё один китаец. Вставляет смайлы в текстовое поле вот таким вот кодом. Источник — http://mirtorrent.ru/css/pppm.js

    Infamous, 03 Марта 2010

    Комментарии (7)
  3. C++ / Говнокод #2709

    +73.5

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    //...                            
                                           }
    
                                        }
                                      }
                                      if(found) break;
                                    }
                                  }
                                  aStr=wcstok(NULL,m_cmdSEP);
                                }
                              }
                            }
                          }
                        }
                      }
                      else NoDeviceErrorActive(1);
                    }
                  }
                }
                else NoDeviceErrorActive(1);
              }
            }
          }
        }
      }
    //...

    Кусочек функции, сегодня наткнулся, сама функция занимает 540 строк, все методы класса -- 8000 =). И форматирование оригинальное -- не табами, а двумя пробелами =) . Мне нужно было просто посмотреть, как этот класс одну штуку делает, и я теперь сижу счастливый и думаю, как хорошо, что не мне этот код поддерживать =)

    ISith, 03 Марта 2010

    Комментарии (17)
  4. PHP / Говнокод #2708

    +168.9

    1. 1
    die('<script LANGUAGE="JavaScript">location.replace("'.$url.'");');

    Приветствуем победителя конкурса на самый извращенный редирект.

    wwwguru, 03 Марта 2010

    Комментарии (16)
  5. JavaScript / Говнокод #2707

    +159.8

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    function check_date() {
    	var	message = "Дата невалидна.";
    		days = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    
    	var str = $('#registration-form [name="birthday"]').val();
    
    	var m = str.match(/(\d*)\.(\d*)\.(\d*)(.*)/);
    
    	if (!m ||
    		!m[1] ||
    		!m[2] ||
    		!m[3] ||
    		m[4] ||
    		parseInt(m[2], 10) < 1 ||
    		parseInt(m[2], 10) > 12 ||
    		parseInt(m[1], 10) < 1 ||
    		parseInt(m[1], 10) > days[parseInt(m[2], 10)-1] ||
    		parseInt(m[3], 10) < 1920 ||
    		parseInt(m[3], 10) > 2000 ) {
    		tooltip($('#registration-form [name="birthday"]').get(0), message);
    	} else {
    		removett($('#registration-form [name="birthday"]').get(0));
    	}
    }

    Не очень говно, но вполне себе код.

    ixth, 03 Марта 2010

    Комментарии (23)
  6. C# / Говнокод #2706

    +965.2

    1. 1
    string k = Convert.ToString(s_kto.Text);

    s_kto - TextBox

    alex_donetsk, 03 Марта 2010

    Комментарии (5)
  7. JavaScript / Говнокод #2705

    +167.6

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    function BOOK_list() {
     document.getElementById('rbLoadedId_list').style.display='block';
     document.getElementById('rbLoadedId_blogs').style.display='none';
     document.getElementById('rbLoadedId_free').style.display='none';
     document.getElementById('rbLoadedId_add').style.display='none';
     document.getElementById('rbLoadedId_friend').style.display='none';
     document.getElementById('rbLoadedId_award').style.display='none';
    
     document.getElementById('0rbLoadedId_list').className='act';
     document.getElementById('0rbLoadedId_blogs').className='book';
     document.getElementById('0rbLoadedId_free').className='book';
     document.getElementById('0rbLoadedId_add').className='book';
     document.getElementById('0rbLoadedId_friend').className='book';
     document.getElementById('0rbLoadedId_award').className='book';
        }
    
      function BOOK_blogs() {
     document.getElementById('rbLoadedId_list').style.display='none';
     document.getElementById('rbLoadedId_blogs').style.display='block';
     document.getElementById('rbLoadedId_free').style.display='none';
     document.getElementById('rbLoadedId_add').style.display='none';
     document.getElementById('rbLoadedId_friend').style.display='none';
     document.getElementById('rbLoadedId_award').style.display='none';
    
     document.getElementById('0rbLoadedId_list').className='book';
     document.getElementById('0rbLoadedId_blogs').className='act';
     document.getElementById('0rbLoadedId_free').className='book';
     document.getElementById('0rbLoadedId_add').className='book';
     document.getElementById('0rbLoadedId_friend').className='book';
     document.getElementById('0rbLoadedId_award').className='book';
        }

    JS-табы по-китайски. Взято отсюда — http://vkurse.net.ru/js/info.js
    Это только первые 2 функции, в источнике ещё больше

    Infamous, 03 Марта 2010

    Комментарии (8)
  8. JavaScript / Говнокод #2704

    +166.8

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    function  trim(text) {
      if (text.length == 0) {
        return text;
      }
      if (text.charAt(0) == ' ') {
        return '';
      }
      if (text.charAt(text.length-1) == ' ') {
        text = text.substring(0, text.length-1);
      }
      return text;
    }

    суровый китайский trim...

    ClintEastwood, 02 Марта 2010

    Комментарии (17)
  9. PHP / Говнокод #2703

    +145.7

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    <?php
    	do{
    	$id=$test['id'];
    
    	?>
    
    ...
    
    <?php
    
    		}while($test = mysql_fetch_array($temp));
    	?>

    creatizmo, 02 Марта 2010

    Комментарии (21)
  10. JavaScript / Говнокод #2702

    +151.2

    1. 1
    <body onload="blinkAfterSearch();setTimeout('loadDummyImg()', 590000);var ex; try { startUpTasks(); } catch(ex) {}" />

    Недавно отрыл в недрах нашего проекта! Try catch в onload!! :D

    jericho, 02 Марта 2010

    Комментарии (16)