Slashdot Mirror


1st International Longest Tweet Results

Dr_Evil6_6_6 writes "Slashdot had a story about the 1st International Longest Tweet Contest last month, and the winners have just been announced." The winner is impressive.

1 of 44 comments (clear)

  1. The winner is impressive. by iamhassi · · Score: 0, Redundant

    FTA:

    "Todd Lehman says:
    March 25, 2010 at 10:14 pm
    The maximum number of bits you can squeeze into a tweet using 32-bit non-Unicode characters is 4339.

    Below is an algorithm which uses large-integer arithmetic to carry out operations which encode and decode a 4339-bit value. Perhaps someone can develop this into a working program.

    Constants:

    Let V = 2 = 2147483648 be the number of non-negative integers representable in 31 bits.
    Let U = 10FFFF + 1 = 110000 = 1114112 be the number of valid Unicode code points.
    Let N = V – U = 2147483648 – U = 2146369536 be the base for numeric conversions below.

    The encoding and decoding algorithms below operate on the principle that 4339 / logV 139.97 and that ceil(4339 / logV) = 140.

    Encoding algorithm (K M[140])

    (1) Let K be any 4339-bit integer
    (2) a := K // Initialize accumulator
    (3) for each i in {0..139}:
    (3a) d := a % N // Extract lowest-order digit from accumulator
    (3b) c := U + d // Convert base-N digit to 32-bit character
    (3c) M[139-i] := c // Store 32-bit character in message
    (3d) a := (a – d) / N // Subtract lowest-order digit and shift accumulator right
    (4) Output M[140]

    Decoding algorithm (M[140] K)

    (1) Let M[140] be an array of characters representing a message to decode
    (2) a := 0 // Initialize accumulator
    (3) for each i in {0..139}:
    (3a) c := M[i] // Extract 32-bit character
    (3b) d := c – U // Convert 32-bit character to base-N digit
    (3c) a := (a * N) + d // Shift accumulator left and add digit
    (4) K = a"

    Anyone care to translate?

    --
    my karma will be here long after I'm gone