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

    В номинации:
    За время:
  2. Си / Говнокод #23143

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    #include <stdio.h>;
    
    void check(int x, int y) {
      if (2*x == y && y < 0 && 0 <= 2*x) {
        puts("Impossible!");
      }
    }
    
    int main() {
      check(0x7F80007F, 0xFF0000FE);
    }

    https://runtimeverification.com/blog/?p=257
    When writing code for a specific compiler you can rely on the implementation-specified behavior, but signed overflow is still problematic. GCC promises that conversions between integer types will be reduced modulo the appropriate power of two when the value is not representable in the target type. This means that with GCC the conversion above will initialize var to -0x112234 on any architecture that GCC supports. However, only initialization and other conversions are safe. GCC still considers signed overflow in arithmetic as undefined behavior, and optimizes under the assumption that there will be no overflow. This can lead to apparently impossible results when signed values do overflow. Compiled with -O3, this program prints “Impossible!”.

    By adding apparently-redundant casts to 2*x to give (int)(2*(unsigned int)x), the calculation becomes implementation-specified behavior from an out-of-range conversion instead of undefined behavior. While this code may not be portable between compilers, GCC now guarantees the “impossible” code will not be executed even with -O3.

    j123123, 20 Июня 2017

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

    −1

    1. 1
    ($prepayment ? 'Предо' : 'О') . 'плата счета №'

    Когда DRY возведен в абсолют

    _dk, 06 Июня 2017

    Комментарии (2)
  4. Java / Говнокод #23105

    −1

    1. 1
    2. 2
    3. 3
    DBHelper dbHelper = DBConnect.getIntance().getDBHelper();
    DBConnect.getIntance().addCycleReport(reportObj,dbHelper);
    dbHelper.close();

    Коллега попросил помочь с дебагом

    diver92, 06 Июня 2017

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

    −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
    $(document).ready(function() {
    	
    	$('.tab').click(function(){
    
    	    var tabs = $(this).closest('.tabs');
    
    	    // Удаляем классы active
    	    $(this).siblings().removeClass('active');
    	    tabs.children('.tabs-content').children('.tabs-content-item').removeClass('active');
    
    	    // Добавляем классы active
    	    $(this).addClass('active');
    	    tabs.children('.tabs-content').children('.tabs-content-item').eq($(this).index()).addClass('active');
    	})
    	
    });

    Вот пример:
    https://codepen.io/ShvedOFF/pen/weBgrQ

    Как более грамотно оформить данный код?
    Все отлично работает, но выглядит коряво.

    Shved, 05 Июня 2017

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

    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
    body{
    	background: gray;
    	text-align: center;
    }
    #serials{
    	text-align: center;
    }
    #search{
    	font-weight: bold;
    	border-radius: 0px 20px 20px 0px;
    }
    #search:hover{
    	color: white;
    }	
    input{
    	border-radius: 20px 0px 0px 20px;
    	text-align: center;
    }
    input, #search{
    	border: grey;
    	background: #9e9e9e !important;
    	font-size: 20px;
    	padding: 10px 20px 10px 10px;
    	outline: none;
    	color: white;
    }

    tiarait, 02 Июня 2017

    Комментарии (2)
  7. SQL / Говнокод #23091

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    cTemp := trim(to_char(xxx.VALUE, '999999.90'));
    if substr(cTemp, 1, 1) = '.' then
      sText := '0'||cTemp;
    else
      sText := cTemp;
    end if;

    PL/SQL, я блять выучил маски!

    ColvirBydlokod, 31 Мая 2017

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

    −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
    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
    VTJGc2RHVmtYMTl0MlNMU1dWMUFpcjEyaHZUVTNqWVluaVVmTFFIR1ExQ1VVd3lBZUJnSkdvdE5S
    MGwxdUxSZApGaDk2YjV4S0FsSzc5MmpGYk45OW9SUTk4V3JpSFhsY3E0a1lWQnVQdU82a2VYL2dQ
    Wkt1TWlpeVdpL29mYmJZCmxZN2lUSVA3TmwyY3BGMlFaY0dTY0Y1cmVqQU9JSmNnNUZYNEJhc2xS
    NVdJaUtBN0lIV0lxazkvUGl6UHJ6cVgKMkVHN0EwSUR3TGNpL0xiL1BPTWVycWQvcHVhQytTY1c1
    T3Q2OXJzQlZjbnordWJCRDVEckN0ZWZJZGdvUCtVSgpaODI1Mk0vMlA1MW5CV0xQR3lObm5qTFkz
    YUw2Y0taWWI0STI3ZFMxQzROUDYvZ3dRVU8rRDVua0xHMHQ3TXp4CmZ2S0lUeXV2anJmK0txYTRz
    R1pDZGI4RExWbi84SDVMWGFFUnhjVjZPWW1EOEVEZzRUOWVKNFB2M1F3b0d3L2UKVzlMVmdwYVB1
    eS9mNzRmbFh1NHAvejNRa09XRVJTVmdRUHd1cS9OODREK0ErSEEyU1ByVzFCM2RyeVBwc3MzOQo2
    UFBDcmdJV1czWDVOaXdBL3JDVXVZaW03YjZIUmlNbEhCaW5VeG9KTVIxU09rVytMRGZKSTE3aS8v
    U1ppM2ZSCmM1T0xVdy9ZN1ZIL2NOWURyWU9NQW5DVG96eXEyNGZOa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3JnTjVT
    SzUrNnIyWDdXU2Q1VEFjdnJTWVVING1Fdmh1MnpuY3NVdmYreERDU2dBcDFnZFlvcnFjWE1PbUoK
    RVdQRmw4N3ljcGEvMHlHZUg2Qk5EVXFvVGFiTktydUNKUVVtU0hJM3E0NVA0MlR6Uy9GeHhIZVJE
    a3hEZ2lSNAp2cTNDcW9TNXY1OGIwcG1VcW5JK2w3Z21oWkFYTFNNZUhkTktSMXRqRHNxcm9oYlc2
    NUhZeG0rTXpSOEpUK1ZLCll4UHB6eVRRbEdIVmRUcmFGZUFZYnhsMDQrQU1KVUNuMVRnVWcyY2ps
    ZDE1cisvK3VCV0U1S3dWZWYvaVI2YmUKREFqSFdWZ2k2eDBNNUJzclNkS2JBdjA2bjVHZ3VPOUcx
    dG9HTVhBZ1VvU1VKTVBCWnIzOVV4elFnSnpOUW15cgpYd3k2M2x3Tm5PMUoxSXR4TGFVTUlvSUFp
    bkwwOXZVYmxOLy91SmY1YjVNTUhrdGxiamlYMlVNWjNxYmZoZzF0CkNiUWk2WjcwbUVwUmZIUjdB
    RVV2N0JpdVVMMHJZci84S0xyUitURXBBL3M0cGpvN01jTnF6bWxKakxtUnpuSWcKNzlPUWVJY0wz
    dE9xUDZXbVdnRE0wTWM0bWJ1UFQrZldEVnl2WlJERDJJZnhNUHcvK25DN2FXdnpUbllwaUFBdgp0
    TFhWTUdoNWt3azFaaU01SG5OL1QrYjdnMHNzcUdjTlp0d1pzNnRPMEZ4empOdWtvcGRKM0p0ajhu
    ZkRNUDB2CkVqdEJhTFMxUTB5SFozS1g2d3FicmlDNHk1ZTFrMGJyd3dXOFdZK1hwb3NGajJ6MUdE
    dy9kUzJLVlAzV3V2S24Ka1g3WFgxM2VTejlOMXovVWVYOGNtb05tV3lkSFRObndnRmVBbWI1aFMv

    Lis, 30 Мая 2017

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

    −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
    GUI.backgroundColor = Color.magenta;
    
                prop = parametersObject.GetIterator();
                var skip = true;
    
                while (prop.NextVisible(true))
                {
                    //Script object Field
                    if (skip)
                    {
                        skip = false;
                        continue;
                    }
    
                    if (prop.depth == 0)
                    {
                        position.height = propertyHeight;
                        EditorGUI.PropertyField(position, prop);
                        position.y += propertyWithSpaceHeight;
                    }
                }
    
                if (EditorGUI.EndChangeCheck())
                {
                    if (parametersObject != null && parametersObject.targetObject != null)
                    {
                        parametersObject.ApplyModifiedProperties();
                        EditorUtility.SetDirty(parametersObject.targetObject);
                    }
                }
    
                parametersProperty.stringValue = JsonUtility.ToJson(parametersObject.targetObject);
    
                GUI.backgroundColor = Color.white;

    //Код исполняется 60 раз в секунду ((((

    huran438, 28 Мая 2017

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

    0

    1. 001
    2. 002
    3. 003
    4. 004
    5. 005
    6. 006
    7. 007
    8. 008
    9. 009
    10. 010
    11. 011
    12. 012
    13. 013
    14. 014
    15. 015
    16. 016
    17. 017
    18. 018
    19. 019
    20. 020
    21. 021
    22. 022
    23. 023
    24. 024
    25. 025
    26. 026
    27. 027
    28. 028
    29. 029
    30. 030
    31. 031
    32. 032
    33. 033
    34. 034
    35. 035
    36. 036
    37. 037
    38. 038
    39. 039
    40. 040
    41. 041
    42. 042
    43. 043
    44. 044
    45. 045
    46. 046
    47. 047
    48. 048
    49. 049
    50. 050
    51. 051
    52. 052
    53. 053
    54. 054
    55. 055
    56. 056
    57. 057
    58. 058
    59. 059
    60. 060
    61. 061
    62. 062
    63. 063
    64. 064
    65. 065
    66. 066
    67. 067
    68. 068
    69. 069
    70. 070
    71. 071
    72. 072
    73. 073
    74. 074
    75. 075
    76. 076
    77. 077
    78. 078
    79. 079
    80. 080
    81. 081
    82. 082
    83. 083
    84. 084
    85. 085
    86. 086
    87. 087
    88. 088
    89. 089
    90. 090
    91. 091
    92. 092
    93. 093
    94. 094
    95. 095
    96. 096
    97. 097
    98. 098
    99. 099
    100. 100
    class Stream(object):
        def __init__(self, generator):
            object.__init__(self)
            self.data = ''
            self.generator = generator
            self.closed = False
            
            generator.subscribe(self)
            
        def update(self, data):
            self.data += data
            
        def read(self):
            if self.closed: return None
            data = self.data
            self.data = ''
            return data
            
        def close(self):
            self.generator.unsubscribe(self)
            self.closed = True
            self.data = ''
    
    class Server(dispatcher, dict):
        writable = lambda x: False
        
        def __init__(self, host = None, port = 0xB00B):
            dispatcher.__init__(self)
            
            self.create_socket(AF_INET, SOCK_STREAM)
            dict.__init__(self, {self.fileno(): self})
            
            self.set_reuse_addr()
            self.bind((host, port))
            self.listen(0xA)
            
            self.dataSource = PiGenerator()
            
        def removeClient(self, client):
            del self[client.fileno()]
            
        def handle_accept(self):
            sock, (host, port) = self.accept()
            print 'new client from %s:%d' % (host, port)
            
            stream = Stream(self.dataSource)        
            self[sock.fileno()] = Client(sock, self, stream)
            
        def handle_error(self):
            print 'Server error: %s' % sys.exc_value
            sys.exit(1)
        
    class Client(dispatcher):
        readable = lambda x: False    
        
        def __init__(self, sock, server, stream):
            dispatcher.__init__(self, sock)
            self.server = server
            self.stream = stream
            self.buffer = ''
            
        def handle_error(self):
            print 'Client error: %s' % sys.exc_value
            import traceback
            print traceback.format_exc(1000)
            sys.exit(1)        
            
        def handle_write(self):                
            sent = self.send(self.buffer)
            self.buffer = self.buffer[sent:]
            
        def handle_expt(self):
            print 'client dropped connection'        
            self.close()
            
        def close(self):
            self.server.removeClient(self)
            self.stream.close()
            self.buffer = ''
            dispatcher.close(self)
            
        def writable(self):
            data = self.stream.read()
            if data == None:
                print 'client finished reading'
                self.close()
                return False
            
            self.buffer += data
            return len(self.buffer) > 0
    
    def main():
        try:
            asyncore.loop(0.1, True, Server('127.0.0.1'))
        except KeyboardInterrupt:
            print '\nBye :-*'
            sys.exit(0)
    
    if __name__ == '__main__':
        main()

    start http://govnokod.ru/23059

    Lis, 23 Мая 2017

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

    −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
    if (this.btn1.Content.ToString() == this.currentSide.ToString() && this.btn2.Content.ToString() == this.currentSide.ToString() && this.btn3.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn4.Content.ToString() == this.currentSide.ToString() && this.btn5.Content.ToString() == this.currentSide.ToString() && this.btn6.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn7.Content.ToString() == this.currentSide.ToString() && this.btn8.Content.ToString() == this.currentSide.ToString() && this.btn9.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn1.Content.ToString() == this.currentSide.ToString() && this.btn4.Content.ToString() == this.currentSide.ToString() && this.btn7.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn2.Content.ToString() == this.currentSide.ToString() && this.btn5.Content.ToString() == this.currentSide.ToString() && this.btn8.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn3.Content.ToString() == this.currentSide.ToString() && this.btn6.Content.ToString() == this.currentSide.ToString() && this.btn9.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn1.Content.ToString() == this.currentSide.ToString() && this.btn5.Content.ToString() == this.currentSide.ToString() && this.btn9.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn3.Content.ToString() == this.currentSide.ToString() && this.btn5.Content.ToString() == this.currentSide.ToString() && this.btn7.Content.ToString() == this.currentSide.ToString())
    this.Victory();

    Проверка на победу в крестиках-ноликах.

    fedor-analplay, 22 Мая 2017

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