1. JavaScript / Говнокод #6178

    +164

    1. 1
    var fffuuuuuu = jQuery.browser.msie && parseInt(jQuery.browser.version) < 7 ? true : false

    ReallyBugMeNot, 01 Апреля 2011

    Комментарии (6)
  2. SQL / Говнокод #6177

    −861

    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
    if @new_dg_sor_code is null and @dg_sor_code<>7
    and
    (
    	(
    		(select count(*) from tbl_dogovorlist WITH (nolock) where dl_dgcod=@dg_code and dl_svkey in (1,1158,1166) and dl_control=0)=
    		(select count(*) from tbl_dogovorlist WITH (nolock) where dl_dgcod=@dg_code and dl_svkey in (1,1158,1166))
    	)
    	and (
    		(select count(*) from tbl_dogovorlist WITH (nolock) where dl_dgcod=@dg_code and dl_svkey=3 and dl_control=0)=
    		(select count(*) from tbl_dogovorlist WITH (nolock) where dl_dgcod=@dg_code and dl_svkey=3)
    	)
    	and (
    		(select count(*) from tbl_dogovorlist WITH (nolock) where dl_dgcod=@dg_code and dl_svkey=5 and dl_control=0)=
    		(select count(*) from tbl_dogovorlist WITH (nolock) where dl_dgcod=@dg_code and dl_svkey=5)
    	)
    )

    Видимо зарплата этого парня зависит от количества запросов к tbl_dogovorlist.
    А иначе зачем ему 6 запросов вместо одного?

    Anatoly, 01 Апреля 2011

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

    +111

    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
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    public List<Zone> IncludedZones {
    	get {
    		var result = new List<Zone>();
    		if (CarreerToHeap.Career.Name != null)
    			result.Add(CarreerToHeap.Career);
    		if (CarreerToHeap.UnLoading.Name != null)
    			result.Add(CarreerToHeap.UnLoading);
    
    		if (CarreerToBank.Career.Name != null)
    			result.Add(CarreerToBank.Career);
    		if (CarreerToBank.UnLoading.Name != null)
    			result.Add(CarreerToBank.UnLoading);
    
    		if (RT3110ToHeap.Career.Name != null)
    			result.Add(RT3110ToHeap.Career);
    		if (RT3110ToHeap.UnLoading.Name != null)
    			result.Add(RT3110ToHeap.UnLoading);
    
    		if (RT3110ToBank.Career.Name != null)
    			result.Add(RT3110ToBank.Career);
    		if (RT3110ToBank.UnLoading.Name != null)
    			result.Add(RT3110ToBank.UnLoading);
    
    		if (WestSubZoneToHeap.Career.Name != null)
    			result.Add(WestSubZoneToHeap.Career);
    		if (WestSubZoneToHeap.UnLoading.Name != null)
    			result.Add(WestSubZoneToHeap.UnLoading);
    
    		if (WestSubZoneToBank.Career.Name != null)
    			result.Add(WestSubZoneToBank.Career);
    		if (WestSubZoneToBank.UnLoading.Name != null)
    			result.Add(WestSubZoneToBank.UnLoading);
    
    		if (RemZone.Name != null)
    			result.Add(RemZone);
    		if (ParkingZone.Name != null)
    			result.Add(ParkingZone);
    		return result;
    	}
    }

    Охрененное свойство

    Guid, 01 Апреля 2011

    Комментарии (3)
  4. Куча / Говнокод #6175

    +113

    1. 1
    Говнокод поломался. Гуесты теперь везде.

    Vasiliy, 01 Апреля 2011

    Комментарии (12)
  5. Perl / Говнокод #6174

    −127

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    #!/bin/perl                                                                                    
    use Crypt::Blowfish; use Crypt::CBC;                                                           
    $encrypt_key= 'key';                                                                           
    $crypted_text = '53616c7465645f5fd56d1d101fb3adbf1d10cd5ce49b40868dd03da0de64c86bde6bfc3102e20aad6f4447b1fd1aacd8de66f6709cb643b56ebd16c8b8b6f86c0abc6dd6750ad3d71a558d7236102d8e730d11ded42a26d1';                                                                       
    $cipher_handle = new Crypt::CBC($encrypt_key,'Blowfish');                                      
    $text = $cipher_handle->decrypt_hex($crypted_text);                                            
    print $text;

    Не говнокод.

    Tanger, 01 Апреля 2011

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

    +159

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    HMODULE nt=LoadLibrary("Ntdll.dll");
    PROCESS_BASIC_INFORMATION pbi={0};
    ZWQUERYINFORMATIONPROCESS _ZwQueryInformationProcess;
    _ZwQueryInformationProcess = (ZWQUERYINFORMATIONPROCESS)GetProcAddress(nt, "ZwQueryInformationProcess");
    DWORD rlg;
    SetLastError(0);
    _ZwQueryInformationProcess(divine,0,&pbi,sizeof(pbi),&rlg);
    printf("%d",GetLastError());

    источник: http://www.wasm.ru/forum/viewtopic.php?pid=426270#p426270

    ReL, 31 Марта 2011

    Комментарии (15)
  7. PHP / Говнокод #6172

    +155

    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
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    private static function recalcReplyRate($contact, $flags) 
    {
        try 
        {
            if (!ANKETA_REPLY_RATE)
                throw new Exception_Base('', -1);
            if (empty($contact))
                throw new Exception_Base('', -2);
    
            if ($flags == 0 &&
                $contact->getProperty('msg_count_from') == 0 &&
                $contact->getProperty('msg_count_to') == 0) 
            {
                $delta = 1;
                $user_id = $contact->getProperty('anketa_id');
            }
            elseif ($flags == 1 &&
                $contact->getProperty('msg_count_from') > 0 &&
                $contact->getProperty('msg_count_to') == 0) 
            {
                $delta = -1;
                $user_id = $contact->getProperty('contact_anketa_id');
            }
            else 
            {
                throw new Exception_Base('', -3);
            }
    
            Data_Helper::recalcReplyRate($delta, $user_id);
    
        }
        catch (Exception_Base $e) 
        {
            return;
        }
    }

    cloucepa, 31 Марта 2011

    Комментарии (10)
  8. C++ / Говнокод #6171

    +162

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    QString SomeClass::newzipname (const QString serial) {
      QDateTime dt=QDateTime::currentDateTime();
      return serial
        +QString("%1%2%3%4%5%6")
        .arg (QString::number (dt.date().year()-2000), 2, '0')
        .arg (QString::number (dt.date().month()), 2, '0')
        .arg (QString::number (dt.date().day()), 2, '0')
        .arg (QString::number (dt.time().hour()), 2, '0')
        .arg (QString::number (dt.time().minute()), 2, '0')
        .arg (QString::number (dt.time().second()), 2, '0')
        +".zip";
    }

    panter_dsd, 31 Марта 2011

    Комментарии (4)
  9. C# / Говнокод #6170

    +125

    1. 1
    2. 2
    3. 3
    4. 4
    if (NewsId == 0)
        categoriesList.Get();
    else
        categoriesList.Get();

    Встретил при модернизации одного веб ресурса с посещаемостью около 10 тыс.пользователей в сутки

    lexx-pnz, 31 Марта 2011

    Комментарии (9)
  10. Куча / Говнокод #6169

    +146

    1. 1
    someVar++%3+1

    На мой взгляд - изящно.

    Как вы думаете, что делает этот код, особенно если его несколько раз вызывать?

    TriAnMan, 31 Марта 2011

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