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

    В номинации:
    За время:
  2. Куча / Говнокод #25840

    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
    ███████                                                                                                                         
    ██   ██                                                                                                                         
    ██   ██                                                                                                                         
    ██   ██  █████     ████ ██   ██ ██████  █████  ██████  ████        ██   ██  █████       ██   ██ ██   ██ ██ █ ██ ██   ██  ████   
    ██   ██ ██   ██   ██ ██ ██   ██ █ ██ █ ██   ██ █ ██ █     ██       ██   ██ ██   ██      ██   ██ ██   ██ ██ █ ██ ██   ██     ██  
    ██   ██ ██   ██  ██  ██ ██  ███   ██   ██   ██   ██    █████       ██   ██ ██   ██      ██   ██ ██   ██  █ █ █  ██   ██  █████  
    ██   ██ ██   ██  ██  ██ ██ █ ██   ██   ██   ██   ██   ██  ██       ███████ ███████      ███████ ██   ██  █████  ███████ ██  ██  
    ██   ██ ██   ██  ██  ██ ███  ██   ██   ██   ██   ██   ██  ██       ██   ██ ██           ██   ██ ██   ██  █ █ █  ██   ██ ██  ██  
    ██   ██ ██   ██  ██  ██ ██   ██   ██   ██   ██   ██   ██  ██       ██   ██ ██   ██      ██   ██  ██████ ██ █ ██ ██   ██ ██  ██  
    ██   ██  █████  ███  ██ ██   ██  ████   █████   ████   ███ ██      ██   ██  █████       ██   ██      ██ ██ █ ██ ██   ██  ███ ██ 
                                                                                                         ██                         
                                                                                                    ██   ██                         
                                                                                                     █████

    Политота не нужна

    HomoSapiens, 15 Сентября 2019

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

    +1

    1. 1
    2. 2
    3. 3
    https://tass.ru/nacionalnye-proekty/6391295
    
    Томские ученые разработали первое в России программное обеспечение, независимое от Windows

    ШОК! Томские ученые открыли способ создавать программное обеспечение, независимое от Windows. Нужно всего лишь…

    j123123, 30 Апреля 2019

    Комментарии (44)
  4. Assembler / Говнокод #24779

    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
    .def temp = r16
    .def rr1 = r17
    .org 0
    Ldi r16, low(RAMEND)
    out SPL, temp
    Ldi r16 high(RANEND)
    out SPH, temp
    
    rjmp start
    start:
    ldi temp,255
    out DDRB, temp
    out PORTB,temp
    rcall delay
    Ldi temp,0x00
    out PORTB,temp
    Rcall delay
    rjmp start
    
    delay:
    ldi rr1, 0xFF
    Pdelay:
    Dec rr1
    brne Pdrlay
    ret

    Почему микроконтроллер не мигает лампочка?
    Но студия не ругается
    (Ассемблер АVR)

    Arduino, 17 Сентября 2018

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

    +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
    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
    /****************************************************************************
    **
    ** Copyright (C) 2015 The Qt Company Ltd.
    ** Contact: http://www.qt.io/licensing/
    **
    ** This file is part of the ActiveQt framework of the Qt Toolkit.
    **
    ** $QT_BEGIN_LICENSE:BSD$
    ** Commercial License Usage
    ** Licensees holding valid commercial Qt licenses may use this file in
    ** accordance with the commercial license agreement provided with the
    ** Software or, alternatively, in accordance with the terms contained in
    ** a written agreement between you and The Qt Company. For licensing terms
    ** and conditions see https://www.qt.io/terms-conditions. For further
    ** information use the contact form at https://www.qt.io/contact-us.
    **
    ** BSD License Usage
    ** Alternatively, you may use this file under the terms of the BSD license
    ** as follows:
    **
    ** "Redistribution and use in source and binary forms, with or without
    ** modification, are permitted provided that the following conditions are
    ** met:
    **   * Redistributions of source code must retain the above copyright
    **     notice, this list of conditions and the following disclaimer.
    **   * Redistributions in binary form must reproduce the above copyright
    **     notice, this list of conditions and the following disclaimer in
    **     the documentation and/or other materials provided with the
    **     distribution.
    **   * Neither the name of The Qt Company Ltd nor the names of its
    **     contributors may be used to endorse or promote products derived
    **     from this software without specific prior written permission.
    **
    **
    ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
    **
    ** $QT_END_LICENSE$
    **
    ****************************************************************************/

    Вот блин, почти в любом проекте в начале каждого файла такая вот куча . Я блядь открываю файл, чтобы посмотреть, что это, хотя бы одну строчку написали: этот класс занимается тем-то и тем-то, так нет, а вот всю эту бурду "ASS PISS" LSD LICENCE - пожалуйста.

    Steve_Brown, 15 Августа 2018

    Комментарии (44)
  6. Куча / Говнокод #24493

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    Здравствуйте.
    Многие из вас знают пользователя TarasB, который обитал на этом сайте.
    Кто знает какие-либо рабочие контакты, чтобы можно было с ним связаться?
    А то на мыло не отвечает. Может на каких-то ещё форумах он доступен?

    Potap, 13 Июля 2018

    Комментарии (44)
  7. Си / Говнокод #24361

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    LRESULT WINAPI DefWindowProc(
      _In_ HWND   hWnd,
      _In_ UINT   Msg,
      _In_ WPARAM wParam,
      _In_ LPARAM lParam
    );

    CrashTesteAnusov, 06 Июня 2018

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

    +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
    bool almostIncreasingSequence(std::vector<int> sq) {
        bool b2 = true; 
        int s = sq.size(); 
        if (s > 2) {                                           // Последовательность меньше трех чисел дает истину.                          
            int i = 1;                                         // Проверка начинается со второго элемента.                                             
            int x = -1;                                      // Для записи индекса элемента <= предыдущего, а еще "флаг".           
            while ((b2) && (i < s)) {              // При нахождении 2-го лишнего происходит выход из цикла.                                 
                if (x != -1) {                               // Проверка "флага".                                                                                             
                    if (sq[i] <= sq[i - 1]){           // Сравнение с предыдущим элементом.                                                             
                        b2 = false;                        // Если условие истинно, то это уже второй элемент,                                
                    }                                             // "конфликтующий" с предыдущим, следовательно, выход и "ложь".
                    if ((sq[i] <= sq[x - 1]) && (x != 1) && (sq[i - 1] <= sq[x - 2])) {  // над этим условием я думал слишком долго
                        b2 = false;                       // Если элемент был "убран", индекс конфликтного                                   
                    }                                            // элемента записан в "x".                                                                                   
                }     
                else {                                        // Если условие ложно, то записываем индекс элемента, который
                        if (sq[i] <= sq[i - 1]) {     // "конфликтует" с предыдущим.
                            x = i;                             // Нам не известно лишний он или нет.
                        } 
                    }
                i++;
                }
            }
          return b2;
    }

    проверяет, можно ли убрать только один элемент из последовательности, чтобы она стала постоянно возрастающей.

    noserdan, 28 Марта 2018

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

    +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
    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
    #define __DEBUG
    #ifdef __DEBUG
        #define print_pair(p) do{std::cout << "(" << ((p).first + 1) << ", "\
                                << ((p).second + 1) << ")" << std::endl;}while(0);
    #endif
    
    Graph::result
    Graph::dijkstra (int start)
    {
    #ifdef __DEBUG
        std::cout << "Dijkstra algorithm tracing:" << std::endl;
    #endif
        distances[start] = 0;
        std::set<std::pair<int, int>> q;
        q.insert (std::make_pair(distances[start], start));
        while (!q.empty())
        {
    #ifdef __DEBUG
            std::cout << "top element of a set: ";
            print_pair(*q.begin());
    #endif
            int current = q.begin()->second;
            q.erase(q.begin());
            for (int i = 0; i < adj[current].size(); ++i)
            {
    #ifdef __DEBUG
        std::cout << "current vertex: " << (current + 1);
        std::cout << " ad current state of distances array is: " << std::endl;
        for (auto i: distances)
            std::cout << i << " ";
        std::cout << std::endl;
    #endif
                int to = adj[current][i].second;
                int length = adj[current][i].first;
                // Relaxations
                if (distances[to] > distances[current] + length)
                {
    #ifdef __DEBUG
        std::cout << "relaxation for edge (" << current << ", " << to << ") ";
        std::cout << "with weight " << length << std::endl;
    #endif
                    
                    q.erase(std::make_pair(distances[to], to));
                    distances[to] = distances[current] + length;
                    path[to] = current;
                    q.insert(std::make_pair(distances[to], to));
                }
            }
        }
        // Replace INF by -1
        std::replace (distances.begin(), distances.end(), INF, -1);
        return distances;
    }

    Я у мамы решил подебажить как мыщъх дебажил при помощи отладочной печати. Вот что получилось.

    HiewMorjowie, 18 Июля 2016

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

    +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
    25. 25
    26. 26
    27. 27
    28. 28
    std::string sql = "INSERT INTO digest_test_record (set_id, ref_digest, cand_digest, vdt_cfg_warn, digest_cfg_warn, "
        "ref_duration, ref_cardinality, ref_dispersion, "
        "cand_duration, cand_cardinality, cand_dispersion, "
        "cardinality, difference, red_difference, ext_difference, "
        "inv_cardinality, inv_difference, inv_red_difference, inv_ext_difference,
        "timing, lib_version) SELECT 0, "
        "ROW($1, $2, $3, $4, $5, $6, $7, $8)::digest_info, "
        "ROW($9, $10, $11, $12, $13, $14, $15, $16)::digest_info,"
        "$17, $18, ",
        "$19, $20, $21, "
        "$22, $23, $24, "
        "$25, $26, $27, $28, "
        "$29, $30, $31, $32, "
        "$33, ROW($34, $35, $36, make_date($37, $38, $39), $40)::lib_version_info";
    
        cn.prepare("insert", sql);
    
        xact.prepared("insert")
        (ref_digest_info.src_width)(ref_digest_info.src_height)(ref_digest_info.src_fps)(ref_digest_info.src_duration)
            (ref_digest_info.vdt_duration)(ref_digest_info.cardinality)(ref_digest_info.has_flags)(ref_digest_info.src_filename)
        (cand_digest_info.src_width)(cand_digest_info.src_height)(cand_digest_info.src_fps)(cand_digest_info.src_duration)
            (cand_digest_info.vdt_duration)(cand_digest_info.cardinality)(cand_digest_info.has_flags)(cand_digest_info.src_filename)
        (results.vdt_cfg_warn)(results.digest_cfg_warn)
        (results.ref_duration)(results.ref_cardinality)(results.ref_dispersion)
        (results.cand_duration)(results.cand_cardinality)(results.cand_dispersion)
        (results.cardinality)(results.difference)(results.red_difference)(results.ext_difference)
        (results.inv_cardinality)(results.inv_difference)(results.inv_red_difference)(results.inv_ext_difference)
        ((double)timing / CLOCKS_PER_SEC)(li.main_ver)(li.sub_ver)(li.revision)(li.year)(li.month)(li.day)(li.platform).exec();

    Мои глаза.... Яркий пример использования нативного pqxx

    leon_mz, 01 Марта 2016

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

    +3

    1. 1
    2. 2
    3. 3
    4. 4
    const int size = 100000;
    const int maxVal = 1e9;
    for(int i = 0; i < n; i++)
        values[i] = rand() % (maxVal + 1);

    Код работает на вин32

    3_dar, 25 Октября 2015

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