1. Куча / Говнокод #27508

    +11

    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
    IT Оффтоп #100
                                    (
    
                                    )
                                   (o)
                                   ,|,
                                   |~\
                          o@@@@@@@@\ |@@@@@I@@r@
                     oo@@@@@@@@@@@@|`|@@@@@@@@@@@T@@ 
                 o@@@@@@@@@@@@@@@@@\ |@@@@@@@@@@@@@R@@@@o
               o@@@y@@@@@@@@@@@@@@@|`\@@@@@@@@@@@@@@K@@@@@o
              @@@@@@o@@@@@@@@@@@@@@\ |@@@@@@@@@@@@@@@a@@@@@@
              p@@@@@@@u@@@@@@@@@@@@@@@@@@@@@@@@@@@@F@@@@@@@q
              @@o@@@@@@@@t@@@@@@@@@@@@@@@@@@@@@@@j@@@@@@@o@@
              @:@@@o@@@@@@@@u@@@@@@@@@@@@@@@@@@l@@@@@@o@@::@
              ::@@::@@o@@@@@@@.@@b@e@@/@@Y@@6@@@@@@o@@:@@::@
              ::@@::@@@@::oo@@@@oo@@@@@ooo@@@@@o:::@@@::::::
              %::::::@::::::@@@@:::@@@:::::@@@@:::::@@:::::%
              %%::::::::::::@@::::::@:::::::@@::::::::::::%%
              ::%%%::::::::::@::::::::::::::@::::::::::%%%::
            .#::%::%%%%%%:::::::::::::::::::::::::%%%%%::%::#.
          .###::::::%%:::%:%%%%%%%%%%%%%%%%%%%%%:%:::%%:::::###.
        .#####::::::%:::::%%::::::%%%%:::::%%::::%::::::::::#####.
       .######`:::::::::::%:::::::%:::::::::%::::%:::::::::'######.
       .#########``::::::::::::::::::::::::::::::::::::''#########.
       `.#############```::::::::::::::::::::::::'''#############.'
        `.######################################################.'
          ` .###########,._.,,,. #######<_\##################. '
             ` .#######,;:      `,/____,__`\_____,_________,_____
                `  .###;;;`.   _,;>-,------,,--------,----------'
                    `  `,;' ~~~ ,'\######_/'#######  .  '
                        ''~`''''    -  .'/;  -    '

    #70: https://govnokod.ru/27097 https://govnokod.xyz/_27097
    #71: https://govnokod.ru/27115 https://govnokod.xyz/_27115
    #72: https://govnokod.ru/27120 https://govnokod.xyz/_27120
    #73: https://govnokod.ru/27136 https://govnokod.xyz/_27136
    #74: https://govnokod.ru/27160 https://govnokod.xyz/_27160
    #75: https://govnokod.ru/27166 https://govnokod.xyz/_27166
    #76: https://govnokod.ru/27168 https://govnokod.xyz/_27168
    #77: https://govnokod.ru/27186 https://govnokod.xyz/_27186
    #78: https://govnokod.ru/27219 https://govnokod.xyz/_27219
    #79: https://govnokod.ru/27254 https://govnokod.xyz/_27254
    #80: https://govnokod.ru/27270 https://govnokod.xyz/_27270
    #81: https://govnokod.ru/27280 https://govnokod.xyz/_27280
    #82: https://govnokod.ru/27284 https://govnokod.xyz/_27284
    #83: https://govnokod.ru/27296 https://govnokod.xyz/_27296
    #84: https://govnokod.ru/27336 https://govnokod.xyz/_27336
    #85: https://govnokod.ru/27381 https://govnokod.xyz/_27381
    #86: https://govnokod.ru/27405 https://govnokod.xyz/_27405
    #87: https://govnokod.ru/27429 https://govnokod.xyz/_27429
    #88: https://govnokod.ru/27432 https://govnokod.xyz/_27432
    #89: https://govnokod.ru/27435 https://govnokod.xyz/_27435
    #90: https://govnokod.ru/27439 https://govnokod.xyz/_27439
    #91: https://govnokod.ru/27449 https://govnokod.xyz/_27449
    #92: https://govnokod.ru/27460 https://govnokod.xyz/_27460
    #93: https://govnokod.ru/27463 https://govnokod.xyz/_27463
    #94: https://govnokod.ru/27466 https://govnokod.xyz/_27466
    #95: https://govnokod.ru/27473 https://govnokod.xyz/_27473
    #96: https://govnokod.ru/27478 https://govnokod.xyz/_27478
    #97: https://govnokod.ru/27484 https://govnokod.xyz/_27484
    #98: https://govnokod.ru/27495 https://govnokod.xyz/_27495
    #99: https://govnokod.ru/27504 https://govnokod.xyz/_27504

    nepeKamHblu_nemyx, 10 Июля 2021

    Комментарии (2692)
  2. Куча / Говнокод #27507

    +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
    24. 24
    import std.stdio;
    
    template GenMix()
    {
      const char[] GenMix = 
        "template GenMix2()" ~
        "{" ~
        "  const char[] GenMix2 = \"writeln(\\\"Hello, Wandbox!\\\");\";" ~
        "};";
    }
    
    template MixMix(string Name)
    {
      const char[] MixMix = "mixin(" ~ Name ~ "!());";
    }
    
    mixin(GenMix!());
    
    
    void main()
    {
      mixin(GenMix2!());
      mixin(MixMix!("GenMix2"));
    }

    https://wandbox.org/permlink/1HpjfgrgVLyBSrXG

    ГОМОИКОННОСТЬ в D

    j123123, 10 Июля 2021

    Комментарии (42)
  3. PHP / Говнокод #27506

    +3

    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
    $a != abs($a)
    $a+abs($a) == 0
    $a && !($a + abs($a))
    $n>>1 > $n
    substr_count($a,"-")
    is_nan(sqrt($number))
    is_nan(log($n))
    !array_shift(explode("-", $num))
    (int)$var === ~~(int)$var
    strlen(strval($num)) != strlen(strval(abs($num)))
    strlen(decbin($n)) == 32
    is_int(strpos(get_headers("http://habrahabr.ru/blogs/php/page$num/")[0], '404'));
    
    function lessThanZero ($num) {
        while (1) {
            if ($num++ == 0) {
                return true;
            }
        }
    }
    
    function is_value_between($value, $begin, $end) {
        return in_array($value, range($begin,$end));
    }

    "Как проверять отрицательное ли число ?
    В мануале в математических функциях не нашёл ."

    https://php.ru/forum/threads/kak-proverjat-otricatelnoe-li-chislo.8208/

    kezzyhko, 09 Июля 2021

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

    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
    class Animal {
        move(distanceInMeters = 0) {
            print(`Animal moved ${distanceInMeters}m.`);
        }
    }
    
    function main() {
        const dog = new Animal();
        dog.move(10);
    
        const dog2 = Animal();
        dog2.move(11);
    }

    Загадка дня... кто знает что первый вызов конструктора отличается от второго?

    ASD_77, 07 Июля 2021

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

    +3

    1. 1
    IT Оффтоп #99

    #69: https://govnokod.ru/27071 https://govnokod.xyz/_27071
    #70: https://govnokod.ru/27097 https://govnokod.xyz/_27097
    #71: https://govnokod.ru/27115 https://govnokod.xyz/_27115
    #72: https://govnokod.ru/27120 https://govnokod.xyz/_27120
    #73: https://govnokod.ru/27136 https://govnokod.xyz/_27136
    #74: https://govnokod.ru/27160 https://govnokod.xyz/_27160
    #75: https://govnokod.ru/27166 https://govnokod.xyz/_27166
    #76: https://govnokod.ru/27168 https://govnokod.xyz/_27168
    #77: https://govnokod.ru/27186 https://govnokod.xyz/_27186
    #78: https://govnokod.ru/27219 https://govnokod.xyz/_27219
    #79: https://govnokod.ru/27254 https://govnokod.xyz/_27254
    #80: https://govnokod.ru/27270 https://govnokod.xyz/_27270
    #81: https://govnokod.ru/27280 https://govnokod.xyz/_27280
    #82: https://govnokod.ru/27284 https://govnokod.xyz/_27284
    #83: https://govnokod.ru/27296 https://govnokod.xyz/_27296
    #84: https://govnokod.ru/27336 https://govnokod.xyz/_27336
    #85: https://govnokod.ru/27381 https://govnokod.xyz/_27381
    #86: https://govnokod.ru/27405 https://govnokod.xyz/_27405
    #87: https://govnokod.ru/27429 https://govnokod.xyz/_27429
    #88: https://govnokod.ru/27432 https://govnokod.xyz/_27432
    #89: https://govnokod.ru/27435 https://govnokod.xyz/_27435
    #90: https://govnokod.ru/27439 https://govnokod.xyz/_27439
    #91: https://govnokod.ru/27449 https://govnokod.xyz/_27449
    #92: https://govnokod.ru/27460 https://govnokod.xyz/_27460
    #93: https://govnokod.ru/27463 https://govnokod.xyz/_27463
    #94: https://govnokod.ru/27466 https://govnokod.xyz/_27466
    #95: https://govnokod.ru/27473 https://govnokod.xyz/_27473
    #96: https://govnokod.ru/27478 https://govnokod.xyz/_27478
    #97: https://govnokod.ru/27484 https://govnokod.xyz/_27484
    #98: https://govnokod.ru/27495 https://govnokod.xyz/_27495

    nepeKamHblu_nemyx, 07 Июля 2021

    Комментарии (2447)
  6. JavaScript / Говнокод #27503

    +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
    24. 24
    25. 25
    26. 26
    class C {
        _length: number;
    
        constructor() {
            this._length = 10;
        }
    
        get length() {
            return this._length;
        }
        set length(value: number) {
            this._length = value;
        }
    }
    
    function main() {
        const c = new C();
    
        print(c.length);
        c.length = 20;
        print(c.length);
    
        delete c;
    
        print("done.");
    }

    пока вы тут балаболили я тут наговнокодил "property" или "accessors"

    ASD_77, 07 Июля 2021

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    public function isBooted()
    {
        return true === $this->booted;
    }

    Дичь

    deenmluzsxbpg, 07 Июля 2021

    Комментарии (42)
  8. Куча / Говнокод #-27501

    0

    1. 1
    Пиздец-оффтоп #24

    #1: https://govnokod.ru/26503 https://govnokod.xyz/_26503
    #2: https://govnokod.ru/26541 https://govnokod.xyz/_26541
    #3: https://govnokod.ru/26583 https://govnokod.xyz/_26583
    #4: https://govnokod.ru/26689 https://govnokod.xyz/_26689
    #5: https://govnokod.ru/26784 https://govnokod.xyz/_26784
    #5: https://govnokod.ru/26839 https://govnokod.xyz/_26839
    #6: https://govnokod.ru/26986 https://govnokod.xyz/_26986
    #7: https://govnokod.ru/27007 https://govnokod.xyz/_27007
    #8: https://govnokod.ru/27023 https://govnokod.xyz/_27023
    #9: https://govnokod.ru/27098 https://govnokod.xyz/_27098
    #10: https://govnokod.ru/27125 https://govnokod.xyz/_27125
    #11: https://govnokod.ru/27129 https://govnokod.xyz/_27129
    #12: https://govnokod.ru/27184 https://govnokod.xyz/_27184
    #13: https://govnokod.ru/27286 https://govnokod.xyz/_27286
    #14: https://govnokod.ru/27298 https://govnokod.xyz/_27298
    #15: https://govnokod.ru/27322 https://govnokod.xyz/_27322
    #16: https://govnokod.ru/27328 https://govnokod.xyz/_27328
    #17: https://govnokod.ru/27346 https://govnokod.xyz/_27346
    #18: https://govnokod.ru/27374 https://govnokod.xyz/_27374
    #19: https://govnokod.ru/27468 https://govnokod.xyz/_27468
    #20: https://govnokod.ru/27469 https://govnokod.xyz/_27469
    #21: https://govnokod.ru/27479 https://govnokod.xyz/_27479
    #22: https://govnokod.ru/27485 https://govnokod.xyz/_27485
    #23: https://govnokod.ru/27493 https://govnokod.xyz/_27493

    nepeKamHblu_nemyx, 07 Июля 2021

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

    0

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

    #1: https://govnokod.ru/20162 https://govnokod.xyz/_20162
    #2: https://govnokod.ru/25329 https://govnokod.xyz/_25329
    #3: https://govnokod.ru/25415 https://govnokod.xyz/_25415
    #4: (vanished) https://govnokod.xyz/_25472
    #5: https://govnokod.ru/25693 https://govnokod.xyz/_25693
    #6: (vanished) https://govnokod.xyz/_26649
    #7: https://govnokod.ru/26672 https://govnokod.xyz/_26672
    #8: https://govnokod.ru/26924 https://govnokod.xyz/_26924
    #9: https://govnokod.ru/27072 https://govnokod.xyz/_27072
    #10: https://govnokod.ru/27086 https://govnokod.xyz/_27086
    #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: https://govnokod.ru/27282 https://govnokod.xyz/_27282
    #17: https://govnokod.ru/27319 https://govnokod.xyz/_27319
    #18: https://govnokod.ru/27380 https://govnokod.xyz/_27380

    nepeKamHblu_nemyx, 07 Июля 2021

    Комментарии (2054)
  10. Python / Говнокод #27499

    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
    import logging
    import requests
    from .. import loader, utils
    
    logger = logging.getLogger(__name__)
    
    def register(cb):
        cb(TagallMod())
    
    def chunks(lst, n):
        for i in range(0, len(lst), n):
            yield lst[i:i + n]
    
    class TagallMod(loader.Module):
    
        strings = {"name": "Tagall"}
    
        def __init__(self):
            self.config = loader.ModuleConfig("DEFAULT_MENTION_MESSAGE", "Привет", "Default message of mentions")
            self.name = self.strings["name"]
    
        async def client_ready(self, client, db):
            self.client = client
    
        async def tagallcmd(self, message):
            arg = utils.get_args_raw(message)
    
            logger.error(message)
            notifies = []
            async for user in self.client.iter_participants(message.to_id):
                notifies.append("<a href=\"tg://user?id="+ str(user.id) +"\">\u206c\u206f</a>")
            chunkss = list(chunks(notifies, 10))
            logger.error(chunkss)
            await message.delete()
            for chunk in chunkss:
                await self.client.send_message(message.to_id, (self.config["DEFAULT_MENTION_MESSAGE"] if not arg else arg) + '\u206c\u206f'.join(chunk))

    tars777, 06 Июля 2021

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