E Programming Language - <AUTHOR> http://erights.org/ <comment><USER2> I'm always astounded by the depth to which Mark has explored this space. On more than a few occasions, I've come up with an interesting idea for a new protocol or programming language feature or piece of distributed systems infrastructure and told Mark about it, only to find he had already thought of that problem and discovered and solved several issues I hadn't even thought about yet.

Cap'n Proto RPC ([https://capnproto.org/rpc.html](https://capnproto.org/rpc.html)) is based on E's network protocol, CapTP, e.g. utilizing The Four Tables:

[http://erights.org/elib/distrib/captp/4tables.html](http://erights.org/elib/distrib/captp/4tables.html)

[https://github.com/capnproto/capnproto/blob/master/c++/src/c...](https://github.com/capnproto/capnproto/blob/master/c++/src/capnp/rpc.capnp#L116)

(You can think of this design as an extension of the file descriptor table concept in Unix, except that both sides may export descriptors to the other side (so that calls can flow either way), and either side can be responsible for assigning the numeric descriptor value for any particular description (which makes it easier to compensate for a high-latency transport).)

When I first told Mark I was working on an object-oriented RPC protocol, he insisted I visit him and listen while he explained all this to me, and boy am I glad he did... would have taken a lot longer for me to figure it out myself.

It's crazy that most of the content of erights.org was written over 10 years ago -- I think some of it goes back to the 90's, even.

<comment><USER3> Back in the mid 2000s at IMVU, I went deep on reading about E, EROS, Polyphonic C#, and Comega, which lined directly up with the problems we were having with asynchronous programming on the client.

Thus, I can point directly to E and friends as leading us to make such a successful, _correct_, asynchronous task engine.

It's funny to think about now. Promises and coroutines and promise pipelining and async are now well-explored, but at the time there wasn't much prior art to draw from, and everyone was figuring it out as they went. Do you synchronously block on futures? Should .then calls run on the calling thread if data was already available? How does cancellation work?

Once you have answers to those questions, you reach the higher-level ones: how do you structure your program so that asynchronous components can communicate? How do you unit test these interactions? What abstractions avoid needing to unit test every possible sequence of events?

We did a pretty good job and I feel blessed that we stumbled upon the E papers, leading us to create abstractions that stood the test of time.

Thanks Mark!

<comment><USER4> > Should .then calls run on the calling thread if data was already available?

This one hits close to home -- I remember being involved in a PR discussion for a JavaScript promises library where this was hotly (iirc?) debated. What conclusion did you reach? (I was on the side of consistency -- .then should not run synchronously even if it could.)

<comment><USER3> That's one where we got lucky. We made the wrong decision, but it didn't matter because the distinction was invisible when using the higher-level abstractions (like coroutines) and combinators.

My opinion now is that JavaScript does it right: `.then` should _always_ defer the callback. BUT, it does come at a real performance cost. And for code that is performance-sensitive and can handle the callback running immediately, the API should support a `.thenImmediate` or something that will run immediately if possible.

<comment><USER2> Yes, JS got it right. It is very often the case that you need to consider different edge cases for synchronous vs. asynchronous execution, and it's very hard to cover both cases in tests, leading to code that randomly breaks in production based on timing differences, which is pretty much the worst.

</comment></comment></comment></comment></comment><comment><USER5> There's an active remake of E with a different syntax and new implementation: [https://monte.readthedocs.io/en/latest/](https://monte.readthedocs.io/en/latest/) (I guess it'll have other language changes too -- that was just what I took away from my read over the docs.)

<comment><USER6> At the bottom of the page, it says "Copyright 2014". Did you mean actively maintained or active in some other sense?

<comment><USER5> I looked at the implementation repo and it has recent commits. I don't think that's true of E itself (I was a minor contributor 20 years ago).

</comment></comment></comment><comment><USER7> "A smart contract is written in program code, in which the logic of the program's execution enforce the terms of the contract. Smart contracts reduce costs by orders of magnitude, leading to a more cooperative world."

A. Most written and oral contracts aren't terrible expensive, especially when there is no disagreement between parties. I want to rent a property, I sign a lease and obey its terms. There's no extra cost unless there's some disagreement.

B. The situation where there is disagreement between parties is where things can get sticky. But with "smart contracts" being just _automatically executing contracts_ , I can't see any way they really solve the problem. A smart contract can't by itself verify that goods are delivered, that the landlord has maintained a habitable space or that I am not destroying the property - except with third parties, who may be reliable but aren't automatically reliable and are something an ordinary contract can employ.

C. The legal system now actually takes into account the degree of sophistication of the parties involved in a contract. Contracts that tend to effect legally naive, average people generally don't allow _unconsciable_ terms[1]. On the other hand, in most sophisticated markets nearly everything can be up for grabs. Which is to say the legal system provides a significant umbrella of protection for most people. Contracts that automatically execute would rip that away - except they wouldn't, because the legal system isn't going away any time soon. A person's ability to create and enforce a "smart contract", an automatically executing financial effect, is limited to what is ... legal. However automatic your effect is, you will find lawyers involved if your effect also isn't legal.

[1] [https://legal- dictionary.thefreedictionary.com/unconscionabl...](https://legal- dictionary.thefreedictionary.com/unconscionable)

<comment><USER8> Smart contracts are orders of magnitude HARDER to write, due to the fact that you have to get them exactly right in every respect, since no interpretation of the intent of the contract can happen, it will just execute as literally written.

And we know very well that writing bug-free code, on the first try, is a ridiculous pipe dream.

Ethereum and its countless hacks and failed contracts has been a very real demonstration of the problem, especially for those who lost large sums of money due to a small mistake in a smart contract.

</comment></comment><comment><USER9> Related resources:

Lambda-the-Ultimate: "A Next Generation Smart Contract and Decentralized Application Platform", Vitalik Buterin. - [http://lambda-the- ultimate.org/node/5003#comment-94645](http://lambda-the- ultimate.org/node/5003#comment-94645)

Mark Miller: Agoric and the Decades-Long Quest for Secure Smart Contracts. [https://letstalkbitcoin.com/blog/post/epicenter-mark- miller-...](https://letstalkbitcoin.com/blog/post/epicenter-mark-miller- agoric-and-the-decadeslong-quest-for-secure-smart-contracts)

[https://agoric.com/](https://agoric.com/)

[https://infominer.id/bitcoin-history/smart- contracts/](https://infominer.id/bitcoin-history/smart-contracts/)

</comment><comment><USER10> Modern smart contract systems should learn a lesson or five from it, most importantly, (object) capability security.

Why? Because it lets programs handle permissions like other objects, keeping them apart and thus reducing the attack surface and preventing Confused Deputy [0] attacks.

[https://en.m.wikipedia.org/wiki/Confused_deputy_problem](https://en.m.wikipedia.org/wiki/Confused_deputy_problem)

</comment><comment><USER11> Not being too familiar with Smart Contracts, it was nice to see the simple summary included.

>A contract is a mutually agreeable arrangement of rules among mutually suspicious parties so they may cooperate with limited risks to each other's mischief. It is a game both are willing to play because both expect to win. > >A conventional contract is passive paper interpreted at great expense by lawyers and courts. > >A smart contract is written in program code, in which the logic of the program's execution enforce the terms of the contract. Smart contracts reduce costs by orders of magnitude, leading to a more cooperative world.

Can anyone recommend a good link to start learning more about smart contacts and how they are used in specific real-world examples? Most of what I'm finding reads as very general/theoretical.

<comment><USER12> Smart contracts are vaporware.

If you are not a programmer, you will require a "great expense" of a programmer to write it for you (with no way for you to verify it).

After you have your "smart contract" you have no way to enforce it if the other party doesn't abide by it.

The "great expense" of lawyers and courts provide a host of features smart contracts can never even imagine providing:

\- identity validation (that the signatories are who they say they are)

\- actual validation of terms (that they are not mutually exclusive, that they are reasonable, that they benefit the parties etc.)

\- enforcement of the contract

There are many other things: like verifying that a party can actually pay for goods/services, that co-signatories are notified and/or agree to the contract, that goods/services are as described in the contract etc. etc. etc.

<comment><USER13> The point would be that smart contract make sense if and only if they can be meaningfully deployed inside a single platform. I agree that they make little sense for physical systems.

But something along the lines "I will pay you X bags if you send me a signed pdf with a specific hash" makes total sense.

They strongly should not be used for anything that would need a lawyer. That would just be a ticking bomb.

<comment><USER12> > But something along the lines "I will pay you X bags if you send me a signed > pdf with a specific hash" makes total sense.

How would it make any sense? Who is there to enforce that I will actually send you _X_ bags? That I will send you X _bags_? Who is there to verify that contract for a non-programmer?

There are literally no use cases for smart contracts because they will always need either a complete trust between the parties or a third-party arbiter for all the things that lawyers and notaries and banks already exist.

</comment></comment></comment></comment><comment><USER14> Their domain name is listed for sale for $1,000,000 according to the link at the bottom of the page. Does that mean this project is dead or are they just amenable to changing the project's domain?

I would imagine at that price point that _any_ domain is at least negotiable, so why list it?

<comment><USER15> It doesn't cost that. Probably been approached multiple times and got tired of replying, so they've set a prohibitive price.

<comment><USER16> Speaking of buying and selling domain names I heard something interesting on a podcast a few days ago about buying a parked domain from someone else.

What they said was, if you are starting a business and the domain name that you want is already taken, you could approach the domain owner with the following suggestion:

You will rent the domain from them for a period of time, say two years, with a contract that gives you the option to buy the domain from them after that time has passed, at some price you both agree upon now.

This agreement could be beneficial to both parties.

\- You avoid shelling out a lot of money for a domain name now for a business you don't know whether will work out or not. The money you don't spend on that domain name now you can use on engineering, marketing etc.

\- They get money from renting the domain name to you, instead of just having it parked and earning them some meager amount of money from the ads they might have on the parked domain. On top of that, if your business works out then they get a good deal of money selling the domain to you in the future.

Of course you will have to be certain that the people you make this agreement with are trustworthy and that they will uphold their end of the contract.

<comment><USER13> Off topic here, but on a different comment there was a discussion about smart contracts. While they are often over hyped this would be a practical example where they would make sense.

</comment></comment></comment></comment><comment><USER17> The E on Common Lisp Project website is down, code on github: [https://github.com/kpreid/e-on-cl](https://github.com/kpreid/e-on-cl)

e-on-javascript: [https://github.com/kpreid/e-on- javascript](https://github.com/kpreid/e-on-javascript)

</comment><comment><USER18> If you're interested in E and Object Capabilities (ocaps) in general, I _highly_ recommend reading this essay:

[https://web.archive.org/web/20190423063056/http://habitatchr...](https://web.archive.org/web/20190423063056/http://habitatchronicles.com/2017/05/what- are-capabilities/)

I found it really enlightening, and it isn't an exaggeration to say that learning about ocaps kind of changed the entire way I look at building or using software.

To my knowledge, E (and similar languages like Monte and Pony), are basically the embodiment of what Object-Oriented Programming was _supposed to be_.

You may have heard about how the actor model is really OOP in its purest form, because it's really all about passing messages between isolated objects or processes. The creator of Erlang (Joe Armstrong) even said something about how Erlang was at its heart really object-oriented[1].

This is what languages like E, Monte, and Pony are trying to encapsulate and design the entire language around. This idea of isolating everything, and controlling access purely by controlling how references to other pieces of data are shared amongst said isolated processes.

Why is this so important?

Because we're building programs more and more to be distributed. Users expect that they will be able to easily and securely share things with each other, and be able to collaborate in a distributed way. This is exactly what tools like google drive, slack, twitter, and so on are all trying to do, and most of them do it badly in my humble opinion. Nobody wants to spend hours managing permissions and access roles on a whole suite of services.

The model that languages like E are built on solves that problem and makes it trivial to manage access and permissions at a ridiculously fine-grained level.

[1] [https://www.infoq.com/interviews/johnson-armstrong- oop/](https://www.infoq.com/interviews/johnson-armstrong-oop/)

Salient quote from above

> Then, my thesis supervisor said "But you're wrong, Erlang is extremely > object oriented". He said object oriented languages aren't object oriented. > I might think, though I'm not quite sure if I believe this or not, but > Erlang might be the only object oriented language because the 3 tenets of > object oriented programming are that it's based on message passing, that you > have isolation between objects and have polymorphism.

<comment><USER5> That's a great intro.

I also blame E for teaching me to appreciate objects. (Or rather, from hanging out in the cluster of related mailing lists back when it was in development.) I'd long held the opinion that OO programming had its uses but was kind of ugly and arbitrary and overhyped, especially compared to functional programming -- on opinion that's more popular nowadays. There's still a need for a really good accessible book on these ideas; Mark Miller's PhD thesis is not going to be it, worthwhile as it is.

</comment></comment><comment><USER19> Could someone explain the difference between a programming language and a framework? I'm confused how a programming language can be implemented in java or lisp. Doesn't that just make it a java/lisp framework?

<comment><USER20> By that logic, every programming language is just an assembly framework ;)

<comment><USER19> Not necessarily, I would consider an interpreter as something entirely different because there is no requirement that it abide to the syntax of the language. I feel that syntax defines the language just like spoken language. It doesn't make sense to me to say this language english is implemented in Spanish and German.

<comment><USER21> _> Not necessarily, I would consider an interpreter as something entirely different because there is no requirement that it abide to the syntax of the language._

What does this mean? A language interpreter naturally abides to the syntax of the language it implements.

 _> It doesn't make sense to me to say this language english is implemented in Spanish and German._

Maybe because natural languages are a useless analogy for this in the first place.

</comment></comment></comment></comment><comment><USER22> List of available letters for programming languages: H, U, V, W, Y

Tenatively available: G - because of G-code and Go, I - because of Io, L - because of LLL, N - because of Nu, O - because of Oz

edit: formatting

</comment><comment><USER23> Anyone remembers [https://en.wikipedia.org/wiki/Amiga_E](https://en.wikipedia.org/wiki/Amiga_E) ?

<comment><USER24> Yeah, I was a bit dissapointed that this wasn't a new modern compiler for it. :)

</comment></comment><comment><USER25> We got as far as S, then it took a step backwards to R. Now back to E? It seems like language Z is perpetually ten years away, and always will be.

<comment><USER26> Z has been around for 40 years. Used to have a book on it.

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

<comment><USER25> Well, that's a system of notation, not a programming language. And it's name isn't properly "Z", it's "Z notation". I'll admit Z++ is a candidate here, but I'm excluding it for it's overly eager "++". So, we may have VR, but until there's a properly compiled ( or even interpreted) Z language, I'm still waiting for the future to arrive :)

</comment></comment></comment><comment><USER27> So, a general Stacksort? [https://xkcd.com/1185/](https://xkcd.com/1185/)</comment>


Protonmail Online Security Guide for Journalists - <AUTHOR> https://protonmail.com/blog/journalist-online-security-tips/ <comment><USER2> Protonmail can't be trusted anymore, especially not by journalists. First they hack a phishing site: [https://twitter.com/thel3l/status/962142015109578752](https://twitter.com/thel3l/status/962142015109578752)

And when they get critical reporting for this, they claim the journalist based his story on 'unsubstantiated rumors': [https://twitter.com/xFailure/status/962026777743835139](https://twitter.com/xFailure/status/962026777743835139)

</comment><comment><USER3> Good idea, regarding this incident (discussed yesterday here, too)

[https://mobile.twitter.com/YuanfenYang/status/96200225940708...](https://mobile.twitter.com/YuanfenYang/status/962002259407089664)

</comment><comment><USER4> > Use encrypted services (ProtonMail for email, Signal for chat, etc.)

Also have a look at Briar [0] as they offer P2P communication, and the ability to route everything via Tor. As an alternative to Mail also BitMessage comes into mind, which avoids Metadata about who you contacted.

Oh also have a look at drdaeman's comment in here, ProtonMail is far from the solution for secure email.

[0]: [https://briarproject.org](https://briarproject.org)

</comment><comment><USER5> Is that why it's usually used for cryptocoins?

<comment><USER6> Protonmail is certainly one of the more secure mail solutions since it's e2e encrypted not just at rest. On the other hand it doesn't support U2F yet which doesn't bring it to the top in terms of security. Regarding privacy I would say it's one of the best available solutions since everything is encrypted they can and do not read your email content.

<comment><USER7> It's still a webapp, fully served from network, without any code signing (not even SRI to match hashes against), except for the TLS layer. AFAIK they don't even have a standalone variant except for the _unofficial_ desktop Electron app, and a beta IMAP bridge for paying customers.

Basically, they still ultimately rely on trust, just like others. While they're drastically different from e.g. Gmail, trust requirement is still there.

If one's well-being really depends on security, it's best to err on side of caution. Meaning, something like MailPile on the client side, very cautious non-automated key exchange, and, optionally, self-hosted email with at-rest encryption (e.g. Postfix+Dovecot+GnuPG pipe) is probably much better option than anything Protonmail can offer in their current state. Or avoiding email (as it's not yet there and probably never will be) and using something like Wire or BitMessage or whatever (I'm not a security expert) has both client- side static and auditable source code and limits metadata leakage.

<comment><USER6> Bridge is out of beta: [https://protonmail.com/bridge/](https://protonmail.com/bridge/) and yes for paying customers. Given they don't sell your data it's natural that advanced features have a price.

Yes there is of course trust involved as with anything. Still, for the majority of the folks it's better to trust someone else with their mail over running their own servers with gaping security holes. Avoiding email is not really possible yet and in the very near future...

<comment><USER8> No linux client and closed source. I would love to switch my gsuite account but there is no real benefit.

<comment><USER6> Coming soon.

Well the end it's only email. You decide whom to trust with.

Personally, I feel better with Protonmail. It's not better nor cheaper than gsuite it just has a totally different proposition as a product.

</comment></comment></comment></comment></comment></comment><comment><USER9> It is fucking straight up evil to disguise your marketing blog posts as "security guides" for at risk people. It is really sad that stuff like this is making it to the HN front page.

The advice given here is largely NOT good.

There are only a few extremely limited scenarios where you might want to choose Protonmail over Gmail. Do not use Protonmail.

And for gods sake, whatever you do don't follow the advice from this "guide" and use their "Secure VPN" service.

Here's a much better guide, which wasn't written with the sole intention of selling you things [https://techsolidarity.org/resources/basic_security.htm](https://techsolidarity.org/resources/basic_security.htm)

EDIT: This is just way too good to not include in here [https://protonvpn.com/secure-vpn](https://protonvpn.com/secure-vpn)

>ProtonVPN comes with Tor support built-in. Through our selected Tor servers, you can route all your traffic through the Tor anonymity network and also access dark web sites. This provides a convenient way to access Onion sites with just a single click.

These guys are trying to convince people to access .onion sites through their VPN using Tor nodes ran by them...

<comment><USER10> Do you have anything besides unfounded claims?

>The advice given here is largely NOT good

It may be insufficient, I agree, but what's particularly wrong with it?

>don't follow the advice from this "guide" and use their "Secure VPN" service

Again, do you have anything substantial? Known vulnerabilities? Negative experience?

It's OK to sell things and write marketing blog posts. I'm pretty sure your company does it as well.

And thanks for the link.

<comment><USER9> >Again, do you have anything substantial? Known vulnerabilities? Negative experience?

Since when is "public VPN services are bad" a claim which needs substantiating?

As tptacek put it: _VPN services. For when you want coffee-shop wireless network security, but in the comfort of your own home or hotel room._

But these guys go further than most providers. These guys try to bait you into ditching Tor and relying on their Tor-as-a-service instead, which is nothing but malicious.

>It may be insufficient, I agree, but what's particularly wrong with it?

They tell you to use a VPN to avoid "government surveillance agencies.

They try to get you to use their Tor-as-a-service, which is _insane_ and completely defeats the purpose of using Tor.

They recommend that you use their products instead of objectively better products by competitors, they don't even bother to mention the competing products.

They suggest that using Protonmail to talk to non-protonmail users over email is at least somewhat secure, it is not.

All the advice that doesn't amount to "use our product" is extremely limited. Key advice such as _Don 't use an Android phone_ is nowhere to be found.

>It's OK to sell things and write marketing blog posts. I'm pretty sure your company does it as well.

The critical difference is that my marketing blog posts do not pretend to be security guides for people who could literally get killed for following bad advice.

We should absolutely be condemning Protonmail for putting this out. They can't claim to be a great provider for at-risk users while simultaneously putting them in further danger by giving them bad security advice.

<comment><USER10> >Since when is "public VPN services are bad" a claim which needs substantiating?

You assume there are good VPN services. What are they? Private ones, self- maintained, run by a friend? For journalists, who are mostly not seasoned sysadmins and crypto experts, self-run VPN is worse.

>But these guys go further than most providers. These guys try to bait you into ditching Tor and relying on their Tor-as-a-service instead, which is nothing but malicious.

No, they don't. The say: _" for ultimate anonymity you can also run Tor locally on your machine"._

>They tell you to use a VPN to avoid "government surveillance agencies.

It's all about your threat model. For many journalists, their adversaries are not US TLAs, but less competent nation states TLAs. Using a service outside of their jurisdiction may be acceptable.

>They try to get you to use their Tor-as-a-service, which is insane and completely defeats the purpose of using Tor.

It's not more insane then trusting your email provider. But yes, you have to trust Proton, this should have been stressed more.

And let me remind again, this is a guide for journalists, not for crypto- nerds. "Tor... can be tricky to set up, and can sometimes attract attention to yourself", which is true.

>They recommend that you use their products instead of objectively better products by competitors, they don't even bother to mention the competing products.

This is not a product comparison.

>They suggest that using Protonmail to talk to non-protonmail users over email is at least somewhat secure, it is not.

It is, for some scenarios. When both parties use providers who protect mail in transit and one of them also protects mail at rest, an attacker's options are very limited.

>All the advice that doesn't amount to "use our product" is extremely limited. Key advice such as Don't use an Android phone is nowhere to be found.

This doesn't make them "bad", but insufficient.

<comment><USER9> >You assume there are good VPN services. What are they? Private ones, self- maintained, run by a friend? For journalists, who are mostly not seasoned sysadmins and crypto experts, self-run VPN is worse.

I do not assume that there are good public VPN services.

Presumably a journalist would be using one provided by their employer or none at all.

>No, they don't. The say: "for ultimate anonymity you can also run Tor locally on your machine".

Yes, they do mention the possibility of running Tor locally. So what? They're still trying to push people to use their Tor gateway which is simply indefensible.

>It's all about your threat model. For many journalists, their adversaries are not US TLAs, but less competent nation states TLAs. Using a service outside of their jurisdiction may be acceptable.

Remember your username, don't think too little of "less competent nation states TLAs". :)

Choosing to follow Protonmails advice involves taking stupid risks, you should not be taking stupid risks if you are worried about any TLAs.

>It's not more insane then trusting your email provider. But yes, you have to trust Proton, this should have been stressed more.

With email you hardly get a choice. There's no legitimate reason to ever have someone else run your Tor client for you.

And we can already establish that Protonmail cannot be trusted. A trustworthy organization would never have released this "SECURITY GUIDE", nor would they ever try to get you to use their Tor client to access hidden services.

>And let me remind again, this is a guide for journalists, not for crypto- nerds. "Tor... can be tricky to set up, and can sometimes attract attention to yourself", which is true.

The first part is not true, Tor browser and Tor messenger are both very easy to use. The second part is true, but Tor isn't going to draw significantly more attention than Protonvpn.

>This is not a product comparison.

No, this claims to be a SECURITY GUIDE but is actually an ADVERTISEMENT.

A legitimate SECURITY GUIDE would never recommend Protonmail over Gmail.

A legitimate SECURITY GUIDE would never recommend ProtonVPN.

A legitimate SECURITY GUIDE would never ever suggest taking advantage of ProtonVPNs "Tor VPN support".

>This doesn't make them "bad", but insufficient.

I strongly disagree with you. Posting this was absolutely unethical on protonmails part.</comment></comment></comment></comment></comment>


California Unanimously Passes Historic Privacy Bill - <AUTHOR> https://www.wired.com/story/california-unanimously-passes-historic-privacy-bill <comment><USER2> Good to hear! Glad to see that some state is going to stand up for consumer protections.

> Facebook initially supported the opposition initiative, but pulled out > publicly in April, a month after news broke that a political consulting firm > called Cambridge Analytica amassed data on tens of millions of American > Facebook users for political purposes without their knowledge.

Hilarious.

> [] lobbyists affiliated with the group TechNet were working behind the > scenes to change crucial parts of the bill, as well, including the > stipulation that businesses include a clear button on their websites giving > people the ability to opt out of data collection.

> The law goes into effect on January 1, 2020. The Internet Association has > already hinted at efforts to modify the legislation before implementation.

A year and a half before it goes live; the fight's not over yet. Gotta make sure they don't completely gut it before then, like the net neutrality bill.

</comment><comment><USER3> Text of the bill: [https://leginfo.legislature.ca.gov/faces/billTextClient.xhtm...](https://leginfo.legislature.ca.gov/faces/billTextClient.xhtml?bill_id=201720180AB375)

Only seems to apply to companies with 50k+ California-resident users, or $25mm+ in revenue. So there's likely much less of a chilling effect on small businesses than GDPR. (IANAL, though, and with the speed this was pushed through, lawyers should take a much closer look in the coming days before anyone jumps to conclusions.)

<comment><USER4> I really dislike the "Do Not Sell My Personal Information" part.

<comment><USER5> Okay. Why?

<comment><USER4> I am talking about the part where the link has to be named that way.

</comment></comment></comment></comment><comment><USER6> > It's similar to the General Data Protection Regulation that went into effect > in the European Union last month, but adds to it in crucial ways. Under the > GDPR, businesses are required to get users' permission before collecting and > storing their data. But the way most companies have designed those opt-in > pop-ups, "you really don't have a choice," says Ashkan Soltani

Those opt-in dialogs that don't actually leave you a choice are __not legal __under the GDPR. So, you cannot add to the GDPR in crucial ways and somehow make these more illegal.

In fact, the GDPR even requires that revoking once given consent is just as easy as giving it. So, companies that have no problem interpreting a single click as consent for something that you need a team of lawyers and tech experts to actually understand the implications of, will have to also somehow present users with a one-click process for revoking this consent.

Companies like Google and Facebook just don't adhere to the GDPR and there's no reason to assume that they will adhere to this new law either. They've placed these clearly illegal dialogs and are now waiting for lawsuits to follow through, requiring them to actually adhere to the law then. They're gambling for the punishment to not be as high as the profit that they'll turn in the time that the lawsuit is not yet settled.

</comment><comment><USER7> The disaster is going to be when/as every state adopts unique privacy legislation.

It's going to be necessary for the US Congress to override these state-based rules using the Commerce Clause, FCC, and FTC, to takeover responsibility for legislating all digital privacy matters on the basis of its impact on interstate commerce and the FCC's overarching control of nearly anything involving electronic communication.

It won't be practical or reasonable to track users across every state and their movements at all times. People that happen to cross a state line and the need to somehow magically identify their location of origin, and all the blah blah shit that goes with that nightmare. California (or any given state) will probably claim their law applies to California residents at all times, and states will claim their laws apply if you're in their state at any point, enter the conflicting nightmare.

Here's also where GDPR's global enforcement proponents should get pretty excited: being consistent with that premise, now all of the EU has to comply with all privacy laws of all 50 US states, to the extent that they have users from the states. So EU companies will have to implement and maintain dozens of privacy schemes to fit all of the US states (as they each roll out unique privacy legislation). That glorious global enforcement. The world must now adopt all US policies. That's how it works according to GDPR proponents, right?

Instead of the Web of insanity that that 50 state disaster will spin, the Feds will ideally smother all state attempts at establishing their own privacy frameworks, establish Federal regulations on the matter and overrule the states aggressively.

<comment><USER8> That's how car emissions are and the world isn't collapsing. Auto manufacturers know if they want access to California they're going to have to deal with the toughest pollution regulations.

</comment></comment><comment><USER9> Most important part of the tldr; is this law does not take effect until 2020. Lots of time to be amended before then.

<comment><USER10> > Most important part of the tldr; is this law does not take effect until > 2020. Lots of time to be amended before then.

Yeah, and it looks like the process has already started:

> And yet, a report by The Intercept revealed that lobbyists affiliated with > the group TechNet were working behind the scenes to change crucial parts of > the bill, as well, including a stipulation that businesses must include a > clear button on their websites giving people the ability to opt out of data > collection.

</comment></comment><comment><USER11> AFAICT, the opt-out stuff only applies to selling data, and not using it internally for ads or whatever. Seems like this won't hit Google or FB very hard.

</comment><comment><USER12> It's better than nothing. Until personal information is the property of the individual, and not resold/shared without permission, the "genie" is out of the "bottle;" lists and databases of personal information will continue to be trafficked by corporations of all sorts.

<comment><USER13> That's one of the most valid ideas I've heard - define private data as personal property.

When one looks deeper into laws like GDPR and this one, at the heart of it lies the fact that a company cannot do as it pleases with an individual's data without said individuals consent. But given the nature of the legislation, it is not too hard for a company to simply bypass it in ways that adhere to the letter of the law but not the spirit.

If instead there were laws that defined private data as the personal property of the respective individual, the need for all this convoluted legislation would be rendered moot, since such a law would open the grounds for a variety of class action lawsuits against companies perceived to be egregiously abusive. The case law itself would set numerous precedents and eliminate the need for varied "interpretations" of one piece of legislation. IMO, this is what we should be pushing for, not more GDPR-clones which can be watered down by lobbyists.

<comment><USER14> I'd love to see private data as personal property, but in practice that's likely to run into a lot of contradictions.

The biggest problem is that most of the interesting private data is actually about _relationships_ between multiple private individuals. If you're having a conversation with a friend on Whatsapp, is that conversation property of you, your friend, or do you each own your own messages? If it's a group conversation, is the whole conversation owned by all of the participants, or only parts of it? What if some people in the group chat aren't actually participating, but are just lurking? If you mention a company's product, does that mention belong to the company or the person mentioning it? What if instead of a product, you mention another person? What if you're quoting gossip they told you in person?

This is why Hacker News doesn't let you delete or edit posts after 2 hours, BTW. Once people have read them and replied and referenced them elsewhere, it's not really fair to other participants in the conversation to remove the words they were replying to.

Other social networks have run into real problems where people have edited their posts after many replies have been added to take the replies out of context and make them mean something totally the opposite of what their authors intended. If you own your own words, this is your right, but it's also a dickish and disruptive thing to do.

The same applies to many other types of personal data. A credit report is a list of transactions _between_ you and various creditors. The credit bureau didn't just snoop on everything you do, that information was reported to them _by the other party of the transaction_. If they own the data about them, this is within their rights, but it certainly doesn't feel about it when it's used to deny the borrower further credit.

I think the current situation, where data is owned by the company or individual that collects it, is the most absurd alternative possible. But that's because our legal system is poorly structured to handle property rights where the "property" is owned by multiple firms, can be transferred easily (and surreptitiously) without the original owner losing rights, and may eventually come to harm one of the original owners.

<comment><USER15> > _The biggest problem is that most of the interesting private data is > actually about relationships between multiple private individuals. If you > 're having a conversation with a friend on Whatsapp, is that conversation > property of you, your friend, or do you each own your own messages? If it's > a group conversation, is the whole conversation owned by all of the > participants, or only parts of it?_

To me, not addressing this one of the biggest flaws of the GDPR.

As a practical example: I've talked to numerous other banks, and with regards to data portability (article 20 GDPR), there is nothing even close to a consensus as to what you are _allowed_ to give the customer with regards to his own transactions, because there are numerous parties involved.

It gets even worse: the text of the "right of access" (article 15 GDPR), in a wide interpretation, grants access to far more information than the data subject would otherwise have access to.

If person A and person B confidentially process data of C, is it really the intention of the GDPR to grant person C access to this confidential processing?

<comment><USER12> There's two ways to look at compromised legislation:

1\. It doesn't go far enough, and sells-out to the opposition.

2\. It's better than nothing, and future legislation can address it.

Holding out exclusively for 1. or settling for 2. are bad strategies. There's nothing wrong with trying to get as much in a bill as possible, but the damn corporations push back on everything for the people.

Until, as Larry Lessig / Aaron Schwartz noticed, either the political OS gets changed (unlikely) or it crashes and burns.

</comment></comment></comment></comment></comment><comment><USER16> Idiocy. The motive is to hamstring some of our most innovative companies which by itself is baffling and of course the collateral damage is the extra overhead and lawyers inflicted on all businesses big and small.

The desire to imitate the euros in their efforts in making it as hard as possible for our companies to operate there is beyond stupid.

California ballot initiatives like all referendums must be eradicated and the fact that a california real estate developer (the source of all that is wrong in the state) straight after killing recent zoning reform is using a ballot initiative to blackmail the assembly into passing this law makes it worse.

<comment><USER17> > most innovative companies

If that innovation is about stalking people online & offline to serve them ads then no thanks.

<comment><USER18> I hear this sentiment expressed a lot, but I rarely see anyone actually articulate their rationale. What do you think the downsides of that are?

<comment><USER19> I find in myself a very human desire to not have every private action subject to registration & scrutiny by unknown entities. No further justification is needed.

<comment><USER18> I think quite a bit further justification is needed. That's why I asked the question. You're proposing companies have their rights circumscribed. You need to justify that.

<comment><USER19> All justifications must ultimately rest on some axiom or set of axioms. You want to recurse down some more levels, that's fine. I don't feel the need. My answer satisfies in itself. It is an answer which recognizes human dignity.

<comment><USER18> You believe it's axiomatic that you are entitled to the services of Google and Facebook and they are not entitled to save the information that you willingly send them during the use of their services?</comment></comment></comment></comment></comment></comment></comment>


Colonizing the Internet - <AUTHOR> https://medium.com/how-to-use-the-internet/8c548a28ad4e

<comment><USER2> These internet-governments already exist, but we hardly think about them as governments because they are built upon our national governments.

Companies like Apple, Google, Microsoft, and Amazon all count. I am looking at the following corollaries here:

      - Has physical dependencies (devices)
      - Has citizens & well-defined relationship (users & tos)
      - Has economy (app & e-commerce stores)
      - Has communication (has APIs)
      - Has higher-level information (surveillance & analytics of users)

</comment><comment><USER3> I'm wondering if there already is a directory of open source plugins and projects that allow someone to quickly take any existing project (Rails, Django, WordPress, Joomla, Drupal) and publish it on Tor with a .onion address.</comment>


The Theory of Peak Advertising and The Future of the Web  - <AUTHOR> http://peakads.org/

<comment><USER2> > click fraud was responsible for $53 million dollars of wasted ad spending in > the first two quarters of 2013 alone

> $37 billion dollar online advertising industry

> click fraud remains a severe and growing problem

$106 million out of $37 billion is 0.28%. Hardly "severe".

<comment><USER3> > $106 million out of $37 billion is 0.28%. Hardly "severe".

And yet they prosecute bank robbers and tax cheats, who steal a much smaller percentage of the mass wealth represented by banks and governments respectively, than do click fraudsters. It's not a matter of percentages, but whether the problem can be solved or alleviated. If no one acts against cheaters, people lose trust in the system.</comment></comment>


The Two Egg Problem - <AUTHOR> http://www.datagenetics.com/blog/july22012/index.html <comment><USER3> An issue with this puzzle is that the objective is not clearly stated upfront. The author should make it clear from the outset that the goal is to minimize the number of drops in the _worst_ case, rather than to minimize the _average_ case, especially since optimizing the average case is (in my experience) more common in optimization problems. He asks in parentheses what the worst case is, but that just sounds like a side question:

> The question is: What strategy should you adopt to minimize the number egg > drops it takes to find the solution? (And what is the worst case for the > number of drops it will take?)

Then in the solution he says:

> Problems where the solution lays lower down the building are taking less > drops than when the solution lays higher up. _We need to come up with a > strategy that makes things more uniform._

It is not explained _why_ it has to be more uniform.

A more minor issue with this puzzle is that for the sake of thoroughness, the author should say is that the number of floors required to break the egg follows a uniform distribution (i.e., every floor is an equally likely candidate).

<comment><USER4> _optimizing the average case is (in my experience) more common in optimization problems ... the author should say is that the number of floors required to break the egg follows a uniform distribution_

Then again, optimizing the worst case performance can be done without worrying about the underlying, and unknown, distribution of the lowest egg breaking drop.

If we start optimizing the average performance, then we need to assume something about the distribution (is it uniform? exponential? is there a bump in the middle?), and different distribution will have different optimal search strategies.

Looking at the worst case keeps the problem algorithmic, the version you propose would be more an exercise in probability calculus.

<comment><USER5> That may be true. Lunchbox's point holds true regardless: the problem statement is ambiguous, and is easy to correct so that it is not so.

<comment><USER6> Well, the standard in computer science is to optimize algorithms and discuss their performance for the worst case, so if we assume he's talking from a CS perspective, I find it natural to assume he's talking about that. There are a few exceptions, like QuickSort, but if some tells me to optimize some algorithm, I'll assume he's asking for optimization of the worst case unless he says otherwise or it's clear that the worse case is _much_ rarer than some other case (I'd ask if I think that).

<comment><USER7> These considerations certainly exist in every day code as well. If you change the daily reporting process to have a worst case run time of 25 hours then you lose, even if the mean run time is cut in half.

</comment></comment></comment></comment></comment><comment><USER8> Let's say an egg costs 1 egg (1E). This means that for management to give us 2 eggs, they were willing to spend 1 additional egg to let us make (in the worst-case) 14 trips vs 100 if we only had 1 egg. So 1 egg < 86 trips in labor cost.

But they weren't willing to give us a 3rd egg. This means that 1E is more than 5 trips. So our labor cost is less than E0.20/trip (assuming a uniform labor cost per trip), but more than E0.012/trip (E1 / 86 trips).

My goal is to find someone willing to work for E1 for 100 trips. This would be be between 1/20 and 86% of my salary (management's choice don't give me enough information to know exactly how much I will be making in eggs).

So if I can find someone* willing to work for that labor cost, I can give him the 1 egg problem, and I can give him the other egg to pay his salary, I then I can spend my time doing something more interesting while still achieving management's objectives.

*Assume the cost of finding an employee is zero. This is an important assumption to make in an interview.

<comment><USER9> This could've been something much mor expensive and dangerous to use - <USER2> example atomic bomb test to check at what elevation when detonated it would affect the ground (just making this up, btw)

</comment></comment><comment><USER10> I was asked this question at a Google interview in 2006. At that time I worked it out mathematically as the author has here. Only afterwards did I realize that it is a simple Dynamic Programming problem.

Let f(y) be the number of drops required with y floors remaining. At a drop from floor x, either the egg breaks and you must test all floors from 1 to x-1, or else the egg does not break and you have reduced to a smaller sub- problem with y-x floors. So the number of drops required is 1 (for the current drop) plus the max of either x-1 or f(y-x). We simply minimize this value over all potential floors x from 1 to y.

Here is a solution in C++: <https://gist.github.com/3156157>

<comment><USER11> This is really helpful ,thank you for the example. Does anyone know of any other resources for simple Dynamic Programming examples?

<comment><USER12> I found the concise explanations here very helpful: <http://people.csail.mit.edu/bdean/6.046/dp/>

</comment></comment></comment><comment><USER13> The blog author is very smart.

However, he is not very clever.

From my experience in the real world, I know that an unprotected egg will smash when dropped from one story, guaranteed. No need to go up 14 or 27 or even two stories.

(I also know that it is possible to devise protective enclosures to keep an egg from breaking when dropped from 6 stories. The Society of Women Engineers often sponsors competitions. Been there, got the T-shirt.)

<comment><USER14> Yeah. I dropped an egg from the kitchen counter and it broke. Ergo, first floor it would break.

Except of course, the article doesn't mention what the landing surface is, or whether it is what we think of as an egg, or some hypothetical super-egg. This would seem to be discounted by the "There are no tricks, gotchas or other devious ruses" clause, however. If the point of the article is to make it purely a mathematical problem, then pretty much anything except an egg would work, like "A strong box".

Otherwise, it's pretty much a "work out this problem but automatically disregard anything that I don't think should be part of the solution" interview question, that whilst I have no doubt are asked by many middle manager interviewers, would imagine is a little below microsoft or google.

<comment><USER13> All it would take to remove the real-world problem would be to change the object from an egg to a ball made of a material of unknown strength and toughness.

Poor specifications lie at the root of many a programming problem.

<comment><USER15> Yes but this isn't a programming problem. It's a math thought experiment.

The real thing I'm wondering is why are you making a big deal about this? You obviously have the mental capacity to come up with the concept that it's a special material, why can't you just pretend that's what it is and not make a big pedantic joke about it? What is added to this discussion by pointing out something we all know - that eggs break when you drop them from shoulder height.

<comment><USER16> I hear you on that, and it can be annoying when people knowingly pretend not to know what you are talking about. However, the most groundbreaking things are often not so much the discovery of clever solutions as the recognition of what the actual problem is. In my work creating custom workflow apps, discovering the _question_ is by far the most difficult part.

</comment></comment></comment></comment></comment><comment><USER17> The author states that _the_ solution is: 14, 27, 39, 50, 60, 69, 77, 84, 90, 95, 99, 100, which takes at most 14 drops.

In fact, that is _a_ solution, not _the_ solution, for this also works, and takes at most 14 drops: 9, 22, 34, 45, 55, 64, 72, 79, 85, 90, 94, 97, 99, 100.

<comment><USER17> Darn...too late to edit.

Note that if the number of floors is 105 instead of 100, then you can still do it in 14 drops, and the solution is unique: 14, 27, 39, 50, 60, 69, 77, 84, 90, 95, 99, 102, 104, 105.

The two solutions given above for 100 floors can be derived from the 105 solution. To get the solution given in the article, use the 105 floor solution and if it calls for dropping from a floor above 100 pretend that you did that drop and the egg broke, and don't actually count that drop in your drop count since you didn't actually do the drop.

The get the solution I gave, take the 105 floor solution, and shift it down 4 floors, so it ends on 100 instead of 105.

Many more solutions are possible by mixing the ideas of pretending that floors about 100 break, and by shifting all or part of the 105 solution down.

</comment></comment><comment><USER18> From the text:

 _We now have all the information to compute the optimal two egg solution._

While I prefer to read about algorithms and strategies in the fashion the author writes, I'm a bit sad that there's is no proof (or informal reasoning) why this is the optimal solution. Does anyone have a paper or some reasoning which will make me believe that this is the optimal solution?

<comment><USER19> When you break the first egg, the worst case is the difference between the current floor (where the egg broke) and the previous floor (where the egg last survived). So, the worst total number of drops is the number of drops for the first egg (until it breaks), plus the above difference. If you try making the maximum difference less than 14, you run into problems with the first number...

The problems with optimizing worst case are much simpler than optimizing the average case (you don't have to deal with probabilities, and you don't need to know the distribution of egg hardness). So, the proof, and the complexity of the proof, depends on what "optimality" measure you choose.

</comment></comment><comment><USER20> I was asked this question in a google interview earlier this year. Neither I nor the interviewer got past the "every 10 floors" approach (though I did make it through that round of interviews!). Interesting to see there was more meat on that bone.

<comment><USER19> I think that "every 10 floors" approach is optimal for average case.

Basically, _E(number of drops) = E(number of drops for 1st egg) + E(number of drops for 2nd egg)_. We know that _E(number of drops for 2nd egg) = 1/2 the difference between two drops of the 1st egg_ , and _E(number of drops of 1st egg) = 1/2 the number of intervals_ , and _100 = the number of intervals × the difference_. So, we're minimizing _x + y_ , knowing that _x × y = 100_. Since the problem is symmetric, _x_ and _y_ must be equal, namely 10, so "every 10 floors" is the correct answer.

<comment><USER21> > E(# of drops) = E(# of drops for 1st) + E(# of drops for 2nd)

In the general case, I don't think this is true. I think you're relying on the idea that all intervals are equally large. But I'm not definite here.

> E(# of drops for 2nd) = 1/2 the difference between two drops of the 1st egg

Sure, but this depends in a nasty way on your schedule for dropping the first egg.

> E(# of drops of 1st) = 1/2 the number of intervals

This is definitely wrong. Say my schedule for dropping the first egg is [1, 2, 3, 100]. On your analysis, the expected number of drops the first egg will take to break is 1.5. If we assume that the egg's breaking threshold is uniformly distributed over floors 1-100, the actual expectation for drops-to- break-the-egg is 3.94.

> 100 = the number of intervals × the difference

True for the average difference, but this is pretty explicit about assuming that the size of an interval is constant.

<comment><USER22> >> _"E(# of drops) = E(# of drops for 1st) + E(# of drops for 2nd)"_

> _"In the general case, I don't think this is true. I think you're relying on > the idea that all intervals are equally large."_

Pretty much.

More explicitly, the grandparent is relying on the assumption that E(egg2) is independent of what happens to egg1, which is only true if the interval sizes are the same. In the article's solution, E(egg2) is dependent upon which interval egg2 is dropped in -- if egg1 breaks on the first drop, E(egg2)=7 (the center of the 1-13 interval) but if egg1 breaks on floor 100, E(egg2)=0 since we already know floor 99 is safe.

To calculate E(egg1 + egg2) we need to compute something resembling a weighted average. A quick-and-dirty excel chart gives me an expectation of 9.97, whereas intervals of size 10 give an expectation of 10.5 (first egg gets 1-10 drops for an expectation of 5.5; second gets 1-9 drops for an expectation of 5.0 as the tenth drop would be a repeat.)

</comment></comment></comment></comment><comment><USER23> I was asked that question, with glass bulbs instead of eggs, at an interview last year. I don't think I found the optimal solution of 14, IIRC I got to the point (just talking aloud to the interviewer, no paper) of saying something like "so if we started at, say, floor ten, we'd have nine floors below, and something close to that sets of floors above if we needed to move up..." and he said something like "ok, cool, that's good, let's move on."

I could've asked for paper, I suppose, but something about the word "puzzle" makes me want to puzzle it out in my head.

So my question for any interviewer types who ask puzzle questions is: do you prefer a candidate to go all the way to working out an optimal solution on paper, or is it really more about "the approach"?

<comment><USER24> In my experience it is more about "I heard you were supposed to ask questions like this on tech interviews, so I'll ask it even if I myself am shaky enough on the mathematics behind it that I simply know the One True Solution I read online".

</comment></comment><comment><USER25> What isn't explained, is why the solution that 'make(s) solutions to all possible answers the same depth' is _also_ the solution that minimizes the average number of attempts needed for many (sets of) eggs. The motivation given is to reduce the worst case. That doesn't explain why there isn't perhaps a solution with a worse worst case, but a lower average number of drops.

<comment><USER26> Indeed it is not obvious. For example there are clearly cases where there are solutions with the same worst case and different worst cases. And in the slight variation where the cost of dropping an egg is the height at which you drop it, the solutions that reduce worst cost and average cost tend to be different.

</comment></comment><comment><USER27> And the next question:

What strategy should you adopt to minimize the number of steps it takes you up and down the stairs to find the solution?

<comment><USER28> That version seems too simple to be interesting. Let there be n floors. In the worst case you'll have to walk to the top floor from the ground floor in case the answer happens to be n-1. Therefore you can't do any better than n-1 steps in the worst case, so the obvious strategy of alternating dropping an egg and walking up one floor until you break the egg is optimal and takes n-1 steps and n-1 drops and only requires 1 egg.

<comment><USER27> You have to go down and pick up the unbroken egg.

<comment><USER28> Good point! That adds a lot of nuance. With several eggs, if you drop one egg and it doesn't break, you have the option of postponing the pick-up until later or leaving it on the ground altogether. Let me think about it.

<comment><USER28> I had a quick go at it using memoized minimax search. I assumed that picking up any dropped eggs is automatic when you're on the ground floor, but it would also be easy to model it as an action.

<https://gist.github.com/3157191>

Let me know if this is what you had in mind.

</comment></comment></comment></comment></comment><comment><USER29> I was asked this question once and I said "This is a common, widely discussed interview question on the internet. Are you trying to find out how smart I am thinking on my feet or whether I surf the web, because in practice, on the job, I'd be doing the latter to find out the answer. If you have genuinely unique problems here, you can do better than that."

And yeah, didn't get that one. Oh well. "Brain teasers" with thoroughly documented, widely-read solutions leave you with a Bayesian problem: You'll have the 0.5% geniuses that can come up with the answer in 2 minutes and 5% of people that have read the answer but will make you believe that they are geniuses by not disclosing they have read the solution.

In other words, you'd probably get 90% cheaters and 10% smarties.

</comment><comment><USER30> Wouldn't the absolute best way (assuming you have never seen an egg before and do not know anything about eggs) would be to try and crush one egg in a vice grip to determine the strength of the outer structure and then infer a fuzzy- ish height/speed limit from that?

<comment><USER31> "There are no tricks, gotchas or other devious ruses. Don't rat-hole with issues related to terminal velocity, potential energy or wind resistance. This is a math puzzle plain and simple."

Not within the rules!

<comment><USER30> "There are no tricks, gotchas or other devious ruses. Don't rat-hole with issues related to terminal velocity, potential energy or wind resistance. This is a math puzzle plain and simple."

Not out of the rules either (according to what you just posted). At some point you need to crush an egg.

If the rules are implying that you can only do X and we are only looking for solution Y then why are we even talking about this? We may as well have a discussion about trains leaving from Chicago and New York and debate what city they will intersect from on a given day.

<comment><USER31> "This is a math puzzle, plain and simple" is the give away.

</comment></comment></comment></comment><comment><USER32> I blogged a solution in German in 2008: [http://bjoernguenzel.de/2008/03/18/weiteres-matheratsel- die-...](http://bjoernguenzel.de/2008/03/18/weiteres-matheratsel-die-zwei- kristallkugeln/)

</comment><comment><USER33> If I was interviewing someone with this problem, I would want to hear what questions the interviewee asked, such as: "Do you want to optimize for best average or minimizing the worst case?"

</comment><comment><USER34> He doesn't write down the math in the general case for the number of floors F(e,d) that you can check with e eggs and d drops:

F(1,d) = d

F(e,d) = sum k>0\. F(e-1, d-k)

The sum can given a closed form solution for e > 2, just like for e=1 and e=2.

Another thing is that he directly solves the quadratic, but in fact n^2/2 < n(n+1)/2 < (n+1)^2/2. So taking the square root of twice the number of floors will get you either give you the number of drops you need with 2 eggs, or will under count by 1. It's easy to check which that is.

</comment><comment><USER35> A more generalized version of the problem was posted as a practice question in Google's codejam contest:

<http://code.google.com/codejam/contest/32003/dashboard#s=p2>

I suggest solving this version of the problem, as it forces you to look at the problem from various perspectives. If you're stuck you can download solutions from the dashboard (link in top right corner).

</comment><comment><USER36> Asymptotically, the question with more coconuts is more interesting. I haven't verified this for sure (there are some assumptions), but:

With the "naive" asymptotically correct solution (go up a constant number k of floors, then linearly search the remainder), two coconuts gives us a worst case cost of:

n/k + k

minimize for k, we get a cost of

2 _n^(1/2)

With 3 coconuts, we have

n/k + 2_k^(1/2)

minimize for k, we get

3 _n^(1/3)

What happens when we get log(n) coconuts?

log(n)_n^(1/log(n))

= O(log(n))

Sweet! So at least we can see that it converges to binary search as we add coconuts.

</comment><comment><USER37> This problem has multiple solutions, as demonstrated by the HN comments. It's not asked to find a solution, instead to figure out your thought processes. You could come up with a comp sci solution (analogous to a data structure or algorithm), or a mathematical solution, or a physics solution or something different.

You'd have to shape your answer to the position you're applying for. The article would be perfect for a programming position, above and beyond what I could ever hope to achieve.

</comment><comment><USER38> This isn't a critical thinking problem, it's a math problem. As a critical thinker, I would estimate what floor I think the egg would break at, then estimate a safe floor I feel the egg won't break at. The more eggs I have, the less safety margin needed. After finding the first "safe" floor I would go up floor by floor (or more than one floor at a time if I had spare eggs).

<comment><USER39> > then estimate a safe floor I feel the egg won't break at

This isn't a solution to the problem. Your approach carries the risk that you never find the answer (given the preconditions). I don't think this qualifies as "good" critical thinking, since you don't actually have a solution.

</comment></comment><comment><USER40> I would hate it to do it in an interview setting since the question didn't state the goal of finding the worst case scenario. It's like mind reading. I did solve it once during lunch with colleagues when we asked each other puzzles, which was fun.

Is people ok with posting the solution here? Or want to try out some more?

Hint: square root.

<comment><USER41> Part of an interview should test communication skills as well.

In the real job's performance you'll get ill-defined specs; it's sometimes more important to know to ask the right questions rather than solve perfectly the wrong problems.

Interviewers are humans, sometimes tired, and an ill-defined question is likely to appear sooner or later. Asking the interviewer if he meant worst- case has the potential to bring lots of bonus points for you; at least it would in my book.

<comment><USER40> Again you expect the interviewee to read your mind that he should ask a particular question. The puzzle is set up with certain conditions and boundary to see how the interviewee performs with those constraints. If one of the terms of the puzzle can be changed, then other terms can be changed, too. I would just replace the egg with a steel ball and be done with it, like just in real life you can just push the boundary and replace the meaning of the question completely.

</comment></comment></comment><comment><USER42> Is binary search until the first egg breaks and then increment by 1 for the second egg the best approach?

<comment><USER43> No. If you first test is at floor N, the two possible consequences are:

\- egg breaks: you know you the answer is in [1,N], and will have to start stepping by one floor until the second egg breaks

\- egg does not break: you know the answer is in [N+1, max], and you still have an extra egg to play with.

There is an asymmetry here. Because of it, assuming that you can improve upon binary search, N should be less than at half the maximum height. That gives you less information, but decreases the chance that you get into the 'only one egg in hand' endgame.

<comment><USER42> Hmm I'm not following. What do you do with the first egg if it doesn't break?

<comment><USER44> You keep using it. Binary search is the right way of thinking about it, but in some sense you haven't really created an even split by dropping the egg from floor 50 - because you know that you can figure out the correct floor faster using two eggs than one, you could check floors 51-100 much faster than you could check floors 1-50 (Even if you just did the naive binary search approach you first applied - i.e. if the first egg didn't break on floor 50 then drop it from floor 75, and then after that use the second egg to check each floor, it would only take you <=25 goes to find the right floor in 51-100, wheras it would take you up to 50 goes to find the right floor in 1-50).

So the correct floor at which to make the first drop is clearly not floor 50. If you dropped the first egg from floor 40 you would do better - it'd take you up to 40 goes to find the right floor if it's below floor 40, and up to 31 or so goes to find the right floor if it's above (because you can reuse the first egg to check whether it's in 40-70 or 70-100). Floor 40 is in some sense a "more binary" place to drop the first egg from than floor 50.

If you keep following this line of thought, and remember that whenever you make your approach more efficient, you can recursively apply that more efficient approach to "what do I do if the first egg doesn't break", you'll arrive at the solution given in the article.

</comment></comment></comment></comment><comment><AUTHOR> Lots of interesting stuff in that blog, be sure to check it.

</comment><comment><USER45> How about this solution: It's an egg. It will break from the hight of even 5 feet. The answer is the first floor.

</comment><comment><USER46> As solved mathematically here <http://www.trungh.com/2010/12/light-bulbs/>

</comment><comment><USER47> Start dropping the first egg at floor 1, if it doesn't break, then drop it from floor 10, then 20, then 30, then 40, etc until it breaks. Say the egg breaks at floor 30, start dropping the other egg from floor 21, then 22, then 23, until it breaks. Very easy problem.</comment>


Leeenux Linux 3.0 now available for netbooks - <AUTHOR> http://www.linuxcritic.com/leeenux-linux-30-netbooks/ <comment><USER2> I'm using the mentioned UNR (Ubuntu Netbook Remix) and have been very impressed. It's working great on the street-available Asus eeePC 1GB as a Ubuntu/Win 7 dual-boot.</comment>


Mappa Mundi – A map that survived 700 years [video] - <AUTHOR> https://www.bbc.com/reel/video/p074n6qg/the-curious-map-that-survived-700-years <comment><USER2> The actual map: [https://upload.wikimedia.org/wikipedia/commons/4/48/Hereford...](https://upload.wikimedia.org/wikipedia/commons/4/48/Hereford- Karte.jpg)

<comment><USER3> This image helped me understand it:

[https://upload.wikimedia.org/wikipedia/commons/4/46/Orthogra...](https://upload.wikimedia.org/wikipedia/commons/4/46/Orthographic_T%26O.png)

It's a hemisphere centered on Jerusalem, with North to the left. "ROMA" is across the Med to the left of the labyrinth just below center. At top right, it's easy to identify the Persian gulf and Red Sea; it appears that Somalia is disconnected from the African continent and infested with Dracones. At bottom left are the British isles, you can see "LONDONIA" just up the Thames, across the English channel from the Seine which flows from the cathedral representing Paris.

The circular outside edge represents the oceans, compressed to a narrow band of shoreline - the Atlantic at the bottom, Arctic at the left, Pacific at top, Indian at the right. There's some discussion as to whether the round world was assumed to be spherical or disc-shaped, with most historians assuming that it was believed to be spherical and that the oceans were simply connected on the 'back' of the map (where the Americas would be).

It's an interesting projection, expanding some areas to give detail based on religious importance and familiarity more than absolute geographical size.

<comment><USER4> An absolutely terrific book about (among other things) this is The Discoverers by Daniel J. Boorstin. He goes into a lot of detail on how map making in Europe for the longest time was driven, as you say, more by religious importance than anything else. Interestingly when Europeans did get more serious about accurate maps this was for a large part driven by the search for the fabled Prester John, a Christian king thought to be ruling in India or Africa.

</comment></comment></comment><comment><USER5> For another take on Mappa Mundi I like this Map Men video: [https://youtu.be/XxYecjWUkJw](https://youtu.be/XxYecjWUkJw)

</comment><comment><USER6> I wonder how theme park maps [0] will be perceived in 700 years.

[0] [https://www.freizeitpark- welt.de/freizeitparks/europa_park/f...](https://www.freizeitpark- welt.de/freizeitparks/europa_park/fotos/parkmap/2017.jpg)

</comment><comment><USER7> Why are maps so comfy as an object in itself?</comment>


SAC Capital hit with criminal charges - <AUTHOR> http://money.cnn.com/2013/07/25/investing/sac-capital-charges/index.html?hpt=hp_t2 <comment><USER2> One thing that's not being mentioned in these stories: at least at it's height, SAC trading (reportedly) represented several percentage points of NYSE / NASDAQ volume on an average day (which is huge considering their AUM and the total number of organizations trading). The allegation that they were essentially an organized insider trading scheme is pretty spectacular given that scale.

(Correction: 3% of NYSE, 1% of NASDAQ: [http://www.vault.com/company- profiles/hedge-funds/sac-capita...](http://www.vault.com/company- profiles/hedge-funds/sac-capital-advisors,-lp.aspx))

</comment><comment><USER3> From what I've read, even with criminal charges it's unlikely that Steven Cohen or anyone else involved will serve jail time.

Here in Colorado an electronics recycler sent their recyclables to China instead of actually recycling and the CEO got 30 months in prison.

I continue to be shocked that bankers and investors get away with fines and a slap on the wrist. I'm not aware of any that have served prison time since the recession started.

<comment><USER4> raj rajaratnam?

<comment><USER5> He is Indian. If you look back at other scandals, usually it's a person considered in a racial minority (Jerome Kerviel, Joseph Jett) that see jail time

<comment><USER6> 1) Raj is Sri Lankan, not Indian. 2) Kerviel is French, grew up and was educated in France, and worked for a French bank. He isn't a racial minority. 3) Jett was a minority sure and Milken, Boesky, etc. were not minorities. Not exactly a pattern there.

</comment></comment></comment></comment><comment><USER7> Finally! The whole world has known that SAC is nothing but insider trading with plausible deniability. SAC even had a platform, where if you submitted a trading idea, and they used it, then they would pay you a fee. It was a scheme to harvest insider information but give SAC an excuse.

</comment><comment><USER8> SAC Capital of Deep Capture fame? Why am I not surprised?

[http://www.deepcapture.com/tag/sac- capital/](http://www.deepcapture.com/tag/sac-capital/)

</comment><comment><USER4> Inside information for wall street is what steroids are for baseball players - everyone uses it.It's the only way to compete and everyone just tries to one- up each other by using more

<comment><USER9> That's the elephant in the room. There are far more hedge funds than there are rocket science algorithms that could possibly confer a trading advantage.

</comment></comment><comment><USER10> This is dominating the discussion at our fund right now.

They should have traded commodities, at least with commodities, most forms of insider trading are legal:)

It will be interesting to see if the fund lives on from this . I find this unfortunate, Steve Cohen is one of the people in this industry I enjoyed following.

</comment><comment><USER11> How many of these guys will actually end up behind bars?</comment>


OpenSignal Ports Its Crowdsourced WeatherSignal App to iOS, Courtesy of iPhone 6 - <AUTHOR> http://techcrunch.com/2014/10/09/weathersignal-brings-its-crowdsourced-weather-app-to-ios-courtesy-of-the-iphone-6/ <comment><USER2> Just installed it on my iPhone 6.

Why can't I allow WeatherSignal to access location services always?

 _Settings- >WeatherSignal->Privacy->Location Services_ looks like this: [http://i.imgur.com/BeOcOLP.png](http://i.imgur.com/BeOcOLP.png)

when it should look like this: [http://i.imgur.com/kAOB53B.png](http://i.imgur.com/kAOB53B.png)

The option "Always" is missing from WeatherSignal settings.

<comment><USER3> Because we can't collect pressure readings in the background (apple doesn't allow a background mode for pressure), so it would just be a waste of the user's battery to be constantly taking their location.

</comment></comment><comment><USER4> Our of curiosity, which Android devices have a barometer? I've seen the API, but never had a device capable of using it.

<comment><USER5> From [https://play.google.com/store/apps/details?id=ca.cumulonimbu...](https://play.google.com/store/apps/details?id=ca.cumulonimbus.barometernetwork&hl=en)

      "Devices with barometers include:
      Galaxy S3, S4, S5
      Galaxy Nexus
      Galaxy Note, 2, 3
      Nexus 4, 5, 10
      Xoom
      RAZR MAXX HD
      Xiaomi MI-2, MI-3
      Droid Ultra
      Moto X
      HTC One (M8)
      ..and others!"

<comment><USER6> No way, my old N4 had a barometer? Wish something like that would be more exploited/publicized, I'm a data nerd and would have loved to play with apps which use it. Good to know, the N6 should have one too in this case.

</comment></comment></comment><comment><USER7> I wonder how the iPhone's barometer accuracy compares to that of an android device?</comment>


Android - SMS are intermittently sent to wrong and seemingly random contact - <AUTHOR> http://code.google.com/p/android/issues/detail?id=9392 <comment><USER2> On a somewhat related note, is this how people really communicate on the internets? Thinking the 954 prior requests will be ignored unless I ask Google to "fix it please" and reach the critical mass of 955 people asking them! Better add "quickly". Or better yet, just throw in a WTF, and multiple !!!.

I can only hope this one is ironic - _"WTF!!?? I just want to say WTF?!!!?!? I will never buy an android phone again. This is the worst thing I can imagine in my life. Worse than the end of the world. Worse than the Doomsday. Just want to say WTF again!!!!!!!"_

<comment><USER3> Although people go over the top in rudeness, which doesn't help anyone, it's a fact that a lot of bug reports by customers to big companies get ignored. So the screaming is not _entirely_ unwarranted.

<comment><USER4> Not that it will take your complain any further, though.

<comment><USER3> Yes, but if a rogue SMS message messed up your relationship with someone, such rationality might be lost.

And there's always strength in numbers, if 2000 people complain about something (ignoring the language), it tends to get noticed more than if 1 person would report it and the rest thinks "hey, it's already reported, let's shut up and wait".

</comment></comment></comment></comment><comment><USER5> I'm sure they'll be fast to fix this, but how fast will phone manufactures be to push this out?

This is definitely a real bug, a few weeks ago a text intended for my girlfriend went to my mom. After you send a text and it goes through the phone changes the name to some random other contact and there's nothing you can do about it.

<comment><USER6> > a few weeks ago a text intended for my girlfriend went to my mom

Talk about worst case scenario!

<comment><USER5> It wasn't anything bad, but it makes me very paranoid to text anything I wouldn't want public.

<comment><USER7> That is probably good advice no matter how you slice it. It's not like SMS is a secure method of communication.

<comment><USER8> It's not secure, but you have a reasonable expectation of privacy using text messages, at least as long as you trust the other person. Not "get away with crimes" privacy, but "I'm getting so-and-so this for their birthday" privacy.

<comment><USER9> Tend to disagree with this. Recently had the htc touch diamond. Then got a blackberry Storm 2 from the same carrier (telus). Bought the old phone back as a present for a friend that was going to go pay as you go (but you cant).

Then my friend tells me hes getting my text messages. Every one of them. So I get the phone back, call telus up and complain. The tech has me enter some number which opens up the config for the phone.

And low and behold I have my phone number sitting in the phone. Deleting the number stopped the text messages.

So lets think about this for a second. All I have to do to get your text messages is enter your 10 digit number into my old non active phone.

I would say security in text messaging is non existant.

FYI: Happened christmas of 2009 so it might be fixed but I doubt it.

</comment></comment></comment></comment></comment></comment><comment><USER10> Interesting how everyone was talking about the iPhone alarm bug, but nobody (in the mainstream world) is talking about Android sending out your SMS to random people.

<comment><USER11> It's possible that I just don't hang out with the cool people, but HN is the only place I've heard any discussion of either of them, and (before this link) I had seen exactly one link about each issue on the front page.

(Edit: Were they talking about it on the TV news? That's about the one obvious place where a lot of people would have heard about it that I would have completely missed. That would make sense, actually.)

<comment><USER12> They talked about the iphone alarm bug on the news, it makes sense as well, the android bug is a fairly obscure and hard to trigger bug thats probably affected a few people, the iphone one affected everybody who uses the alarm

<comment><USER13>
      iphone one affected everybody who uses the alarm

Not true. I cannot comment on the ratio though. Alarm worked fine for me on iPhone 4 and for my gf on iPhone 3G.

To make your statement true you should add modifiers like "on Jan 2nd", "those using recuring alarms" and possibly some others, I don't know the exact setup needed for this bug to manifest.

<comment><USER14> I actually had the iPhone alarm bug hit me on iOS 4.2 this past weekend. Almost messed up a surgical procedure I had scheduled. Not good.

<comment><USER15> I'm imagining that you were the surgeon. "Appendectomy? Yeah, there's an app for that."

<comment><USER14> Haha, no. In fact, it was my son's.

Nice play on words.

</comment></comment></comment></comment></comment></comment></comment><comment><USER16> Well, not for long - it looks like they have a fix: <http://code.google.com/p/android/issues/detail?id=9392#c1460>

<comment><USER13> Isn't the situation such that this fix will take a long time to reach some of the users? Sometimes as long as "never"?

<comment><USER17> Well with a bit of luck it won't be 2.3 only, so yeah but not as likely. And I'm guessing carriers are getting bitched at as well, so they're probably looking into getting this one fixed soon-ish on the phones they "manage".

<comment><USER18> Maybe the fallout will be a valuable lesson to carriers.

They've (in some cases) loaded phones up with crap, and in so doing made maintenance difficult. Any patch will have to go through their crapification process, and re-testing, leading to customer dissatisfaction.

Depending on how much dissatisfaction the bug causes, and the degree to which people clamor for Android phones anyway, carriers might decide to change their attitudes toward crapware.

</comment></comment></comment></comment><comment><USER19> Perhaps we should add a standard disclaimer to the bottom of all SMSs we send:

"If you are not the intended recipient of this message .. blah blah blah"

</comment><comment><USER20> Hehe, makes me happier I don't use sms and just use email. If that happened to email I'd shoot the phone. Seriously that's an odd bug, anyone looked at the patch? How those the bug happen?

</comment><comment><USER21> This has me all paranoid now. I've never noticed it on my phone (and I send a LOT of texts for work as well as personally), but now i've got this itch to go back through every message stream for the last few months and check.

</comment><comment><USER22> Comment 1013 by xiaweihua94, Jan 02 (5 days ago) oh come on that's horrible, the message which is supposed to my girlfriend went to my boss. please fix it as soon as you guys can

<comment><USER23> Omigosh. I wonder if that's why my boss keeps looking at me funny lately. This is no good at all.

</comment></comment><comment><USER24> This is such a bad bug that I will be surprised if it doesn't get picked up by major news organizations.

The fact that this bug exists is bad enough, but realizing that your phone might _never_ get the bug fix is even worse.

</comment><comment><USER25> The question is - if they have a fix, how will they get it out to people who aren't upgrading to 2.4 (or whatever the next version is)?

Are people with HTC Wildfires and the like going to be stuck with this bug permanently?

<comment><AUTHOR> Dot versions are pushed, too (I'm on 2.3.1 right now) - so I suppose it will be in 2.3.2 and presumably whatever stable version of Froyo.

I guess we'll see.

<comment><USER26> I look forward to getting the fix on my Motorola Milestone this time next year.

<comment><USER27> This is one reason I ditched my HTC Magic on Rogers. I hear all this great stuff about new Android releases, but it's going to take months before any updates get to my phone, and by then Rogers will have boned things up somehow. With my iPhone I always have current (non-telco-modified) software.

<comment><USER28> Fwiw, Nexus One and Nexus S do the same for Android.

<comment><USER15> Yeah, this bug has convinced me that, when I get an Android phone, it has to be a Nexus.

<comment><USER28> Just got my Nexus S a few days ago, love it :).

</comment></comment></comment></comment></comment></comment></comment><comment><USER29> Unbelievable...

</comment><comment><USER30> <http://code.google.com/p/android/issues/detail?id=9392#c1460></comment>


25 years and counting – Bits from Debian - <AUTHOR> https://bits.debian.org/2018/08/debian-is-25.html <comment><USER2> Debian is a great OS. Kudos to all those involved in making the project a tremendous success.</comment>


Show HN: HOW-TO create reports in plain English in Google Analytics using chrome - <AUTHOR> http://kueri.me/google-analytics-chrome-extension/ <comment><AUTHOR> Would love to here you comments and feedback.</comment>


How to generate a double-precision floating-point number in [0, 1] (2014) - <AUTHOR> http://mumble.net/~campbell/2014/04/28/uniform-random-float

<comment><USER2> Why [0, 1] interval is so popular in random number generators? It's one of the worst intervals possible imo because it includes subnormal numbers. The interval [1, 2] is much nicer. Some implementations generate random numbers in [1, 2] and subtract 1.0: [http://permalink.gmane.org/gmane.comp.lang.lua.luajit/3051](http://permalink.gmane.org/gmane.comp.lang.lua.luajit/3051)</comment>