1. Список говнокодов пользователя MAKAKA

    Всего: 35

  2. Куча / Говнокод #27212

    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
    # ------------------- fUnicodeToUTF8----------------------
    :global fUnicodeToUTF8
    :if (!any $fUnicodeToUTF8) do={ :global fUnicodeToUTF8 do={
      :global fByteToEscapeChar
    #  :local Ubytes [:tonum $1]
      :local Nbyte
      :local EscapeStr ""
    
      :if ($1 < 0x80) do={
        :set EscapeStr [$fByteToEscapeChar $1]
      } else={
        :if ($1 < 0x800) do={
          :set Nbyte 2
        } else={  
          :if ($1 < 0x10000) do={
            :set Nbyte 3
          } else={
            :if ($1 < 0x20000) do={
              :set Nbyte 4
            } else={
              :if ($1 < 0x4000000) do={
                :set Nbyte 5
              } else={
                :if ($1 < 0x80000000) do={
                  :set Nbyte 6
                }
              }
            }
          }
        }
        :for i from=2 to=$Nbyte do={
          :set EscapeStr ([$fByteToEscapeChar ($1 & 0x3F | 0x80)] . $EscapeStr)
          :set $1 ($1 >> 6)
        }
        :set EscapeStr ([$fByteToEscapeChar (((0xFF00 >> $Nbyte) & 0xFF) | $1)] . $EscapeStr)
      }
      :return $EscapeStr
    }}

    угадай язык

    MAKAKA, 12 Января 2021

    Комментарии (23)
  3. VisualBasic / Говнокод #27189

    −2

    1. 1
    We’ve heard your feedback that you want Visual Basic on .NET Core

    https://devblogs.microsoft.com/vbteam/visual-basic-support-planned-for-net-5-0/

    MAKAKA, 31 Декабря 2020

    Комментарии (14)
  4. Kotlin / Говнокод #27176

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    * Returns the largest value among all values produced by [selector] function
     * applied to each element in the collection.
     * 
     * @throws NoSuchElementException if the collection is empty.
     */
    @SinceKotlin("1.4")
    @OptIn(kotlin.experimental.ExperimentalTypeInference::class)
    @OverloadResolutionByLambdaReturnType
    @kotlin.internal.InlineOnly
    public inline fun <T, R : Comparable<R>> Iterable<T>.maxOf(selector: (T) -> R): R {
        val iterator = iterator()

    MAKAKA, 25 Декабря 2020

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

    +3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    The reboot() call reboots the system, or enables/disables the reboot keystroke (abbreviated CAD, since the de‐
           fault is Ctrl-Alt-Delete; it can be changed using loadkeys(1)).
    
           This system call fails (with the error EINVAL) unless magic equals LINUX_REBOOT_MAGIC1 (that  is,  0xfee1dead)
           and  magic2  equals LINUX_REBOOT_MAGIC2 (that is, 672274793).  However, since 2.1.17 also LINUX_REBOOT_MAGIC2A
           (that is, 85072278) and since 2.1.97 also LINUX_REBOOT_MAGIC2B (that is,  369367448)  and  since  2.5.71  also
           LINUX_REBOOT_MAGIC2C  (that  is,  537993216)  are  permitted as values for magic2.  (The hexadecimal values of
           these constants are meaningful.)

    man 2 reboot

    MAKAKA, 23 Декабря 2020

    Комментарии (13)
  6. Kotlin / Говнокод #27165

    +1

    1. 1
    2. 2
    val users = listOf("foo", "bar")
    println(users.joinToString{","})

    MAKAKA, 15 Декабря 2020

    Комментарии (18)
  7. Kotlin / Говнокод #27087

    +1

    1. 1
    2. 2
    Currently it's hard or even impossible to use hexadecimal literal constants that result in overflow of the corresponding signed types. 
    https://github.com/Kotlin/KEEP/blob/master/proposals/unsigned-types.md

    какой пиздец!!!

    MAKAKA, 06 Ноября 2020

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

    +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
    54. 54
    55. 55
    56. 56
    include std/socket.e as s
    include std/error.e as err
    
    constant PORT = 5050
    constant BACKLOG = 5
    
    procedure die(object result, sequence action) 
    	printf(2, "Error %d in %s", {result, action})
    	err:crash(action)
    end procedure
    
    procedure ensure_zero(integer result, sequence action)
    	if result != 0 then
    		die(result, action)
    	end if 
    end procedure
    
    function ensure_seq(object result, sequence action)
    	if atom(result) then
    		die(result, action)
    	end if
    	return result
    end function
    
    enum SOCKET, READ, WRITE, ERROR
    constant PHRASE = "Hello from Euphoria\n"
    
    procedure client_proc(sequence socket)
    while 1 do
    		for i = 1 to length(PHRASE) do
    			sequence result = s:select({}, socket, {}, 0, 100)
    			sequence result_s = result[1]
    			if result_s[WRITE] = 1 then
    				s:send(socket, {PHRASE[i]}, 0)
    			end if 
    			task_yield()
    		end for
    end while
    end procedure
    
    constant client_proc_id = routine_id("client_proc")
    
    sequence server = ensure_seq(s:create(s:AF_INET, s:SOCK_STREAM, 0), "create")
    ensure_zero(s:bind(server, "127.0.0.1", PORT), "bind")
    ensure_zero(s:listen(server, BACKLOG), "listen")
    
    while 1 do
    	sequence listen_result = s:select(server, {}, {}, 0, 100)
    	if listen_result[1][READ] = 1 then
    		sequence client = ensure_seq(s:accept(server), "accept")
    		printf(1, "Here comes %s\n", {client[2]})
    		atom task = task_create(client_proc_id, {client[1]})
    		task_schedule(task, {0.5, 0.5})
    	end if
    	task_yield()
    end while

    MAKAKA, 27 Октября 2020

    Комментарии (72)
  9. Куча / Говнокод #27055

    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
    // Define type
    define bottles_of_beer => type {
    
    	// Define internal data 
    	data private bottles = 99
    
    	// Define private methods
    	private br => '<br/>'
    	private s => .bottles != 1 ? 's' | ''
    	
    	// Generate lyrics when object represented as a string
    	public asstring => {
    
    		local(out = '')
    	
    		// Use Lasso query syntax to generate the lyrics
    	
    
    		with n in 99 to 1 by -1 do {
    			.bottles = #n
    			#out +=  .bottles + ' bottle' + .s + ' of beer on the wall, ' + .br
    			#out +=  .bottles + ' bottle' + .s + ' of beer; ' + .br
    			.bottles--
    			#out += 'Take one down, pass it around, ' + .br
    			#out += .bottles + ' bottle' + .s + ' of beer on the wall. ' + (.br * 2) 
    		}
    
    		// Return result
    		return #out
    	}
    }
    
    bottles_of_beer

    https://en.wikipedia.org/wiki/Lasso_(programming_language)

    MAKAKA, 24 Октября 2020

    Комментарии (104)
  10. JavaScript / Говнокод #27038

    +2

    1. 1
    2. 2
    ARMv8.3-a adds a new instruction "jscvt", which can be used for converting double to int32_t in JS semantics.
    https://bugs.webkit.org/show_bug.cgi?id=184023#c24

    MAKAKA, 18 Октября 2020

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

    +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
    catch (Exception &exception)
    	{
    		Application->ShowException(&exception);
    	}
    	catch (...)
    	{
    		try
    		{
    			throw Exception("");
    		}
    		catch (Exception &exception)
    		{
    			Application->ShowException(&exception);
    		}
    	}

    https://github.com/greatis/Anti-WebMiner/blob/master/AntiWebMiner.cpp#L23

    MAKAKA, 13 Сентября 2020

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