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

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

    −1

    1. 1
    2. 2
    3. 3
    Вас заметили 
    
    капча pa9e

    Part of the challenge of programming (and for some people, the reason why programming is fun in the first place) is looking at the building blocks provided to you and deciding how to assemble them to build something new. After all, if everything you wanted a program to do already existed ready-made, it wouldn't be called programming any more. It would be called shopping.

    >> Is there an API or a quick way to find out which window the mouse is in?

    I replied, "The LEGO Group does not make a piece for every possible object. Sometimes you just have to take two LEGO blocks and click them together. Here are some interesting blocks: GetCursorPos, WindowFromPoint."

    >> Thanks for your reply. But WindowFromPoint gives me the window of the object at the location of the cursor. But I'm looking for the top level window containing the cursor.

    Fine, then use a different block.

    I wonder how it is these people manage to write programs at all. I get the impression they write code by asking a million tiny questions and cutting and pasting together all the replies.

    No wait, pasting together the replies counts as snapping blocks together. Maybe they just ask for completed programs.

    kak, 12 Марта 2020

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

    0

    1. 1
    let randomHexColor = (g = () => (a => (a < 16 ? '0' : '') + a.toString(16))(~~(Math.random() * 255)))() + g() + g();

    fuckyounoob, 09 Февраля 2020

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

    0

    1. 1
    Ворециометр зашкаливает

    Охладите трахание.
    Как будто вернулся в 2015, когда не понимал о чём тут пишут.

    3_dar, 22 Января 2020

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

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    сука блядь ебучий фрорнтенд блядь гори сука в аду, JS, HTML, CSS и прочая хуета, это ебаное исчадь ада
    еuо создали настоящие мрази, ебучие серийные программисты, сколько жизней уже отобрала эта хуйня?
    ПРЕДСТАВЬТЕ ПРОСТО СКОЛЬКО ЛЮДЕЙ В СУММЕ ПОТРАТИЛИ ВРЕМЕНИ НА ОТЛАДКУ ВСЕЙ ЭТО КРИВОЙ ХУЕТЫ
    КОТОРАЯ БЫЛА СОЗДАНА C ОДНОЙ ЕБАНОЙ ЦЕЛЬЮ -- ДЛЯ ТОГО ЧТОБЫ УБИВАТЬ ЛЮДЕЙ, ДЕТЕЙ НА ДОНБАССЕ СУКА, ГИБНУТ!!!

    МОЙ АНУС МИРОТОЧИК ПЫЛЬЮ ГАЛАКТИК ДОСТИГНУВШИХ КОЛЛАПСА

    JS-PIDORAW, 20 Января 2020

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

    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
    public static long NextTimestamp()
    {
    	if (initTimestamp == null)
    	{
    		lock (syncRoot)
    		{
    			if (initTimestamp == null)
    			{
    				initTimestamp = false;
    				var sessionProvider = Locator.GetServiceNotNull<ISessionProvider>();
    				TimestampService.GetTimestamp();
    				sessionProvider.CloseSession("");
    				initTimestamp = true;
    			}
    		}
    	}
    
    	return initTimestamp.Value ? TimestampService.GetTimestamp() : 0;
    }

    Нельзя просто взять и вызвать TimestampService.GetTimestamp() - StackOverflowException получишь. Вот как надо!

    scrappyabc, 27 Ноября 2019

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

    +1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    private static string GetServerHostFromUrl(string url)
      {
          char[] delimiterChars = { '/', ':' };
          var urlParser = url.Split(delimiterChars);
    
          if (urlParser[0] == "http" || urlParser[0] == "https")
              return urlParser[3];
          else
              return string.Empty;
      }

    Когда ты умеешь решать все поставленные задачи

    partizanes, 05 Ноября 2019

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

    −102

    1. 1
    Тест.

    SwiftGovno, 27 Сентября 2019

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

    +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
    <?php
                          function php2js ($var) {
    			if (is_array($var)) {
    				$res = "[";
    				$array = array();
    				foreach ($var as $a_var) {
    					$array[] = php2js($a_var);
    				}
    				//return "[" . join(",", $array) . "]";
    				return "" . join(",", $array) . "";
    				
    			}
    			elseif (is_bool($var)) {
    				return $var ? "true" : "false";
    			}
    			elseif (is_int($var) || is_integer($var) || is_double($var) || is_float($var)) {
    				return $var;
    			}
    			elseif (is_string($var)) {
    			
    						
    				//return "\"" . addslashes(stripslashes($var)) . "\"";
    				  return "" . addslashes(stripslashes($var)) . "";	
    			}
    		
    			return FALSE;
    		}

    real_escape_string, 19 Мая 2019

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

    +3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    namespace 
    {
    struct list {              
    		type  pole1;             
    		list *pole2;             
    } 
    stack; 
    }

    Пример описания стека

    dethless, 19 Мая 2019

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

    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
    93. 93
    94. 94
    95. 95
    96. 96
    #include<math.h>
    #include<stdio.h>
    #include<stdlib.h>
    #include<string.h>
    #include<ctype.h>
    #define  MAX 300
    
    struct stack {
    	char alpha;
    	struct stack *nxtPTR;
    
    };
    
    typedef struct stack  Stack;
    typedef  Stack *node;
    void  message(void);
    char out_print(char word[]);
    int precedence_power(int res_1, int  res_2);
    int pop(node *topPtr);
    void push_stack(node *topPTR, char value);
    int pop(node  *topPTR);
    char check_stack(node data);
    int isOperator(char c);
    int precedence(char data_1, char   data_2, int(intro_precedence_power)(int res_1, int  res_2));
    void  converting(char *in, char *out, node *PTR, char (checking_stack)(node), void (push)(node *topPTR, char value), int (pop)(node *fix), int (isOper)(char c), int (precedence_intro)(char data_1, char  data_2, int(intro_precedence_power)(int res_1, int  res_2)), int(intro_precedence_power)(int res_1, int  res_2));
    void  please_enter(void );
    
    int main(void) {
    	
    	char infix[MAX];
    	char postfix[MAX];
    	node topPTR = NULL;
    	
    	fgets(infix, sizeof(infix), stdin);
        int	m = strlen(infix);
    
    	infix[m] = ')';
    
    	memset(postfix, 0, MAX);
    	
    
      
    
    	converting( infix, postfix, &topPTR, check_stack, push_stack, pop, isOperator, precedence, precedence_power);
    	out_print(postfix);
    	
    	puts(" ");
    	
    return 0;
    }
    
    char out_print(char word[]) {
    
    if( word[0]  != '\0' ){
    	 	printf( "%c " ,  word[0]    ) ; 
    return    out_print(word + 1  )  ;
    }
    
    }
    
    void push_stack(node *topPTR, char value) {
    	node newPTR = malloc(sizeof(Stack));
    
    	if (newPTR != NULL) {
    
    		newPTR->alpha = value;
    		newPTR->nxtPTR = *topPTR;
    
    		*topPTR = newPTR;
    	}
    
    	else {
    
    		puts("error");
    
    	}
    }
    
    int pop(node *fix) {
    
    int value = (*fix)->alpha;
    
    	node temp = *fix;
    	*fix = (*fix)->nxtPTR;
    	free(temp);
    
    	return value;
    }
    
    char check_stack(node data) {
    	return data->alpha;
    }
    
    int isOperator(char c) {
    	return c == '/' || c == '*' || c == '-' || c == '+'  || c == '^'  ;
    }

    вычисляет обратною польскою нотацию номер раз

    lazy_8, 19 Апреля 2019

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