1. Лучший говнокод

    В номинации:
    За время:
  2. ActionScript / Говнокод #1015

    −429.1

    1. 1
    searchResultItemArray.push(new SearchResultItem(((kwList.GetItem(rsl[i].kwC))[0].kw[rsl[i].kw]),((kwList.GetItem(rsl[i].kwC))[0].src),i));

    Красота архитектуры умиляет

    guest, 07 Мая 2009

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

    +143.9

    1. 1
    http://www.***.com/Hotels?action=hotelPackageWizard@searchHotelOnly&packageType=HOTEL_ONLY&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_hotelSearchRegionControl_hotelRegionTypeControl_inpRegionType=AIRPORT&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_hotelSearchRegionControl_airportControl_inpAirport=kiev&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_dateRangeWidget_inpStartDate=3/25/2009&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_dateRangeWidget_inpEndDate=4/15/2009&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_roomInputWidget_hotelRoomCountInput=1&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_roomInputWidget_adultCountInput=2&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_roomInputWidget_childCountInput=0&isAdditionOptionExist=0&rfrr=-905

    // админы сделайте общую категорию а пока это асм наверно :)
    к всем ЯП-ам относится

    guest, 22 Марта 2009

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

    +173.1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    $h_month = date("m");
    $h_day = date("d");
    $h_year = date("Y");
    $h_hour = date("H");
    $h_minute = date("i");
    
    $history = mysql_query("insert into history values('','$h_month','$h_day','$h_year','$h_hour','$h_minute','$total_open','$beat','$wins','$tie','$can_change_up','$can_change_down','$cannot_win','$t_adjusted_gain','$t_adjusted_loss','$t_dollar_amount')");

    вот так вот человек хранит дату в БД =)

    guest, 12 Марта 2009

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

    +849.2

    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
    switch (driver.Status)
          {
            case ClientStatus.Unknown:
              return m_driverStatusNames[ClientStatus.Unknown];
            case ClientStatus.Free:
              return m_driverStatusNames[ClientStatus.Free];
            case ClientStatus.Busy:
              return m_driverStatusNames[ClientStatus.Busy];
            case ClientStatus.InWay:
              return m_driverStatusNames[ClientStatus.InWay];
            case ClientStatus.Work:
              return m_driverStatusNames[ClientStatus.Work];
            case ClientStatus.Break:
              return m_driverStatusNames[ClientStatus.Break];
            case ClientStatus.Alarm:
              return m_driverStatusNames[ClientStatus.Alarm];
          }

    :)

    guest, 30 Декабря 2008

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

    +24

    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
    while (!bFound && j < enmMessages)
    {
    	if (!strcmp(str.operator const char * (), strPacketName[j]))
    	{
    		iPacketType = j;
    		bFound = true;
    		TRACE(" of type %s\n",strPacketName[j]);
    		strcat(strOut," of type ");
    		strcat(strOut, strPacketName[j]);
    		break;
    	}
    	j++;
    }

    guest, 19 Декабря 2008

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

    +2.4

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    int a=0;
    if (a != 0)
    {
     a=0;
    }
    else a=0;

    guest, 15 Декабря 2008

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

    +11.9

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    if ($site_is_work)
     {
     }
    else
     {
    	exit('Сайт не работает');
     }

    guest, 14 Декабря 2008

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

    0

    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
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    // https://github.com/dotnet/runtime/issues/117233#issuecomment-3028066225
    
    // Issue: Math.Pow relies directly on the OS pow implementation
    
    // Location: [src/coreclr/classlibnative/float/floatdouble.cpp lines 232‑236] and [src/coreclr/classlibnative/float/floatsingle.cpp lines 207‑211]
    
    // COMDouble::Pow and COMSingle::Pow simply call pow/powf from the C runtime. On Windows 11 Insider Preview (build 27881.1000),
    // these functions can return incorrect results (e.g., Math.Pow(-1, 2) giving -1). The JIT also uses these functions for constant folding, causing
    // wrong constants to be embedded at compile time.
    
    // Suggested Fix: Introduce a managed fallback in COMDouble::Pow/COMSingle::Pow that handles negative bases with integral exponents, bypassing the faulty system call.
    
    //A simple approach:
    
    FCIMPL2_VV(double, COMDouble::Pow, double x, double y)
    {
        FCALL_CONTRACT;
    
        if ((x < 0.0) && (y == floor(y)))
        {
            double absResult = pow(-x, y);
            return fmod(fabs(y), 2.0) == 1.0 ? -absResult : absResult;
        }
    
        return pow(x, y);
    }
    
    // Suggested Implementation:
    
    // Add the following code to src/coreclr/classlibnative/float/floatdouble.cpp below line 234 before the return pow:
    
    if ((x < 0.0) && (y == floor(y)))
    {
        double result = pow(-x, y);
    
        if (fmod(fabs(y), 2.0) != 0.0)
        {
            result = -result;
        }
    
        return result;
    }
    
    // Add the following code to src/coreclr/classlibnative/float/floatsingle.cpp below line 209 before the return powf:
    
    if ((x < 0.0f) && (y == floorf(y)))
    {
        float result = powf(-x, y);
    
        if (fmodf(fabsf(y), 2.0f) != 0.0f)
        {
            result = -result;
        }
    
        return result;
    }
    
    // Add the following code to src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Math.cs below line 1124:
    
    [Fact]
    public static void Pow_NegativeBaseEvenExponent_ReturnsPositive()
    {
        Assert.Equal(1.0, Math.Pow(-1, 2));
        Assert.Equal(16.0, Math.Pow(-2, 4));
    }

    Вот к чему плавучий петух приводит!

    j123123, 04 Июля 2025

    Комментарии (22)
  10. Си / Говнокод #29073

    +1

    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
    /* Python:
    
    def A004086(n):
    return int(str(n)[::-1])
    */
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    
    int A004086(int n) {
        char str[12]; // Enough to hold the string representation of an int
        sprintf(str, "%d", n);
        int len = strlen(str);
        char reversed[12];
        
        for (int i = 0; i < len; i++) {
            reversed[i] = str[len - 1 - i];
        }
        reversed[len] = '\0'; // Null-terminate the string
        
        return atoi(reversed);
    }

    Результат переписывание с "Python" на "C". A004086 это последовательность из OEIS https://oeis.org/A004086

    j123123, 02 Января 2025

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

    0

    1. 1
    $_GET

    OCETuHCKuu_nemyx, 15 Октября 2024

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