promethea.incorporated

brave and steely-eyed and morally pure and a bit terrifying… /testimonials /evil /leet .ask? .ask_long?


Anonymous asked: 1 in 3 show up and can't fizzbuzz. 1 in fucking _3_. Everyone has seen a cartoon I guess.

nuclearspaceheater:

theinternetcrab:

shkreli-for-president:

another-normal-anomaly:

gattsuru:

another-normal-anomaly:

nniihilsupernum:

woodswordsquire:

nniihilsupernum:

shieldfoss:

It is not hard to lie on a  resume.

EDIT: Or just have different standards. In my last job, over 2½ years, I wrote maybe at most a hundred lines of Powershell. Do I put Powershell on my resume? Do I put two and a half years of Powershell on my resume?

ok but…..i don’t know how this works in real life but at least a lot of startups will have you solve something nontrivial before they talk to you

I always wonder how many failures to fizzbuzz are more about performance anxiety than lack of skill.

i mean, fizzbuzz is really easy, people who can fail to do it bc of performance anxiety should probably not have programming jobs

but it is also evil because it requires you to suppress your desire for elegance

it’s like, “code monkeys should just do exactly what theyre told and not have any aesthetic intuitions and basically wait around until good programmers can replace them with robots”

Can you unpack that a bit? Can a fizzbuzz implementation never be elegant? Also, I don’t think anyone is implying anything about what code should be like with fizzbuzz. They just want to make sure you can string a few lines together.

The ‘default’ form, which most interviewers will expect, is a little ‘ugly’ : 

for (int i = 1; i <= 100; i++) {

  string str = “”;

  if (i % 3 != 0 && i % 5 ) { str = i }

  else {

    if (i % 3 == 0) { str = str + “Fizz” }

    if (i % 5 == 0) { str = str + “Buzz” }

}

  fprint(str + “,\n”);

}

This is readable, but it’s really easy to get confused by it, and not just cause I used Egyptian brackets.  Indeed, that’s part of the point of the fizzbuzz test, as many inexperienced programmers will get the if-else’s mixed up and thus output fizzfizzbuzzbuzz or nothing on 15s, or run into other problems.  Some things that seem like they’d make it cleaner will either break it or make it less accessible  Worse, it’ll tweak experienced coder’s expectations of ‘elegance’: unnecessary nested conditionals are Incorrect.

That’s not always bad – there’s a lot of places where inelegant code is the right solution, and here the inelegant solution has the benefit of following the phrasing of the question, and a lot of times making elegant efficient code doesn’t matter.  But it’s not necessarily something you want to teach.

You can clean it up a little without changing the toolkit too much : 

