[HN Gopher] The Cursed Computer Iceberg Meme
___________________________________________________________________
The Cursed Computer Iceberg Meme
Author : merlinscholz
Score : 258 points
Date : 2021-04-11 01:06 UTC (21 hours ago)
(HTM) web link (suricrasia.online)
(TXT) w3m dump (suricrasia.online)
| strogonoff wrote:
| After reading "There's no elegant solution to FizzBuzz",
| immediately had to check how I might try to be unnecessarily
| clever if I had to do it in Python and arrived at:
| for i in range(1, 100): divisible_by_3 = i % 3 == 0
| divisible_by_5 = i % 5 == 0 fizz = 'Fizz' if
| divisible_by_3 else '' buzz = 'Buzz' if divisible_by_5
| else '' num = '' if divisible_by_3 or divisible_by_5
| else i print "{0}{1}{2}".format(fizz, buzz, num)
|
| (In reality, of course, I would likely have had to look up the
| modulo operator first.)
| inoursweetz wrote:
| There is a nice paper, which explores possible elegant
| solutions to FizzBuzz.
| https://themonadreader.files.wordpress.com/2014/04/fizzbuzz....
| strogonoff wrote:
| > FizzBuzz in Haskell by Embedding a Domain-Specific Language
|
| I was not disappointed.
|
| > Meanwhile, we want there to be at most one place that
| outputs fizz, buzz, or the string representation, and each
| test to be performed only once.
|
| These do intuitively seem like the properties of an elegant
| solution.
| tandav wrote:
| My 2 cents: import itertools #
| this block is just for simple functional pipes class B:
| def __init__(self, f): self.f = f class Pipe (B):
| __ror__ = lambda self, x: self.f(x) class Map
| (B): __ror__ = lambda self, x: map (self.f, x) class
| MapValues(B): __ror__ = lambda self, it: it | Map(lambda kv:
| (kv[0], self.f(kv[1]))) # here the actual
| FizzBuzz ( range(1, 100) | Map(lambda
| i: (i, itertools.compress(('Fizz', 'Buzz'), (i % 3 == 0, i % 5
| == 0)))) | MapValues(''.join) | Map(lambda
| kv: kv[1] or kv[0]) | Pipe(list) )
| [1, 2, 'Fizz', 4, 'Buzz', 'Fizz', 7, 8, 'Fizz', 'Buzz', 11,
| 'Fizz', 13, 14, 'FizzBuzz', 16, 17, ... ]
|
| if you're interested in pipes like above - here my simple
| library for that (no install needed, just copy some lines)
|
| https://github.com/tandav/pipe#fizzbuzz
| makerofthings wrote:
| I do it like this. fizzbuzz n = case (n^4 `mod`
| 15) of 1 -> show n 6 -> "fizz" 10 ->
| "buzz" 0 -> "fizzbuzz" main :: IO () main =
| print $ map fizzbuzz [1..30]
| eurasiantiger wrote:
| That is Euler's FizzBuzz:
| http://philcrissman.net/posts/eulers-fizzbuzz/
|
| I think it is an elegant solution.
| fanf2 wrote:
| Euler's fizzbuzz is elegant
| http://philcrissman.net/posts/eulers-fizzbuzz/
| Zarel wrote:
| JavaScript can eliminate all repetition thanks to how its ||
| operator works: for (let i = 1; i <= 100;
| i++) { console.log( (i % 3 == 0 ? "Fizz"
| : "") + (i % 5 == 0 ? "Buzz" : "") || i
| ); }
|
| Whether or not you consider this more elegant is a matter of
| taste, though.
| strogonoff wrote:
| While I like to think the opposite, I can see myself using ||
| with an empty string occasionally (at least with TS, where I
| can be reasonably sure the variable will definitely be a
| string at runtime). However, concatenating strings with + is
| a bit implicit to my taste.
| finnh wrote:
| I've always thought that an elegant solution wouldn't iterate
| by ones, but would instead increment the correct amount between
| each print statement... 0+3+2+1+3+1+2+3+3+2+...
| yarcob wrote:
| Maybe the fact that there is no elegant solution makes it
| useful.
| xoudini wrote:
| Here's a (perhaps "unnecessarily clever") Python 3 version I
| wrote a while back, for some reason: import
| functools def fizzbuzz(n): if not
| n % 3: yield (r := "fizz") if not n % 5: yield (r
| := "buzz") if not "r" in locals(): yield n
| compose = lambda f, g: lambda *args: f(g(*args))
| functions = "".join, functools.partial(map, str), fizzbuzz
| transform = functools.reduce(compose, functions)
| print("\n".join(map(transform, range(1, 100))))
| universenz wrote:
| Haha whoa, I didn't realise at one point EVE Online released an
| update that deleted the Boot.ini file. (Below the Iceberg)
|
| [0]: https://www.eveonline.com/news/view/about-the-boot.ini-issue
| jmillikin wrote:
| It was big news at the time. CCP released a short video about
| it at a convention later:
| https://www.youtube.com/watch?v=msXRFJ2ar_E
| bombcar wrote:
| That response is a well done description of how these things
| should be handled:
|
| 1. mitigate ASAP (pull or fix the update)
|
| 2. Make customers whole (anyone affected should be fixed no
| matter the hassle or cost - paying for Geek Squad is brilliant)
|
| 3. Determine how testing could have caught it and didn't (does
| your CI include rebooting? Nonstandard configurations?)
|
| 4. Remove overlapping filenames
|
| 5. Be open about all the above
| nynx wrote:
| The Birth and Death of Javascript (near the end of the bottom of
| the iceberg) has played a big role in my life and I expect it to
| be relevant far into the future.
| erk__ wrote:
| "unicode on punch cards" in the Abyss, should clearly point to
| UTF-EBCDIC [0] and not just EBCDIC [1]. UTF-EBCDIC is probably
| one of the most exotic unicode formats, and I don't believe it is
| used much anymore, if it ever were.
|
| [0]: https://en.wikipedia.org/wiki/UTF-EBCDIC
|
| [1]: https://en.wikipedia.org/wiki/EBCDIC
| DaiPlusPlus wrote:
| Correctly referred to as WTF-EBCDIC.
| jmillikin wrote:
| Unicode encoding is a rich source of strange behavior. A couple
| that come to mind:
|
| Decoders that try to restart on unexpected byte sequences:
| https://john-millikin.com/%F0%9F%A4%94/case-report-surugaya-...
|
| GHC 7.2 using Unicode to represent file paths on Linux (where
| paths are arbitrary bytes), an approach which was further
| explored in GHC 7.4 by using reserved codepoints.
|
| \u vs \U escapes in languages that added Unicode support before
| the codepoint space was expanded beyond 16 bits.
| gbuk2013 wrote:
| The OpenPGP SKS vulnerability gist was a sad read
| https://gist.github.com/rjhansen/67ab921ffb4084c865b3618d695...
| bombcar wrote:
| Given the extent of the issue they got off quite easy, in my
| estimation.
|
| Immutable distributed histories are all susceptible to the
| "encoded illegal content" and I don't know how they'll end up
| resolving it.
| Palomides wrote:
| why is alloca on this list? is it really that cursed?
| swiley wrote:
| Yes because you have no idea if it's going to result in the
| stack overwriting the heap. On many compilers it's just a macro
| that decrements the stack pointer by the value in the argument.
| You really shouldn't ever use it.
| Palomides wrote:
| doesn't that apply to any other function call also? (though
| obviously alloca can let you do it really fast)
| majewsky wrote:
| IIRC, there's a protected page between the stack and the
| heap, where any reads or writes will `kill -SEGV` the
| program. With regular function calls, you'll be advancing
| the stack pointer slowly enough to guarantee a hit on that
| page. With alloca(), you can move the stack pointer in
| larger steps, thus missing that page.
|
| (The lowest few pages of memory are protected in the same
| way to increase the likelihood that a NUL pointer correctly
| blows up in your face when you try to access its memory.)
| ac42 wrote:
| Oh, wow... I haven't felt so nerdy in a long, long time. Lovely
| :)
| nxpnsv wrote:
| Das ist ein gameboy is remarkable
| skytreader wrote:
| I really didn't get this and Google search comes up with
| nichts. Maybe cause I'm in Germany so it doesn't ring a special
| bell to Google. Explainer someone?
| dEnigma wrote:
| The text on the iceberg is linked to whatever it is talking
| about so you can simply click on it to get to the source.
| DaiPlusPlus wrote:
| Ah, thanks! I'm on my iPad so there's no :hover hints... at
| least until Apple adds support for off-screen finger
| detection.
| lordgrenville wrote:
| Just from the context, looks like just the fact that it's a
| serious-looking medical device which is literally a case
| around a GBA. (More here: https://www.theverge.com/circuitbre
| aker/2017/9/21/16339122/e...)
| swiley wrote:
| Searching on English google from the US also just brings up a
| bunch of German articles about the Gameboy.
| bombcar wrote:
| There are a large number of specialized devices that used to
| have custom touchscreens - and many MANY of them are much more
| reliable now that they just have an iPad stuck in there
| instead.
|
| Seeing it done with a GBA is not surprising.
| enriquto wrote:
| Now I want a printed poster of this to hang on my lab.
| Jabbles wrote:
| Missing https://blogs.ei.columbia.edu/2021/03/12/iceberg-really-
| floa...
| ralfd wrote:
| Off topic: The draw-an-iceberg game posted recently here taught
| me that icebergs do not look like that. That thing would float
| sideways!
| 1MachineElf wrote:
| I was surprised to see "RAID write hole" so close to the bottom.
| Surely at least half or more users of ZFS are aware of that.
| [deleted]
| tripa wrote:
| "fonts can be malicious" (on iceberg) and "font hinting is Turing
| complete" (middle of iceberg) are the same.
| simias wrote:
| "Fonts can be malicious" made me think of security
| vulnerabilities in font engines that can be exploited remotely
| by untrusted websites through things like webfonts. That
| doesn't necessarily involve Turing completeness, just some
| bogus memory handling in a font library written in C for
| instance.
| tripa wrote:
| That was my understanding as well, but the links don't
| corroborate.
| simias wrote:
| Oh, I completely missed that the links were clickable until
| I read your comments. I thought it was an image.
| [deleted]
| InsOp wrote:
| I found the "basilisk collection" (at the bottom of "bottom of
| the iceberg") the most fascinating one .
|
| I have the feeling that the whole iceberg only exists for us to
| click on this very article (as both share the same domain)
| lifthrasiir wrote:
| Sam Hughes' recent work [1] has the roughly same concept, a
| fictional Wikipedia article with enough details to believe. I
| enjoyed both.
|
| [1] https://qntm.org/mmacevedo
| DaiPlusPlus wrote:
| Before I read the SCP-like article, I thought it might be a
| reference to Roko's Basilisk: an unrelated, but equally
| unsettling, proposition.
| fanf2 wrote:
| Roko's Basilisk is just the same as Pascal's Wager.
| ralfd wrote:
| The twist of Rokos Basilisk is that it is an info hazard:
| it only is dangerous if one knows about it. Like a dark
| cult of Cthulhu who only conjures the elder god so they
| have the mercy to be eaten first.
|
| I think it is silly, but there are people anxious about it,
| which is not true about Pascals Wager.
| DaiPlusPlus wrote:
| > I think it is silly, but there are people anxious about
| it, which is not true about Pascals Wager.
|
| There's reason to be anxious about Pascal's Wager:
| assuming one holds a charitable view of the historicity
| of religious texts then Pascal's Wager is very rational -
| but one might feel social pressure to not be religious -
| or more likely: social pressure to hold a particular
| religion) - and just procrastination to get-around-to-
| researching-this-whole-religion-thing, so the uncertainty
| and lack of confidence in ones' own actions can lead to
| anxiety like that.
| wayvey wrote:
| Wow, I went to read the article and completely forgot you said
| "same domain". I was fooled for a while and couldn't believe
| I'd never heard of it before. Very facinating indeed. It'd be
| pretty wild if that stuff was real :)
| simias wrote:
| It took me a while to understand that it was fiction too. I
| spent a few minutes anxiously pondering if I could somehow
| have overlooked one of the most important cryptographic event
| in decades. It's very well made.
| SubiculumCode wrote:
| Is this like a "no true geek" test?
| weeboid wrote:
| No refs to lexicon, sysadmin from hell, LISP, or manual garbage
| collect. F-
| gsich wrote:
| >Alexander Rhatushnyak broke Kolmogorov complexity and won 8000
| euros
|
| I couldn't find that on the link?
| Scuds wrote:
| not sure what this is ordering
| ac42 wrote:
| Responses to the poll, I would presume?
| Sharlin wrote:
| By apparent obscurity of the reference. At the bottom there's a
| link to a poll whose results the ordering is presumably based
| on.
| lifthrasiir wrote:
| I feel the order up to the Bottom of the iceberg is roughly
| correct, and anything below that is almost randomly ordered.
| For example I don't think GCJ-02 and Mario Wolczko's unix
| recovery is _that_ obscure.
___________________________________________________________________
(page generated 2021-04-11 23:02 UTC)