File system that stores location of file in Pi - <AUTHOR> https://github.com/philipl/pifs <comment><USER2>
      Now, we all know that it can take a while to find a long sequence of digits in π,
      so for practical reasons, we should break the files up into smaller chunks that
      can be more readily found.

      In this implementation, to maximise performance, we consider each individual byte
      of the file separately, and look it up in π.

Definitely worth a chuckle. Very cute idea and implementation.

<comment><USER3> You laugh now, but when we develop a trivial method to calculate pi and other irrational constants to quadrillions of digits, this will be wonderful.

<comment> Tuna-Fish By the pigeonhole principle, no matter how fast you can calculate pi, you cannot actually use this to compress data. The index to relevant sequence is on average >= the size of the data to be stored.

<comment><USER4> I don't get how this applies.

If you have a 100-gigabyte file you want to "compress" with Pi, all you have to do is find the beginning of that exact sequence in Pi and write down its location and the size (100gigabytes). As long as the binary representation of the location within Pi was less than 100 gigabytes, it is now "compressed". Why wouldn't this work?

<comment><USER5> > Why wouldn't this work?

It _would_ work, exactly like you say. However, you seem to intuitively be vastly underestimating how far into pi you have to go to find a particular bit pattern.

To sharpen your intuition of this, I recommend this website: [http://pi.nersc.gov/](http://pi.nersc.gov/)

I tried searching pi for the string "zzzz" (this is 20 bits of information according to their somewhat weird encoding scheme). The decimal position in pi for this 20-bit string was 3725869808, which takes 32 bits to represent.

The same will be true in most cases -- the offset into pi will take more space to represent than the data itself! However, in some cases data absolutely can be compressed with this pi scheme. Just not often enough to be actually useful.

However, the fact that the data will _usually_ be larger is not what the pigeonhole principle is about.

All the pigeonhole principle says is: it's not possible for _every_ 100 GB file to have a offset in pi that takes less than 100GB to represent. The pigeonhole principle still allows _some_ files to be compressable with pi, just not all.

To prove this is simple: take every possible 100GB file (there are 2 __100G of them). Now let 's suppose that for every single one you can actually find a location in pi whose binary representation is less than 100GB to represent. If you can do this, then it means that at least 2 of the input files mapped to the same location in pi (because there were 2 __100G distinct input files but less than 2 __100G pi offsets that we are allowed to use). Therefore, once "compressed", you can't tell the difference between the two input files that both mapped to the same location in pi!

<comment><USER5> Aw shoot, where my comment above says "2100G" that was supposed to be "2^100G". HN ate my double-asterisk.

</comment></comment></comment></comment></comment></comment><comment><USER6> When I was young I had this idea that any hard drive can be compressed into 100 bytes. The compressed data is a 4 dimensional vector, a component of the vector is a 25 byte floating point number, and represent the space-time coordinates of the hard drive. (For example my hard drive in 1994 marc 3 23:00:45.456 at a specific place in Budapest) The extractor algorithm just have to simulate the universe from the big bang up until the given time, read the state of the atoms at the specified location, recognize the hard drive, and read the data from it. (Provided that the universe is deterministic, and what seems to be random in quantum mechanics can be simulated with a pseudorandom number generator.)

<comment><USER7> Well, let's assume that the past is constantly changing. The path leading from the start to the universe to the writing of your 4D vector would also change and therefore your vector itself might change automatically with every change to space-time. Or would that still be called deterministic?

<comment><USER8> Could yóu explain how/why do you think the past is constantly changing?

</comment></comment></comment><comment><USER9> If you're going to use a normal number for this purpose, why not choose a much nicer one? Let's use a number such that its binary representation is the concatenation of consecutive ascending binary numbers.

        0 1 10 11 100 101 110 111 1000...

becomes

        0.0110111001011101111000...

It's much easier to demonstrate that this number is normal than to do so for pi. It's also much easier to calculate the nth digit, and to find an occurrence of a given string of bits.

</comment><comment><USER10> Obligatory Dinosaur Comics: [http://www.qwantz.com/index.php?comic=353](http://www.qwantz.com/index.php?comic=353)

"You can't copyright a fact (like a number), but you can copyright a creative work, like a song or a piece of software. But since one can be transformed into another, copyright law is logically INCOHERENT."

<comment><USER11> What Colour are your bits?

[http://ansuz.sooke.bc.ca/entry/23](http://ansuz.sooke.bc.ca/entry/23)

<comment><USER12> Wow, great article!

Does a number that represents a range within Pi, get also coloured as copyrighted if your intent while computing it was the search for a copyright coloured sequence of bits within Pi ?

I think that for a lawyer it doesn't really matter; it doesn't matter which technique you're using to encode your data, as long as somebody can access that content and you did that on purpose. They're good at dealing with loosely defined things like intent, better than with formally defined things.

I wonder what amount (and progress) of AI research has been done in this area; not all illogical things are bullshit, however you might want to feel about them. Anti-digital-rights sentiment (disclaimer: I personally deplore much of the consequences about enforcement of digital rights, so I share that sentiment at many levels) sometimes can cloud judgement, and I've seen many people invoke rational thinking so well they successfully miss the point.

</comment></comment></comment><comment><USER13> Isn't this one of the April 1st jokes from 2012? Most of the commits were made on March 31, 2012[1]. And there's even a reference to the pi joke[2].

[1] [https://github.com/philipl/pifs/commits/master](https://github.com/philipl/pifs/commits/master)

[2] [http://www.netfunny.com/rhf/jokes/01/Jun/pi.html](http://www.netfunny.com/rhf/jokes/01/Jun/pi.html)

</comment><comment><USER14> Great, now we're going to see a DMCA takedown for π as it contains copyrighted content.

<comment><USER15> Yeah, and bomb building instructions and child pornography.

</comment></comment><comment><USER16> Like other lossless compression algorithms, there always exist some blobs of data, where the length of the location plus metadata exceeds that of the the original blob, due to the pigeon hole principle. The trouble in the case of pi-fad is that probably we will not know whether the location is longer or not before it is ever actually computed.

<comment><USER17> Quantum computing will abstract that away so we don't need to know whether the location is longer or not before using it.

</comment></comment><comment><USER18> I love pieces of code like this, it appeals to me in the same way sleepsort does. A superficial understanding of it might make you think it would be worth it, but really, while it may work, it's better left as a joke.

</comment><comment><USER19> I'm skeptical that this could really save any space. Just speculating here, really, but it seems like on average the amount of space needed to store the starting index of an arbitrary string of digits in pi should be greater than (or at least comparable to) the size of the string itself.

e.g., the first instance of "256" in pi starts at the 1750th digit. So in that case you're getting a 'compression' rate of -33% if we go by the count of decimal digits used.

<comment><USER20> To be fair, it compressed my 93 Gb file into 6 bytes. Incidentally, the file stored the first 100 billion decimals of pi.

<comment><USER21> Ah, the LenPEG approach.

[http://www.dangermouse.net/esoteric/lenpeg.html](http://www.dangermouse.net/esoteric/lenpeg.html)

</comment></comment></comment><comment><USER22> Hooli is gonna be pissed when they learn that Pi-ed Piper nailed a compression algorithm.

</comment><comment><USER23> I had played with this idea some time back and gave up after some very specific flaws came became clear.

The good probability that a 5 digit combination is found in Pi will be in the range of locations above 10000, for example I once located by 6 digit phone number in position 685214 which was not actually helpful at all.

Further we are not sure if Pi is normal hence the better idea would be use a simple computable normal series.

It was just yesterday I uploaded a paper that presents a idea for Compressing Random Data to -> [https://www.academia.edu/7620004/Advanced_Compression_Techni...](https://www.academia.edu/7620004/Advanced_Compression_Technique_For_Random_Data) which proposes an Idea to push multiple bytes represented by a positions in a computable number series into small representation and generate them on the go when required. (need lot of improvement to actually apply)

</comment><comment><USER24> I'm not sure I understand how this would compress files. I mean, the only way it could is if the decimal place in Pi at which the byte occurs is significantly less than the value of the byte itself. Statistically, this would happen less than 50% of the time, the other 50+% of the time occurring at a higher decimal place. I don't see this providing any real compression benefit.

For example, the byte 0xFF, which is the number 255, first occurs at the 1168th value of Pi.This means instead of storing 255, you're now storing 1168, or 0x490, requiring an extra half-byte. However, 0x328, or number 808, first occurs at the 105th value of pi, or 0x69, requiring one less half-byte.

How does this system provide better compression? The way I see it, the best case scenario would be if no sequence from 000 to 255 was ever repeated in Pi (or rather, not until every pattern in that sequence has been covered), in this case the compression ratio should be exactly 0%, no net gain or loss.

</comment><comment><USER25> I've been looking for the lyrics to the song that, when sung, will bring about peace on this planet. Now to hear that the file containing these lyrics is already contained in pi is revelatory. Could someone please give me the index and length of the file? I've got some singing to do.

<comment><USER26> As Dr. Ellie whispers in in Contact; "No words to describe it" and in the Dark Crystal Jen's song is without words.

I think the lyrics are contained in the celestial music itself, and such music is contained in the silence. Silence or 0 is the holy grail of 100% compression, creatio ex nihilo. Perhaps you could find such a song in Pi in a lifelong quest, but it's a much deeper mystery that Pi and 0 are mysteriously related. Euler is rumoured to have remarked it to be proof of God's existence. But even if such proof exists it's of no value compared to it's beauty.

"After proving Euler's identity during a lecture, Benjamin Peirce, a noted American 19th-century philosopher, mathematician, and professor at Harvard University, stated that "it is absolutely paradoxical; we cannot understand it, and we don't know what it means, but we have proved it, and therefore we know it must be the truth." Stanford University mathematics professor Keith Devlin has said, "Like a Shakespearean sonnet that captures the very essence of love, or a painting that brings out the beauty of the human form that is far more than just skin deep, Euler's equation reaches down into the very depths of existence."

[http://en.wikipedia.org/wiki/Euler's_identity](http://en.wikipedia.org/wiki/Euler's_identity)

</comment></comment><comment><USER27> This reminds me of Frederik Pohl's [1] book The Gold at Starbow's End, in which Gödelization [2] is used to compress a huge message into a very short one. There's a brief description of that part of the book at MathFiction [3]

[1] [http://en.wikipedia.org/wiki/Frederik_Pohl](http://en.wikipedia.org/wiki/Frederik_Pohl)

[2] [http://www.encyclopediaofmath.org/index.php/Gödelization](http://www.encyclopediaofmath.org/index.php/Gödelization)

[3] [http://kasmana.people.cofc.edu/MATHFICT/mfview.php?callnumbe...](http://kasmana.people.cofc.edu/MATHFICT/mfview.php?callnumber=mf1033)

</comment><comment><USER28> As many pointed that out using Pidgeon Hole principle, it is not practical to create a compression index(A lookup index where you map actual data with some kind of adresses preferably smaller than sequences), using every possible n byte sequence of your data!

Because your index size would be at least equal or higher than your original data.

The only way you get a smaller compression index, you have to look for recurrences, and try to only include most recurring sequences up to a number(there would be a tradeof and an optimal number for compression ratio) and left other sequences uncompressed. Only this way you can achieve compression ratio's smaller than 100%.

</comment><comment><USER29> I scanned the responses and saw only one that mentioned that pi is not proved (or possibly also provably) normal. That comment was downvoted.

</comment><comment><USER30> If anyone here hasn't read The Library of Babel yet, then now is a good time.

Here's a link in case you have trouble locating it within Pi: [http://hyperdiscordia.crywalt.com/library_of_babel.html](http://hyperdiscordia.crywalt.com/library_of_babel.html)

</comment><comment><USER31> This project was posted before and hasn't been updated since. I doubt that it is still in development

<comment><USER32> Its also pretty obviously an elaborate mathematics joke.

<comment><USER33> Yes, but it conceivable. It's like a code. You could securely save files with two numbers. Just a position and length.

<comment><USER34> It would only be secure if nobody knows what the position refers to. And the position is likely to be longer than the data, so you might as well use proper encryption.

</comment></comment></comment></comment><comment><USER35> This is extremely clever and something I have wanted to do for a while. If you are interested in contributing to a fun, small Clojure project, stop by: [https://github.com/bmhimes/clojure-pifs](https://github.com/bmhimes/clojure- pifs)

</comment><comment><USER36> Reminds me of Jan Sloot; [http://en.wikipedia.org/wiki/Jan_Sloot](http://en.wikipedia.org/wiki/Jan_Sloot). It was like an april fools but a lot of _big_ people fell for it at the time.

</comment><comment><USER37> If you use base 11 you get the added bonus of proving the existence of god !([http://en.wikipedia.org/wiki/Contact_(novel)](http://en.wikipedia.org/wiki/Contact_\(novel\)))

</comment><comment><USER38> Reminds me of this SMBC: [https://medium.com/the-nib/jesus-is-destroying- civilization-...](https://medium.com/the-nib/jesus-is-destroying- civilization-a2ac3c553d47)

</comment><comment> andrey-p I prefer the infinite monkey database [1] myself.

[1]: [https://github.com/brycebaril/infinite-monkey- db](https://github.com/brycebaril/infinite-monkey-db)

</comment><comment><USER39> I'm not sure pi is proven to contain all sequence of digits. Anyone care to link a proof. The joke be on them and they might not really understand pi at all.

<comment><USER29> It isn't proven to be "normal" ([http://en.wikipedia.org/wiki/Normal_number](http://en.wikipedia.org/wiki/Normal_number)). There is no guarantee that any particular sequence is in pi until you've searched and found it. It's a very common fallacy that because the expansion is infinite and non-repeating it should contain every possible sequence, very simple counter examples exist.

Pi can be infinite and non-repeating (as it's irrational) and only sparsely contain 5s after the 100 trillionth digit (or whatever we've calculated it to so far), unlikely.

There are some normal numbers that are known but they seem hard to construct (to me, not a number theorist), like Champernowne's number which is the concatenation of all natural numbers (clearly any number will be in it's expansion by definition but it won't be very good for compression purposes due to the indexing issues highlighted elsewhere).

Some further reading: [http://math.stackexchange.com/questions/216343/does-pi- conta...](http://math.stackexchange.com/questions/216343/does-pi-contain-all- possible-number-combinations), [http://mathoverflow.net/questions/51853/what- is-the-state-of...](http://mathoverflow.net/questions/51853/what-is-the-state- of-our-ignorance-about-the-normality-of-pi), [http://en.wikipedia.org/wiki/Complexity_function](http://en.wikipedia.org/wiki/Complexity_function).

<comment><USER40> If the idea that an infinite, non-repeating pattern might _not_ contain every possible digit seems strange, consider Penrose Tilings [1]. Penrose Tilings are infinite geometric patterns which never repeat, yet clearly don't contain every image known to man.

[1] [http://en.wikipedia.org/wiki/Penrose_tiling](http://en.wikipedia.org/wiki/Penrose_tiling)

</comment></comment></comment><comment><USER41> Fascinating implementation I must admit. How does i/o performance change as the byte-length or chunks vary in size from 3 to 200 bytes?

<comment><USER42> I think it would probably take forever for the initial lookup, because the probability of matching any 3 byte sequence is higher than matching a 200 bytes sequence?

<comment><USER2> _Literally_ forever, right?

It's basically scanning a random byte-stream for a 200-byte long exact match. 200 bytes, 1600 bits, or 2^1600 different possible sequences, making the odds 1/2^1600 that any particular 200 bytes pulled out will match the bytes you are looking for.

<comment><USER43> In fact, it's still not known if pi is normal (contains all finite patterns of numbers[π]), so you can't guarantee that any search will terminate.

π: Not quite the definition of normal, but equivalent.

<comment><USER44> Even if pi isn't normal, there are plenty of normal numbers to choose from (almost all of the reals are normal, in fact), including some really simple and predictable ones like Champernowne's constant (in base 10: 0.1234567891011121314...) that would support simpler index calculations than pi.

</comment></comment></comment></comment></comment><comment><USER45> This is genius!

Am I right in assuming that the decompression step is several orders of magnitude faster than the compression phase?

</comment><comment><USER46> Smartest thing I've seen in months, not so much the speed, but the compression value of it is great

</comment><comment><USER47> really cool idea, but not sure if actually true: [http://math.stackexchange.com/questions/216343/does-pi- conta...](http://math.stackexchange.com/questions/216343/does-pi-contain-all- possible-number-combinations)

</comment><comment><USER48> if you have this large base file with pi-numbers, you could use it to compress data right? and with the current internet speeds, pi-storing in the cloud could be an option. or hell, even distributed pi files :)

</comment><comment><USER49> The location of where the data is is no less complex than the actual data.

</comment><comment><USER50> His weissman score must be off the charts.

</comment><comment><USER51> has anybody run bonnie++ benchmarks with this fs?

</comment><comment><USER52> > They said 100% compression was impossible? You're looking at it!

If the offset within pi is so large that any representation of it is larger than my data?

<comment><USER53> Yep. Consider the minimum case: assume we've described a process for finding any bitstream we want in pi while necessarily saving at least one bit. Attempt to do so for the bitstreams 00, 01, 10, and 11. If we compress 2 bits to 1 bit, by the pigeonhole principle, at least one of 0 and 1 has to represent at least 2 distinct bitstreams, which means we have lost data.

A similar argument works for all compression algorithms and all sizes. It is flatly impossible to compress all data all of the time.

<comment><USER54> "It is flatly impossible to compress all data all of the time." Might I add "...such that the uncompressed data is recoverable."

Pedantically speaking, any data passing through a cryptographic hash algorithm is being compressed.

<comment><USER55> Pedantically, that's not compression.

<comment><USER54> Indeed it is: [https://en.wikipedia.org/wiki/One- way_compression_function](https://en.wikipedia.org/wiki/One- way_compression_function)</comment></comment></comment></comment></comment>


A Woman's Reproductive Tract Can Weed Out Unwanted Sperm - <AUTHOR> https://www.cnn.com/2020/08/18/health/sperm-sorted-by-female-reproductive-tract-wellness/index.html <comment> blaser-waffle Holy shit does that headline make it sound like an ugly quote about "shutting down legitimate rape".

Actual points from the actual article:

> A sperm's swimming motion, speed and viability are affected by the level of > genetic compatibility between a female's cervical mucus and the male's > sperm, found a new study that published Wednesday in the Proceedings of the > Royal Society B journal.

> A prior study by the same authors found the same thing occurred in a woman's > follicular fluid.

> Think of it as a chemical "sorting hat" \-- dictated by a female's > reproductive secretions -- that help sperm who are most likely to give her > offspring a genetic boost in survival.</comment>


Ares 1-X countdown - 2 minutes and counting ... - <AUTHOR>

Countdown is on - about two minutes to go ... <comment><AUTHOR> Stream: <http://www.space-multimedia.nl.eu.org/stream/nasa.php></comment>


Of Gravatars and Robohashes - <AUTHOR> http://www.codingthewheel.com/internet/of-gravatars-and-robohashes <comment><USER2> That is really cool! ;)

I didn't realize that this was a use-case anyone was interested in, but it sort of makes sense. I've added a parameter you can pass to RH.org to deal with the gravatar pull on my side, so you don't have to.

This adds a bit of serverload, since I need to make a bunch of requests, but it's not THAT bad.

<http://firstname.lastname@example.com?gravatar=yes>

If you pass gravatar=yes, it will make a pull to the gravatar URL for that address. If something exists there that isn't the default, it will issue a 301 over to the site.

Otherwise, it will return the robohash you requested. It also passes the size param over to Gravatar, just to be nice ;)

<comment><USER3> Gravatar uses hashes for privacy so the email addresses themselves do not have to be transmitted.

To maintain email privacy, you could use a straight pass-through when using Gravatar. In this case, your URL could look like:

[http://robohash.org/620050a4db5104bae758cd75171d64ca?gravata...](http://robohash.org/620050a4db5104bae758cd75171d64ca?gravatar=yes)

<comment><USER2> Good idea!

I've added this.

Try - [http://robohash.org/620050a4db5104bae758cd75171d64ca?gravata...](http://robohash.org/620050a4db5104bae758cd75171d64ca?gravatar=hashed)

</comment></comment></comment><comment><USER4> Nice work, but the "they look like they were drawn by programmers" comment makes me think you missed the point of Gravatar's specific default avatars.

They're intentionally ugly. The theory is that an ugly default avatar makes the user more likely to upload their own image.

<comment><USER5> Interesting point. Wavatars are Shamus Young's original work.[1] Identicons[2] and monsterids[3] are Scott Sherill-Mix's work. I don't think those guys were shooting for "ugly", but I agree an ugly or nondescript avatar could incentivize users to upload a custom one. And that may have played into Gravatar's decision to support these avatar types.

[1] <http://www.shamusyoung.com/twentysidedtale/?p=1462>

[2] <http://scott.sherrillmix.com/blog/blogger/wp_identicon/>

[3] <http://scott.sherrillmix.com/blog/blogger/wp_monsterid/>

<comment><USER3> Minor correction: Identicons were created by Don Park who open sourced a Java implementation. Scott adapted it for WordPress and gives credit to Don credit for the idea in your link[2]:

"A couple weeks ago I made a WordPress plugin to generate unique monsters for each commenter. Don Park came up with the original idea for representing users with geometric shapes. Since I already had the framework in place I thought I'd make a WordPress plugin for the original geometric Identicons."

</comment></comment></comment><comment><USER6> yikes, Gravatar has an open redirect.

[http://www.gravatar.com/avatar/8ca7425c8ada807b9bf6934f10d59...](http://www.gravatar.com/avatar/8ca7425c8ada807b9bf6934f10d59fa.jpg?&d=http%3A%2F%2Fnews.ycombinator.com)

It's a fun trick, but it should't be possible.

<comment><USER3> Gravatar is designed that way so you can use any default image.

The technique is described in the Gravatar docs under "Default Image."

<http://en.gravatar.com/site/implement/images/>

<comment><USER6> Ah. But I'd expect think that they'd limit it to only images, or do some sorta safety checking. I recognize the performance concerns, but it's too easy to add a malware redirect onto their trusted url.

</comment></comment></comment><comment><USER7> Very nice, I was planning to implement a similar thing with for 'anonymous' ip-based human readable usernames to identify users without forcing them to create profiles.

An excellent bonus - my robohash looks exactly like Bender from Futurama :^)

<comment><USER8> How will you handle thousands of users behind a corporate firewall?

</comment></comment><comment><USER9> I'm curious how many variations robohash uses. It seems either you've got a very wide variety of custom graphics elements, or only a few elements and have to draw a very wide number of images to fit in them.

Each two digits of hex is 255, and I count 16 pairs, but can think of only 8 elements in the photos (eyes, ears, nose, mouth, head, body, arms, background).

If it's those 8 elements and they're derived from four digits in the hash, then you need 65,535 or so different ears.

I'm guessing the solution to this is to reduce the hash further... so you get more repetition where two texts produce the same robot, but apparently they've not made it too bad.

How far did robohash reduce it? Or how far should one reduce it? How many images does a robohash art set have?

<comment><USER2> It depends on which set you use.

There are three sets-

The default set has 10 base colors, 10 base faces, 10 Bodies, 10 Eyes, 10 Accessories, 10 Mouths.

There are then 2 sets of 10 backgrounds.

So 3(10^6) _(2_ 10) ~= 60,000,000</comment></comment>


Universal Basic Income Can Work, and Here's How: Andrew Yang - <AUTHOR> https://youtube.com/watch?v=HzKwW6-Feog <comment><USER2> $2.4 trillion a year program. Pie-in-the-sky. It would be the biggest expansion of Federal control over the economy in history. An unprecedented intervention in capital inflows and outflows, the scale of which has never been tested. It's dubious and dangerous on many levels.

</comment><comment><USER3> Is there a plan for Universal Rent Control?

I am skeptical of how this may work out in practice.

Given rates of homeownership/rent in metropolitan areas without rent control, wouldn't this result in a significant portion of renters (younger people especially) quickly having to pay more in rent?

Thats the scenario I think about, lots of people suddenly have $12k more per year to spend, why wouldn't landlords just increase rent proportionally?

<comment><USER4> Rent control doesn't work long term [0]. If you have a healthy housing market, then normal market forces will keep rents down. That is not to say that creating a healthy housing market is easy, but it is a different problem.

At a high level, UBI is a wealth transfer from the rich to the poor [1]. One extreme is that 100% of the additional wealth received by the poor goes to rent, another extreme is that 0% does. [2]. The number will probably fall someplace in the middle, along with inflation on other assets. Regardless of what asset classes see what inflation, and what the exact amount of inflation is, the bottom tier of wealth/income people will control a bigger share of buying power, which should help them in aggregate.

Returning to the housing question, there is reason to think that UBI will improve the health of housing markets. One of the major issues in housing we are seeing is economic activity being concentrated in a few wealthy areas, driving up local housing prices. In addition to being a wealth transfer on an individual level, UBI is also a wealth transfer on a geographical level, where money goes from the few rich centers to the less rich areas. On the margins, this will cause people to move away from the high-demand areas and into the low-demand areas. I doubt this force will be strong enough to fix all of our housing markets, but I would expect it to help.

[0] Although it can work as a policy to shift market risks from the renter to the landlord; which may be worth doing.

[1] Assuming a rational funding system.

[2] Conceivably, the numbers could pass either bound, but I think that possibility falls clearly in the 'you need more specific justification; bucket.

</comment></comment><comment> dfeojm-zlib AY's on the right track and UBI would reduce inequality with a simple and effective plan, but the problem is he seems to be an one-issue candidate, and those are rarely perceived to be equipped to lead (i.e., overall strategy, track-record and stated positions on issues) and don't appeal to enough voters.

<comment><USER4> You are assuming that he is trying to win. Being 1 issue is a great way of advocating for that issue. If you aren't going to win anyway, it is probably a more influential approach than trying to advocate a little bit for everything. He got the idea into the national discourse. Now 4/8/16 years from now, we are more likely to hear it from more viable candidates. Just look at what happened with Bernie's policy positions (although his were so popular that he someone managed to almost win the primary).

As an added bonus to Yang, this could give him name recognition that would be beneficial for his future political career.

</comment></comment><comment><USER5> Really interested to see where this goes. I think UBI is the best solution to a world of automation and Yang is a smart guy well versed in startups.

</comment><comment><USER6> Perhaps at the next debate, Mr. Yang will get more than two questions and an allegedly dead mic.

</comment><comment><USER7> He wants to add a federal vat. What happens to the local sales tax ?

</comment><comment><USER8> If UBI is truly universal will it create inflation? Would there be some upper bound where taxes > UBI on certain individuals?

<comment><USER9> There will surely be people who pay a lot more tax than they receive in UBI. The key thing is not to build an elaborate gameable system to decide who should be eligible for UBI and what it may be used for.</comment></comment>


Verifying smart contracts in Libra's Move language - <AUTHOR> https://synthetic-minds.com/pages/blog/blog-2019-09-11.html <comment><USER2> Very nice! Is the synthesis post ready?

<comment><AUTHOR> Yes. We did all the work together. Was going to talk about that one later, but since you asked:

Synthesizing smart contracts from test cases. [https://synthetic- minds.com/pages/blog/blog-2019-09-12.html](https://synthetic- minds.com/pages/blog/blog-2019-09-12.html)

<comment><USER3> Would love to hear back from you guys, richardheartauthor at gmail, emailed you in oct '18, and jun '19, and now.

<comment><AUTHOR> Thanks for the ping. Looking forward to running your contracts through our system.</comment></comment></comment></comment>


Ask HN: How did you make your first dollar online? - <AUTHOR> <comment><USER2> I just implemented the payment system on my job board [https://www.linuxjobs.fr](https://www.linuxjobs.fr) but it was not yet mandatory to pay to post a job offer. Someone thought it was and paid!

Just the "Wow" moment of my side project :) Of course I switched immediately to enforce it was mandatory from now on to pay to post job offers.

</comment><comment><USER3> I copy pasted a link from clickbank into some cheap ad. Spent $10, made $300

<comment><USER4> So the process is you buy an affiliate account from clickbank, then you entered that link into a Facebook ad or what?

<comment><USER3> I googled "cheap traffic" and by shear luck it got positioned on a relevant forum.</comment></comment></comment>


You're Either Venture-Backed or a Lifestyle Business: The Big Lie (2014) - <AUTHOR> http://hunterwalk.com/2014/03/04/youre-either-venture-backed-or-a-lifestyle-business-the-big-lie/ <comment><USER2> I'm glad someone still has enthusiasm for job creating, real-value based on profits business models</comment>


Microsoft Orleans – An approach to building distributed applications in .NET - <AUTHOR> http://dotnet.github.io/orleans/ <comment><USER2> "actors are called 'grains',"

If you can write a sentence "X are called Y", and X is more well-known, drop Y.

"You can then send messages to the grain by creating a proxy object, and calling the methods: var grain = GrainClient.GrainFactory.GetGrain<IMyGrain>("grain1"); await grain.SayHello("World");"

var brain = BrainClient.BrainFactory.GetBrain<IMyBrain>("brain1"); await brain.Say("WTF");

<comment><USER3> I share your sentiment.

I'd been away from .NET/C# for a few years and came back to find that they dialed the abstraction level to 11.

I adore C# as a language but I find myself increasingly alienated by its generally accepted coding style.

I find that Microsoft's products have extremely unintuitive naming schemes at both a low level (language, standard libraries) and a high level (.NET product word salad naming schemes, Office 365 referring to a diverse and inconsistent range of products...).

The skeptic in me thinks that this may be an attempt at educational lock-in.

The lines between marketing and technology have definitely been blurred.

<comment><USER4> Seems to me all big software houses are affected of this in their long standing products. You start a new thing and come up with a good name. 15 years with 17 product cycles down the line and you have a whole forest of names that have some relation to this thing.

See also:

iTunes (OSX), iTunes (iOS), "Music" (iOS), Apple Music, iTunes Match, Genius and the iCloud Music tab. Podcasts and videos are also all in there somewhere, know what dear user, _you_ figure it out k?

<comment><USER5> They brought in very highly paid, smart engineers. Which have periodic performance reviews. If they don't we "we designed and implemnted X, Y, Z awesome new abstractions / features" everyone in the room bosses, employees, higher ups, marking it going to feel let down. So, we have ever more features.

"Say, Steve, what have you been doing last year?" \- "Welp, just making sure things work, fixed some bugs, documentation, took customer calls. The product essentially works, people love it". "Wait, so we haven't shipped any new features, hmm, ok...".

vs the response of "We implemented fizz, bar, quux features. We tore down old zig and added zag instead. It is really the same as old zig, but now look green and re-written with latest framework we saw in HN headlines". "Oh great, you get a promotion and a raise".

I am being a bit silly, but it is only half-joking, it is how software industry often works.

</comment></comment></comment></comment><comment><USER6> Orleans is just fantastic.

343 Industries famously used Orleans for Halo 4 backend services infrastructure. Caitie McCaffrey's presentation can be found here: [https://www.infoq.com/presentations/halo-4-orleans](https://www.infoq.com/presentations/halo-4-orleans)

You may be interested in Obit ( [https://github.com/orbit/orbit](https://github.com/orbit/orbit) ). It is inspired and based on Orleans, except it's written in Java. Similar concepts and semantics. ( a BioWare project )

<comment><USER7> Why not Akka/Akka.net? It looks more mature framework with bigger community and you can find much more resources about it.

<comment><USER8> I've experimented with both; I've done some Akka.net training. My thoughts:

1\. Orleans is very clean but highly opionated and this results in what I see as operational shortcomings, e.g. I prefer running discrete Windows services that I can start/shutdown to provide fault isolation and safe upgrades, but this doesn't seem to be directly supported in Orleans (the documentation speaks about "restrictive placement strategies" to ensure certain grains are located in certain silos, but I could never figure out how to achieve that, and it also seems against the design to have such a level of control). If it fits what you need, it's really a nice solution.

2\. Akka.net's API is very messy and out-dated, in my opinion; I'll give some examples. You have to inherit from Akka.net classes, which makes me very nervous from a testing standpoint. Messages are untyped. There is no easy way to understand the interface (sequence of valid message flows) to an actor. This suggests maintenance will be tricky after some time away from the code unless you carefully design your actors (yes, arguably this could be said of any code). Documentation for fundamental topics is still incomplete in places (e.g. [http://getakka.net/docs/working-with-actors/handling- message...](http://getakka.net/docs/working-with-actors/handling-messages)). Persistence still confuses me after reading it 5 times. That all being said, it's a straightforward API clone of something that is proven and accommodating to the different development styles required for a broad range of back-end services.

<comment><USER9> In Akka you can have typed actors, however you're missing the point.

In the actor model you often end up modeling state machines, and especially in the presence of asynchrony, it is impossible to meaningfully add types to such state machines. Because you see, the full set of messages that an actor recognizes at some point is much less interesting than the set of messages an actor accepts right now.

Another problem is that actors often communicate with multiple other actors at the same time, possibly aggregating data from multiple sources, outputting data on multiple channels. Thus a single actor can expose different APIs, depending on whom it is taking to.

And yet another problem is that often actors act as proxies or supervisors, simply forwarding messages around.

Basically people complaining about the untyped nature of actors are terribly misunderstanding the actor model. Or distributed systems.

<comment><USER10> You don't add types to state machines, however you can add typed ports and channels to actors. There is no requirement for a single inbox for messages. See kompics [http://www.springer.com/la/book/9783642450648](http://www.springer.com/la/book/9783642450648)

</comment></comment></comment></comment></comment><comment><USER11> For those interested in distributed, high-scale computing on .NET, I'd also recommend having a look at MBrace: [http://mbrace.io/](http://mbrace.io/)

MBrace supports F# and C# and is designed to work well in interactive scripting scenarios, which lets you develop scalable systems gradually using REPL. I think it is complementary to Orleans/Akka.Net, so it is worth knowing it exists!

</comment><comment><USER12> Comparison of Orleans with Erlang and Riak Core:

[http://christophermeiklejohn.com/papers/2015/05/03/orleans.h...](http://christophermeiklejohn.com/papers/2015/05/03/orleans.html)

</comment><comment><AUTHOR> I did not know about this until I looked at the awsome-dotnet list[1] .This project is based on Microsoft research[2] and is heavily used internally and externally at Microsoft (Halo and Skype project). I think the Microsoft Azure Service Fabric is cloud version of the orleans might be originated from this framework(I may be wrong).I have done some sample applications and i think this is a good alternative to AKKA.NET

[1][https://github.com/quozd/awesome-dotnet](https://github.com/quozd/awesome- dotnet) [https://www.microsoft.com/en-us/research/project/orleans- vir...](https://www.microsoft.com/en-us/research/project/orleans-virtual- actors/)

<comment><USER13> > I think the Microsoft Azure Service Fabric is cloud version of the orleans > might be originated from this framework(I may be wrong)

Service Fabric is a confusing beast. It _includes_ a Virtual Actor runtime which is indeed very heavily inspired from Orleans, but it is a reimplementation. Orleans is built for "cloud" scenarios. You can run Orleans on top of Service Fabric using a host I wrote: [https://github.com/OrleansContrib/OrleansFabricSilo](https://github.com/OrleansContrib/OrleansFabricSilo)

</comment></comment><comment><USER14> Why does Microsoft keep doing this, over and over again a technology becomes big, and Microsoft says "learning x is hard, we developed Y so you can do X without learning it". Which sounds good on the surface, but the trade off is 1. You can't leave the platform and reapply the concepts... you're stuck in Microsoft, but even more importantly 2. The process of abstracting away the thing you're trying to avoid learning means that you're probably doing it less efficiently.

<comment><USER13> In this case you can: Orbit (by Bioware/EA) for the JVM also implements the Virtual Actor model. Hopefully other frameworks will adopt the model, too. Orbit: [https://github.com/orbit/orbit](https://github.com/orbit/orbit)

</comment></comment><comment><USER15> I myself am mostly aquainted with Akka for Scala. So I was wondering what different design decisions they made, if any. After all a second implementation of a framework is often better than the first.

They do go into that in the research paper [1].

"Actor platforms such as Erlang [3] and Akka [2] are a step forward in simplifying distributed system programming. However, they still burden developers with many distributed system complexities because of the relatively low level of provided abstractions and system services. The key challenges are the need to manage the lifecycle of actors in the application code and deal with inherent distributed races, the responsibility to handl e failures and recovery of actors , the placement of actors, and thus distributed resource management. To build a correct solution to such problems in the application, the developer must be a distributed systems expert. To avoid these complexities, we built the Orleans programming model and runtime, which raises the level of the actor abstraction."

It's an interesting question how hard it would be to offer such a often-good- enough option in Akka for the cases when you don't have the need or the time or the team to develop a custom distributed computing model.

Edit: maybe Lagom is meant to fit that space. I think it's wider in scope than 'easy actors' though.

<comment><USER15> For posterity's sake: I just noticed this thorough comparison between Akka and Orleans from the Akka team. [1]

[https://github.com/akka/akka- meta/blob/master/ComparisonWith...](https://github.com/akka/akka- meta/blob/master/ComparisonWithOrleans.md)

</comment></comment><comment><USER16> I saw a talk about how this was used in Halo. Seems very impressive but I haven't had a project that needed this sort of scale since then. They are working on supporting .NET Core, which is promising: [https://anclafs.com/#other](https://anclafs.com/#other)

 _Shameless plug:_ I wrote about this in chapter ten of my recent book ([https://www.packtpub.com/packtlib/book/Application%20Develop...](https://www.packtpub.com/packtlib/book/Application%20Development/9781785881893/10)). You'll need to have bought it for that chapter, but the first one is free.

<comment><USER17> Talk from Build 2014: "Using Orleans to Build Halo 4's Distributed Cloud Services in Azure" [https://channel9.msdn.com/Events/Build/2014/3-641](https://channel9.msdn.com/Events/Build/2014/3-641)

</comment></comment><comment><USER18> Service Fabric is a system that came out of this research. It's in use now by some game companies and Microsoft uses it as the platform that they build their offerings for Azure on.

[https://azure.microsoft.com/en-us/services/service- fabric/](https://azure.microsoft.com/en-us/services/service-fabric/)

It's really slick. Persistent distributed .Net collections. Actor model support.

[https://channel9.msdn.com/Events/Build/2015/3-618](https://channel9.msdn.com/Events/Build/2015/3-618) Service Fabric stuff starts at ~38 minutes in...

[https://channel9.msdn.com/Events/Build/2016/KEY02](https://channel9.msdn.com/Events/Build/2016/KEY02) Scott Hanslemann demos its use for a game called Age of Ascent? (Something like that.)

In addition to being in production use in Azure for several years it also runs on Linux.

</comment><comment><USER19> It's been a couple years since the last time I looked at Orleans. I must say though that even in the early days the documentation was pretty good; it's even more impressive now.

</comment><comment><USER20> Why this name ? As someone who has family in this town I'm wondering. Historical reasons ? Some character in a game I don't know about ? Random chosen french city ?

<comment><USER13> Back when this was an internal MS project (and I was working there, on another team), I believe the icon for the Orleans (internal) nugets and the demo apps was the Mardi Gras flag, which suggests that it's named after New Orleans. I might be misremembering.

</comment></comment><comment><USER21> I thought MS Nancy was firstname based, but I'm starting to wonder if they're revisiting "USofA oldest ally".

</comment><comment><USER22> The latest episode of Scott Hanselman's podcast covered Orleans in an interview with Richard Astbury.

[http://hanselminutes.com/536/exploring-the-orleans- distribut...](http://hanselminutes.com/536/exploring-the-orleans-distributed- virtual-actor-model-with-richard-astbury)

</comment><comment> UK-AL Whats the difference between service fabric and this?

<comment><USER23> Service fabric is a different distributed runtime with its own complex semantics. Orleans is conceptually simpler, with (virtual) actors running on "silos"; it's much closer to erlang.

</comment></comment><comment><USER24> What's up with the string identifiers? Don't break refactoring, that's just Java-esque.</comment>


Physicists May Have Evidence Universe Is A Computer Simulation  - <AUTHOR> http://www.huffingtonpost.co.uk/2012/10/11/physicists-may-have-evide_n_1957777.html

<comment><AUTHOR> This is kind of ridiculous but posted it to see if anyone had torn it apart already. Maybe it simply doesn't deserve mention...</comment>


Ask HN: (General-purpose) Reverse Auctions — undeveloped or needless? - <AUTHOR>

I've been playing with an idea of reverse auctions a bit — it appears that there isn't much reverse auction systems around — at least nothing that you can compare with even a fraction of forward auctions' market.
Though I am not sure — does that mean nobody's really interested in reverse auctions (neither buyers nor sellers) or is this niche is just undeveloped and will kind of welcome new players?
Of course there is no firm answer, but what do you guys think about it?
P.S. From Wikipedia: "It is a type of auction in which the role of the buyer and seller are reversed, with the primary objective to drive purchase prices downward. In an ordinary auction (also known as a forward auction), buyers compete to obtain a good or service. In a reverse auction, sellers compete to obtain business." <comment><USER2> I think the main issue is that the concept of a reverse auction is not practical for the seller in an online environment. In a reverse auction, the seller must work for a sale whereas in a conventional auction the site and the buyers do the work for them. Why should the seller "work" for a sale if (s)he doesn't need to?

On the flip side of the coin, it is generally accepted that if a consumer wants to purchase something (s)he must shop for it. So far attempts to revamp this process have not been widely adopted. Ebay tried a reverse auction segment of the site for a while and I don't think it worked out very well. That's not to say it can't be done of course, just that eBay couldn't do it with its approach - and all of its resources.

<comment><AUTHOR> hm, I haven't realized ebay had this — it might be interesting to know how exactly they did it.

While I was playing with this idea, I though that these things might help reverse auction solution:

* powerful market research/alert tool for sellers — i.e. sellers would need a powerful toolset to monitor demand on an RA site.

* social networks _integration_ and stuff like that — RFQ information shouldn't be locked in a single site — it should be spread to wherever potential sellers might find it.

* "ning.com" for auctions

<comment><USER2> It will be an interesting part of your process to learn that eBay's solution is in fact still live.

wantitnow.ebay.com

I had no idea it was still live. I think that the very existance of this site, and the fact that you've never even heard of it, can play a large (and positive) role in your development process. If you plan to attack this you have your work cut out for you. You also, however, have a great tool in Want it Now - theoretically "what not to do".

<comment><AUTHOR> whoa, eBay still has this feature and there are active listings! :)

</comment></comment></comment></comment><comment><USER3> Reverse auction already exists in some form. One thing, that comes to my mind is bidding for contracts. Normally outsourced companies bid lower to increase the chance of getting the contract(but yeah not always the lowest bidder gets the contract).

</comment><comment><USER4> The german site my-hammer.de does reverse auctions for craftspeople.

</comment><comment><USER5> scriptlance and other similar sites are essentially reverse auctions.

<comment><AUTHOR> though scriptlance is quite far away from being a general-purpose reverse auction, isn'it?

I am not to say that there are NO general-purpose reverse auctions. There are _some_</comment></comment>


Ask HN: How to prepare for a Front-end Developer interview? - <AUTHOR> How should I prepare for a front-end dev interview? What type of questions do you usually ask / or have been asked in an interview? <comment><USER2> Most modern production quality software systems there days are implementing fibonacci algorithms as part of their core business rules, controlled via a red/black tree. Usually it's held together by a fizzbuzz architecture so as a minimum you should be able to whiteboard fizzbuzz. You should understand all these things well, and really if you are doing modern software development these things hould be day to day tasks anyway so they should be top of mind.

<comment><USER3> I agree that it's far from what is needed in everyday tasks, but in defense of that process: if you are unable to implement fizzbuzz, Fibonacci numbers, etc., I am _almost sure_ you can't understand react sagas or dependency injection properly. Mixed with more open-ended questions (why was React built? how does it compare to Angular? What's a generator function?), I believe this isn't the worst type of interview.

See the other side: a significant number of applicants can't implement fizzbuzz, Fibonacci sequences or anything, but ask for ridiculous salaries and their portfolios appear to be mostly borrowed plumes. We need a process that isn't too time-consuming to id the chaff, allowing for false negatives (people who are good at Fibonacci numbers and interview questions, but not much else), but keeping the false positives low (I explain the Fibonacci sequence first so it doesn't become a math riddle rather than a programming task).

<comment><USER4> > their portfolios appear to be mostly borrowed plumes.

I don't understand this phrase. What do you mean by borrowed plumes?

<comment><USER5> When you aren't being forthright with the position you held on a development team. If you were a late onboard to a project and spent your time firefighting bug reports, you could perhaps lend cachet to your resume by omitting the relatively minor role you had in the project. Then you'd be borrowing the "plume in your cap" from your team, who deserves more of the credit.

edit: this is my best-fit guess. I have no idea what I'm talking about.

</comment></comment></comment></comment><comment><USER6> In my experience, closures are a topic that always comes up. It is also important to know how to handle a closure inside of a for loop. I've been asked about "this" binding, coercion, and CSS specificity. I've had to solve problems that required me to know about how to use stacks, trees, and nested for loops. Other topics that have come up are how to architect an app, concurrency, memoization, building out and handling api endpoints, and pass by reference vs. pass by value.

You may not think databases are a front-end topic, but I have been asked about them on more than one occasion. Prepare to talk about sharding, natural primary keys, what your favorite database is and why, etc.

Something that has been extremely useful for me is to have a project that I've built myself to show and talk about during the interview. Although I have had one interview where I was asked to talk in detail about how I built some of my projects that are in my github, I like to respond to general technical questions while referencing something I've built. A lot of times the interviewer will then use my app as a starting point into a discussion for how I would scale it. Here's an example of an app I built quickly and have used for discussion in interviews: [http://moviemap.xyz/](http://moviemap.xyz/) More here: [http://valeriemettler.com/](http://valeriemettler.com/)

<comment><USER7> > In my experience, closures are a topic that always comes up.

Opinions will differ, but IMHO closure is a great concept to divide those who know JS at a conceptual level (or at least have crammed for the interview) from those who don't.

<comment><USER8> I agree. We always put the little 'for loop that creates a list of functions that spit out the current number of the iteration' exercise first in all of our interviews. Generally, when people solved that one fast, they also did well in the rest of the interview and if they struggled there, they also had a hard time coming up with an elegant solution for most of the other tasks.

What I also like about it is that a closure isn't the only way to solve it. You can use `let` for example to make sure the variables are block scoped, or use `bind` to partially apply a function with the number.

So in the end it's a conceptually very simple exercise that can give you a very good insight into how much the candidate knows about how JS actually works.

<comment><USER9> Would that exercise be the following? I'm not sure I understand what's being tested.

      const f = (k) => {
        const funcs = [];
        for(let i = 0; i < k; i++) {
          funcs.push(() => i);
        }
        return funcs;
      }

      const test = f(4);
      console.log(test[0]()); // 0
      console.log(test[1]()); // 1
      console.log(test[2]()); // 2
      console.log(test[3]()); // 3

<comment><USER10> Try writing that same thing without ES6.

<comment><USER9> I'm also in the process of interviewing for a front-end engineer position, so thank you for replying and providing feedback. I'm assuming it has to be written this way because the function being pushed was referencing i, which was within the scope of the closure. Turning it into an IIFE breaks out of that. Thoughts?

      // Assuming pre-ES6
      function iterate(k) {
        var funcs = [];
        for(var i = 0; i < k; i++) {
          (function(num) {
            funcs.push(function() {
              return num;
            });
          })(i);
        }
        return funcs;
      }

      var itTest = iterate(4);
      console.log(itTest[0]()); // 0
      console.log(itTest[1]()); // 1
      console.log(itTest[2]()); // 2
      console.log(itTest[3]()); // 3

<comment><USER7> I'd probably ask you to do the printouts from within the function itself.

If you haven't already read them, I highly recommend the You Don't Know JS series of books. One of them covers this exact question.

<comment><USER11> neat series of books. thanks for the tip

[https://github.com/getify/You-Dont-Know-JS](https://github.com/getify/You- Dont-Know-JS)

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER12> You should at least be familiar with the major front-end libraries and frameworks - React, Angular and Ember. You don't necessarily need to "know" them, but at least know about them.

You should be familiar with what ES6 is and what Babel does. These technologies probably won't be specific questions per se but if they come up and you can't speak about them, it'd be a red flag.

Even for a front-end developer you should have a basic knowledge of data structures like linked lists, binary trees, min/max heaps, depth/breadth first search, tries, recursion, hash tables, etc. These often come up in whiteboarding questions.

Practice whiteboarding on an actual whiteboard so you get used to writing code then practice on hackerrank so you get used to quickly writing code that actually compiles. Some companies only use whiteboards, others want your code to run.

Make sure you think of test cases for your problems. TDD in an interview is usually a good sign.

Usually knowing this stuff and having some sample code will usually get you through most of the interview. Knowing the specific things mentioned in other comments is useful, but I can't imagine not hiring someone because they didn't know some specific CSS selector or how to use flexbox.

Other tips - don't get visibly flustered, talk your way through problems. Stay postive about past employers. Good luck!

<comment><USER13> > Even for a front-end developer you should have a basic knowledge of data > structures like linked lists, binary trees, min/max heaps, depth/breadth > first search, tries, recursion, hash tables, etc.

I would never care about these if I was specifically hiring a front-end dev. I've never once seen any of them come up in the context of front-end work in my entire career. And in fact an interviewer asking questions about them would be a huge red flag for someone who prioritizes nerd-cred over actual business needs, and is therefore likely to make poor decisions.

<comment><USER14> I don't understand how that's possible. For example, in a recent project I needed to implement a path-finding algorithm to draw connections routed around arbitrarily-placed boxes. More recently, efficiently snap a line to the nearest edge from an in-memory set of (again, arbitrarily placed and changing) objects as the mouse moves. I'm having to use and think about some item from that list on a daily basis. Where's the disconnect here - are we talking about different kinds of front-end work?

<comment><USER13> > Where's the disconnect here - are we talking about different kinds of front- > end work?

Yeah I would assume so. Of course if know the job requires such knowledge, you should interview for it. But I'm thinking of more average front-end work, where you'd be building forms or dashboards or ordinary websites.

It sounds like you're building a complex application that just happens to be hosted in a browser. Although even then, I'd argue that while your knowledge of when to apply those algorithms is important, you still shouldn't be writing them yourself. You should be finding a well-vetted library and taking the function from there.

<comment><USER14> We may be on the same page here. I don't like the way dev interviews are run and I think the focus on textbook algorithms is misplaced. I would say if your interview process can be aced by somebody hitting the books for a month, you're not testing for hard enough things.

I was just a little surprised about those particular items because I feel like they're such an essential background for all software development. But I don't think they should be quizzed for in an interview.

<comment><USER15> So, so many people do things the hard and reliable way, or don't do them at all and sacrifice some desired feature, because they don't recognize a well understood computer science problem lurking underneath a business problem or a UI implementation.

I'm not saying that's what anyone in this discussion is doing, just that I see it everywhere (and have done it myself). 1000s of lines of incomprehensible code because no one realized that this drag and drop flow chart creation interface can be understood as a graph.

</comment></comment></comment></comment></comment></comment><comment><USER16> If the anecdotes I read here are correct, you should be prepared to implement a red-black tree in C, followed by an A* pathfinding algorithm on the whiteboard.

I think the best preparation you can do is to spend several hours reviewing your old projects.

For each project, recall and be prepared to explain in depth:

\- The biggest technical challenge you faced and how your team solved it

\- The technical tradeoffs your team made in the implementation, and whether you would make the same tradeoffs today

\- What your specific contributions were to that project.

\- If you can bring code that's great; if not then have the high-level design in your head and be ready to outline and explain it.

If you're anything like me, for three or four projects that represents a couple days or more of preparation.

<comment><USER17> Asking a front-end developer to write a red-black tree is insane. Is anyone actually doing that?

<comment><USER18> I'm pretty sure the OP is making a joke.

</comment></comment></comment><comment><USER19> I'm a front-end dev going through the hiring process right now. Here's a list of some of the questions I have been asked in technical interviews: \- What is a clojure? \- What is a callback? \- What is an IIFE? \- How can you use scope to keep a copy of i in a loop? \- What is going on when you click a link to go to a website? \- Difference between classical inheritance vs prototypical \- Difference between object-oriented programming vs functional \- Knowing what 'this' is referencing at different points inside a function/class \- Difference between <p>, <div> and <span> \- Difference between css selectors: '.classA.classB', '.classA .classB', '.classA > .classB' \- Difference between 'x is undefined' and 'x is not defined' error messages

Programming problems: \- Calculating fibonacci numbers \- Depth-first binary tree search \- Turning a hashmap with multiple levels of embedded hashmaps inside-out \- Handling API response data to create new objects \- Creating a login form \- Using media queries to make responsive pages \- Determine if word is a palindrome \- Using recursive functions

Knowing methods to reduce computation time and space with hashmaps and arrays is important. You will also be asked to state the computation time and space of your solutions

Framework-specific questions: \- What is the difference between a component and a directive? (AngularJS) \- What is the difference between a service and a directive? (AngularJS)

I'm sure there's more I've forgotten.

[https://www.interviewcake.com/](https://www.interviewcake.com/) and Hackerrank can prepare you for programming problems but outside of the giants you don't often get asked these.

<comment><USER20> you meant closure ?

<comment><USER21> No he's from the UK. He meant clousure

<comment><USER20> lol man.

</comment></comment></comment></comment><comment><USER22> Generally, I start by getting an idea of how well a candidate understands JavaScript with a problem like this:

Write a function that enables the following API...

        createOlympian()
          .name('Katie Ledecky')
          .sport('Swimming')
          .country('USA')
          .log()

        // Katie Ledecky, Swimming, USA

Next, if things are going well, I have the candidate transform a JSON collection response to match some arbitrary requirements using Lodash/Underscore.

After that, I focus on the candidate's experience and talk about projects they've worked on, their process and what they're looking for in their next position.

If you're a front-end candidate that's solid at design, visualizations or complex layouts, I'd encourage you to bring your personal laptop and show off some of the work you've done on your own.

<comment><USER23> Pointers on how to improve this (while maintaining your API) would be great :)

var createOlympian = function() { return (function() { var attrs = []; // private variable for our olympian attributes

        var olympian  = {
          name: function(name){
            attrs['name'] = name;
            return this;
          },

          sport: function(sport) {
            attrs['sport'] = sport;
            return this;
          },

          country: function(country) {
            attrs['country'] = country;
            return this;
          },

          log: function() {
            console.log(attrs['name'] + ", " + attrs['sport'] + "; " + attrs['country']);
          }
        };

        return olympian;
      })();

};

<comment><USER24> Bonus points for being meta?

        function createOlympian() {
          let props =  ['name', 'sport', 'country']
          let olympian = {
            log() {
              console.log(props.map(prop => this[prop]).join(', '))
            }
          }
          props.forEach(prop => {
            olympian[prop] = function(value) {
              this[prop] = value
              return this
            }
          })
          return olympian
        }

<comment><USER25> This is neat, but those functions can only be used once.

</comment></comment></comment></comment><comment><USER26> Here are a few questions/problems I was asked in from-end interviews a couple months ago:

Write a function that accepts an array of ints and a target number. If two of the numbers in the array can add up to the target, return their indices. (aka Two Sum)

Write a function that accepts an int x and prints a spiral of "#"s so that the number of "arms" in the spiral equals x.

Write a function that accepts a month and a year, and draws a calendar view of that month.

Given a non-negative int x, repeatedly add all its digits until the result has only one digit.

I think I was also asked something that involved a tree structure, but I can't remember the specific problem.

I thought all of those questions were fucking stupid. The good interviewers, IMO, gave me a "take-home" problem of building some mini front-end app that hit an API, and the really fun one involved reverse engineering an unpublished API - that's how I got my current job.

I spent a lot of time studying the h5bp Front End Interview Questions[1], and the only front-end specific question I was asked was, "What is an SVG sprite?" during an initial phone chat with a CEO.

1\. [https://github.com/h5bp/Front-end-Developer-Interview- Questi...](https://github.com/h5bp/Front-end-Developer-Interview-Questions)

<comment><USER27> >>The good interviewers, IMO, gave me a "take-home" problem of building some mini front-end app that hit an API, and the really fun one involved reverse engineering an unpublished API - that's how I got my current job.

I agree with you, but whenever this subject comes up, a lot of folks here on HN complain that they have full-time jobs and families and don't have time for "take-home" questions.

<comment><USER26> I understand that point, but I just personally hate the stress and the irrelevance of the "over-the-shoulder" algorithm problems that a recent CS grad would be almost more suited to answering. If I'm really interested in working for a company, I have no issue spending a couple hours building a little app to prove my chops.

</comment></comment></comment><comment><USER28> In general, don't pretend to be someone you are not. If you don't know something, just say "I don't know this, but I learn quickly". Being flexible, open-minded and easy-adapting is much more important today than knowledge of specific languages, algorithms or frameworks. Google knows everything, you only need to be able to ask it right questions and handle the answers. So, just be ready to prove that you are such kind of person.

</comment><comment><USER29> There's a pretty good repository of potential questions for front end developer interviews on GitHub[0]. I'd suggest skimming through the list and making sure you've got a decent grasp on most of them.

Ideally you'll get mostly questions that are relevant to what your job will be, but I wouldn't be surprised to see some CS stuff in there as well (basic data structures & algorithms). Good luck!

[0]: [http://h5bp.github.io/Front-end-Developer-Interview- Question...](http://h5bp.github.io/Front-end-Developer-Interview-Questions/)

</comment><comment><USER30> Having gone through this situation before, my biggest mistake while performing this type of interview was not actually having candidates build something with the team. Frontend development is usually very visual and UX-oriented, so it's important to see what they can build and their attention to that type of detail. There's plenty of knowledge questions that can filter candidates down by experience, but until you get them working in your setting, you won't be able to see whether they can build something you actually want and get along with others in a team-oriented way. My suggestion is to give them a small project they can build during an interview with you/your team.

<comment><USER13> Couldn't agree with this more. When I originally read the OP's question, I assumed he was asking how to prepare as a candidate, and you gave a great answer for how to prepare as an interviewer -- the question is ambiguous and even on re-reading I'm not sure which he meant.

To add to your answer, having them build a clone of a simple game in 1-3 hours, especially when they have to balance a bare bones look with more features versus a slicker look with fewer features, and deciding which to cut and what's important to them and how they think about it -- all that can be revealing.

</comment></comment><comment><USER31> Understand Big O notation [1] and how to use more technical JavaScript features like .map [2] and .reduce [3].

I get asked these frequently, and it was never mentioned to me when I asked for advice on how to prepare. This may be specific to senior developer positions.

[1] [https://en.wikipedia.org/wiki/Big_O](https://en.wikipedia.org/wiki/Big_O)

[2] [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)

[3] [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce)

<comment><USER32> Big O notation is an entry-level question, any fresh grad should know it well.

</comment></comment><comment><USER33> Same way you prepare for any other interview - you don't.

There are a ton of developer positions, after going through about 5-10, you'll know every question they ask you, off the top of your head.

So there's no need to stress or prepare - you'll screw up the first few and it'll get easier going forward.

The mindset you should be coming in with is I'm a new guy, willing to learn and work the extra hours. I don't know everything and will need a little mentoring to get me going - if you don't offer that, that's ok, there's plenty of other places that do.

You're just starting out - you'll get screwed on salary and get worked to the bone for the first few years until you learn to say no. The advice I'd give is have a little more confidence in your inner voice that tells you when you're getting fucked - and know that you're right.

That's more important :)

</comment><comment><USER34> Before Babel, I often used to ask about code organization/modularization, mostly to filter out candidates who haven't been on a big project and have only copied and pasted jQuery snippets together; today I'd ask if you use Babel modules and why/why not. As other people have said, closures will surely come out. A favorite of mine is array functions: map, forEach, filter. Also, promises, callbacks, workers. Finally, xhr throttling.

<comment><USER35> Why would Babel change drastically the way you organize your code? Isn't it a just compiler?

<comment><USER34> I really meant ES6 modules, I said babel because it's what made ES6 features actually usable in production.

</comment></comment></comment><comment><USER36> Aside from all the technical questions, don't underestimate the importance of knowing about the company you are applying to.

I've hired several developers over the last 10 years, and by the final round, there are often candidates with similar technical ability. The applicant that really understands the company they are applying to work for (the current state of their app, their competition, the direction you think they may need to go) will have an edge.

</comment><comment><USER37> Nice list here, but by no means exhaustive: [https://github.com/h5bp/Front- end-Developer-Interview-Questi...](https://github.com/h5bp/Front-end- Developer-Interview-Questions)

</comment><comment><USER38> For general programming questions I found [https://www.interviewbit.com/](https://www.interviewbit.com/) very good. It is both a tutorial and programming questions at the same time.

I was asked to describe the important properties of a hash map in a telephone interview. The interview contained less technical questions but various developers asked me about all areas of my CV. There was also a HTML/CSS/JS coding exercise to create a small application to a spec that they gave.

So expect to get questions on anything that you've put in your CV. If you're not familiar enough with it - take it out of your CV.

</comment><comment><USER39> Closures, specificity, home made getElementsBySelector, DOM traversal stuff, weird IE things, coding standards, an understanding of how jquery works, how to protect against npm poisoning/leftpad issues, lodash, semantic naming strategies, being opinionated (why is BEM shit/great?), box model, floats, flex box, centering techniques, an understanding of how plane old js works, cross origin/same origin stuff, basic design principles (spacing, fonts, information hierarchy, fitts law), react.

<comment><USER40> xhr, promises, a modern build tool (webpack? browserify?), prototypal inheritance, virtual dom, object oriented programming, when to add more abstractions and when to tear them down, front-end performance & memory profiling, browser dev tools, canvas, svg, service workers, browser caching, cookies, websockets, SASS, Ecmascript 6, API design principles, data modeling, when to use a hash and when to use an array, basic concepts of UX, and of course, most importantly, box shadows

<comment><USER39> All correct! Babel, Redux/data flow and immutable data structures. Basic software design principles. Anything else?

</comment></comment></comment><comment><USER41> JavaScript:

-Variable hoisting

-Es6/Es2016

-Experience with react, angular, or another modern js framework

-Do you understand build tooling? Webpack? It's becoming a standard.

Css:

-Given a task of basic ui animation, are you still using js or have you adopted css transitions and animations?

-Do you have experience with sass or less? Opinions?

Html5:

-Know it.

Http2

-How will this affect your life as a front end developer?

Tradecraft:

-What can you do when working with designers to make handoff easier?

-When is something good enough to ship?

-how do you learn a new, complicated code base?

</comment><comment><USER42> tl;dr Have a zen attitude about getting turned down. The best companies in the world are still spectacularly bad at technical interviews.

Whew, reading these answers is depressing. Not because of any of the answers that anyone has given (they are mostly good) but because it's a reminder of the state of both software engineering interviews and the state of the JS ecosystem.

I recently started a company but before that I was at a company that would be considered by most to be top-tier amongst places that create web based software. After leaving that job I interviewed at and received offers from several other places that are top tier by SV standards (think GooAmaFaceSoft and their similarly hyped but non-public peers).

One of the interviews was over coffee because networking really is the bees knees (there were further rounds involving actual programming). While it started as a fairly straightforward "tell me about…" interview, we eventually got to just chatting as peers in the industry. One of the points of discussion was the state of interviewing technical candidates. I've interviewed >150 candidates over the past 8 years. I'm opinionated about all sides of the process and I think I as well as the rest of the industry have a lot to learn.

In a moment of candor I said to the person across the table something along the lines of "I'm very confident in the fact that I'm a great engineer overall and that I'm particularly skilled and highly marketable as a JS dev because that's what I've been focused on for the past five years. That said, throughout these interviews, I wouldn't be surprised if I get an offer from about 50% of my interviews."

The person who has sat down to interview me and would later give me an amazing job offer mostly agreed with my statement. They tried to be comforting asserting that it would probably be a little more than half. In the end I got offers from 3 out of 5. All three of the offers were had a first year take home north of 2x my previous salary.

None of this is an indictment of the companies that turned me down, I just think it's worth saying to someone prepping for interviews that there's a strong chance that you'll get turned down. You might truly bomb and interview and you might walk away thinking you nailed it only to learn that they didn't feel the same way.

Don't let it get to your too much. Zen mode, enabled.

</comment><comment><USER43> I'm in the process of doing this and was told I needed to know sorting algorithms (among other things) so I made a barebones redux project to stuff it into. Not sure if this is your case but if it helps, take a look: [https://github.com/Outc4sted/AlgorithmAtelier/blob/master/sr...](https://github.com/Outc4sted/AlgorithmAtelier/blob/master/src/reducers/sortAlgorithm.js)

</comment><comment><USER44> In my experience interviewing candidates and being interviewed, the experience is wildly inconsistent. Most times, if it's a Front-End specific position, I wouldn't (and haven't been) asked about algorithms or data structures. I think the most important thing is to be able to talk intelligently about a bunch of subjects. Some examples:

\- Do you know a client side MVC? Do you know why the internet thinks this client side MVC is bad? What are some alternatives? When should you use what?

\- Why is SASS valuable?

\- In javascript, describe the this keyword. What is the difference between Call and Apply? Bind?

\- What is prototypal inheritance? How do you feel about it (no right or wrong answer, just a thing to talk about).

\- Typical web security vulnerabilities.

If I whiteboard a candidate usually it'll be something very basic, something like write a palindrome function in JS, then write it a different way, then tell me when to use which. Also, I ask a lot about a candidate's interests. Why do you think Elm is cool? What've you written with D3 that was nifty? Talk about the problems you've solved, how you solved them, and why it was interesting.

Most importantly: be passionate about learning and doing.

</comment><comment><USER45> When I interview front-end developers, I take a wireframe mockup, or sometimes just a screenshot (either from a real product, or just make one up), and ask "how would you implement this". I want to see if they know the toolkit, can make good choices, can discuss tradeoff (e.g. should something be a custom widget or a stock system), can discuss performance (what if that table had 100k items? would it still work?). Then I ask if they have suggestions to change or improve the design, just to see if they think of themselves as more of an implementer or as sharing the responsibility with the interaction designer (both have their place). Finally, I do make sure they can do simple coding tasks, and give them some questions to test their comp-sci background, though that wouldn't disqualify someone, it can help.

Oh yeah, I also ask them to talk about how to make an interface feel responsive even though most actions can trigger a network call that may take several seconds to respond.

</comment><comment><USER46> It heavily depends on the company and area I'd say.

At my company, an IT-Consultancy in Germany, the junior-position-baseline is a solid understanding of HTML and CSS, and at least a basic grasp of Javascript. For mid-level-positions I expect "fluency" in all of those areas, plus a good knowledge of standard-tools and accessibility. I also look for a good foundation in either design or CS, depending on the interviewees background.

The interview is the same for every level, though we look for different things of course. We ask the applicants to set up a basic front-end-file-structure and to start coding a design we created specifically for interviews. During that we ask them to think aloud and talk about the reasons they do things the way they do.

The second exercise is a palindrome-function in JS (or on the whiteboard for juniors).

They seem like simple tasks, but you wouldn't believe how many interviews we had where the person couldn't even code an img-tag from mind.

I understand that at Valley-Companies/Start-Ups, Frontend-Development includes many more advanced topics than in our case.

</comment><comment><USER47> Be sure to review these: [http://code.tutsplus.com/tutorials/the-30-css- selectors-you-...](http://code.tutsplus.com/tutorials/the-30-css-selectors- you-must-memorize--net-16048). When I interview candidates, I make sure they know more than just class and element selectors.

</comment><comment><USER48> I had to demonstrate how to inverse the value of an immutable object hashed data stream whilst ensuring that the dilithium matrix array was phase decoupled.

Seriously just be yourself, don't over think it. If you don't know something, don't be afraid to so, but you're keen to learn if it is something useful. You can't know everything, no one can, just be confident in the things you do know. Nothing worse than a faker, you'll be caught out anyway, you're going to be judged on your strengths not your weaknesses, unless the employer is crappy, and you wouldn't want to work for them anyway.

Good luck.

</comment><comment><USER49> It really depends on the job you're applying for. If you're applying for a job at a company that provides SaaS on a particular software stack that's gonna be really different than applying at a work-for-hire web development house. There's really not enough information here for me to give you any kind of useful advice. If you'r qualified for the job you should know the basics that are applicable to just about any front end web developer job.

I'd try to find out as much as you can about what the company you're applying to does so you can get familiar with that stuff.

</comment><comment><USER50> When I worked at Rackspace I recall the same sentiment as the majority of the comments here.. Testing for specific things the interviewer(s) happens to have fresh on their mind at the time. I've fallen into this trap myself and recall a particularly harsh interview we put an internal candidate through. It was almost a joke in this case and we wanted him anyway(incidentally he did surprisingly well regardless), but these were par for the course at the time. I doubt I could answer the questions I asked as well as he did if I had to today.

</comment><comment><USER51> I usually supplement the interview with a take home project, because front end web dev (emphasis on web) is about building interfaces and managing state really well and that is hard to test in an hour!

Some of the more domain specific stuff is about building a scalable components library that your team can use, testing your code, building assets in the most elegant way possible (gulp, webpack, grunt). So make sure you're very honest with your resume!! (dishonesty is bad).

For the case of front end web, here is what I would ask from the top of my head (thinking aloud):

\- A good interview will have some pair programming. I usually like to give a very simple mock. These mocks will have a simple task where I will ask you to implement me a two column layout, or a popup window. Therefore I'd like to see that you have strong fundamentals of CSS, HTML, and Basic DOM manipulation using JavaScript. Nice interviewers will allow the use of google!

\- You should understand how a network request and response works. I'll probably ask you to teach me what an AJAX request is to start. I hope to have a good conversation because I forget things often and like to learn from others.

\- I will probably ask you what are some ways to implement components that won't produce side effects in a large codebase.

\- I will probably ask you questions about how you plan to work with Design and other product stakeholders to ensure that you're able to iterate quickly on the front end. This is because requirements and design changes frequently (more common with companies that are focused on product versus growth/retention).

\- I will ask you how you approach testing, and how do you ensure your interface will work cross browser, cross device.

\- If you're really a generalist and you have no front end experience but a lot of other programming experience, I'll probably ask you to serialize a network response with JSON, where you'll create a map of ids and their resources (for fast access!) and walk through an object tree to do this. We can probably pseudo code this if you've never touched JavaScript and know nothing about its data structures (this jon snow case is rare, like jon snow).

\- If you're really junior I'll ask you a generic algorithm question because I'm probably going to train you on the job anyways. No one should be punishing junior people for being junior with stupidly difficult domain specific questions. Don't work somewhere where they punish you for being junior because they won't realize how much potential you have (you have a lot).

Last note: Good luck and have fun, remember to be yourself and try your best.

</comment><comment><USER52> It of course depends on the front-end stack.

HTML, Android, iOS, UWP, WPF, UWP, Qt

General design questions how a specific design would be implemented using the stack best practices.

Things not according to your opinion should have been designed better.

How to create an UI component in a specific stack.

How to avoid freezing UI effects and the best practices to have a responsive (in speed) UI.

How to use the framework features to adapt to several screens.

In the specific case of HTML, some additional general questions about JavaScript, with the typical _this_ trap.

</comment><comment><USER53> Im not an expert in frontend but key concepts kind of remains same across frontend design: MV*, pub-sub patterns, what not to do in a UI-thread, lifecycle of a page/view load, talk through on how candidate goes about representing a given json/xml data to a web page - can candidate show his skills in choice-and-usage of UI elements here.

Data structures.

Then specifics about language and framework.

Knowledge based questions like comparing frameworks - pros and cons. Technical challenges overcome in previous roles.

</comment><comment><USER54> I don't know how these things work, but I'd have thought showcasing your prior work goes a long way in determining if someone wants to hire you. A bit similar to how, if I wanted you to create an ad campaign for my product, I'd more interested in seeing other campaigns you'd done, more than anything else. To see how you quantified the problem and the solution you came up with. Isn't that what front end dev is?

</comment><comment><USER55> We hire people who've done something great or have attempted doing something great, and who love to work on finding a better mouse trap, so to speak.

</comment><comment><USER56> The ones that hired me just asked if I can do the job ;)

<comment><USER57> I got one of my best roles like this. Admittedly there was also a part where I was asked to share my laptop's screen and after one look the guy said "ok you're hired."

</comment></comment><comment><USER58> Here is a list of interview questions: [https://github.com/khan4019/front-end- Interview-Questions#fr...](https://github.com/khan4019/front-end-Interview- Questions#front-end-interview-questions)

</comment><comment><USER59> Depends on the company and what they are doing. If it is google/Amazon etc. be prepared for technical interview process similar to other engineers. Same problems of recursion, dynamic programming etc. with some component of domain Android knowledge.

</comment><comment><USER60> You got this, I believe in you. Go for No and that way you can't fail.</comment>


RIP Mrdocs (1963–2019) - <AUTHOR> https://www.scribus.net/r-i-p-mrdocs-1963-2019/ <comment><USER2> > A quick hop on Google, yielded a home page with Scribus 0.3.6, a Quark-like > DTP program which had just started to be developed. So, download, do the > ./configure bit and splat: Scribus won't compile. I fire off a quick e-mail > with the gobbly-gook error message I had yet to understand and surprisingly > just 20 minutes later a polite reply explaining the error of my ways. Good > sign…

today one will reach a stackoverflow page with a similar error, but won't be able to comment because they lack account privileges, then will try to post a question and be hit with an unsolvable captcha[1] and give up.

[1] [https://meta.stackexchange.com/questions/75965/the- recaptcha...](https://meta.stackexchange.com/questions/75965/the-recaptcha- has-become-too-difficult-for-humans-to-solve)

</comment><comment><USER3> If the site is still down, [https://web.archive.org/web/20190322200152/https://www.scrib...](https://web.archive.org/web/20190322200152/https://www.scribus.net/r-i- p-mrdocs-1963-2019/) has the page.

</comment><comment><USER4> Scribus is an underrated project, and has very good documentation. Now I know why. RIP.</comment>