for (int i = 1; i <= 100; i ++) {

  if (i % 15 == 0) { fprint(”FizzBuzz,\n”) }

 elseif (i % 5 == 0) { fprint(”Buzz, \n”); }

 elseif (i % 3 == 0) { fprint(”Fizz, \n”); }

 else { (fprint(i + ”, \n”); }

}

It’ll still bug the hell out of anyone that’s done optimization work on modern CPUs – the most common situation is tested last, the least-common is tested first, which does have a cost – but you don’t need to optimize a problem of n = 100.  The biggest downside is readability : it’s not as obvious from the code what the original question is, and programmers raised in the field of ‘self-documenting code’ will wince a bit.  Of course, self-documenting programmers should be fired out of a cannon into the sun, so it all works out. (Some languages support switch/case for this style of answer, which are ‘better-looking’ and usually have programming benefits, but I can’t get tumblr to accept it reasonably.)

You can actually do some clever stuff that makes it look nicer and optimize it better: it’s entirely possible to write FizzBuzz without any branching at all!  Of course, if you go too far down those paths you risk the interviewer not recognizing the answer, either.

Thanks for the explanation! I see what you mean now.

An elegant solution: Array.apply(null,Array(100)).map((c, i)=>{return (++i%3?“”:“Fizz”)+(i%5?“”:“Buzz”)||i})

(For bonus points, explain why you have to use Array.apply(null, Array(100)) instead of Array(100).)

holy side effects and typecasts, batman

#include <stdwhiteboard.h>

fizzbuzz(100);

shkreli-for-president is the only right-thinking one here; I’d love to ragequit an interview that expected ifs and elses instead of teh pretty

the only problem is the fucking javascript why is there javascript in my fizzbuzz

nniihilsupernum:

jesus

im sorry

how did they get an interview tho

def fizzbuzz(up_to)
  (1..up_to).map do |i|
   str = “
   str << ‘fizz’ if i % 3 == 0
   str << 'buzz’ if i % 5 == 0
   str.empty? ? i : str
  end
end

puts fizzbuzz(100)

this is still not perfect because it’s not 100% elegant and it’s in Ruby instead of Rust or Haskell or something but at least it’s not Javascript and it represents what I’d actually do in a fizzbuzz interview if I had to do one now; if I wanted to do it more Properly I’d make a generic modulo matcher function and then define fizzbuzz as taking a specific form of it (no I hand’t read this one when I was writing that)

and troll answers:

1 week ago · tagged #baby leet · 63 notes · source: nniihilsupernum · .permalink


Anonymous asked: 1 in 3 show up and can't fizzbuzz. 1 in fucking _3_. Everyone has seen a cartoon I guess.

nniihilsupernum:

shieldfoss:

nniihilsupernum:

jesus

im sorry

how did they get an interview tho

It is not hard to lie on a  resume.

EDIT: Or just have different standards. In my last job, over 2½ years, I wrote maybe at most a hundred lines of Powershell. Do I put Powershell on my resume? Do I put two and a half years of Powershell on my resume?

ok but…..i don’t know how this works in real life but at least a lot of startups will have you solve something nontrivial before they talk to you

That’s because startups know their shit and they haven’t hired the non-fizzbuzzers so they actually are capable of pre-filtering, is my guess

1 week ago · tagged #baby leet · 63 notes · source: nniihilsupernum · .permalink


eliza-was-here:
“ phoneus:
“ dprflagemoji:
“ korolevcross:
“ phoneus:
“ i believe this diagram is from the neuro experiment where they connected two rats together by the brain and they could transmit information. rats have good neuroplasticity. it...

eliza-was-here:

phoneus:

dprflagemoji:

korolevcross:

phoneus:

i believe this diagram is from the neuro experiment where they connected two rats together by the brain and they could transmit information. rats have good neuroplasticity. it was a simple lever test with the rats pulling the lever to get water but the encoder gets a visual thing i forget what exactly they used but they get a cue and the brain activity related to recieving the cue zipzops into the decoders brain directly and everyone was peeing their pants over it because it implied hypothetically you could hook a bunch of brains together, creating a network like a computer

looking forward to may 19, 2036, the day a guy successfully installs and runs DOOM on a box full of rats for the first time

i want to be the first guy to compile the linux kernel on ratbox

I hate you people

–target=ratbox-unknown-linux-gnu

http://www.strangehorizons.com/2004/20040405/badger.shtml

(via michaelblume)

1 week ago · tagged #shitposting #baby leet · 14,570 notes · .permalink


nuclearspaceheater:

lisp-case-is-why-it-failed:

socialjusticemunchkin:

nuclearspaceheater:

I was reading about Ethereum.

Solidity is the JavaScript-like programming language designed for developing smart contracts that run on the Ethereum Virtual Machine (EVM).

My intuitions are saying that the language should be functional, simple, high-level and damn well tested. Ideally it should also be close enough to natural language that it would be partially self-documenting and difficult to hide nasty tricks in. And it should have a strict syntax so that there’s only one correct way to do anything ever, and deviating from it would produce an obvious error instead of unexpected behavior and it would be noticed at “compile-time” so that the only programs that ever get to run are Correct.

I’m not an expert yet but these features sound like inspiration should be taken from the likes of Ada, Haskell, Python etc.

…so they chose javascript instead

what has the world done to deserve this

Rust, Haskell, and Coq (or one of the other dependently typed languages, I haven’t use them) are much better inspirations. Ada was only good like 50 years ago, and Python is a really bad choice if you care about program correctness.

Natural language is the opposite of what you want. Every language that has tried it (COBOL and Ruby stand out) have turned into unreadable messes. You want something very close to formal logic, so it is extremely clear what is being done.

“One way to do everything” is literally impossible in a Turing complete language. You can’t even make it hard to do things in more than one way. You can have conventions for how to do common things, and that’s about it.

There is also argued to be some value in a well-define total functional subset of the language, which is much easier to prove things about, and which would be preferable in any case where Turing-completness is not actually necessary.

Okay yes, my totally non-expert intuitions and vague guesses were corrected by people who know better (insert that picture about how the best way to get information is to post wrong information first so the people who know the stuff will correct it).

Although the “one way to do a thing” is basically “one reasonable way to do a thing”; I’d find it preferable if the alternate ways of doing most things were clearly excessively roundabout so the language would effectively end up enforcing best practices as deviating from them would be obviously a stupid idea and oftentimes signal that something suspicious might be going on.

And the “natural language” thing wasn’t what I was exactly going for; having short clear ways of doing standard things instead of getting bogged down in unnecessary imperative boilerplate would perhaps be closer to what I meant.

1 week ago · tagged #baby leet · 53 notes · source: nuclearspaceheater · .permalink


nuclearspaceheater:

socialjusticemunchkin:

shlevy:

socialjusticemunchkin:

nuclearspaceheater:

I was reading about Ethereum.

Solidity is the JavaScript-like programming language designed for developing smart contracts that run on the Ethereum Virtual Machine (EVM).

My intuitions are saying that the language should be functional, simple, high-level and damn well tested. Ideally it should also be close enough to natural language that it would be partially self-documenting and difficult to hide nasty tricks in. And it should have a strict syntax so that there’s only one correct way to do anything ever, and deviating from it would produce an obvious error instead of unexpected behavior and it would be noticed at “compile-time” so that the only programs that ever get to run are Correct.

I’m not an expert yet but these features sound like inspiration should be taken from the likes of Ada, Haskell, Python etc.

…so they chose javascript instead

what has the world done to deserve this

And it should have a strict syntax so that there’s only one correct way to do anything ever, and deviating from it would produce an obvious error instead of unexpected behavior and it would be noticed at “compile-time” so that the only programs that ever get to run are Correct.

Python

Wat

That was more about the “natural language-resembling” part; to my knowledge none of those languages would satisfy all of the requirements, but Python programs are actually readable while javascript is…javascript.

“Natural language-resembling” sounds to me like how you get COBOL. Natural language is not optimized for smart contracts, and so I’d expect that it would be full of false-friends and other traps, and programming constructions that are similar-to-but-not-actually what you expect them to be are an on-going source of many troubles.

Okay, I don’t mean it in that sense; I mean in the sense that stuff that doesn’t need to be complicated isn’t complicated.

To take a simple example, in Python one can just do a loop like “for var in array…” which, when implemented solidly, should be no less secure and predictable than Javascript’s more complex looping of “i = 0, i < length(array), i++…” or whatever it was.

In fact, my totally non-expert intuitions suspect that it’d be easier to sneak unexpected behavior to something with such imperative boilerplate (the underhanded C contest remaining a favorite for a reason) whereas pure well-defined functions if done correctly will do exactly what they should and making them deviate from their intended behavior should be the weird thing that sticks out. “for var in array…” will loop through each element of the array exactly once or otherwise python has been broken, but having to fuck around with an explicit “i” seems like it would introduce the possibility of fucking around with it to make the program do something it should not do.

Or to take an example from Julia: sum(primes(2000000)) returns the sum of primes under 2 million and it’s the job of the language to do it properly, but if I wrote my own code to do it without such (presumably very well checked and proven, in the case of the smart contract language) ready-made functions an innocent mistake (or something that’s made to look like an innocent mistake) could make it skip some primes or introduce non-primes, thus invalidating the result. If people need to spend time checking the prime-testing algorithm of each individual program it’s time away from the things that actually need attention. The less there is to fuck up with, the less chance there is to fuck up. (Although once again I suspect having it be something like “sum(primes_in(1..2000000))” would make it more reliable as this would make it explicit that we’re dealing with a range and selecting the primes from it instead of eg. the first 2 million prime numbers. Simple is good, but unambiguous is vital.)

1 week ago · tagged #baby leet #software horrors · 53 notes · source: nuclearspaceheater · .permalink


kirideth:

the-future-now:

That’s Louis Rossman, a repair technician and YouTuber, who went viral recently for railing against Apple. Apple purposely charges a lot for repairs and you either have to pay up or buy a new device. That’s because Apple withholds necessary tools and information from outside repair shops. And to think, we were just so close to change.

Follow @the-future-now

This shit is literally why I will never purchase an Apple product. It’s been well over a decade since I made this decision. Also, this person is a hero.

Hackers breaking bullshit monopolies is always enjoyable to see. Own the phones, pwn the drm, hack tha body, liberate the hard and the soft and the wet alike.

(via veronicastraszh)

1 week ago · tagged #irl heroes #baby leet · 97,855 notes · .permalink


veronicastraszh:

socialjusticemunchkin:

shlevy:

socialjusticemunchkin:

nuclearspaceheater:

I was reading about Ethereum.

Solidity is the JavaScript-like programming language designed for developing smart contracts that run on the Ethereum Virtual Machine (EVM).

My intuitions are saying that the language should be functional, simple, high-level and damn well tested. Ideally it should also be close enough to natural language that it would be partially self-documenting and difficult to hide nasty tricks in. And it should have a strict syntax so that there’s only one correct way to do anything ever, and deviating from it would produce an obvious error instead of unexpected behavior and it would be noticed at “compile-time” so that the only programs that ever get to run are Correct.

I’m not an expert yet but these features sound like inspiration should be taken from the likes of Ada, Haskell, Python etc.

…so they chose javascript instead

what has the world done to deserve this

And it should have a strict syntax so that there’s only one correct way to do anything ever, and deviating from it would produce an obvious error instead of unexpected behavior and it would be noticed at “compile-time” so that the only programs that ever get to run are Correct.

Python

Wat

That was more about the “natural language-resembling” part; to my knowledge none of those languages would satisfy all of the requirements, but Python programs are actually readable while javascript is…javascript.

Agreed. Now certainly Python is not an ideal choice. On the other hand, it’s not a terrible choice. First, it is established. Lots of people know it. It’s easy to pick up the basics, so there a low barrier to entry – which, getting all down with “This is based on Haskell, but with a dependent typing layer, and here are some links to research papers that describe the basics, except I’ve add some stuff, which will be maybe published in June. Keep an eye on arXiv. And – hey, are you familiar with co-inductive proofs?”

I mean, I’d have more fun learning the latter, but I can understand how a project would choose something like Python.

Javascript, on the other hand…

Just, no.

And the thing I was thinking of is basically something like that quote, with “…but it looks like Python.” appended

I might add Julia to the list of “languages that have some features that language should have” as it’s good for mathy stuff and has a readable syntax (“sum(primes(2000000))” was the most hilarious one-liner Project Euler solution ever as it’s literally impossible to describe the question in a shorter way) but it lacks in the other departments afaik, just like all of the others in their own way

1 week ago · tagged #baby leet #software horrors · 53 notes · source: nuclearspaceheater · .permalink


shlevy:

socialjusticemunchkin:

nuclearspaceheater:

I was reading about Ethereum.

Solidity is the JavaScript-like programming language designed for developing smart contracts that run on the Ethereum Virtual Machine (EVM).

My intuitions are saying that the language should be functional, simple, high-level and damn well tested. Ideally it should also be close enough to natural language that it would be partially self-documenting and difficult to hide nasty tricks in. And it should have a strict syntax so that there’s only one correct way to do anything ever, and deviating from it would produce an obvious error instead of unexpected behavior and it would be noticed at “compile-time” so that the only programs that ever get to run are Correct.

I’m not an expert yet but these features sound like inspiration should be taken from the likes of Ada, Haskell, Python etc.

…so they chose javascript instead

what has the world done to deserve this

And it should have a strict syntax so that there’s only one correct way to do anything ever, and deviating from it would produce an obvious error instead of unexpected behavior and it would be noticed at “compile-time” so that the only programs that ever get to run are Correct.

Python

Wat

That was more about the “natural language-resembling” part; to my knowledge none of those languages would satisfy all of the requirements, but Python programs are actually readable while javascript is…javascript.

1 week ago · tagged #baby leet #software horrors · 53 notes · source: nuclearspaceheater · .permalink


nuclearspaceheater:

I was reading about Ethereum.

Solidity is the JavaScript-like programming language designed for developing smart contracts that run on the Ethereum Virtual Machine (EVM).

My intuitions are saying that the language should be functional, simple, high-level and damn well tested. Ideally it should also be close enough to natural language that it would be partially self-documenting and difficult to hide nasty tricks in. And it should have a strict syntax so that there’s only one correct way to do anything ever, and deviating from it would produce an obvious error instead of unexpected behavior and it would be noticed at “compile-time” so that the only programs that ever get to run are Correct.

I’m not an expert yet but these features sound like inspiration should be taken from the likes of Ada, Haskell, Python etc.

…so they chose javascript instead

what has the world done to deserve this

1 week ago · tagged #baby leet #software horrors · 53 notes · source: nuclearspaceheater · .permalink


socialjusticemunchkin:

Fucking hell…

the upsides of living with a cat who loves to bite wires in places it considers its own:

  • you learn a lot of opsec and electronics repair skills

the downsides of living with such a cat:

  • IT’S ONLY BEEN A COUPLE OF DAYS SINCE I GOT MY MODEM BACK ONLINE GIVE ME A GODDAMN BREAK SOMETIMES

@collapsedsquid said: Your cat is making you learn opsec? Is your cat a l33t hx40r?

Yes. Do not leave vulnerabilities where an adversary can access them, for the adversary will inevitably exploit them. The only real defense is eliminating the vulnerability.

And the pragmatist’s corollary: sometimes it’s sufficient to just measure it as (motivation * ability) and the only practical defense is reducing vulnerabilities to those that the adversary isn’t interested enough to exploit. Reducing motivation alongside with ability is, when dealing with Not-Mossad, sufficient to deal with the threats that are really impractical to eliminate the ability of exploiting which.

And the clockwork corollary: ultimately there is no difference between motivation and ability, and they all boil down to “how hard will you(r modem wires) be pwned” and reducing the amount of pwnage one receives is what matters.

1 week ago · tagged #baby leet · 13 notes · source: socialjusticemunchkin · .permalink


.next