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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    Whether or not you check in your Pods folder is up to you, as workflows vary from project to project. We recommend that you keep the Pods directory under source control, and don't add it to your .gitignore
    
    Benefits of checking in the Pods directory
    
        After cloning the repo, the project can immediately build and run, even without having CocoaPods installed on the machine. There is no need to run pod install, and no Internet connection is necessary.
        The Pod artifacts (code/libraries) are always available, even if the source of a Pod (e.g. GitHub) were to go down.
        The Pod artifacts are guaranteed to be identical to those in the original installation after cloning the repo.

    https://guides.cocoapods.org/using/using-cocoapods.html

    Desktop, 25 Февраля 2018

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

    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
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    let src1 = r#"
            __kernel void add1(__global float* A, __global float* BBB, __global float* B, int m, int n) 
            {
                __local float Blo[64];
                int x = get_local_id(0);
                int y = get_local_id(1);
                int i = get_global_id(0);
                int j = get_global_id(1);
                int k = get_global_id(2);
                i += k / 8;
                j += k % 8;
    
                if (i >= n || j >= m) return;
    
    
                Blo[x * 8 + y] = A[i * m + j];
    
    
    
    
                barrier(CLK_LOCAL_MEM_FENCE);
    
                float BB = 0;
    
                for (int xx = 0; xx < 8; ++xx)
                    for (int yy = 0; yy < 8; ++yy)
                    {
        
                            float c = (2 * xx + 1) * x * 3.1415926535 / 16;
                            float cc = (2 * yy + 1) * y * 3.1415926535 / 16;
                            c = cos(c);
                            cc = cos(cc);
                            BB += Blo[xx * 8 + yy] * c * cc;
    
                    }
    
                float Ci, Cj;
                if (x == 0)
                    Ci = 1 / 1.4142135623;
                else
                    Ci = 1;
    
                if (y == 0)
                    Cj = 1 / 1.4142135623;
                else
                    Cj = 1;
                B[k * m * n + i * m + j] = Ci * Cj / 4 * BB;
    
                barrier(CLK_LOCAL_MEM_FENCE);
    
                i = get_global_id(0);
                j = get_global_id(1);
    
                float summ = 0;
                for (int ii = 0; ii < 64; ++ii)
                    summ += B[ii * m * n + i * m + j];
                BBB[i * m + j] = summ / 64;
                
            }
        "#;
    
    
    let pro_que = ProQue::builder().src(src1).dims((hi, wi, 64)).build().unwrap();
    
    
       let matr11 = Buffer::builder()
            .queue(pro_que.queue().clone())
            .flags(MemFlags::new().read_only().use_host_ptr())
            .dims((hi, wi))
            .host_data(&Resr)
            .build().unwrap();
    
            let matg11 = Buffer::builder()
            .queue(pro_que.queue().clone())
            .flags(MemFlags::new().read_only().use_host_ptr())
            .dims((hi, wi))
            .host_data(&Resg)
            .build().unwrap();
    
    ...
    
        let mut kernel;
        {
                let wi = wi as i32;
                let hi = hi as i32;
                kernel = pro_que.create_kernel("add1").unwrap().arg_buf(&matr11).arg_buf(&resr11).arg_buf(&bor1).arg_scl(wi).arg_scl(hi);
                kernel.lws((8, 8)).enq().unwrap();
                kernel = pro_que.create_kernel("add1").unwrap().arg_buf(&matg11).arg_buf(&resg11).arg_buf(&bog1).arg_scl(wi).arg_scl(hi);
                kernel.lws((8, 8)).enq().unwrap();
                kernel = pro_que.create_kernel("add1").unwrap().arg_buf(&matb11).arg_buf(&resb11).arg_buf(&bob1).arg_scl(wi).arg_scl(hi);
                kernel.lws((8, 8)).enq().unwrap();
        }

    Ничего особенного, лаба по opencl, написанная на Rustе

    gorthauer87, 24 Февраля 2018

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

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    https://github.com/wiistriker/govnokod_legacy
    
    Вот почему всё через жопу?
    Почему, блядь, я просто не могу положить проект в htdocs, и чтобы всё заработало?
    
    Что это за поебень, кто-то в курсе?
    mzz не может быть запущен по причине:
    Directory "" is not readable
    Directory "/templates_c" is not readable
    Directory "" is not writable
    Directory "/templates_c" is not writable

    inho, 23 Февраля 2018

    Комментарии (559)
  4. PHP / Говнокод #23814

    +1

    1. 1
    2. 2
    3. 3
    if (count($this->session->userdata('search_data') > 0)) {
    ...
    }

    Видимо, это "проверка", что массив не пустой

    gorsash, 22 Февраля 2018

    Комментарии (0)
  5. C# / Говнокод #23813

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    while(true) 
    {
        i++;
        if (i > Int32.MaxValue - 10)
        {
            MessageBox.Show("Зациклилось!");
            break;
        }
    }

    mazhuravlev, 22 Февраля 2018

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    $female = $image->getOwner();
    if ($female->isMale()) {
        return true;
    }

    из дейтинг проекта

    chizdrel, 21 Февраля 2018

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

    0

    1. 1
    2. 2
    3D-движок, написанный на формулах MS Excel
    https://habrahabr.ru/post/348704/

    inho, 20 Февраля 2018

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

    0

    1. 1
    return f() <= x->size() ? true:false;

    Классика?

    syoma, 20 Февраля 2018

    Комментарии (67)
  9. C++ / Говнокод #23801

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    // Read option name (can contain spaces)
         while (is >> token && token != "value")
    -        name += string(" ", name.empty() ? 0 : 1) + token;
    +        name += (name.empty() ? "" : " ") + token;

    terminate called after throwing an instance of 'std::length_error'
    what(): basic_string::_M_create


    Replacing string(" ", name.empty() ? 0 : 1) with (name.empty() ? "" : " ") and the same in the while() loop for value fixes the problem (for me).

    Does anyone know if "string(" ", 0)" is invalid C++ ?

    Кресты такие кресты.

    3.14159265, 18 Февраля 2018

    Комментарии (17)
  10. PHP / Говнокод #23799

    0

    1. 1
    php.net/manual/ru/book.runkit.php

    Век живи, век удивляйся PHP

    dm_fomenok, 17 Февраля 2018

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