Don't become a scientist (1999) - <AUTHOR> http://physics.wustl.edu/katz/scientist.html <comment><USER2> Sigh. This gets posted every few months and the title is still wrong. It's a great time to be a scientist, especially if you're into, say, computational biology. It's an awful time to shoot for a tenure track faculty position. There are lots of ways to do science, both in and out of academia, without the 'professor' title.

<comment><USER3> Yes. _Do_ be a scientist. _Don 't_ be an academic.

Dropping out of academia was amongst the more difficult decisions I've made. Also amongst the best.

There are _huge_ opportunities for scientists today. I'm a physicist. I've worked in computer-assisted surgery, medical physics, image processing, computer vision, genomics, computational physics and a few other things besides. It has paid well and let me do all kinds of interesting research that I would never have been able to touch as an academic.

Things to do as a student: study modern statistics hard. Being a card-carrying Bayesian is like the secret handshake to an unlimited world of really cool stuff these days. There's a childhood friend of mine who's (finally) finishing his PhD in psychology, and when we reconnected a few years ago we were amazed that we could meaningfully talk to each other about our work because we both spoke the same statistical language. It really is a universal grammar, and anyone in any field who speaks it fluently has a world of opportunity waiting for them, from finance to fisheries.

<comment><USER4> > study modern statistics hard

Would you recommend some texts that cover this?

A friend suggested:

* Data Analysis: A Bayesian Tutorial by Devinderjit Sivia, John Skilling

* Bayesian Data Analysis, by Andrew Gelman, John B. Carlin, Hal S. Stern

* Introduction to Statistical Inference by Jack C. Kiefer, Gary Lorden

Currently I am working my way through this.

Pattern Recognition and Machine Learning by Christopher M. Bishop

These books are expensive and very time-consuming so it is important to pick the right ones.

</comment></comment></comment><comment><USER5> I began working as a student at a national lab two years ago after earning my bachelor's degree in physics. I was converted to staff nearly a year later. I'm now earning more than most of my professors back home and some of the postdocs here, although if the postdocs are converted (a difficult process), they're very likely to have a higher starting salary.

I feel very lucky to be a well-paid staff researcher at such a young age, especially since I don't have a graduate degree. I'm surrounded by older people with PhDs; most of the time, I feel like there's really nothing that really differentiates us.

However, and this might be my inferiority complex kicking in, sometimes I feel like I should go back to school and get my PhD. But then I read essays and articles like these, and I wonder if a choice like that would be stupid. Granted, I'd pursue some sort of computational physics in grad school, so I'd still leave with marketable skills.

Anyway, I don't know what to do. Just thinking out loud. If anyone has any advice, I'd appreciate it.

<comment><USER6> I got a PhD in physics in 1993. I think the advice we received still rings true today. Don't attend grad school unless:

1\. You are so in love with the subject matter, that you can't think of doing anything else. I'd give the same advice to someone thinking of going to music school (my Plan B when I was a kid).

2\. Somebody else is paying for it. My spouse and I finished grad school with no debt.

Without wanting to be too negative about it, I think that the inferiority complex thing, and expecting to receive marketable skills, aren't good enough reasons. Are computational physicists really more employable than common, or garden, computer programmers? A lot of programming can and is done by trial and error or looking up stuff online, and a lot of people doing it are basically self taught. (I'm looking in the mirror when I say those things).

I went to grad school because my parents had science degrees, and seemed to have good careers and happy lives. And I was interested in learning more, in an academic environment. I already knew how to program, but saw it as a drudge job -- easy but ultimately boring if you were doing it for someone else. (My summer internships at a data processing center may have biased my perspective). During the time that I was in school, the people who seemed to be doing the coolest things with computers were the physicists.

Note that I have to be careful what I say about programming, in a nest of programmers. ;-) I really have a lot of respect for what folks are doing, but am describing the limited environment that I was exposed to 20+ years ago.

<comment><USER5> Thank you for the great reply!

I hear statement (1) quite a lot, but it seems like a really subjective criterion. When I hear this, I think, "If I'm not as passionate as Feynman, I should not go to grad school." And so I haven't. Am I looking at this the wrong way? When I compare the subjects I enjoy and the careers that allow freedom and decent pay, physics seems to be the only thing that remains. Is that not enough? I don't have the confidence to know whether I'll love the subject in ten years. I also think anyone who has that confidence is either a Feynman-type or has deluded themselves. Regarding (2), don't most hard science grad programs pay the students?

I'm also not saying that computational physicists are more employable than common programmers (or that they're better software developers!). I'm just saying I enjoy working on problems similar to those encountered in computational physics. I enjoy figuring out how things work and modelling them. In case I ended up hating physics by the end of graduate school, at least I'd have a strong background in mathematics and programming, and those skills could be transferred to domains with similar problems.

If you don't mind me asking, are you still working in physics? Based on your "about" section, you seem to be interested in a great many things, like myself. Before entering graduate school, could you truly not think of doing anything else, i.e., did you truly obey criterion (1)? I can think of many things I'd still like to do while I'm young: start a business, write songs professionally, act... but it's hard to take risks like that when you've got a good (and more practical) thing going.

<comment><USER6> I suppose (1) is an exaggeration. But there are a number of risks inherent in joining a grad program -- ways that students fall out and don't get their degrees. At least I think you need to be aware of those risks and willing to absorb them. And one of those risks is that you emerge with your PhD and folks wonder how you're actually smarter than you were without one.

(2), yes, but it's just a reminder to set a bar for yourself, that you have to get into a decent program with decent support in order for it to be worthwhile. It might not be so much the principle of getting paid to work, but having enough of a financial cushion so you don't have to deal with crises by quitting grad school.

I obeyed criterion (1) but not Feynman level. That's too strong of a criterion, like you suggest. Rather, the alternatives to grad school all looked pretty blah. I've been _extremely_ lucky. My thesis project was very much a hackathon in optics, electronics, software, etc. Today I work for a company that makes scientific instruments, and I work on assimilating new technologies on a 1 - 2 year time frame before we attempt to develop them into the next generation of products. So I do a lot of experimenting, learning theory, etc. I solve difficult problems that crop up with our products, in production and in the field.

Truth be told, I also spend a reasonable amount of time on mainstream work, e.g., project engineering. I've tried my hand at both project management and people management. Those were OK. I don't have enough mental organization to do the project management thing when I'm actually competing with other project managers for resources.

Over the duration of grad school, I kinda lost interest in basic research. It's cool, but I'm not a _great_ physicist, and I've simply never had an idea for my own line of research, which would kinda put a damper on an academic career. I prefer to work on shorter term projects where I can add value by developing an understanding of how things work. I also feel that the industry I'm in genuinely creates good solid jobs for people. I don't face the dilemma of wondering if I have to exploit people in order for my own work to progress.

</comment></comment></comment></comment><comment><USER7> I went to the school where he teaches and never had any student mention his name with a shred of respect or have anything positive to say about him. I would take his points with a huge grain of salt.

<comment><USER8> It's not like this guy is the only one who has observed the problem with academia. I don't really think it's relevant if students liked him as a teacher. The job problem in academia is very, very well-known at this point, and many professors would back him up now.

<comment><USER7> I agree and in light of your points, I feel like my comment is out of line.

</comment></comment></comment><comment><USER9> The guy is barking up the wrong tree. There is indeed a crisis in science, especially in pharmacology, but it isn't caused by an oversupply of biochemists, it's that since 2004, and especially since 2008, _everything that isn 't academia has stopped hiring_. It's not that the source is too plentiful, it's that the sink has become plugged up.

There may be a cautionary tale in there for computer science: once the VC carousel stops the situation in computer science will be quite as bad.

<comment><USER10> This was written in 1999.

<comment><USER9> I know. It's all bullshit what the guy writes, this essay and all the others on his site. This one here ([http://physics.wustl.edu/katz/defense.html](http://physics.wustl.edu/katz/defense.html)) is really something fierce.

That's why I said the unemployment crisis isn't caused by an oversupply of scientists - up to about 2004 most everyone with a PhD degree could find employment in industry. But this fellow Katz doesn't even mention industry. He is either ignorant or intentionally dishonest. There is no excuse for either.

<comment><USER11> The author is a physicist; where would one find employment in the physics industry? The "physics industry" is pretty much academia, with the exception of a few DoD positions. Physics Ph.D.s frequently go into finance and software development, but since neither of those use physics (except limited amounts of software), I think they would fit into the "career change" that he did mention.

I graduated with an B.S. in Physics about the time that he wrote, and his analysis pretty much matched what I saw in the lab I worked in. Of my physics classmates who I know what happened to them, all got jobs doing no physics (including the newly minted Ph.D. who was supervising me). I talked with the postdoc in our lab (her second postdoc position), looked at the number of Ph.D.s and postdocs at Ohio State (lots), looked at the number of open positions in the Physics Department at Ohio State (none), and decided I did not want to postdoc until a professor died and then hope that I get picked. So I said physics was a fun, stimulating, foundational undergraduate choice, felt like I understood the entire world, and promptly pursued software. (Fortunately, I was aided by being tired of school and not really enjoying physics research)

One of my physics classmates did software for a while, then decided to do a Ph.D. in (rocket) propulsion, which is physics-related. "Industry" for him is pretty much limited to NASA (who else is going to employ someone looking into new forms of propulsion?) Turns out he doesn't want to work for NASA bureaucracy, so he switched back to software again.

I think the author is right on, at least for his field of physics.

</comment></comment></comment></comment><comment><USER12> I started working this year in University genetics a lab as a programmer. Lots of post docs, and its a hard life. Despite being a very prestigious University and working crazy amounts, some of the post-docs are having trouble finding academic jobs. Though from here due to reputation they can go into industry make more money, but then they don't get to work on what they want.

</comment><comment><USER13> >If you are in a position of leadership in science then you should try to persuade the funding agencies to train fewer Ph.D.s.

or, increase funding for science (academic and otherwise)

</comment><comment><USER14> I think PhD should be viewed as a kind of job, rather than a degree. Being a professor shouldn't be the only way to go for a PhD. Industries should provide equal opportunities for PhDs (they often think PhDs are over qualified).

<comment><USER14> Wait, just noticed that the article is from 1999! should have read this before I applied for PhD 7 years ago.

