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

    В номинации:
    За время:
  2. 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

    Комментарии (17)
  3. JavaScript / Говнокод #29150

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    Казалось бы, измненений не много
    https://github.com/microsoft/monaco-editor/compare/v0.47.0...v0.48.0-dev-20240319
    Но за ними конечно же кроется это
    https://github.com/microsoft/vscode/compare/1e790d77f81672c49be070e04474901747115651...33cd6f1001b92a912898996be69b6928eda1a682
    Все фронтендеры должны гореть в аду

    Где-то здесь поломали рендер. Где, конечно, неясно, эксепшнов никаких нету, просто рисует какую-то эпилепсию вместо текста, но разумеется этот редахтур пихуют повсюду. Как среди этой кучи что-то найти тоже неясно.
    Это не код, авгивевы конюшни.
    Горите блять в аду

    mittorn, 04 Июля 2025

    Комментарии (4)
  4. Python / Говнокод #29153

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    from gremllm import Gremllm
    
    # Be sure to tell your gremllm what sort of thing it is
    counter = Gremllm('counter')
    counter.value = 5
    counter.increment()
    print(counter.value)  # 6?
    print(counter.to_roman_numerals()) # VI?

    https://github.com/awwaiid/gremllm

    Нет, вы не поняли. На каждый метод он запускает "ИИ", который додумывает что нужно сделать.

    OCETuHCKuu_nemyx, 04 Июля 2025

    Комментарии (2)
  5. Python / Говнокод #29149

    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
    def animate_fight (self, игрок):
           if self.gamedata.animate_fight == True: 
              
              if self.gamedata.fight_animation_progress < 3:
               self.gamedata.screen.blit(self.fight1, (self.x - (self.width // 2), self.y - (self.width //2) ))
               
              elif 3 <= self.gamedata.fight_animation_progress < 6:
               self.gamedata.screen.blit(self.fight2, (self.x - (self.width // 2), self.y - (self.width //2) ))
    
              elif  6 <= self.gamedata.fight_animation_progress < 9:
               self.gamedata.screen.blit(self.fight3, (self.x - (self.width // 2), self.y - (self.width //2) ))
               self.gamedata.screen.blit(self.fight1, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
              elif  9 <= self.gamedata.fight_animation_progress < 12:
               self.gamedata.screen.blit(self.fight4, (self.x - (self.width // 2), self.y - (self.width //2) ))
               self.gamedata.screen.blit(self.fight2, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
              elif  12 <= self.gamedata.fight_animation_progress < 15:
               self.gamedata.screen.blit(self.fight5, (self.x - (self.width // 2), self.y - (self.width //2) ))
               self.gamedata.screen.blit(self.fight3, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
              elif  15 <= self.gamedata.fight_animation_progress < 18:
               self.gamedata.screen.blit(self.fight6, (self.x - (self.width // 2), self.y - (self.width //2) ))
               self.gamedata.screen.blit(self.fight4, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
              elif  18 <= self.gamedata.fight_animation_progress < 21:
                 self.gamedata.screen.blit(self.fight5, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
    
              elif  21 <= self.gamedata.fight_animation_progress < 24:
                 self.gamedata.screen.blit(self.fight6, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
               
              elif  24 <=self.gamedata.fight_animation_progress:
                 self.gamedata.animating = False
                 self.gamedata.fight_animation_progress = 0
                 self.gamedata.animate_fight = False
              if 24 > self.gamedata.fight_animation_progress:
               self.gamedata.fight_animation_progress += 1

    Зачем делить на 3, если можно написать кучу говна?

    1004w, 02 Июля 2025

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