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

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

    +10

    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
    var
     DPen: TGPPen;
     Drawer: TGPGraphics;
     DBrush: TGPSolidBrush;
     DFntFam: TGPFontFamily;
     DPath: TGPGraphicsPath;
     IC,BC:Integer;
     ICL, BCL:TGPColor;
     W:WideString;
     si:TGPRectF;
     rt:TGPRectF;
     GP:TGPPoint;
    begin
      W:=FWaterMark.Text;
      IC:=ColortoRGB(FWaterMark.Font.Color);
      BC:=ColorToRGB(FWaterMark.CircuitColor);
      ICl:=MakeColor(GetRValue(IC), GetGValue(IC), GetBValue(IC));
      BCL:=MakeColor(GetRValue(BC), GetGValue(BC), GetBValue(BC));
      Drawer:=TGPGraphics.Create(FBitMap.Canvas.Handle);
      Drawer.SetCompositingQuality(CompositingQualityHighQuality);
      Drawer.SetSmoothingMode(SmoothingModeAntiAlias);
      Drawer.SetTextRenderingHint(TextRenderingHintAntiAlias);
      DPath:=TGPGraphicsPath.Create;
      DPen:=TGPPen.Create(BCL, FWaterMark.FCircuitWidth);
      DBrush:=TGPSolidBrush.Create(ICL);
      DFntFam:=TGPFontFamily.Create(FWaterMark.Font.Name);
    
      RT.X:=0;
      RT.Y:=0;
      RT.Width:=FBitMap.Width;
      RT.Height:=FBitMap.Height;
      
      DPath.AddString(W, Length(W), DFntFam, FontStyleBold, FWaterMark.Font.Size, GP, TGPStringFormat.Create()); 
      DPath.GetBounds(RT, nil, DPen);
      DPath.Reset; 
    
    //В общем, хз, как узнать ширину и высоту нарисованного.
    //MeasureString/MeasureCharacterRanges не подходят,а в доке такая муть, что я чуть не спился.

    Нежнейший аромат...

    Exception, 04 Марта 2018

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

    0

    1. 1
    Просто оффтоп #41

    #11: https://govnokod.ru/27122 https://govnokod.xyz/_27122
    #12: https://govnokod.ru/27153 https://govnokod.xyz/_27153
    #13: https://govnokod.ru/27159 https://govnokod.xyz/_27159
    #14: https://govnokod.ru/27200 https://govnokod.xyz/_27200
    #15: https://govnokod.ru/27237 https://govnokod.xyz/_27237
    #16: (vanished) https://govnokod.xyz/_27282
    #17: https://govnokod.ru/27319 https://govnokod.xyz/_27319
    #18: https://govnokod.ru/27380 https://govnokod.xyz/_27380
    #19: (vanished) https://govnokod.xyz/_27500
    #20: https://govnokod.ru/27607 https://govnokod.xyz/_27607
    #21: https://govnokod.ru/27951 https://govnokod.xyz/_27951
    #22: https://govnokod.ru/28076 https://govnokod.xyz/_28076
    #23: https://govnokod.ru/28266 https://govnokod.xyz/_28266
    #24: https://govnokod.ru/28373 https://govnokod.xyz/_28373
    #25: https://govnokod.ru/28474 https://govnokod.xyz/_28474
    #26: https://govnokod.ru/28563 https://govnokod.xyz/_28563
    #27: https://govnokod.ru/28645 https://govnokod.xyz/_28645
    #28: (vanished) https://govnokod.xyz/_28664
    #29: https://govnokod.ru/28674 https://govnokod.xyz/_28674
    #30: https://govnokod.ru/28680 https://govnokod.xyz/_28680
    #31: https://govnokod.ru/28688 https://govnokod.xyz/_28688
    #32: https://govnokod.ru/28695 https://govnokod.xyz/_28695
    #33: https://govnokod.ru/28702 https://govnokod.xyz/_28702
    #34: (vanished) https://govnokod.xyz/_28708
    #35: https://govnokod.ru/28715 https://govnokod.xyz/_28715
    #36: https://govnokod.ru/28725 https://govnokod.xyz/_28725
    #37: https://govnokod.ru/28733 https://govnokod.xyz/_28733
    #38: (vanished) https://govnokod.xyz/_28748
    #39: https://govnokod.ru/28758 https://govnokod.xyz/_28758
    #40: https://govnokod.ru/28885 https://govnokod.xyz/_28885

    nepeKamHblu_nemyx, 26 Ноября 2024

    Комментарии (271)
  4. JavaScript / Говнокод #17905

    +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
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    var existingDates=new Array();
    existingDates[11]=new Array();
    existingDates[11][3]=[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28];
    existingDates[11][4]=[3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,28,29,30,31];
    existingDates[11][5]=[1,2,4,5,6,7,8,9,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
    existingDates[11][6]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
    existingDates[11][7]=[1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
    existingDates[11][8]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
    existingDates[11][9]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
    existingDates[11][10]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
    existingDates[11][11]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
    /*... */
    existingDates[24][1]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28];
    existingDates[24][2]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
    existingDates[24][3]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
    existingDates[24][4]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
    existingDates[24][5]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
    existingDates[24][6]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
    existingDates[24][7]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
    existingDates[24][8]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
    existingDates[24][9]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
    existingDates[24][10]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30];
    existingDates[24][11]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
    existingDates[25]=new Array();
    existingDates[25][0]=[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
    existingDates[25][1]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28];
    existingDates[25][2]=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
    existingDates[25][3]=[1];
    /* ... */

    Src: http://www.kommersant.ru/archive/news/77/2015-04-01

    sysctl, 01 Апреля 2015

    Комментарии (270)
  5. Куча / Говнокод #14370

    +119

    1. 1
    "По какой-то причине не удается завершить установку вин 8.1"

    Информативное сообщение при апдейте 8.0 -> 8.1.

    bormand, 16 Января 2014

    Комментарии (269)
  6. bash / Говнокод #28484

    −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
    Новогодний оффтоп #3
    ░░░░░░░░░░░░░░░░░▐▌░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░▀████▀░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░▄█▀▀█▄░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░░▄▄░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░▄████▄░░░░░░░░░░░░░░░
    ░░░░░░░░░░░▄▄██╬██╬████▄▄░░░░░░░░░░░
    ░░░░░░░░▀███████╬███╬██████▀░░░░░░░░
    ░░░░░░░░░░▄▄█╬████╬█████▄▄░░░░░░░░░░
    ░░░░▄▄▄▄██╬████╬█████╬███╬██▄▄▄▄░░░░
    ░░░░░░▀▀████╬█████╬█████████▀▀░░░░░░
    ░░░░░░░░░▄█████╬██████╬███▄░░░░░░░░░
    ░░▄▄▄▄██████╬█████╬███████╬███▄▄▄▄░░
    ░░▀▀▀████╬█████╬████╬███╬██████▀▀▀░░
    ░░░░░░░░████╬████████╬██████░░░░░░░░
    ░░▄▄▄█████╬██████╬█████╬███╬███▄▄▄░░
    ▀▀▀████╬█████╬█████╬████╬███╬████▀▀▀
    ░░░░░░▀▀▀██████████████████▀▀▀░░░░░░
    ░░░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░

    #1: https://govnokod.ru/27188 https://govnokod.xyz/_27188
    #2: https://govnokod.ru/27893 https://govnokod.xyz/_27893

    gostinho, 12 Декабря 2022

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

    +5

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    private void DeleteNode()
    {
    	viewModel.timing.Rows.Remove(Row);
    	viewModel.Rows.Remove(this);
    	//(x_x)
    	viewModel.ModelChanged.Raise();
    }

    При самоубиении не забудьте оставить коммент для GC, чтобы он ошмётки отскрёб от стенки

    kerman, 28 Июля 2016

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

    −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
    AnsiString str = IntToHex((__int64) longvalue, 2); // 0x01020304
    
        char _c[11];
        char *ch = str.c_str();
        int len = strlen(ch);
        int _s = len;
        int j = 0;
        _c[j++] = '0';
        _c[j++] = 'x';
        while (_s >= 2) {
            _c[j++] = ch[_s-2];
            _c[j++] = ch[_s-1];
            _s-=2;
        }
        if (len == 7) {
            _c[j++] = '0';
            _c[j] = ch[0];
        }
        _c[10] = '\0';
    
        unsigned long pp;
        char *pEnd;
        pp = strtoul (_c, &pEnd, 16); // 0x04030201 - PROFIT!

    Наслаждайтесь

    FataLL, 05 Августа 2022

    Комментарии (266)
  9. JavaScript / Говнокод #27445

    +6

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    [■,■,■,■].map(■→●) ⇒ [●,●,●,●]
    [■,●,■,▲].filter(■→true) ⇒ [■,■]
    [■,●,■,▲].find(●→true) ⇒ ●
    [■,●,■,▲].findIndex(●→true) ⇒ 1
    [■,●,■,▲].fill(●) ⇒ [●,●,●,●]
    [■,●,■,▲].some(●→true) ⇒ true
    [■,●,■,▲].every(●→true) ⇒ false

    https://twitter.com/rauschma/status/1398668839177568259

    Немного визуализации для демонстрирования работы с массивами

    groser, 30 Мая 2021

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

    +1

    1. 1
    Приватный дневник-тред, который никто не прочтёт, чтобы писать сюда всякие секреты.

    Это место для тех, кто устал от публичности социальных сетей.
    Здесь можно взять любой логин, не указывая настоящего имени,
    вести свой дневник, закрыв его от части или всего виртуального
    мира. До 75% записей на сайте подзамочные — для избранных
    читателей. Можно писать в тред, который кроме вас вообще
    никто не прочтет.

    JloJle4Ka, 20 Июня 2023

    Комментарии (265)
  11. JavaScript / Говнокод #27998

    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
    function* map<T, R>(a: T[], f:(i: T) => R)
    {
    	for (const v of a) yield f(v);
    }
    
    function main()
    {
    	let count = 0;
    	for (const v of map([1, 2, 3], (i) => { count++; return i + 1; }))
    	{
    		print(v);
    	}
    
    	assert(count == 3);
    }

    а ты, а ты так можешь на своем говно-с++ компиляторе ваять?

    ASD_77, 07 Февраля 2022

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