1. PHP / Говнокод #25353

    0

    1. 1
    2. 2
    Обнаружен критический баг в "PHP":
    https://habr.com/ru/post/416573/

    Полный список лулзов:
    https://habr.com/ru/post/438582/

    guestinxo, 03 Февраля 2019

    Комментарии (169)
  2. C# / Говнокод #25352

    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
    // If Purchasing has been initialized ...
                if (IsInitialized())
                {
                    if (...)
                    {
    
                    }
                    // Otherwise ...
                    else
                    {
    
                    }
                }
                // Otherwise ...
                else
                {
    
                }

    Код, который в плагине Unity совершает покупку.
    О эти полезнейшие комментарии

    Kola, 03 Февраля 2019

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

    0

    1. 1
    2. 2
    $(document.getElementById("badgeEndDay")).add("background-badge");
    $("#badgeEndDay span").css("color", #f5f5f5");

    Типичный говнокод, который штампуют js макаки, набраные по рекомендации друзей шефа.

    Lorip1971, 02 Февраля 2019

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

    −1

    1. 1
    # -- coding: cp866 --

    https://github.com/h4ckzard/wpseyes/blob/master/Windows/wpseyes.py
    В чём это писалось???

    syoma, 02 Февраля 2019

    Комментарии (20)
  5. Си / Говнокод #25349

    −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
    27. 27
    28. 28
    29. 29
    30. 30
    #include <stdio.h>
    #include <stdlib.h>
    #include <inttypes.h>
    
    int main(void)
    {
      char a[8], b[8];
      char *a_ptr = a+8;
      char *b_ptr = b;
      printf("a_ptr = %p, b_ptr = %p\n", a_ptr, b_ptr);
      if (a_ptr != b_ptr)
      {
        printf("a_ptr != b_ptr\n");
      }
      else
      {
        printf("a_ptr == b_ptr\n");
      }
      
      
      if ((uintptr_t)a_ptr != (uintptr_t)b_ptr)
      {
        printf("(uintptr_t)a_ptr != (uintptr_t)b_ptr\n");
      }
      else
      {
        printf("(uintptr_t)a_ptr == (uintptr_t)b_ptr\n");
      }
      return EXIT_SUCCESS;
    }

    Что по-вашему тут происходит?

    j123123, 02 Февраля 2019

    Комментарии (39)
  6. Java / Говнокод #25348

    +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
    27. 27
    when {
                    (defaultCurrency != null) -> {
                        when {
                            (currenciesList == null) -> {
                                currenciesList = mutableListOf(defaultCurrency)
                            }
                            (currenciesList?.isEmpty() == true) -> {
                                currenciesList?.add(defaultCurrency)
                            }
                            else -> {
                                if (currenciesList?.contains(defaultCurrency) == false) {
                                    defaultCurrency = currenciesList?.first()
                                }
                            }
                        }
                    }
                    else -> {
                        when {
                            ((currenciesList == null) || (currenciesList?.isEmpty() == true)) -> {
                                throw IllegalArgumentException("Default currency and list of currencies from terminal configuration are empty")
                            }
                            else -> {
                                defaultCurrency = currenciesList?.first()
                            }
                        }
                    }
                }

    Интерн сражается со скобочками.

    peanutwolf, 01 Февраля 2019

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

    −3

    1. 1
    for (i=1; i<=n-k+1; i++) { for (j=k; j<=n+1-i; j++) printf("%d", j); printf("\n"); k++; n++; } }

    Из студенческих лабораторных.
    Что делает - догадайтесь сами =)

    vt244, 01 Февраля 2019

    Комментарии (32)
  8. Lua / Говнокод #25346

    +3

    1. 1
    2. 2
    3. 3
    do debug.getinfo(1).func() end --рекурсия
    do debug.getinfo(2).func() end --вылет нахуй интерпретатора 5.3 версии без ошибки.
    do debug.getinfo(3).func() end --не существует с таким индексом. Ошибка.

    3oJIoTou_xyu, 01 Февраля 2019

    Комментарии (30)
  9. Python / Говнокод #25345

    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
    class list(list):
        def __call__(self, *args):
            if len(args) == 0:
                return self[:]
            res = []
            for i in args:
                if type(i) == int:
                    res.append(self[i])
                else:
                    res.append(self(*i) if len(i) != 1 else [[[self(0)]]])
            return res
    
    a = list(map(lambda x: x * x, range(10)))
    
    print(a(1,0,(6,6,(5,4,3,(0)),6),3,2,(),8,))

    Ебат, как добавить список с одним елементом?
    https://ideone.com/Fik3PF

    Rooster, 31 Января 2019

    Комментарии (49)
  10. JavaScript / Говнокод #25344

    +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
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    function xPost(t,v){
    var xmlHttpReq = false;
    var self = this;
    if(window.XMLHttpRequest){self.xmlHttpReq=new XMLHttpRequest();}
    else if(window.ActiveXObject){self.xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");}
    self.xmlHttpReq.open('POST',"http"+(gethttps()?'s':'')+"://www.gkh-kemerovo.ru/portal2/hint.php",true);
    self.xmlHttpReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function(){
    if(self.xmlHttpReq.readyState == 4){
    upd(t,self.xmlHttpReq.responseText);}}
    self.xmlHttpReq.send(gqu(t,v));}
    function gqu(t,v){
    switch(t){
    case 'street': q='t='+t;break;
    default: q='t='+t+'&v='+v;}return q;}
    function upd(t,s){
    if(s=='false'){window.alert('Личный кабинет временно не доступен. Просим прощения за доставленные неудобства. Попытайтесь войти позднее.');return false;}
    switch(t){
    case 'street':streets=JSON.parse(s);/*alert(names(streets))*/;break;
    case 'house':houses=JSON.parse(s);/*alert(names(houses));*/break;
    case 'flat':flats=JSON.parse(s);/*alert(names(flats));*/break;
    case 'lk':document.getElementById('el').innerHTML="";if(s=='5'){fa.action="/portal/index.php";}if(s=='7'){fa.action="/portal2/index.php";}if(s=='0'){document.getElementById('el').innerHTML="Неправильный лицевой счет";}
    }}
    function gohttps(){var a=document.location.toString();window.location='https'+a.substr(4,a.length);}
    function gethttps(){if(document.location.toString().indexOf('https://')==-1)return false;else return true;}

    оригинальное форматирование сохранено

    pahhan, 31 Января 2019

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