</comment></comment><comment><USER15> [https://hn.algolia.com/?q=don%27t+become+a+scientist#!/story...](https://hn.algolia.com/?q=don%27t+become+a+scientist#!/story/forever/0/don't%20become%20a%20scientist)

</comment><comment><USER16> This is one of the reasons I have not pursued my PhD in Physics - there are few professorships available. I don't want to spend years trying to get one of the very few postdoc jobs available.</comment>


Numbers everyone should know - <AUTHOR> http://highscalability.com/numbers-everyone-should-know <comment><USER2> My databases professor at my university once brought up Jim Gray's data latency analogy to illustrate the costs of using different types of storage. Basically it goes something like this:

Using a register is like interacting with information in your own brain, using an L1 cache is like walking to a bookshelf in the room you're in, using an L2 cache is like walking across campus, using RAM is like going to Sacramento (we were in Berkeley), hitting the disk is like _going to Pluto_ , and using tape drives is like going to Andromeda.

I never fully registered the consequences of hitting disk until then.

<comment><USER3> My company does this, but in reverse, whenever someone is getting something to eat there's a metaphor for it. Cache means you've already got it, hitting memory means you need to go to the kitchen, disk means you need a trip to the store, regisers of course means you're actively chewing.

<comment><USER4> I really like this analogy. When the article said "Numbers everyone should know", it's not really the numbers that matter, but the general relative scale of performance costs for common operations. IOTW, memorizing the nanoseconds of a cache hit isn't useful, but knowing how many times slower disk is than ram is.

</comment></comment></comment><comment><USER5> People should also know for writes that there are a variety of ways to mitigate this. The first way is to write sequentially (no seeking). The second way is to install battery backed write cache which will do this for you. If you're ok with losing a little bit of data you can also just have the OS write to memory before flushing to disk. BBWC controllers seem to handle write reorder optimization much better than the OS. So I'd recommend the BBWC over writing to memory.

This is a large reason I dislike cloud hosting, most of the hardware is crap and you could get much better performance from it with a little more expense. Also it's mostly pointless to bother making your writes sequential as the performance degrades to random IO because of all the other instances on the machine.

</comment><comment><USER6> Well if anyone wants to learn more from Jeff Dean than just twelve numbers, here's a talk he gave at Standford about Google's architecture and system building in general:

[http://ee380.stanford.edu/cgi- bin/videologger.php?target=101...](http://ee380.stanford.edu/cgi- bin/videologger.php?target=101110-ee380-300.asx)

The slides for the talk: [http://www.stanford.edu/class/ee380/Abstracts/101110-slides....](http://www.stanford.edu/class/ee380/Abstracts/101110-slides.pdf)

</comment><comment><USER7> Needs updating for SSDs, I'm not sure it's really worth the development time and increased time to market to optimise for rotating disks.

<comment><USER8> You seem to have accidentally traveled back in time to 2011 from whatever golden future you live in before posting this comment.

<comment><USER7> We spent a lot of time over several years tweaking every setting imaginable, trying to get the performance up of a NFS server, none of which really made any difference. Installing SSDs fixed the problem completely. Disk I/O now stays in the single digit percentage range when previously would stay at 100%, sometimes for minutes.

SSDs about twice the price of 15k rpm drives, hardly out of reach for most. Also for VPSs, server axis 20mb unmetered SSDs are cheaper than slicehost's rotating disk based systems. <http://serveraxis.com/vps-ssd.php>

<comment><USER9> Yeah, SSDs are going to totally kill 15krpm disks. But killing disks in general is a ways off. In fact, disks might actually be getting cheaper per bit faster than SSDs are.

</comment></comment></comment></comment><comment><USER10> I know noSQL is all the rage with the crazy kids these days and I know it has its place but why is half of the literature regarding noSQL about solving problems that are trivial in an RDBMS?

<comment><USER8> This particular article is addressing problems that would not be trivial in an RDBMS. If you're worried about concurrency when incrementing a counter, you're at a level of scale few people get to work on.

There's a legitimate rant to be had about using elephant architecture to serve mouse traffic, and I think that's what annoys me most about the NoSQL fad. But that doesn't mean the problems mentioned in this article don't exist.

<comment><USER11> "If you're worried about concurrency when incrementing a counter, you're at a level of scale few people get to work on."

I'm not sure I understand. If I make an application that has to increment a counter, shouldn't I always be worried about concurrency?

What I mean is, sure, if I'm serving only a few requests, then of course the probability of running into concurrency issues is lower than a site with more requests/sec. But it's still a matter of chance, there is _some_ probability that two requests will come in at exactly the same time and cause a problem.

<comment><USER12> You are worrying about _correctness_ of concurrency. Yes, this should always be worried about.

The parent poster is worrying about _performance_ of concurrency. This doesn't need to be worried about unless you are one of about 5-10 tech companies whose name is recognisable to people on the street.

</comment></comment></comment></comment><comment><USER12> I love the concept of sharding counters to trade write performance for read performance! As so often happens, my understanding advances by looking at something I thought I knew the only possible answer to ("Of course a counter goes in a single variable!") and seeing that other alternatives are possible.

</comment><comment><USER13> An article with 'numbers everyone should know' without linking to Peter Norvig?! Here goes: <http://norvig.com/21-days.html>

</comment><comment><USER14> Not trying to be mean, but sometimes I wonder how many programmers actually have friends outside the industry. This happens when I read titles like "Numbers everyone should know" and then find out that it's numbers like the time needed for an L2 cache reference or how to optimize for low write contention. Does anyone realize that this stuff is about as esoteric as it gets?

<comment><USER15> I think the author assumed readers were programmers. That's OK in a trade publication.

Indeed, every programmer should know those numbers.

<comment><USER16> There's still an argument to be made that it's largely esoteric even for programmers. There's an enormously large cross section of professional programmers for whom this is really only relevant to satisfy some curiosity rather than in any way relevant to their day to day coding. There's 100% no use in knowing the difference between an L1 and L2 cache hit compared to a branch misprediction if your day job involves, say, writing Wordpress plugins in php or iOS apps or maintaining some corporate Java app.

<comment><USER17> Your right that you can't really think about this stuff to much sitting in a high level language. It is useful though to have a good idea of the underlying architecture which your taking advantage of at a higher level. Sure L1 and L2 cache optimization is out of your hands but if you are writing an app for the GAE knowing the relative speeds of writes in relations to reads could influence the decisions you make.

</comment></comment></comment></comment><comment><USER18> Another way to make unique ordered keys is to use a timestamp and append a random value, such as a random UUID.

key = timestamp + UUID4

<comment><USER12> I didn't like this idea at first, since it struck me that if for some reason you had to create many records in quick succession (e.g. some kind of bulk upload) they would essentially be placed in random order. But thinking about it, the only scenarios where you would need to do this _and_ want to preserve the order exactly would be if all the records were coming from the same source -- in which case you could just choose a single UUID for the batch and append increasing values of a _local_ counter to this.

TL;DR: This would actually work really well I think!

<comment><USER19> Isn't this exactly what the article suggests doing? Time stamp + user id + comment count.

</comment></comment></comment><comment><USER20> Blogspam repost of a 2yo+ presentation. A very good one, but still...

<comment><AUTHOR> I'm sorry you feel that way. I was re-reading information on systems architecture and came across the article. I thought it was relevant to HN and thought hey this is something people might like to read. Not everyone here has been here since 09 and not everyone here will have seen the article. Just trying to help educate fellow members of this community.

<comment><USER18> I get connection reset when I try to comment on your blog.

<comment><AUTHOR> I have a blog?

</comment></comment></comment></comment><comment><USER21> [http://www.beej.us/guide/bgipc/output/html/singlepage/bgipc....](http://www.beej.us/guide/bgipc/output/html/singlepage/bgipc.html#flocking)

</comment><comment><USER22> Excellent tidbits!</comment>


First Digital Pill Approved - <AUTHOR> https://www.nytimes.com/2017/11/13/health/digital-pill-fda.html?_r=0 <comment><USER2> Shouldn't they use this with antibiotics first, to better make sure that people take the full course of their prescription?

> Abilify is an arguably unusual choice for the first sensor-embedded > medicine. It is prescribed to people with schizophrenia, bipolar disorder > and, in conjunction with an antidepressant, major depressive disorder.

> Many patients with these conditions do not take medication regularly, often > with severe consequences. But symptoms of schizophrenia and related > disorders can include paranoia and delusions, so some doctors and patients > wonder how widely digital Abilify will be accepted.

Abilify is a "partial dopamine agonist" \- the other anti-psychotics are stronger dopamine agonists, and are much more effective at inducing akathasia [0] ("inner restlessness"). This class of drugs are palliative medications that don't address the causes of a patient's symptoms.

[0] [https://en.wikipedia.org/wiki/Akathisia#Drug- induced](https://en.wikipedia.org/wiki/Akathisia#Drug-induced)

When my friend's sixth hospitalization put her on Abilify, she got worse as the week progressed. The day before she was released she was as delusional as she'd ever been. I was certain they'd send her to another hospital, but they released her anyways. I got a call the next day, and had to drive 5 hours to retrieve her from Las Vegas, where she'd ditched the 'friends' who'd talked her into going to California.

There is no controversy about Abilify causing compulsive behaviors:

[https://www.fda.gov/Drugs/DrugSafety/ucm498662.htm](https://www.fda.gov/Drugs/DrugSafety/ucm498662.htm)

[https://www.thedailybeast.com/patients-say-abilify-turned- th...](https://www.thedailybeast.com/patients-say-abilify-turned-them-into- compulsive-gamblers-and-sex-addicts)

The only way to escape from maintenance meds like Abilify is to taper off. If the digital pill is tattling on the patient, it only makes their recovery more difficult.</comment>


Government researcher misuses supercomputers to mine Bitcoin - <AUTHOR> http://www.forbes.com/sites/kashmirhill/2014/06/06/government-researcher-misused-supercomputers-to-mine-bitcoin

<comment><USER2> _What's disheartening about the NSF researcher is that he or she had some super expensive computing resources, worth $150,000, but only managed to mine $8,000 – $10,000 worth of Bitcoin._

I feel like the only people consistently making money out of Bitcoin are the ASIC vendors.</comment>


Apple appeal in Japan is turning the tables - <AUTHOR> http://news.cnet.com/8301-13924_3-20006368-64.html?tag=newsFeaturedBlogArea.0

<comment><USER2> My anecdotal experience in Japan...

I go to Japan every spring for 3 weeks or so, and I am always looking around to see what electronic gadgets people are using, so I am always checking out everyone, especially on the train.

Spring 2009...before arriving, I was quite interested to see how many people were using an iPhone. I was quite surprised to see only the the odd iPhone here and there. The iPhone had already been out for a long time, with great success most everywhere else, so I thought maybe there was something unique about the way they use their phones (the Japanese are constantly reading or typing on their phones) such that the iPhone was inferior (I still don't know the answer to this).

Spring 2010...iPhones everywhere. On any given train, of the people visibly using a cell phone, 20% to 40% of them had an iPhone. It was a pretty impressive conversion in the span of one year.

I did see the new Sony XPeria in the stores over there, it did look like a fairly nice device. But the advantage the iPhone will always have is the app store, there are some really cool Japan only apps that (for now) you can only get on the iPhone.

Maybe Japanese cell phone companies should just standardize on Android and try to come out with the slickest Japanese implementation first, then try to re- tackle the international market if they can pull that off.

<comment><USER3> One reason is that the price dropped quite a bit. I got a 8GB for "free" last year, subject to a 2 year contract.

Your estimate of 20~40% is probably off by a factor of about 10, though. Think about it. Softbank is one of the 3 major mobile carriers in Japan. In fact, the other two are still bigger. Even _all_ of the dozens of Softbank models combined probably don't add up to 25% of market share.

Also, each carrier has had their own app stores way before iPhone existed. Of course, iPhone has the novelty factor, a great interface, etc, but existing stores have plenty of apps and also a subscription model.

<comment><USER4> I think that cities are vastly biased towards the iPhone. There's just lots of pro-iPhone people in the cities; mac users (note there are only a few mac stores in Japan and they are all in big cities), Japanese people who are more "worldly", business people or tech people who appreciate the easy access to the real web and not watered down iMode version etc etc.

But get outside the cities - you know, the other 90% of Japan - and I'd wager a guess that the amount of iPhones you see in the wild drops considerably.

So you're right in a way. There's probably very high market penetration within big cities. But outside the cities where its high school kids, X-corp salarymen, factory workers and housewives, other models dominate.

<comment><USER5> > outside the cities - you know, the other 90% of Japan

So far as I can tell, more than half the population of Japan is in major metropolitan areas.

</comment></comment></comment></comment><comment><USER6> Obligatory anecdotal confirmation:

I recently went to a neighboorhood meetup (オフ会) near my home in Kobe. At some point I got out my iPhone to look at the time. Someone said "oh, you have an iPhone?" At which point fully HALF of the other attendees pulled out theirs and began discussing.

Yes, sampling bias and all that, but it's still a bit surprising. One guy who didn't have one expressed his loyalty to an opposing carrier that doesn't have the iPhone.

Still haven't seen an iPad here, but it hasn't been very long.

<comment><USER7> I'm in Tokyo, and the news here is _full_ of the amazing new world ushered in by the iPad, and I know it sold out the first day; people camped out for two days in front of the Apple Store in Ginza to get one, and the lines were _huge_

I'll let you know if Ginza/Shibuya is an iPad-fest this weekend.

</comment></comment><comment><USER8> Japan does not _always_ pick Japanese stuff over non-Japanese stuff. Perl seems more popular than Ruby, everyone uses Windows, OS X, or Linux, and so on.

I think the appeal of the iPhone is that it is marketed like a luxury good rather than a commodity, like the Japanese-made cell phones are. The Apple Store in Tokyo is in the super-ritzy Ginza district, after all. (Although the same is true in the US; the Apple Stores are always in the high-end retail districts, and the iPhone is a luxury where its competitors are faceless commodities that you "pay" ninety nine cents for every two years.)

Another thing I see going for Apple is that, it seems, people in Japan are actually willing to pay for consumer electronics. In the US, we go for whatever's cheapest (go to Best Buy sometime, not a high-end item in sight), but the Japanese seem to be more discerning. At least in my experience.

(I am typing this on a Y30,000 keyboard that was imported from Japan. The most expensive keyboard I can find on Amazon is $100, and only because it has a shit-ton of stupid bells and whistles, like LEDs and a text display. This keyboard is a regular 103-key keyboard without a numberpad. No lights, no display, no wireless. Just a good keyboard. Only in Japan...)

<comment><USER9> His article is a little weird. The Japanese have been into Americana products like Levis, work boots, boat shoes, surfboards and Harley Davidsons since the 70s. You can't get american made jeans or shoes in the US, but you can (for $800) in Tokyo.

Regarding electronics from the USA (China?), there simply have not been any worth buying until the iPhone and iPad.

<comment><USER10> I think that last bit was kind of the whole point.</comment></comment></comment>


President Trump's Insecure Android - <AUTHOR> https://www.lawfareblog.com/president-trumps-insecure-android <comment><USER2> Assuming that Trump is going to resist having his choice of device dictated, could his IT staff secure the device (somewhat) by running all his traffic through a VPN that does outbound filtering?

<comment><AUTHOR> They could attach dedicated microcell for Trump and lock his phone into it. After that they can put all his connections behind firewall and block or filter Trump's access as much as they like.

Not a foolproof solution, but better than nothing.

<comment><USER2> He has Secret Service people with him at all times, so they could be carrying the microcell equipment. Presumably you would then route the traffic over the standard cell networks (to get maximum coverage) using an encrypted tunnel.

</comment></comment></comment><comment><USER3> I suppose it's fitting for an insecure President to have an insecure phone.

<comment> village-idiot Funny how much he attacked Clinton for insecurity (and her record was _not_ great), I always suspected that he was projecting hard on that issue.</comment></comment>


Ask HN: substitute for Google Calendar - <AUTHOR>

Hi everyone,
I am trying to be less and less of a Google user, and, after GMail, the only thing that requires an account and I really depend on is Google Calendar.
Is there a good alternative? Maybe storing things in my Dropbox or a server of mine.
I appreciate any tip! <comment><USER2> Teamup calendar is pretty nice. [http://www.teamup.com/](http://www.teamup.com/)

</comment><comment><USER3> Calendar and lots more! [http://owncloud.org/](http://owncloud.org/)

</comment><comment><USER4> You didn't include critical information like what platforms you use. Failing that, I recommend iCloud for calendaring.

<comment><USER5> I don't think ditching one company that provides data to the NSA (assuming that's why the OP is leaving) for another that does the same thing is helpful.

<comment><USER4> You may have missed the part where he said he was looking at Dropbox (which you may remember as being widely reported being mentioned in PRISM slides as "coming soon").

So, I think the assumption that he is trying to dodge the NSA is a bad one.

</comment></comment></comment><comment><USER6> If you're an Apple user, Fantastical is a great iOS + OSX calendar app.</comment>


Beginners guide to gateways and proxies - <AUTHOR> https://www.learncloudnative.com/blog/2020-04-25-beginners-guide-to-gateways-proxies/ <comment><USER2> Wish developers would call these load balancers and stop trying to misappropriate words that designate something else.

A gateway is a network device that gives access to other networks (usually the router giving you internet). A proxy is an intermediate system to access, filter and cache requests, usually HTTP requests to the internet, not to confuse with a reverse proxy / load balancer that doesn't do that.

Of course all these are related network equipments often managed by the same guys, so go figure what tickets about "device" are really about.

edit: Also, it should be returning 401 instead of 403. This reminds me I need to make a post about the good usage of 401 and 403.

<comment><USER3> Yes its a sad thing that as anything matures, the technical terms get washed out by the tide of amateurs entering the field. The wrong error codes get used; the wrong names get put on things (e.g. Chrome is an _operating system_ instead of a desktop). We old geezers try to stand against the waves, but get washed away.

<comment><USER4> Hey old geezers - please keep old geez-ing. As a clueless amateur myself, I appreciate it when my elders set me straight. I need your wisdom.

Please don't be discouraged or lose hope on us, especially when our own hubris gets the better of us. We just don't know any better ... yet.

</comment></comment></comment><comment><USER5> What are y'all using for an egress gateway? I haven't been able to find one that meets my needs. Typically I use Envoy, because it supports Opentracing and Prometheus metrics, which is what I'm looking for for an egress proxy. (I also like circuit breakers for external APIs; if Slack is down, there's no point in sending them another request for a while and it should just fail fast.) But Envoy does not handle dynamic HTTPS proxying particularly well (you can't just set $http_proxy in your environment and have it Just Work; you would need to create a cluster and route for every upstream), so doesn't work too well for the egress gateway case. (Things like Istio claim to provide this, but they actually just configure Envoy to act as a TCP proxy and can't extract your Opentracing identifiers or response codes. So you can get metrics like "you sent 2398473 bytes to 188.8.131.52" but not "100% of requests to api.slack.com timed out". It's something, but not useful enough to be worth the configuration overhead for me.)

I have also looked at some of the traditional egress proxies, like Apache Traffic Server. It seems like it was invented before anyone ever heard of distributed tracing or metrics, and doesn't support those. So it doesn't work for me.

My ultimate goal is to configure every application I use to make all outgoing requests through a proxy, and then use network policies to physically prevent them from talking to any namespace that isn't the egress proxy or something it's authorized to talk to. That way, there can be no unexpected (and unaudited) communication with the outside world; if some container I use starts including a coin miner or a traffic sniffer or something, I'll know about it and can shut it down. But... nobody seems to care except me. So I might have to write my own, which is a pain.

<comment><USER6> I am biased because I contributed actively to Apache Traffic Server when I worked at a past employer.

It has its quirks. I played a major role in migrating our company from ATS4 to ATS5 and then ATS6.

There are many developers eager to help, especially if you're hosting or able to show up at the ATS summits.

Envoy has native middleware support but as far as I know you have to build the middleware with the server.

With ATS, you can use TS API or atscppapi and create shared objects that are dynamically loaded middleware.

We had considered Facebook's proxygen at one point too but we already had way too many middleware targeting ATS that it didn't make much sense.

However the hooks that they provide match almost 1-to-1 so it would be not that challenging.

Even to this day, my past employer uses ATS in their PoPs. And then at the next layer of reverse proxies, and then the layer after that.

So imagine PoP (level 0) to pick the right colo -> Level 1 to pick the right service cluster -> Level 2 to front the service instances are all ATS. After that you get to the origin servers that are discovered by a service discovery plugin loaded into ATS, just like all the higher levels. Each level discovers the downstream hosts over zookeeper back then and I had migrated that system to use Consul, so Consul now.

For some context, we were probably handling 8000qps on each ATS, with extremely heavy use of middleware plugins to do everything from auth to dispatch to spam filtering with dynamic rulesets pushed from internal hosts. I benchmarked ATS with and without plugins. With no plugins, our configuration could push over 80000qps.

We had ~36 PoPs, 20-30 instances at each PoP. That's around 8.6Mqps handled with ATS. Part of this was realtime bidding for ads [0], and the rest was actual user traffic, part of it static content, part of it dynamic.

We had our own CDN but also had Akamai on the side to fallback to. AFAIK from my conversations with people in these summits, iTunes is behind ATS. Comcast also pipes your unencrypted traffic through an ATS instance of their own with some custom middleware.

[0] - [https://support.google.com/google- ads/answer/6366577?hl=en](https://support.google.com/google- ads/answer/6366577?hl=en)

</comment></comment><comment><USER7> Would be good to include [Tyk]([https://Tyk.io](https://Tyk.io)) in there, as far as OSS gateways go it's one of the more popular ones (caveat: I'm the founder) :-)

<comment><USER8> That pricing page REALLY bothers me in that it's "starts out free" -> "contact us for details" and no other details :<

<comment><USER7> People confuse our pricing page with OSS, Tyk Open Source is batteries- included, so you get 100% of the functionality free of charge. We charge only for the stuff that companies like: GUIs, RBAC, SSO etc. This is all delivered by a closed source product, and to get pricing for that, we want to talk to you.

We don't hide the ball We invest heavily in ensuring you can do everything you need to do in OSS version We ensure that there's always an OSS way of doing things with Tyk, we don't strong arm you into buying

We do need to feed ourselves, so for the proprietary stuff, we need to be competitive, that's just how the market works.

<comment><USER9> The market has prices out in the open (mostly)

</comment></comment></comment></comment><comment><AUTHOR> The accompanying GitHub repo with example is here: [https://github.com/peterj/square-service- gateway](https://github.com/peterj/square-service-gateway)

</comment><comment><USER10> This is a helpful post technically, but the English could use some work. I'm guessing the author is eastern European and not a native English speaker. It would be a good idea to run the body text through spell check ("service" instead of "ervice", &c) and edit accordingly.

 _The first time you run the above command, it can take a bit as Docker needs to download_

"It can take a bit _of time_ as Docker needs to download" is proper English. Also, in the title, you need an apostrophe after "Beginners."

<comment><USER3> Fellow pedant! It should be apostrophized thusly: "Beginners'"</comment></comment>


More than 50% of respondents said Arabic numerals should not be taught in school - <AUTHOR> https://www.snopes.com/fact-check/teaching-arabic-numerals/ <comment><USER2> Interestingly, another question mentioned in the article - "Should schools in America teach the creation theory of Catholic priest Georges Lemaitre as part of their science curriculum?" \- yielded similar results :-)

<comment><USER3> I think you could plausibly still call it bigotry even if the thing you thought you were voting on deserves to be voted on that way if it turns out that you were actually supposed to be voting on something else and you ended up voting the wrong way because of a kneejerk reaction to the wording.

With that said, this example is substantively different because "creation theory" is a term that has a very different meaning in common parlance than the one intended here. "Arabic numerals" has no confounding information other than the mere fact that they're being called Arabic.

<comment><USER4> "They are uneducated, backwards, mouth-breathing bigots! My tribe was tricked by using words that we have a negative reaction to." Oh wait.

<comment><USER3> Yes basically.

</comment></comment></comment></comment><comment><USER5> Reminds me of someone going around college campuses asking whether or not we should ban Dihydrogen Oxide.

<comment><USER6> It also works with abolishing female suffrage.

</comment></comment><comment><USER7> 1\. The numerals are actually Indian [1], that Arabic traders picked up and propagated elsewhere. I don't think it changes the findings as I expect the respondents to have answered in a similar fashion.

2\. I don't believe this is evidence of bigotry. If a similar survey were to be taken in say Saudi Arabia, asking if American Numerals need to be taught in madrasass, it'd likely have a similar response.

I think this entire exercise is setup with an agenda to apparently uncover bigotry in the US, when the actual science behind it is questionable. Specious sounding, misleading questions are often answered inaccurately. Clearly, the question never educated the audience on the fact that Arabic Numerals are in fact regular numbers in general use. The whole survey is intending to exploit unawareness on the definition of "Arabic Numerals"

[1]: [https://en.m.wikipedia.org/wiki/Hindu–Arabic_numeral_system](https://en.m.wikipedia.org/wiki/Hindu–Arabic_numeral_system)

<comment><USER3> > _I don 't believe this is evidence of bigotry. If a similar survey were to > be taken in say Saudi Arabia, asking if American Numerals need to be taught > in madrasass, it'd likely have a similar response._

What do you think bigotry is if not being opposed to something for reasons other than its own merit? The unbigoted answer if you don't know what Arabic Numerals means is the third option, "I don't know/No opinion".

<comment><USER7> > What do you think bigotry is if not being opposed to something for reasons > other than its own merit?

Opposition to things for lack of awareness in itself isn't bigotry. Opposition _because_ of hate of something you somewhat understand/misunderstand _is_ bigotry.

I'd vote NO to "Should we learn Martian Numerals", because I do not know what martian numerals are, not because I hate martians

<comment><USER3> > _I 'd vote NO to "Should we learn Martian Numerals", because I do not know > what martian numerals are_

Voting _no_ because you don't understand something is expressing hate for things that you don't understand. The unbigoted answer would be "I don't know/No opinion".

<comment><USER7> > Voting no because you don't understand something is expressing hate for > things that you don't understand

It's a stretch to call it "hate". I mean, as long as we're playing with words, maybe you can classify "No opinion" as masked hate". A No vote IS NOT BIGOTRY. I like Chocolate ice cream more than Vanilla, and would vote NO on a school survey asking what flavor to serve in the cafeteria. I'm not bigoted against Vanilla

<comment><USER3> > _I like Chocolate ice cream more than Vanilla_

This is not analogous unless you actually think that schools should not teach numerals or if the only reason you like chocolate is _because_ you don't know what vanilla is. Choosing between two things by preference is also not analogous to choosing yes or no for one thing.

> _A No vote IS NOT BIGOTRY._

It is IF you vote no BECAUSE you don't understand. That's called xenophobia.

If you don't have a note from a psychiatrist excusing your behavior because of a medical condition, xenophobia is bigotry. Bigotry against vanilla and Martians, it turns out, is not considered to be a big deal (yet) so you're probably safe.

<comment><USER7> Here's a refresher of the definition:

"intolerance toward those who hold different opinions from oneself"

None of the scenarios described in your tirade fits the definition.

And back to the original article, it's highly likely that the audience understood "Arabic" numerals to mean actual numerals in Arabic script. The only definitive way to deduce bigotry is from a follow up question that has amongst other choices, one for "because I dislike XYZ people". Everything else is speculation - if you don't believe me, submit this for publication in any peer reviewed academic journal.

"Never Attribute To Malice What You Can Attribute To Stupidity" \- the respondants (likely) didn't know Arabic Numerals referred to what they already use, and the question is setup to exploit the general lack of knowledge on the matter, and spin a native on bigotry. Because, a story on bigotry is a LOT more click baitey than simple ignorance.

BTW - you seem intent on pushing a "bigotry" narrative, and FUD-ing in general. Are you the author? Or the person cited in the article tweeting an obvious non sequitur, claiming _this_ unscientific, non-conclusive data to be _evidence_ of bigotry?</comment></comment></comment></comment></comment></comment></comment>


Show HN: Google Analytics is used to track korea-dpr.com (View Source) - <AUTHOR> http://www.korea-dpr.com/kfa.html

<comment><AUTHOR> No argument made by me, just thought it was interesting.</comment>


Parenting Hack: Modern Cloth Diapers - <AUTHOR> http://www.innovators-house.com/1/post/2011/04/modern-reusable-cloth-diapers.html

<comment><USER2> Steps 1-9 are done once a month with disposable diapers.

This study also shows that disposable diapers normally use less energy than cloth ones. [http://randd.defra.gov.uk/Document.aspx?Document=WR0705_7589...](http://randd.defra.gov.uk/Document.aspx?Document=WR0705_7589_FRP.pdf)

<comment><AUTHOR> With disposable diapers, I found that I was going through steps 1-9 at least once a week. The diapers come in 40 packs. If my son averages 8 diapers a day, that is only 5 days. Sure, I can (and did) buy multiple 40 packs at a time, but I only have so much room at my house and in my car for transportation and storage. Moreover, especially when my son was younger, it was not uncommon for him to go through 5 diapers during a single night and he had a much fast diaper burn rate than even what I described above.

Your linked study seems interesting and I am reading through it.</comment></comment>


Heroin's Hidden Ingredient Is a Chemical Made by U.S. Companies - <AUTHOR> https://www.bloomberg.com/news/features/2020-08-26/u-s-drug-crisis-is-made-in-mexico-with-american-raw-materials <comment> xkcd-sucks These War on Drugs PR pieces make me want to tear my hair out. \- Fentanyls and other synthetics are _already_ a bigger problem than heroin

\- Without acetic anhydride, heroin is morphine, which is practically the same thing

\- Without acetic anhydride, morphine can be acetylated in situ with acetic acid (vinegar) and a little bit of technique.

\- Without acetic acid, morphine can be esterified with a million other chemical species similar to acetate. I hear dibenzoylmorphine is particularly easy "kitchen chemistry" with common ingredients and spectacular results

\- Acetic anhydride is already a DEA list 2 chemical.

It's like what is the end goal of writing these pieces? The endgame is my kid's science teacher gets disappeared for running the "aspirin from salicylic acid" lab, while cartels buy fucking cellulose acetate plants and divert a few tons of acetic anhydride into heroin in between runs of preserved wood and plastic pellets.

On the other hand if it leads to drug-subsidized development of the chemical industry in Mexico, maybe that's good for the environment on the Gulf coast and Mississippi Delta

</comment><comment><USER2> I'm always skeptical of these kinds of attempts at controlling drug production. Methylamine and acetic anhydride are not that difficult to synthesize</comment>


Proof of Work Without All the Work - <AUTHOR> https://arxiv.org/abs/1708.01285 <comment><USER2> I think the title and abstract of this are not very clear.

I gave it a fast skim to figure out what general class of thing it actually is.

This should be compared with "proof of idle" ([https://www.cs.virginia.edu/~shelat/14s-pet/2014/02/11/proof...](https://www.cs.virginia.edu/~shelat/14s-pet/2014/02/11/proof- of-idle.html)).

It is an online scheme for resisting sybil attacks in a P2P network where nodes have cryptographic identities which works by periodically forcing all users to do proof of work within a limited time window. Peers that don't respond fast enough are banned from the system (have to create a new identity to join, which is computationally expensive).

The idea is that this get some of the benefits of POW for sybil resistance without spending as much energy.

It doesn't, however, produce a large amount of cumulative work building up over a history. So it's not the sort of thing you'd want to use to protect the history of a ledger directly.

<comment><USER3> One of the holy grails in cryptocurrency research is figuring out a PoW alternative the provides similar security at reduced energy cost. A few other examples:

1\. Bram Cohen's Proof of Space & Time: [https://youtu.be/aYG0NxoG7yw;](https://youtu.be/aYG0NxoG7yw;) [https://cyber.stanford.edu/sites/default/files/bramcohen.pdf](https://cyber.stanford.edu/sites/default/files/bramcohen.pdf)

2\. DFINITY VRF-based Threshold Relay: [https://youtu.be/o8HHM18PedU](https://youtu.be/o8HHM18PedU) ([https://en.wikipedia.org/wiki/Verifiable_random_function](https://en.wikipedia.org/wiki/Verifiable_random_function))

3\. Algorand: [https://people.csail.mit.edu/nickolai/papers/gilad- algorand-...](https://people.csail.mit.edu/nickolai/papers/gilad-algorand- eprint.pdf)

These are some of the more interesting ones, but plenty of others.

<comment><USER4> Proof of useful work?

I.e. the problem is that hashing is wasteful. But we have demand for distributed computing.

Could the work that's being evidenced actually be performing useful computations? Perhaps by structuring a distributed computation platform that accepted standard units of compute work. Like perhaps an Erlang reduction.

<comment><USER3> I would dispute the assertion that hashing is wasteful. That implies it's inefficient or you're not getting something of equal value in return for what you're paying. But in PoW you spend energy and get in return the security of a global public accounting ledger, which has considerable potential social value, easily comparable to the cost of it. It should not even be surprising that such a thing has great cost, given that economics is certain of only two things - incentives matter and there's no free lunch. There's no free lunch in blockchain. (well, maybe there is, but it would take a considerable CS breakthrough).

And if you're concerned about the environment, don't worry, most of Bitcoin is secured by hydropower right now anyway, and in the foreseeable future will probably migrate to solar power ([https://finance.yahoo.com/news/why- california-giving-away-el...](https://finance.yahoo.com/news/why-california- giving-away-electricity-132012579.html)).

<comment><USER5> _which has considerable potential social value, easily comparable to the cost of it._

The value is 'potential,' the cost is real.

What evidence or milestones are there to indicate this considerable potential social value panning out is increasingly more or less likely? What exactly is the social value that the average HNer could perceive firsthand, rather than some mythical "unbanked" or whatever?

How long has bitcoin been around, a decade? Has anyone putting it to use in a sustainable, self-perpetuating use case that isn't a dark market or ransomware?

<comment><USER3> It's been around less than a decade and jury is still out whether it will even succeed or not yet, hence why I wrote "potential". But assuming it does prove sound and reliable over the long term, then its best value is as a hedge against governments screwing up their currency, like Venezuela and other distressed economies. There are already US dollar black markets in those places, and new cryptocurrency black markets are starting to form now too.

As for "unbanked", I don't even know why you mention it unless you're setting up a strawman to knock down. But here, let me do that for you - people who are unbanked don't have access to financial services b/c they don't have money, b/c they live somewhere that economic norms, institutions, and growth all have problems that make it hard to create wealth. Solve those problems and the banks and finserve folks will come running and those people won't be unbanked anymore. But I have yet to see a good case for how cryptocurrency in its current incarnation will solve those problems.

</comment></comment></comment></comment></comment></comment><comment><USER6> If new coins are distributed as block rewards, then collectively, miners will spend (nearly) the monetary value of those coins in competition to solve as many blocks as possible. In other words, any gains in marketcap will translate to increased mining efforts. Paul Sztorc has written a lot more about this in [http://www.truthcoin.info/blog/pow- cheapest/](http://www.truthcoin.info/blog/pow-cheapest/)

<comment><USER7> If a cryptocurrency becomes too big to fail, then it seems inevitable that nation-states and large corporations will mine it at a loss.

<comment><USER8> If it is solar powered, I don't see how it will be mined at a loss? Power is the number one cost, and we have a free unlimited supply of it.

<comment><USER9> PoW wouldn't work if power was free or unlimited.

<comment><USER10> It would, just the hardware/admin/maintenance costs would dominate instead.

</comment></comment></comment></comment></comment><comment><USER11> I'm in the process of auditing new low-power Po* algos for a crypto system I'm researching. This paper needs a way better abstract. The math is incomprehensible without knowing what it's end goal is. The paper uses acronyms (ex "Good ID") before explaining what they are. Overall a poorly written paper. The work maybe revolutionary, but what good is that if it's so difficult to understand. People forget that the purpose of a paper is to communicate your idea to other people. If it doesn't do that effectively then no matter how awesome the work is, you've failed.

</comment><comment><USER12> Here's some "lore" around proof-of-work and why it must burn external resources:

[https://download.wpsoftware.net/bitcoin/asic- faq.pdf](https://download.wpsoftware.net/bitcoin/asic-faq.pdf)

[https://download.wpsoftware.net/bitcoin/pos.pdf](https://download.wpsoftware.net/bitcoin/pos.pdf)

[https://download.wpsoftware.net/bitcoin/alts.pdf](https://download.wpsoftware.net/bitcoin/alts.pdf)

</comment><comment><USER13> For those who interested in the topic. Nem uses something called proof of importance [https://www.nem.io/NEM_techRef.pdf](https://www.nem.io/NEM_techRef.pdf)

</comment><comment><USER14> Would this make it possible to implement a cryptocurrency that wasn't an ecological disaster?

<comment><USER15> Bitcoin mines are in western China and Oregon precisely for the abundant and cheap hydro power. That's not so bad, ecologically speaking.

Bitcoin is only as ecologically harmful as the source of the electricity used to run the miners, and it's no more harmful than any other use of electricity. If the world switches over to solar and wind as baseload power, problem solved. If the world doesn't switch away from using coal, that's not Bitcoin's fault. It's not a problem Bitcoin can solve.

<comment><USER16> If the world's economies ran on bitcoin we would need a stupendous amount of energy to keep the miners running. That energy not being spent on something else is a huge opportunity cost since many problems could be solved if there were just enough spare energy..

<comment><USER15> > If the world's economies ran on bitcoin we would need a stupendous amount of > energy to keep the miners running.

You've misunderstood something about Bitcoin if you think this is true. Bitcoin miners use resources based on the logic of competing with each other for the value of the mining reward, not based on the number of transactions they process. If Bitcoin solved all its scaling problems so that everyone in the world could use Bitcoin, but mining rewards remained constant, the resources the miners expend to collect the reward wouldn't be any different from today.

<comment><USER17> I think you're underestimating the issue with attackers, if the world ran on bitcoin, attacking it becomes much more attractive, so use must indeed use more energy. It must use enough to make attacking bitcoin very unattractive.

<comment><USER15> No, sorry, that's not how Bitcoin works either. If the whole world used Bitcoin and the market cap of Bitcoin was over a trillion dollars, a 51% attacker could still only double-spend its own transactions. As long a public key crypto is secure, you cannot just re-write arbitrary Bitcoin balances into your own wallet even if you had 100% of the mining power. Therefore the incentive to attack Bitcoin is only as big as your own Bitcoin holdings, not the value of the entire market cap.

<comment><USER17> >> Therefore the incentive to attack Bitcoin is only as big as your own Bitcoin holdings, not the value of the entire market cap.

That's not quite true though is it? They could certainly (for instance) block transactions and generally hold the whole thing to ransom.

You're right, it doesn't have the financial incentive that you could (for instance) steal coin, but you could potentially block all transactions that don't have a considerable fee, for you, or just break stuff. Motives to do that will become more pressing the higher value the network is to nation states.

</comment></comment></comment></comment></comment></comment></comment><comment><USER18> There is something thoroughly logical about this approach to the unfortunate waste implicit in Proof of Work (PoW) schemes.

In summary of the motivations of the paper: PoW is currently limited to cryptocurrencies as a security system because of the implicit financial incentive in mining coins. This approach could allow PoW schemes to be widely adopted to secure systems as the overhead is lowered dramatically. Additionally, battery powered devices (ie phones) could make use of PoW without incurring large battery drains. This last bit is particularly interesting and could allow some interesting, distributed P2P systems on cellphones to arise.

The general principle of the paper revolves around asking network members to prove computational power only as much as necessary as the network scales. Because an attacker could easily spoof their MAC / IP address when joining the network, computational tests are periodically distributed to network members. If the test is unsolved in an allotted time period, their network membership is revoked (and the node is blacklisted). The attack referred to in the paper is an attacker adding bad (fake or otherwise) nodes to a system rapidly.

</comment><comment><USER19> "Consequently, if the network is attacked, our scheme guarantees security, with algorithmic costs that are commensurate with the cost of the attacker. Conversely, in the absence of attack, algorithmic costs are small."

Hope it works.

<comment><USER20> The network will be under attack constantly.

<comment><USER21> Blockchain tech has a lot of potential uses outside of currency. In those fields, the likelihood of a constant foreverwar amongst the contributors is way lower.

Also, providing a sliding cost on the network might make the miners agree it's more cost effective to step back from this breakneck energy-use-maximization game they're playing.

</comment></comment></comment><comment><USER22> So now we have click-baity academic papers? Can someone summarizes to me the genius behind the idea? Because as far as my math goes, it is not theoretically possible.

<comment><USER23> > _So now we have click-baity academic papers?_

As academic paper titles go this is pretty normal.

> _Can someone summarizes to me the genius behind the idea?_

I'm reading quickly, but I think the idea is that the reason we need proof-of- work is to prevent Sybil attacks, that is, a single entity pretending to be 50% of the network via spoofed identities. So you have a concept of persistent identity for each (apparent) member of the network, and you require nodes to solve a computational problem when they join the network and also periodically while they're in the network. This puts relatively little computational load on each participant, but puts a lot of load on a long-term attacker, and even more work on a short-term attacker who's trying to claim a bunch of identities in a hurry.

I'm not sure how much this actually helps Bitcoin, since my impression is that the computational load is what's needed to match the abilities of the _legitimate_ members of the network. I guess the trick is that maybe you can make the block-mining difficulty scale up less aggressively over time, but I'm not following that logic yet.

<comment><USER23> Thinking harder I guess the only reason that mining difficulty is so competitive is that there's a reward for mining, given to just the miner, so the arms race is profitable (much as, say, the arms race for microsecond-level tech improvements is profitable to HFT because even if two algorithms make the same decision only one gets the purchase in first).

So if you get rid of that, and maybe add a nominal "reward" for solving the puzzles to remain in the network and give it to _all_ participants, the incentive to build giant mining farms goes away: the only reason to have additional computational power is either to keep up with the network as a whole (not the fastest person in the network) or to actually gain 50% of computational power.

</comment></comment></comment><comment><USER8> When I read this: "This shortcoming is highlighted by recent studies showing that PoW is highly inefficient with respect to operating cost and ecological footprint." The moment we try and do away with this inefficiency we are going against the entire solution of what bitcoin was going for: how to use all of the inefficient computer parts laying around the globe for something useful?

It makes me think people just don't get it. High inefficiency is the _ENTIRE_ point! It gives rarity to the coin. That 10 minute block time is the same as compressing millions of years of geology into 600 seconds. It is fundamentally sound mathematics, and ultimately, _that_ is why it holds its value. It is not meaningless mathematics, people who say that don't understand fully as to what they are talking about, imho.

<comment><USER24> You're misinterpreting what people mean by "inefficient" in this context.

The bitcoin mining ASICs are extremely efficient _at mining bitcoins_. You can't mine them with an old GPU and expect to make back more money than you spent on electricity.

But the choice to mine bitcoins at all is (arguably) an inefficient use of resources that could have been used for pretty much anything else. There's no shortage of useful problems to be worked on by supercomputers and the world would be better off if we did that instead of mining cryptocurrencies. But the economic incentives aren't there.

EDIT: Reading your comment again, I think I was a bit quick on the "you're wrong" here. ISo to clarify, I do agree that inefficiency is at the core of the bitcoin mining ecosystem, but it's all about the "we have to spend a bunch of energy that could've done a lot of other things" inefficiency, not an individual "we can use old hardware for this" sort.

<comment><USER17> When you look at it from that angle, Bitcoin becomes a very interesting hack on economic incentives (and how they don't always map to useful real-world activity)

<comment><USER25> Whether you think Bitcoin mining has real-world utility or not depends entirely on whether you think Bitcoin has real-world utility or not.

Without Bitcoin mining, there is no Bitcoin.

<comment><USER17> Certainly, but whether you think bitcoin has any real-world utility, bitcoin- mining certainly has economic incentives.</comment></comment></comment></comment></comment>


Ask YC: What logo do you prefer - <AUTHOR>

Would appreciate comments / suggestions on possible logos,
http://www.myplaylist.biz/index2.php
Red, Green, or neither? <comment><USER2> None of the above. The whole thing is a big logo train wreck.

Because the contrast of the stripey letters is so much lower, the whole thing ends up half-legible. At first glance I see "p ay st", or "myp ay st". I have to squint, or use my brain, in order to tell what the hell I'm looking at -- and both of those tasks are too much to ask of visitors!

</comment><comment><USER3> Lose the bezel. Reconsider the colors; you've got limp, low-value, low- saturation red and green there. The indicator bar letters are cute, but overused; pick one letter and use it there.

<comment><USER4> +1 for for brighter colors and having the level meter only in the "i". However, I would have the level approaching red a little before the dot, then make the dot entirely red. Additionally, I'd make the dot square; having it round kills the whole bar / level effect.

</comment></comment><comment> a-priori Don't forget about colour blindness. Although it isn't critical in this case (the red/green distinction doesn't add much information about the structure of the logo), in general mixing red and green is bad news.

</comment><comment><USER5> I agree with pretty much everything everyone else has said. \- Lose the beveled edge. \- The meter-effect thing is a decent concept, I guess, but it's way too overdone. One letter is more than enough. \- It already has enough color, don't color any of the letters or the dot over the i.

You should always consider whether or not your logo will look good if you have only one color to work with. Think about things like screening your logo in black-and-white (e.g., a t-shirt or trade-show duffel bag). Incidentally, this is one reason to avoid gradients in general (another being that they just look like crap). This is also why the bevel has to go. So will the sound-meter analogy carry through with just black? I think it might lose something if you don't have green and red to work with, but that's just my opinion.

You should also make sure that you can shrink your logo down to a teeny-tiny size and have it still be recognizable. Think about things like favicons.

The font in the logo is actually pretty good... it's clean, readable, and a bit edgy.

I'm certainly no graphic designer, this is just stuff that I've read about logo design over the years. :)

</comment><comment><USER6> I think having the level meter in JUST the "i" would be far better. As others have noted, readability is very low on this as it is. Adjusting just one letter can work, but not three, especially two in a row.

As far as colors go, none of these are very vivid. Perhaps all white with just the "i" as a green level meter, with a white dot.

<comment><USER7> Best advice so far. To it I'll add (1) lose the outline/dropshadow effect, (2) do it in Photoshop or something that smooths the pixelation, (3) use a white background, (4) use a thinner, sans serif font, maybe something slightly techno.

My favorite font site: <http://www.dafont.com/theme.php?cat=303>

</comment></comment><comment><USER8> They're all more or less the same to me. I suggest ignoring all of the comments here and simply take a week-long break from tweaking your logo. Come back to your logo when your mind and imagination are fresh.

</comment><comment><USER9> The best part about the logo is the lined L's and I (representing volume/frequency?), why not carry that on through the rest of the letters?

The shadow doesn't help.. Try and keep it simple.

</comment><comment><USER10> I posted your question at [http://www.ask500people.com/questions/which-logo- do-you-pref...](http://www.ask500people.com/questions/which-logo-do-you- prefer-asking-for-a-friend)

It will get a few votes over the next while, but if it gathers enough up-votes (sort of like digg, but for polls) from the community within 24 hours it'll run on the home page and get many more votes from around the web. Hope it's useful for you and good luck with the site.

</comment><comment><USER11> "myplaylist" in san serif is good. Lowercase is alright. Black background may create printing problems and limit future styling. "my" in green is good. Red dot on "i" is good. Volume style stripes on "li" significantly reduces legibility. Just omit this from the design and you'll be alright.

</comment><comment><USER12> Neither.

</comment><comment><USER13> I have to agree with everyone here so far. None of these logos are nice to look at.

</comment><comment><USER14> You're kidding right? Neither.

</comment><comment><USER15> When in doubt use Helvetica.

<comment><USER3> Why?

<comment><USER15> <http://allyoucanupload.webshots.com/v/2001228246529956665>

<comment><USER3> Oh, so, fanboyism.

</comment></comment></comment></comment><comment><USER16> Link triggers my corporate content filter - bad bad bad

</comment><comment><USER17> ew. I am not skilled graphically so I cannot provide any advice. But I agree with one of the previous users that the logs do not contrast well.

</comment><comment><USER18> make sure you anti-alias your edges too yo. jaggies are gross

</comment><comment><USER19> Green. Red infers a problem.

<comment><USER20> Red implies a problem. I infer that red denotes a problem.

<comment><USER19> Glad to see the grammar police have arrived. I feel safer already.

Maybe you oughta check spelling, too. That'll give you something to do.

</comment></comment></comment><comment><USER21> None

</comment><comment><USER22> its web -9999.0

</comment><comment><USER23> neither ... change the logo, the style and the fonts. changing only color won't help.</comment>


Fuck mandrill here's how you move to Amazon SES and pay 1/8 of the price - <AUTHOR> Mandrill/Mailchimp are fuckwits.
They just raised their pricing by 8x and they didn't give their users any notice. All the said was oh we're merging mailchimp and mandrill accounts in an email, not telling users that their also going to get fucked over because the price is now 8x higher.
I prepurchased several thousand dollars with mandrill in credits at the previous price, and they won't provide me with the service at the previous price even for my prepaid credits. wtf?
let's all move to amazon SES, most startups have free AWS credits, else it $0.10c per thousand, an eight of the price of mandrill,
here's how you multithread to send bulk campaigns on Amazon SES:
http://stackoverflow.com/questions/16834279/amazon-ses-php-sdk-2-how-to-achieve-high-send-rate <comment><USER2> The problem with SES is its poor deliverability. It might be useful to send 10K mails with SES but after that it is mostly useless.

<comment><USER3> I have been finding this out after a product launch. Worked great in testing, lots of bounces in production.

</comment></comment><comment><USER4> I'm amazed, they even said that the first million e-mails were on them, and then totally ignored their promise and the blocks that we purchased previously were useless.

They could have perfectly increased their price (even 2x would've been fine) and we would have paid for it. The only thing that is holding us are the dedicated IP addresses, which will be a pain in the ass to whitelist with our clients again.

It is really sad.

</comment><comment><USER5> I recommend moving to SendGrid. You can get 12k emails a month for free and do transactional and newsletter emails from the same platform.

</comment><comment><USER6> Double True, previously all emails have said:

Current users will have until 4/27 to merge their accounts.

Now it's 4/27 at noon and they are disabling sending through mandrill only accounts.

Just icing on the cake.

I love(d) MailChimp and love(d) Mandrill.

Signed up clients for both of them, always recommended them.

Never again will I recommend MailChimp for anything.

Can't believe they won't honor your pre-purchase. I would demand a refund.

Sounds like they don't want to be in the email business.

</comment><comment><USER7> You might like this tweet, [https://twitter.com/shawnroos/status/702764554816778240/phot...](https://twitter.com/shawnroos/status/702764554816778240/photo/1?ref_src=twsrc%5Etfw)

</comment><comment><USER8> I am dropping them like a brick. I wrote a very detailed post on how to add the dkim to your DNS on digital ocean for mandrill that everyone likes. I got it all setup for my domain, but I just do not have the volume to justify a paid plan at this point.

</comment><comment><USER9> I switched to sparkpost. Took about an hour. 100k emails / month are free.

</comment><comment><USER10> Also note with SES, you have to write some code to handle bounces and complaints programmatically. Unlike Mandrill and Sendgrid, there is no UI dashboard to manage any e-mails.

</comment><comment><USER11> We moved all our clients and our projects to sendgrid

</comment><comment><USER12> What I really don't understand is why it seems like I must pay for MailChimp in order to pay for Mandrill. Wtf?

</comment><comment><USER13> We use vero & mailgun.

</comment><comment><USER14> Moved to Postmark and couldn't be happier.

</comment><comment><USER15> Cheers, wasted the past 2 hours moving off of Mandrill.</comment>


328 Googlers Facebook Should Poach - recruiting via algorithm - <AUTHOR> http://www.seravia.com/about/328-googlers-facebook-should-poach

<comment><USER2> Heh, knowing several of the Googlers on this list, I find this pretty amusing. I'll have to show it to them...</comment>


Electronic US Dollar, backed by the Fed. What if? - <AUTHOR> Imagine if the United States begins issuing electronic US Dollars that can be emailed from one person to another or sent via an attachment.
Imagine if this currency is backed by the Fed and the Central Bank.
Imagine if you could go to any US Bank and convert the electronic currency to the real US Dollars.
Imagine if anyone could buy something for 1 cent simply by sending, texting or emailing the funds, without paying a transaction cost.
Imagine how this will transform the global commerce.
The 20th Century was an American Century because the United States, namely the US Dollar, became the bedrock of the global commerce.  It enabled the US to ship dollars by the trillions (costing pennies to print) oversees in exchange for wealth from other countries, which was used to build our economic might.  And, in exchange for those dollars the US shipped, it received tremendous amount of wealth for ZERO INTEREST.  There is no cheaper way for a country to finance its growth than to print currency and ship it abroad, because those who hold the currency are not expecting a return for their "investment".
Now, the 21st century is clearly becoming the century of electronic commerce, however we are still using the currency of the previous generation.  If the Federal Reserve issued an electronic US Dollar that could be traded like BitCoin, but backed by the Fed and exchanged for real US dollars, it would become the bedrock of the electronic commerce overnight.    People all over the world would be able to trade it, exchange it electronically, and settle with their bank in exchange for the printed equivalent.   I can imagine the sheer volume of wealth that will flow into the US in exchange for the US-backed electronic currency.
It will not only result in more efficiency in the online commerce at home and oversees, but also create new industries overnight.    This one step has the potential of taking the US out of the current recession overnight, and substantially offsetting the national debt.
Of course, many issues would have to be ironed out, particularly around security.  But, considering how secure BitCoin is without central governance, I am convinced that none of the technical challenges will be insurmountable, because all transactions will have to be verified.
I think sooner or alter one country's currency will become the defacto electronic currency for global commerce.  The question is will it be the US, Canada, or some other country?
Sandro G Seattle, WA <comment><USER2> The idea sounds fantastic, but what will give the "e-dollar" any intrinsic value? 1 US dollar is basically paper with ink on it. If it's not worth anything, there's no point.

<comment><AUTHOR> I'm thinking that the e-dollar will have the same value as $1, guaranteed by the Fed. As if BitCoin had a constant exchange rate pegged at 1.00 against the US dollar. BitCoin can never achieve this, the the e-dollar can.</comment></comment>


Cellphones for Women in Developing Nations Aid Ascent from Poverty - <AUTHOR> http://www.nytimes.com/2015/04/02/business/dealbook/melinda-gates-cellphones-for-women-aid-ascent-from-poverty.html

<comment><USER2> I'm not sure I completely follow on why women in a developing nation need a cellphone. The article stated that there was a portion of individuals who did not even possess a bank account. Mobile banking isn't going to do anything for that. Are there legitimate needs for a cellphone in their life? The ones who do not own one have survived until now without one.

Who is going to pay for the service for the device? How are they going to handle situations where the phones will be flipped for a profit. How are they going to handle situations where the phone becomes broken or lost?

Lastly, how in the world is a phone going to get them out of poverty? I can understand if it was like a suit, where it gives a person a better position to obtain a job. However, I would think that a library would be better suited to get them out of the position where they're at.

<comment><USER3> _The article stated that there was a portion of individuals who did not even possess a bank account. Mobile banking isn 't going to do anything for that._

Per this article, only 20% of people in Bangladesh have traditional bank accounts. Yet 33 percent of Bangladeshi men have used mobile money. Mobile money has replaced the bank account.

 _Are there legitimate needs for a cellphone in their life?_

Do you have legitimate needs for a cellphone in your life? For a wallet, credit and debit cards?

Mobile money transfers are used in place of card processing, for loans and gifts. SMS and mobile money transfers have replaced cash remittances or money transfer services from cities to rural areas. You can't access these services without a cell phone.

 _Lastly, how in the world is a phone going to get them out of poverty? I can understand if it was like a suit, where it gives a person a better position to obtain a job. However, I would think that a library would be better suited to get them out of the position where they 're at._

A cellular phone will help someone learn a fair price for their crop, good, or service, and allow them to contact buyers. This will do more for their income than a suit. But access to cell phones and mobile money doesn't just benefit people by increasing income. Giving women the ability to make purchases has listed benefits in the article:

 _" Women spend money differently from men. They tend to invest more in the health and well-being of their families — as much as 10 times more. They give priority to spending on health care, nutritious food and education. A child born in a household where the mother controls the family budget is 20 percent more likely to survive — and much more likely to thrive."_

<comment><USER2> > Per this article, only 20% of people in Bangladesh have traditional bank > accounts. Yet 33 percent of Bangladeshi men have used mobile money. Mobile > money has replaced the bank account.

Unless I'm mistaken, that still doesn't sound like it would actually help the people that they claim that need it. You can't put physical cash into the mobile banking. [Well at least without using a transaction service, which would tack on fees]

> Are there legitimate needs for a cellphone in their life? > Do you have > legitimate needs for a cellphone in your life? > For a wallet, credit and > debit cards?

We're talking about different cultures. They've survived and accomplished life goals without a cellphone in their life. Could I go without a cellphone? Absolutely. I could go to a landline. But thats not the point here.

> A cellular phone will help someone learn a fair price for their crop, good, > or service, and allow them to contact buyers. This will do more for their > income than a suit. But access to cellphones and mobile money doesn't just > benefit people by increasing income. Giving women the ability to make > purchases has listed benefits in the article:

You're making an assumption that they will use the phone in the best case. To call someone over a fair price.... but you have to know those people in the first place. To further drive this point home: If you were buying a car, who would you call to compare prices? (Using internet services on your phone won't count for this.. as that in this culture it would be a new concept to find others in the market via a mobile)

> "Women spend money differently from men. They tend to invest more in the > health and well-being of their families — as much as 10 times more. They > give priority to spending on health care, nutritious food and education. A > child born in a household where the mother controls the family budget is 20 > percent more likely to survive — and much more likely to thrive."

That sounds like a gender based stereotype.

<comment><USER3> _You can 't put physical cash into the mobile banking._

Yes you can. You can typically deposit without fees at airtime resellers and cell network retail outlets. Faster and cheaper than traveling to a bank branch.

Fees to cash out/send/receive money are as low as 0.22%.

 _Could I go without a cellphone? Absolutely. I could go to a landline. But thats not the point here._

This article and my question were more about the phone's ability to replace a credit/debit card and bank account, not a landline.

 _To call someone over a fair price.... but you have to know those people in the first place... If you were buying a car, who would you call to compare prices?_

You call your family members, previous buyers, or middlemen in cities to get a rough sense of the market price. There are startups that offer crop price data via SMS.

[http://www.howwemadeitinafrica.com/how-mobile-phones-are- tra...](http://www.howwemadeitinafrica.com/how-mobile-phones-are-transforming- african-agriculture/8704/)

 _[Women invest more in the health and well-being of their families — as much as 10 times more] ... That sounds like a gender based stereotype._

Clicking through on the links in the NYT article went to this article in Science ([http://www.sciencemag.org/content/345/6202/1273.full.pdf](http://www.sciencemag.org/content/345/6202/1273.full.pdf)) which cites the following four sources for those statistics:

World Bank, World Development Report 2012: Gender Equality and Development (World Bank, Washington, DC, 2011); [http://elibrary.worldbank.org/doi/book/10.1596/](http://elibrary.worldbank.org/doi/book/10.1596/) 978-0-8213-8810-5.

D. Thomas, in Intrahousehold Resource Allocation in Developing Countries: Models, Methods and Policy, L. Haddad, J. Hoddinott, H. Alderman, Eds. (Johns Hopkins Univ. Press, Baltimore, MD, 1997), pp. 142–164.

R. L. Blumberg, Ed., Engendering Wealth and Well-Being: Empowerment for Global Change (Latin America in Global Perspective) (Westview Press, Boulder, CO, 1995).

E. Duflo, "Women's empowerment and economic development," working paper 17702 (National Bureau of Economic Research, Cambridge, MA, 2011); available at www.nber.org/papers/w17702

<comment><USER4> > Yes you can. You can typically deposit without fees at airtime resellers and > cell network retail outlets. Faster and cheaper than traveling to a bank > branch.

That's quite true. Even in developer (but not first-world) countries like Argentina, lots of stores and supermarkets allow you to push cash into your mobile phone. There's probably about 3 such places less than two blocks from home.

Personally, I just use online banking. But I feel that the newer generation (eg: those under 22) don't.</comment></comment></comment></comment></comment>


Facebook Wants Your Face and You'll Probably Let Them Have It - <AUTHOR> https://gizmodo.com/facebook-wants-your-face-and-youll-probably-let-them-ha-1821428981 <comment><USER2> The final step in the Panopticon is almost complete.

Facebook is bullshitting everyone just like it did on many occasions.

Yes, they can "technically" use their DATR cookies to help with security slightly, but we all know that was never the _primary use case_ , which is why they used _in secret_ for many years.

Yes, the phone number can be used for security, too, but that's not why they started asking us for it in the first place.

The face thing is no different. I'm 99% sure this is to help stores, like those self-shopping Amazon stores, identify and match users when they enter the store. Expect Facebook to give this option to advertisers in about 12-18 months.

And that's just one of the _primary_ use cases for this. Another primary use is most likely for law enforcement. I wonder if we're going to hear about a "big contract with the government" that Facebook will "win" soon. If we do, you can attribute it to this move from Facebook.

By the way, in case you were not aware, Facebook advertisers now have an option to track you by your Facebook email and phone number. So Facebook has already sold out your email and phone number to advertisers, the same info you _trusted_ them to use for "security". But I'm sure they would never do that with your _face profile_. No, never. Certainly not Facebook.

There are many other use cases for this, none of which have anything to do with security. I hope the EU will _crush_ Facebook over this lie when they inevitably start exposing it as the lie that is.

</comment><comment><USER3> You'll let them have it, even if you don't, right? Other people upload your pictures to Facebook all the time. They give FB permission to use facial recognition, then your photo is theirs to do as they please.

Does the EU have any privacy laws to counter this behavior from FB?</comment>


Firefox Floppy Disks - <AUTHOR> http://toastytech.com/good/fffloppies.html <comment><USER2> How about cassette tapes?

<comment><USER3> Nowhere near as good as punched paper tape for your ASR33.

[https://en.wikipedia.org/wiki/File:PaperTapes-5and8Hole.jpg](https://en.wikipedia.org/wiki/File:PaperTapes-5and8Hole.jpg)</comment></comment>


Pytest assert magic - <AUTHOR> http://pythontesting.net/podcast/pytest-assert-magic/ <comment><AUTHOR> This is a podcast episode.

How pytest, unittest, and nose deal with assertions.

The job of the test framework to tell developers how and why their tests failed is a difficult job.

In this episode I talk about assert helper functions and the 3 methods pytest uses to get around having users need to use assert helper functions.</comment>


DuckDuckGo now displays data on LGBT rights for any country - <AUTHOR> https://duckduckgo.com/?q=lgbt+rights+china&ia=equaldex <comment><USER2> not quite ANY. doesn't work for "bosnia"</comment>


Tesla's utility-sized Megapack battery may debut in California - <AUTHOR> https://www.engadget.com/2018/12/15/tesla-megapack-california/ <comment><USER2> What south Australian power company Neoen got is built out of powerpacks, so this is a jargonised story about a larger unit of scale but functionally feels like the same thing.

Debut in the sense of the battery unit is in debut. Not that it's the first utility scale battery deployment.</comment>


Show HN: PriceLabs, Machine learning dynamic pricing for Airbnb listings - <AUTHOR> https://pricelabs.co

<comment><USER2> Looks like a valuable tool for Airbnb hosts, although it's not clear to me from the site exactly what it does (the 3 boxes are more 'how it does it').

Am I correct that this site allows Airbnb hosts to dynamically change their price to reflect market trends, similar to hotels, in order to maximise their income? If so, looks great, but you might need to spell that out better.

Good luck!

<comment><AUTHOR> Thanks Jacob! Yes, it dynamically changes price to reflect market trends. Will make changes to the How it works portion to spell it out clearly.

</comment></comment><comment><USER3> I understand that there is another company called beyondpricing, that is doing something similar as well. Remember seeing it in HN a while ago.

<comment><AUTHOR> Yep. Pretty big market if you think of it. Good to have another player. Helps in building awareness, I would think.

</comment></comment><comment><USER4> What algorithms do you use? Gaussian Processes?

<comment><USER5> Hi - I work on this product.

We do not use Gaussian Processes. For our purposes, with some customization we were able to obtain comparable accuracy from multiple algorithms, both parametric and non-parametric. Being able to study and understand the domain/data offline helps immensely with this.

Gaussian processes didn't scale up as well as some of the other algos we tried, but would have been one of our top choices otherwise.</comment></comment>


Solution of Google Lake Volume Puzzle - <AUTHOR> Below we have output and code for the Google lake volume puzzle. <comment><AUTHOR> Below we have output and code for the Google lake volume puzzle.

         >glv_puzzle 4 9 7 5 9 7 4 8 3 4 2 6 5 8 12 0 0 0 3 6 5 8 9 0 2 5 3
         GLV_puzzle:  Started ...
         GLV_puzzle:  Number of walls = 27
         GLV_puzzle:  Max wall height = 12
         GLV_puzzle:  Max wall height at 15
         GLV_puzzle.  Calculating left results.
         GLV_puzzle.  Calculating right results.
         GLV_puzzle:  Lake volume = 89

         PRINT_LAKE:  We display the lake with walls 'X' and water '.'

                       X
                       X
                       X
          X..X.........X.......X
          X..X..X.....XX......XX
          XX.XX.X.....XX......XX
          XX.XX.X...X.XX....X.XX
          XXXXX.X...XXXX....XXXX..X
         XXXXXXXX.X.XXXX....XXXX..X
         XXXXXXXXXX.XXXX...XXXXX..XX
         XXXXXXXXXXXXXXX...XXXXX.XXX
         XXXXXXXXXXXXXXX...XXXXX.XXX

         GLV_puzzle:  Returning.

         /* GLV_PUZZLE.REX -- Google lake volume puzzle.                       */
         /*                                                                    */
         /*   Here we have code for a solution to                              */
         /*   the Google lake volume puzzle.                                   */
         /*                                                                    */
         /*   The code is in Open Object Rexx and                              */
         /*   easy to read.                                                    */
         /*                                                                    */
         /*   The lake is one foot wide and, for                               */
         /*   some positive integer n, n feet long.                            */
         /*   Each foot of length has a vertical                               */
         /*   wall with square cross section of one                            */
         /*   square foot.                                                     */
         /*                                                                    */
         /*   The heights of the walls, in feet, >=                            */
         /*   0, are inputs to the program.                                    */
         /*                                                                    */
         /*   Water is poured into the lake to fill                            */
         /*   it.  The water is stored between                                 */
         /*   walls.                                                           */
         /*                                                                    */
         /*   The puzzle is to find the volume, in                             */
         /*   cubic feet, of the water in the lake.                            */
         /*                                                                    */
         /*   For i = 1, 2, ..., n, the wall at i                              */
         /*   has height a.i.                                                  */
         /*                                                                    */
         /*   For our solution, first we find k so                             */
         /*   that a.k >= a.i for all i.  Second we                            */
         /*   go to the left end and work toward                               */
         /*   the wall at k finding lake volumes.                              */
         /*   Then go the the right end and work                               */
         /*   toward wall at k finding the rest of                             */
         /*   the lake volumes.                                                */
         /*                                                                    */
         /*   It's an O(n) solution.                                           */
         /*                                                                    */
         /*   The wall heights are arguments on the                            */
         /*   command line.                                                    */
         /*                                                                    */
         /* Created at 10:20:52 on Monday, December 10th, 2018.                */

         /*   Get the name of this program:                                    */

              exec_name = 'GLV_puzzle'
              return_code = 0
              sq = "'"

              Say exec_name':  Started ...'

              Parse Arg all

              n = 0

              Do Forever
                Parse Var all token all
                If token = '' Then Leave
                n = n + 1
                If Datatype( token,'N' ) \= 1 Then
                  Do
                    Say exec_name':  Input' n 'has bad data.'
                    Signal out
                  End
                a.n = token
              End

              If n = 0 Then Signal out

              max_height = -1
              Do i = 1 To n
               If a.i > max_height Then
                 Do
                   max_height = a.i
                   k = i
                 End
              End

              Say exec_name':  Number of walls =' n
              Say exec_name':  Max wall height =' max_height
              Say exec_name':  Max wall height at' k

              Do i = 1 To n
                Do j = 1 To max_height
                  lake.i.j = ' '
                End
              End

              Say exec_name'.  Calculating left results.'

              volume = 0

              result_code = left_calculate()

              Say exec_name'.  Calculating right results.'

              result_code = right_calculate()

              Say exec_name':  Lake volume =' volume

              result_code = print_lake()

         out:
           Say exec_name':  Returning.'
           Return return_code

         /* </comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment> */

         left_calculate:
              Procedure Expose n a. k volume lake.

              return_code = 0

              height = a.1

              Do i = 1 To k
                Do j = 1 To a.i
                  lake.i.j = 'X'
                End
                Do j = a.i + 1 To height
                  lake.i.j = '.'
                End

                If a.i <= height Then volume = volume + (height - a.i)
                Else height = a.i

              End

         left_calculate_out:
              Return return_code

         /* </comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment> */

         right_calculate:
              Procedure Expose n a. k volume lake.

              return_code = 0

              height = a.n

              Do i = n To k By -1
                Do j = 1 To a.i
                  lake.i.j = 'X'
                End
                Do j = a.i + 1 To height
                  lake.i.j = '.'
                End

                If a.i <= height Then volume = volume + (height - a.i)
                Else height = a.i

              End

         right_calculate_out:
              Return return_code

         /* </comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment> */

         print_lake:
              Procedure Expose n lake. max_height

              return_code = 0

              Say ' '

              Say 'PRINT_LAKE:  We display the lake with walls ''X'' and water ''.'' '

              Say ' '

              line = ''
              Do j = max_height To 1 By -1
                line = ''
                Do i = 1 To n
                  line = line || lake.i.j
                End
                Say line
              End

              Say ' '

         print_lake_out:
              Return return_code</comment>