1. Поиск говнокода

    Этот поиск практически ничего не может найти! Но вы всё-таки попытайтесь, вдруг повезет.

    Найдено: 210

  2. C# / Говнокод #7996

    +126

    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
    public static bool GetSafeBool(object val, bool defaultVal)
            {
                //TODO: check functionality
                bool result = defaultVal;
                try
                {
                    if (val != null)
                    {
                        string str = val.ToString().Trim();
                        // compare ignore case, for performance
                        result = (0 == string.Compare(str, true.ToString(), true) || str == "1" || str == "-1");
                    }
                }
                catch { }
                return result;
            }

    Продолжая тему расовых индусов...

    fade, 27 Сентября 2011

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

    +128

    1. 1
    2. 2
    3. 3
    4. 4
    XmlNodeList list = xdoc.GetElementsByTagName("Customer");
    for (int i = 0; i < list.Count; i++)
    {
    XmlElement cl = (XmlElement)xdoc.GetElementsByTagName("Customer")[i];

    Написано расовым индусом.
    http://www.c-sharpcorner.com/UploadFile/vimalkandasamy/Xml03032009055848AM/Xml.aspx - чисто индусский бложик. Там много подобного.

    koodeer, 26 Сентября 2011

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

    +159

    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
    <?
    session_set_cookie_params(86400);
    session_start();
    
    $full_home_path = dirname(__FILE__);
    require_once($full_home_path.'/_rootload.php');
    
    if ($do == "logout" and !$pass) {
            userLogOut();
            Header("Location: billing.php");
            exit;
    }
    
    if ($dh = opendir($full_home_path)) {
    	while (($my->xcsd31s = readdir($dh)) !== false) {
    		if (preg_match("/_rootconfig/ui",$my->xcsd31s) and $my->xcsd31s != "_rootconfig.php") {
    			$my->azazqwe2a = $my->xcsd31s;
    			break;
    		}
    	}
    	closedir($dh);

    Индусский быдлокод по русски.
    Таким мастерски написаным говнокодом пестрит все 8 мегабайт уйобища с гордым названием биллинг.

    tertychniy, 23 Сентября 2011

    Комментарии (10)
  5. SQL / Говнокод #7927

    −530

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    SELECT ID, 
    INTO var
    FROM tbl_ref
    WHERE 
       TO_DATE (TO_CHAR (sysdate, 'MM-DD-YYYY'), 'MM-DD-YYYY') BETWEEN VAL_EFF_FROM_DATE AND VAL_EFF_TO_DATE

    Индусы любят строки! А особенно конвертить даты в строки и обратно!

    Dragon, 21 Сентября 2011

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

    +128

    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
    <th style='border-left: 1px solid #97cbee;'>Premium<br />without<br />excess<span><img src='Artog/Images/empty/empty.gif' /></span>
    					<div style='position: relative; top: 0'>
    						<IMG class='str3' width='16' heigth='16' title='The excess can be removed from some plans in return for a higher premium.<br/>You can select this option when purchasing the plan from the insurer.' src="Artog/Images/Icons/InfoIcon28x28.png" />
    					</div>
    				</th>
    				<th style='border-left: 1px solid #97cbee'>Luggage/<br />Personal<br />effects<span><img src='Artog/Images/empty/empty.gif' /></span>
    					<div style='position: relative'>
    						<IMG class='str3' width='16' heigth='16' title='Coverage on luggage (typically important for people with a lot of good quality travel gear)' src="Artog/Images/Icons/InfoIcon28x28.png" />
    					</div>
    				</th>
    				<th style='border-left: 1px solid #97cbee'>Medical<br />expenses<span><img src='Artog/Images/empty/empty.gif' /></span>
    					<div style='position: relative'>
    						<IMG class='str2' width='16' heigth='16' title='How much will be contributed to any doctor's bills, emergency surgery etc. (for obvious reasons this is generally important for all travelers)' src="Artog/Images/Icons/InfoIcon28x28.png" />
    					</div>
    				</th>
    				<th style='border-left: 1px solid #97cbee'>Cancellation<br />costs<span><img src='Artog/Images/empty/empty.gif' /></span>
    					<div style='position: relative'>
    						<IMG class='str2' width='16' heigth='16' title='How much will be paid from inconvenience due to cancellation of flights etc. (typically important for people with a complex itinerary)' src="Artog/Images/Icons/InfoIcon28x28.png" />
    					</div>
    				</th>

    разбираю тут 1 проект
    <th style='border-left: 1px solid #97cbee'> <---------- индусы не знают ,что такое класс в css

    Rubaka, 20 Сентября 2011

    Комментарии (8)
  7. Java / Говнокод #7897

    +82

    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
    /**
         * метод возвращает int-овое смещение тайм-зоны
         */
        
        public long getIntOffset() {
    
            if (timeZone == null) {
                return 0;
            }
            return timeZone.getOffset(System.currentTimeMillis());
            Calendar now = Calendar.getInstance();
            int millisPerDay = 
                now.get(Calendar.HOUR) * ONE_HOUR + 
                now.get(Calendar.MINUTE) * ONE_MINUTE +
                now.get(Calendar.SECOND) * ONE_SECOND;
            int offset = timeZone.getOffset(
                    now.get(Calendar.ERA), 
                    now.get(Calendar.YEAR), 
                    now.get(Calendar.MONTH),
                    now.get(Calendar.DAY_OF_MONTH), 
                    now.get(Calendar.DAY_OF_WEEK), 
                    millisPerDay
                );
            int diff = now.get(Calendar.ZONE_OFFSET);
            boolean isNegative = (offset < 0);
            long intOffset = Math.abs(offset) - Math.abs(diff);
            //todo здесь наверное как-то по-лучше можно выделить часы 
            SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
            String time = sdf.format(new Date(intOffset));
            Date d;
            try {
                d = sdf.parse(time);
            } catch (ParseException e) {
                d=null;
            }
            if (d!=null)
                return (isNegative?-1:1) * d.getHours()*3600000;
            else 
                return 0;
        }

    Этот "шедевр" был написан не индусами, а суровыми программистами Новосиба ;) Это чудо долго работало, вплоть до обновления tzdata на 2011. Придется удалить, а жаль...

    karamba, 19 Сентября 2011

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

    +129

    1. 1
    IsDirty = InitialLoad ? false : true;

    Классический индусокод, в исполнении расового полового индуса.

    VasyaMatros, 17 Сентября 2011

    Комментарии (9)
  9. Java / Говнокод #7861

    +93

    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
    <%if(myaccount.getCountry().equals( "AF" )){%> <font color="grey"><label for="country">Afghanistan</label></font>
        	<%}else if(myaccount.getCountry().equals( "AL" )){%> <font color="grey"><label for="country">Albania</label></font>
        	<%}else if(myaccount.getCountry().equals( "DZ" )){%> <font color="grey"><label for="country">Algeria</label></font>
        	<%}else if(myaccount.getCountry().equals( "AS" )){%> <font color="grey"><label for="country">American Samoa</label></font>
        	<%}else if(myaccount.getCountry().equals( "AD" )){%> <font color="grey"><label for="country">Andorra</label></font>
        	<%}else if(myaccount.getCountry().equals( "AO" )){%> <font color="grey"><label for="country">Angola</label></font>
        	<%}else if(myaccount.getCountry().equals( "AI" )){%> <font color="grey"><label for="country">Anguilla</label></font>
        	<%}else if(myaccount.getCountry().equals( "AQ" )){%> <font color="grey"><label for="country">Antarctica</label></font>
        	<%}else if(myaccount.getCountry().equals( "AG" )){%> <font color="grey"><label for="country">Antigua and Barbuda</label></font>
        	<%}else if(myaccount.getCountry().equals( "AR" )){%> <font color="grey"><label for="country">Argentina</label></font>
        	<%}else if(myaccount.getCountry().equals( "AM" )){%> <font color="grey"><label for="country">Armenia</label></font>
        	<%}else if(myaccount.getCountry().equals( "AW" )){%> <font color="grey"><label for="country">Aruba</label></font>
        	<%}else if(myaccount.getCountry().equals( "AU" )){%> <font color="grey"><label for="country">Australia</label></font>
        	<%}else if(myaccount.getCountry().equals( "AT" )){%> <font color="grey"><label for="country">Austria</label></font>
        	<%}else if(myaccount.getCountry().equals( "AZ" )){%> <font color="grey"><label for="country">Azerbaijan</label></font>
        	<%}else if(myaccount.getCountry().equals( "BS" )){%> <font color="grey"><label for="country">Bahamas</label></font>
            <%}else if ...

    Индусская проверка принадлежности аккаунта к определённой стране...

    P.S. Всё не влезло - стран у нас много =)

    vetal, 14 Сентября 2011

    Комментарии (15)
  10. Ruby / Говнокод #7801

    −99

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    case klass
        when "Subject"
          case attr.to_sym
          when :screening_num then :screening_num
          when :subject_num then :subject_num
          end
        end

    это чО на всякий пожарный чтоли ?
    обратите внимание что klass это объект ActiveRecord а проверяется как стринг

    писал русский паренёк Дима ) а вы говорите индусы )

    koshak, 08 Сентября 2011

    Комментарии (6)
  11. PHP / Говнокод #7556

    +166

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    $darray = explode('.', $_SERVER['HTTP_HOST']);
    $narray = array_reverse($darray);
    array_pop($narray);
    $domain = implode('.',array_reverse($narray));
    $this->view->domain=$domain;

    Индусы такие индусы...

    kest, 16 Августа 2011

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