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

    +4

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    while($r=mysql_fetch_array($q)){
      $buf[$r['id']]['image_file']=$r['file'];
      $r=null;
      $r['id']=null;
    }
    return $buf;

    StTv, 14 Июня 2016

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

    −98

    1. 1
    2. 2
    3. 3
    4. 4
    К стандартным добавили реквизиты
    ИНН2
    КПП2
    записали туда тоже самое что и ИНН и КПП

    helperapple, 14 Июня 2016

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

    +5

    1. 1
    2. 2
    3. 3
    4. 4
    //If the array is not empty
      if ($files[0] != '') {
        ...
      }

    http://valentinvannay.com/2016/01/07/laravel-5-multiple-files-upload

    binsh, 14 Июня 2016

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

    +4

    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
    public bool IsNormal() {
    	return Type == TypeOfWord.Normal;
    }
    
    public bool IsNumber() {
    	return Type == TypeOfWord.Number;
    }
    
    public bool IsOperator() {
    	return Type == TypeOfWord.Operator;
    }
    		
    public bool IsBracket() {
    	return Type == TypeOfWord.Bracket;
    }
    
    public bool IsSymbol() {
    	return IsOperator() || IsBracket();
    }
    
    public bool IsSpace() {
    	return Type == TypeOfWord.Space;
    }
    
    public bool IsComment() {
    	return Type == TypeOfWord.Comment;
    }
    
    public bool IsExcess() {
    	return IsComment() || IsSpace();
    }
    
    public bool IsQuotedText() {
    	return Type == TypeOfWord.QuotedText;
    }
    
    public bool IsQuotedChar() {
    	return Type == TypeOfWord.QuotedChar;
    }
    
    public bool IsQuotedTextOrChar() {
    	return IsQuotedText() || IsQuotedChar();
    }
    
    public bool IsUnknown() {
    	return Type == TypeOfWord.Unknown;
    }

    dm_fomenok, 13 Июня 2016

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

    +14

    1. 1
    2. 2
    3. 3
    Note: If your <username> starts with the "u" or "x" character, change
    C:\MSys\1.0\home\<username>\config.h and double all backslashes
    in VLC_COMPILED_BY constant.

    Из гайда по сборке VLC.

    bormand, 13 Июня 2016

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

    +10

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    final public function getCustomerKey()
        {
            return implode('', array_map('c'.'h'
                .'r', explode('.', '53.51.50.52.49.51.50.50.49.51.102.100.50.57.55.54.101.54.56.51.51.57.102.55.53.102.49.57.100.54.49.98.51.51.49.56.99.53.57.48.57.49')
            ));
        }

    Tim_Walker, 13 Июня 2016

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

    +7

    1. 1
    Вопрос по говнокодику.

    Не работает [blink], копнул учебник html, а там написано мол не все браузеры поддерживают. И что теперь делать?

    dm_fomenok, 12 Июня 2016

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

    +8

    1. 1
    https://github.com/mpak2/mpak.su/blob/master/include/mpfunc.php#L54

    Новая система измерения файлов

    dm_fomenok, 12 Июня 2016

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

    +5

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    $number_of_posts = 1;
    $page_id = $_GET['page'];
    $all_posts_query = "SELECT * FROM `posts` WHERE status = 'publish'";
    $all_posts_run = mysqli_query($con, $all_posts_query);
    $all_posts = mysqli_num_rows($all_posts_run);
    $total_pages = ceil($all_posts / $number_of_posts);
    $posts_start_from = ($page_id - 1) * $number_of_posts;
    
    $query = "SELECT * FROM `posts` WHERE `status` = 'publish' ORDER BY id DESC LIMIT $posts_start_from, $number_of_posts";

    Задача: сделать паджинацию, выжрав максимум ресурсов сервера :))
    Сверхзадача: реализовать выборку по id с помощью LIMIT'а

    DDDeeper, 11 Июня 2016

    Комментарии (11)
  10. C++ / Говнокод #20176

    +2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    connector* getConnector( int id )
    {
        autolock_read<lock_rw_t> alr( _lock );
        return _getConnector(id);
    }

    П-потокобезопасность

    govnokoderatata, 10 Июня 2016

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