The magic of asyncio explained - <AUTHOR> https://hackernoon.com/a-simple-introduction-to-pythons-asyncio-595d9c9ecf8c <comment><USER3> Yet another asyncio tutorial that shows you to run a few sleep tasks concurrently. Can we finally get one that shows how to do _real_ stuff such like socket programming, wrapping non-async-compatible libraries and separating cpu-intensive blocking tasks to awaitable threads?

<comment><USER4> > such like socket programming

That's one of my biggest pet peeves (and if you see my other comments, you'll notice I have quite a few).

To do socket programming in asyncio, you can either use:

\- protocols, with a nice reusable API and an interface that clearly tells you where to do what. But you can't use "await". You are back to creating futures and attaching callback like 10 years ago.

\- streams, where you can use async / await, you but get to write the entire life cycle by yourself all over again.

I get that protocols are faster, and match Twisted model, and I get that streams are pure and functional, but none of this is easy. I use Python to make my life easier. If I wanted extreme perfs I'd use C. If I wanted extreme pureness I'd use Haskell.

> wrapping non-async-compatible libraries and separating cpu-intensive > blocking tasks to awaitable threads

That's the one of the things asyncio did right. Executors are incredibly simple to use, robust and well integrated.

Problem is: they are badly documented and the API is awkward.

I won't write a tutorial in HN, but as a starting point:

You can use:

        loop = asyncio.get_event_loop()
        future = loop.run_in_executor(executor, callback, arg1, arg2, arg2...)
        await future

If you pass "None" as an executor, it will get the default one, which will run your callback in a thread pool. Very useful for stuff like database calls.

But if you want CPU intensive task, you need to create an instance of ProcessPoolExecutor, and pass it to run_in_executor().

I say it's one of the things asyncio did right because the pools not only distribute automatically the callbacks among the workers of the pool (which you can control the number), but you also get a future back which you can await transparently.

<comment><USER5> I'm curious of your take on Trio or Curio. Do either address the peeves you've outlined?

[https://github.com/python-trio/trio](https://github.com/python-trio/trio) [https://github.com/dabeaz/curio](https://github.com/dabeaz/curio)

<comment><USER4> Trio is a better Curio, so you don't really need Curio anymore. It was what started everything and deserves credit for that though.

As for Trio, it's what asyncio should have been from the beginning, at least for the high level part (although not for the pet peeves of socket programming: it's too low level for Python IMO)

The problem with Trio is that it's incompatible with asyncio (minus some verbose quirky bridges), so you get yet another island, yet another ecosystem. So what, now we get twisted, tornado, gevent, qt, asyncio... and trio ?

The madness must stop.

And that's why I think there is a better way: creating a higher level API for asyncio, which enforces the best practices and make the common things easy, and the hard things decent.

A complete rewrite like Trio would be better (e.g: it famously handles Ctrl + C way better and has a smaller API). But this ship has sailed. We have asyncio now.

asyncio is pretty good honestly. But it needs some love.

So, considering asyncio is what we have to work with, and by experience, it's quite great if you know what you are doing, I advice people to actually write a wrapper around it.

If you don't feel like writing a wrapper, I'll plug in the one I'm working on in case people are curious: [https://github.com/Tygs/ayo](https://github.com/Tygs/ayo)

It:

\- is based on asyncio. Not a new framework. Integrated transparently with normal asyncio.

\- implement some lessons leaned from trio (e.g: nurseries, cancellation, etc)

\- expose a sweet API (running blocking code is run.aside(callback, _args,_ *kwargs), and automate stuff it can (@ayo.run_as_main setup the event loop and run the function in one row)

\- make hard things decent: timeout and concurrency limit are just a param away

I does need some serious doc, including a rich tutorial which features a pure asyncio part. Also it needs some mix between streams and protocols. I'm not going to skip that part, I think it's mandatory, but I'll need many months to make the whole thing.

Now, I am not Nathaniel or Yury, so my work is not nearly as bullet proof as theirs. I would not advice to install ayo in prod now, but I think it's a great proof of concept of how good asyncio can be.

And we most certainly can do even better.

</comment></comment></comment></comment><comment><USER6> Python is my language of first choice, but I must say that I am not that thrilled how this multithreading ended up. There are many tutorials about the topic promising to explain how it works, usually in the form of "simple introduction". But when one tries to implement something production-ready, with correct error handling etc., things starts to complicate pretty quickly; at least that was my experience. I don't want to accuse anyone specifically, but most of the tutorials I saw seems to portrait it in a way, that it looks easier than it actually is.

Ultimately, my company decided, that instead of fighting with asyncio, certain projects will switch to Go.

<comment><USER4> That's because most of those tutorials have not been written by somebody actually putting something in production.

I've been using asyncio for a while now, and you can't get away with a short introduction since:

\- it's very low level

\- it's full of design flaws and already has accumulated technical debt

\- it requires very specific best practices to be usable

I'm not going to write a tutorial here, it would take me a few days to make a proper one, but a few pointers nobody tells you:

\- asyncio solves one problem, and one problem only: when the bottleneck of your program is network IO. It's a very small domain. Most programs don't need asyncio at all. Actually many programs with a lot of network IO don't have performance problems, and hence don't need asyncio. Don't use asyncio if you don't need it: it adds complexity that is worth it only if it solves your problem.

\- asyncio is mostly very low level. Unless you code your own lib or framework with it, you probably don't want to use it directly. E.G: if you want to make http requests, use aiohttp.

\- use asyncio.run_until_complete(), not asyncio.run_forever(). The former will crash on any exception, making debugging easy. The later will just display the stack trace in the console.

\- talking about easy debugging, activate the various debug features when not in prod ([https://docs.python.org/3/library/asyncio-dev.html#debug- mod...](https://docs.python.org/3/library/asyncio-dev.html#debug-mode-of- asyncio)). Too many people code with asyncio in the dark, and don't know there are plenty of debug info available.

\- await is just a way to inline a callback. When you do "await", you say 'do the stuff', and any lines of code that are after "await" are called when "await" is done. You can run asynchronous things without "await". "await" is just useful if you want 2 asynchronous things to happen one __after__ another. Hence, don't use it if you wants 2 asynchronous things to progress in parallel.

\- if you want to run one asynchronous thing, but not "await" it, call "asyncio.ensure_future()".

\- errors in "await" can be just caught with try/except. If you used ensure_future() and no "await", you'll have to attach a callback with "add_done_callback()" and check manually if the future has an exception. Yes, it sucks.

\- if you want to run one blocking thing, call "loop.run_in_executor()". Careful, the signature is weird.

\- CPU intensive code blocks the event loop. loop.run_in_executor() use threads by default, hence it doesn't protect you from that. If you have CPU intensive code, like zipping a lot of files or calculating your own precious fibonacci, create a "ProcessPoolExecutor" and use run_in_executor() with it.

\- don't use asyncio before Python 3.5.3. There is a incredibly major bug with "asyncio.get_event_loop()" that makes it unusable for anything that involve mixing threads and loops. Yep. Not a joke.

\- but really use 3.6. TCP_NODELAY is on by default and you have f-string anyway.

\- don't pass the loop around. Use asyncio.get_event_loop(). This way your code will be independent of the loop creation process.

\- you do pretty much nothing yourself in asyncio. Any async magic is deep, deep down the lib. What you do is define coroutines calling the magic things with ensure_future() and await. Pretty much nothing in your own code is doing IO, it's just asking the asyncio code to do IO in a certain order.

\- you see people in tutorials simulate IO by doing "asyncio.sleep()". It's because it's the easiest way to make the event loop switch context without using the network. It doesn't mean anything, it just pauses and switch, but if you see that in a tutorial, you can mentally replace it with, say, an http call, to get a more realistic picture.

\- asyncio comes with a lot of concepts, let's take a time to define them:

        * Future: an object with a thing to execute, with potentially some callbacks to be called after it's executed.

        * Task: a subclass of future. The thing to execute is a coroutine,, and the coroutine is immediately scheduled in the event loop when the task is instantiated. When you do ensure_future(coroutine), it returns a Task.

        * coroutine: a generator with some syntaxic sugar. Honestly that's pretty much it. They don't do much by themself, except you can use await in them, which is handy. You get one by calling a coroutine function.

        * coroutine function: a function declared with "async def". When you call it, it doesn't run the code of the function. Instead, it returns a coroutine.

        * awaitable: any object with an __await__ method. This method is what the event loop uses to execute asynchronously the code. coroutines, tasks and futures are awaitables. Now the dirty secret is this: you can write an __await__ method, but in it, you will mostly call the __await__ from some magical object from deep inside asyncio. Unless you write a framework, don't think too much about it: awaitable = stuff you can pass to ensure_future() to tell the event loop to run it. Also, you can "await" any awaitable.

        * event loop: the magic "while True" loop that takes awaitables, and execute them. When the code hits "await", the event loop switch from one awaitable to another, and then go back to it later.

        * executor: an object that takes code, execute it in a __different__ context, and return a future you can await in your __current__ context. You will use them to run stuff in threads or separate processes, but magically await the result in your current code like it's regular asyncio. It's very handy to naturally integrate blocking code in your workflow.

        * event loop policy: the stuff that creates the loop. You can override that if you are writing a framework and wants to get fancy with the loop. Don't do it. I've done it. Don't.

        * task factory: the stuff that creates the tasks. You can override that if you are writing a framework and wants to get fancy with the tasks. Don't do it either.

        * protocols: abstract class you can implement to tell asyncio __what__ to do when it establish/loose a connection or send/receive a packet. asyncio instantiate one protocol for each connection. Problem is: you can't use "await" in protocols, only old fashion callback.

        * transports: abstract class you can implement to tell asyncio __how__ to establish/loose a connection or send/receive a packet.

Now, I'm putting the last point separately because if there is one thing you need to remember it's this. It's the most underrated secret rules of asyncio. The stuff that is literally written nowhere ever, not in the doc, not in any tuto, etc.

asyncio.gather() is the most important function in asyncio </comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment></comment><comment>=====

You see, everytime you do asyncio.ensure_future() or loop.run_in_executor(), you actually do the equivalent of a GO TO. (see: [https://vorpus.org/blog/notes-on-structured-concurrency- or-g...](https://vorpus.org/blog/notes-on-structured-concurrency-or-go- statement-considered-harmful/))

You have no freaking idea of when the code will start or end execution.

To stay sane, you should never, ever, have an dangling awaitable anywhere. Always get a reference on all your awaitables. Decide where in the code you think their life should end.

And at this very point, call asyncio.gather(). It will block until all awaitables are done.

E.G, don't:

        asyncio.ensure_future(bar())
        asyncio.get_event_loop().run_in_executor(None, barz)
        await asyncio.sleep(10)

E.G, do:

        foo = asyncio.ensure_future(bar())
        fooz = asyncio.get_event_loop().run_in_executor(None, barz)
        await asyncio.sleep(10)
        await asyncio.gather(foo, fooz)  # this is The Only True Way

Your code should be a meticulous tree of hierarchical calls to asyncio.gather() that delimitates where things are supposed to stop. And if you think it's annoying, wait for debugging something which life cycle you don't have control over.

Of course it's getting old pretty fast, so you may want to write some abstraction layer such as [https://github.com/Tygs/ayo](https://github.com/Tygs/ayo). But I wouldn't use this one in production just yet.

<comment><USER7> Wow, really nice list, I wish I knew it before I started to work with asyncio.

> stay sane, you should never, ever, have an dangling awaitable anywhere. > Always get a reference on all your awaitables. Decide where in the code you > think their life should end.

This is the most difficult part for me, it's not trivial to know if a function you're calling is async or not without looking at the function source, specially when you're using external libraries. Also by default there's no logs about this kind of situation so it's a easy way to shoot yourself in the foot and waste 10 minutes debugging to find a dangling awaitable on a function call you didn't realize was async.

<comment><USER8> And still people vote for async-await because "true light threads are hard to implement at low level". This generator-based madness has to end, but few seem to understand what hassle it brings to their coding and what an alternative could be. I don't get it.

</comment></comment></comment><comment><USER9> This is essentially how modern JavaScript works, in particular with the addition of async/await syntax [1] (which was originally from C#, I think), but it's been possible with libraries like task.js, co, and Bluebird [2] since generator functions were available (either natively or via transpiling).

The main difference is in JavaScript the event loop is automatic and hidden, and asynchronous IO is the default, so it's a bit harder to shoot yourself in the foot.

1\. [https://developer.mozilla.org/en- US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Statements/async_function)

2\. [https://github.com/mozilla/task.js](https://github.com/mozilla/task.js) [https://github.com/tj/co](https://github.com/tj/co) [http://bluebirdjs.com/docs/api/promise.coroutine.html](http://bluebirdjs.com/docs/api/promise.coroutine.html)

</comment><comment><USER10> I'm still bummed that Python took this direction. Maybe introducing new keywords into the language for event loop concurrency was Python's way of satisfying "explicit is better than implicit" but i can's shake the feeling that callback passing and generator coroutines are a fad that is complex enough to occupy the imagination of a generation of programmers while offering little benefit compared to green threads.

<comment><USER11> This might be interesting reading. Comments on rust's approach to async from green thread.

[https://aturon.github.io/blog/2016/08/11/futures/](https://aturon.github.io/blog/2016/08/11/futures/)

<comment><USER12> One of the key reasons Rust took this approach is because Rust's implementation is zero cost - it doesn't require a runtime to implement. It is potentially very efficient, and thanks to Rust's other guarantees its very safe to use. It's as close to bare metal as you can get for a async framework and as a result its incredibly efficient.

However, to me, the implementation is a lot complex that green threads. The Future's crate has had a lot of churn, and when I first dabbled in it a while back, it was one of the first few times I struggled to understand what the compiler errors even meant as the types were so deep. Compared to golang's 'go', futures are harder to understand, plus you have to rewrite all your networking/blocking code to be compatible (Python would still likely have to do the same, but I think it could be done in such a way that if you were using the system provided networking libraries, you could get compatibility for "free").

Python doesn't benefit from the Rust benefits explained in that article. Python already has a garbage collector and runtime. Python is single threaded.

I don't follow the Python language to have a well informed opinion on why they went with futures, but I doubt its close to the reasoning that Rust chose.

<comment><USER13> > Python is single threaded.

That's not true, there are multiple threads in Python i.e. zlib from the standard library.

People want unsafe code to communicate concurrently through the Python thread state. I'll let someone else tackle that one.

</comment></comment></comment></comment><comment><USER14> quoting the article:

> Concurrency is like having two threads running on a single core CPU.

> Parallelism is like having two threads running simultaneously on different > cores

> It is important to note that parallelism implies concurrency but not the > other way round.

Aurgh! I don't think this attempted definition-by-simile is helpful, or even somewhat correct.

I much prefer yosefk's way of framing things:

> > concurrent (noun): Archaic. a rival or competitor.

> > Two lines that do not intersect are called parallel lines.

...

> Computation vs event handling

> With event handling systems such as vending machines, telephony, web servers > and banks, concurrency is inherent to the problem – you must resolve > inevitable conflicts between unpredictable requests. Parallelism is a part > of the solution - it speeds things up, but the root of the problem is > concurrency.

> With computational systems such as gift boxes, graphics, computer vision and > scientific computing, concurrency is not a part of the problem – you compute > an output from inputs known in advance, without any external events. > Parallelism is where the problems start – it speeds things up, but it can > introduce bugs.

...

> concurrency is dealing with inevitable timing-related conflicts, parallelism > is avoiding unnecessary conflicts

yosefk's whole essay about this is great: [https://yosefk.com/blog/parallelism-and-concurrency-need- dif...](https://yosefk.com/blog/parallelism-and-concurrency-need-different- tools.html)

<comment><USER15> I also initially thought the same thing. Page two of "Parallel and Concurrent programming in Haskell" maybe says it in a nicer way:

>A parallel program is one that uses a multiplicity of computational hardware ....

>concurrency is a program-structuring technique in which there are multiple threads of control...

(a pdf can readily be found with your favorite search engine for the full extract :) ).

I would much prefer to see a precise, rigorous definition and then examples (or eg and then defn is also acceptable), instead of just a list of examples. Examples help you understand a rigorous statement. But, if you only give a hand waving explanation for something, I think it just creates more confusion in the end, as you never know exactly what is correct. It's leaving it open for ambiguity.

</comment></comment><comment><USER16> I really liked this article. It's by far the most concise explanation of asyncio in python that I've come across. Also, great use of little "quoted" statements throughout that encourage you to stop and really understand what was said before moving on (these probably have a special name).

Bravo!

</comment><comment><USER17> A few years ago I wrote an BitTorrent client in Python 3.5 to get to know asyncio better.

Maybe those blogposts are still of use to somebody:

\- [http://markuseliasson.se/article/introduction-to- asyncio/](http://markuseliasson.se/article/introduction-to-asyncio/)

\- [http://markuseliasson.se/article/bittorrent-in- python/](http://markuseliasson.se/article/bittorrent-in-python/)

</comment><comment><USER18> Here is a comparison of `asyncio` (Python), `async` (Ruby) and Go: [https://github.com/socketry/async- await/tree/master/examples...](https://github.com/socketry/async- await/tree/master/examples/port_scanner)

I wrote a similar article but for Ruby: [https://www.codeotaku.com/journal/2018-06/asynchronous- ruby/...](https://www.codeotaku.com/journal/2018-06/asynchronous-ruby/index)

Yes, it's a good model for many use cases.

One thing I wondered about Ruby, is it really necessary to have the `await` keyword?

<comment><USER19> `await` is useful since with the absence of it you can schedule multiple tasks concurrently. In JS:

        var task1 = someAsyncTask1()
        var task2 = someAsyncTask2()

        await Promise.all([task1, task2])

If `await` was implicit then task2 would wait for task1 to finish.

</comment></comment><comment><USER20> It seems odd that Python ended up with asyncio when they had a clear and successful model they could've adopted from Stackless. It would have been more difficult to implement, but it would allow for the same benefits without requiring an asynchronous programming model, which would have reduced the total amount of effort involved in getting to having good concurrency in Python.

</comment><comment><USER21> Wasn't there a language where every call was async? Instead of async ... A/returing Future[A] it did/would return A from method calls.

If it didn't exist, one can imagine one.

A.x = 3 would be wrapped in A.map(_.x = 3) etc. So you write code that would be executed when you finally await a value. No more red/blue world. Would probably need coroutines instead of threads for executing.

<comment><USER22> Just to post it as an answer instead of a question. That's Haskell's IO.

It is just one of the lots of concurrency behaviors available in libraries. Also, parallelism is "free" on pure code.

<comment><USER21> From my understanding, this is not Haskells IO - though my time with Haskell is limited.

1\. Haskell uses special notation 'do' to handle access to IO wrapped values, e.g. (contrieved example, one would not use do for such simple cases)

          y = do x <- xWithIO
              return x + 1

instead of

          y = x + 1

2\. Haskell method signatures do include IO, e.g.

        doSomething   :: Int -> IO Int

instead of

        def doSomething(i:Int):Int

3\. Because IO is usually not the only effect managaging monad, as I've said in another comment, the type signature usually uses a type alias that does alias a monad transformer stack like

        type Result a = ReaderT Env ( ErrorT  String ( StateT  Integer Identity))

or concurrency mixed in

4\. This the same as my Scala code, where I have cats FutureT monad transformers with Scalactic errors OrT Every stacks showing up all over my APIs as a type alias of 'WithErrors'.

5\. 'Also, parallelism is "free" on pure code.' Not sure what's that got to do with it, but yes if you have no concurrency problems (concurrent writes to shared data) you don't need to think about concurrency and parallelism is free.

But if my understanding is wrong, I'm happy to learn something about concurrency in Haskell without it showing in code and type signatures.

<comment><USER22> Well, it does not have the exact same syntax of your example. Even more because your example was pure. Haskell does that automatically for pure code too (`y = x + 1` would do exactly what you described) but it's not really relevant.

IO code always returns a promise, and the next statement on a `do` block may await the previous promise and yield the execution to whatever other piece of code can run, based on some rules on the compiler, based in large part on data dependency. If I'm reading your comment correctly, that is what you are asking for.

<comment><USER21> Sorry for being so confusing

"Even more because your example was pure."

No it wasn't which is the whole point.

        y = x + 1

means

        y = x.map(_ + 1)

by default with async effects.

"same syntax"

Which is also the point, that there is syntax for the effects. When everything is async, there should be no special syntax as you have that syntax all over your code and it's redundant.

</comment></comment></comment></comment></comment><comment><USER23> Someone send this article to Armin Ronacher (creator of Flask, Jinja, etc.) so he can understand asyncio since he wrote a much longer and more detailed article explaining why he doesn't understand asyncio (previous discussion at [https://news.ycombinator.com/item?id=12829759](https://news.ycombinator.com/item?id=12829759)).

</comment><comment><USER24> Is this any different than in C#?

</comment><comment><USER25> My first endeavor with asyncio felt worse than a beating with a wet rubber hose. But it was a character building experience to really get up close and personal with the asynchronous model and I can definitely see its advantages over imperative, as well as it's always good to have another tool in the box.

</comment><comment><USER26> Thinly veiled advertisement for a "Intelligent Infrastructure Analytics - <USER2> Machine Learning driven approach for DevOps & SREs of modern age" company. Seems like hackernoon just published a native advertisement? Not surprisingly shady though, considering the "buy crypto with credit card" link in the top bar.</comment>


Police chief refuses to tell Parliament about secret spyware - <AUTHOR> https://www.abc.net.au/news/2019-10-24/police-chief-refuses-to-tell-parliament-about-secret-spyware/11632956 <comment><USER2> This is amazing. This sort of behavior (spying on defense lawyers) in the US could lead to blanket vacating of all convictions in a jurisdiction.</comment>


How Sleep Clears the Brain - <AUTHOR> http://www.nih.gov/researchmatters/october2013/10282013clear.htm <comment><USER2> This press release from two months ago resulted in BBC reporting that was extensively discussed here on HN back then.[1] (I remember this because I had a good night's sleep last night.) As usual for news stories about science discoveries, this is a report of a preliminary primary research finding that may or may not be replicated and extended into the framework of an overall theory of human sleep. The science news cycle gives a crucial role to press releases like the release kindly submitted here,[2] so all of us who sleep will look forward to further research studies to confirm or disconfirm this preliminary finding and help us understand how this mouse study relates to human behavior.

The obligatory link for any discussion of a report on a preliminary research result is the article "Warning Signs in Experimental Design and Interpretation"[3] by Peter Norvig, director of research at Google, on how to interpret scientific research. Considering carefully how the current research was done (after a good night's sleep, of course) may help suggest further research that will advance our understanding of what sleep is good for.

[1] [https://news.ycombinator.com/item?id=6567966](https://news.ycombinator.com/item?id=6567966)

[2] [http://www.phdcomics.com/comics.php?f=1174](http://www.phdcomics.com/comics.php?f=1174)

[3] [http://norvig.com/experiment-design.html](http://norvig.com/experiment- design.html)

<comment><USER3> Maybe this already exists, bit I see a startup opportunity for tagging a study as "of interest" and having a site build a portfolio of information related to that study and finding new studies. Feedback could be given on the relevance of returned results.

Something like the app flipboard but have it contain dedicated magazines/journals that gather up and continually build out.

Rather than just be a social media stream.

</comment></comment><comment><USER4> Not sure what it is with me, but if have no daily obligations and don't force my self to go to sleep at night, I always end up reversing my sleep schedule. Been that way even through high-school, summer vacation comes and I'm there watching tv or playing video games until 5-6am and then I crash and wake up for lunch at 1-2pm. Somehow, the peacefulness of the night is soothing, even my mind seams clearer. Also, sometimes my mind is racing, and I won't go to sleep even if my body is tired. Usually, at that time before crashing, I feel so close to having all the answers.

<comment><USER5> I used to behave like this, would go to bed between 2 and 5, despite not liking the consequences (shortened daylight time, city noise while I slept in, being out of sync with others). I think I've gradually fixed it. Still working on being more regular, but these days I'm able to fall asleep at 10h30. Here's what I think helped me personally:

\- learning about mindfulness (useful to stop/slow down the intense flow of thoughts. I recommend reading/listening to The Power of Now by Eckhart Tolle)

\- 500 mcg of melatonin at the end of dinner. (the chewable ones sold at Trader Joe's work for me) Required read: [http://www.gwern.net/Melatonin](http://www.gwern.net/Melatonin)

During the transition, some days I may have forced myself to get up a little earlier so that I would go to bed earlier, it helped but I avoided doing this too often because it could affect my abilities for days. You want to sleep as much as you need but still go to bed at a reasonable time, not sleep deprive yourself to sleep. Setting your clock is a gradual thing. Maybe you can try to go to bed 15 min earlier every day.

EDIT: I'm not a doctor, and I didn't get help from a doctor for this. Take this advice at your own risk. But if you do get help from a doctor and you're offered a prescription for sleeping pills, please remember there may be healthier alternatives.

EDIT: Forgot to mention, I think exercising helped me too. If you're not exercising because you can't find the time, you could - like me - start here: [http://well.blogs.nytimes.com/2013/05/09/the- scientific-7-mi...](http://well.blogs.nytimes.com/2013/05/09/the- scientific-7-minute-workout)

<comment><USER4> Being phsyically exhausted certainly helps. I was into hiking and spelunking and somehow in the mountains there is no need for an alarm clock, the sunrise just wakes you up. Also, there's a lack of stress and anxiety about work or what tomorrow holds, you sort of live in the now.

</comment></comment></comment><comment><USER6> Sleep works wonders. Sometimes dozing off for 20 minutes after lunch feels like a whole night of sleep to me. It's like a hardware reset.

<comment><USER7> I've heard this before and it's simply amazing to me. I've never been a napper, and I'm envious

</comment></comment><comment><USER8> I know this is OT, and it's not caused by sleep deprivation, but does anyone know what NIH uses to generate their site. It seems simple and straightforward on the surface but a look at the source reveals it to be tight, templated, and well organized. Seems well designed and executed.

<comment><USER9> It looks like this section of their site is generated using Dreamweaver templates.

Actually, cool to see that they're using Crazy Egg for clickmaps of their site. Seems like government websites often lack the usability factor.

<comment><USER8> Thanks. Kudos to the design and development team. Nice work.

</comment></comment></comment><comment><USER10> We need more research on sleep, to be able to further improve the 33% of our life (assuming 8 hours of sleep).

While ideas like polyphasic sleep are cool to tinker with, the long term risks are too high IMO to 'experiment' as we know so little about sleep.

<comment><USER11> I'd not mind doing some self-experimentation with sleep, but I have a hard time drawing a line with when to stop and try to evaluate what the effect was. Changes might be so gradual as to not really being able to tell ("do I feel better now than before?"). I wish there were more objective measures for this sort of thing that didn't require a sizeable study population to be reliable. I guess we need more biomarkers for... sleep health?

</comment></comment><comment><USER12> And I only slept 3 hours tonight. However, I've came to master my sleep cycles. Had I slept 3.5 or 5 hours, I would be dead tired right now. I wonder if it's long enough for the brain to clears itself. I tend to sleep only a few hours all month, then I get tired once a month and sleep for around 12 to 14 hours and feel good for the next 30 days or so.

I'm probably killing myself. Or perhaps I've found the perfect sleep schedule for me.

<comment><USER13> If you slept "a few hours per month" you'd be dead.

<comment><USER14> In one of Michel Jouvet's[1] experiments for developing the drug modifinil, he deprived cats of sleep until they drowned in a vat of water. On average, the cats managed to survive 35 days with only micro-sleep[2].

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

[2] [http://psychology4a.com/sleep8.htm](http://psychology4a.com/sleep8.htm)

<comment><USER3> That is very cruel.

<comment><USER15> It's so cruel I thought he was joking. Seriously, depriving cats of sleep until they drown? Good god...

</comment></comment></comment></comment></comment><comment><USER16> I wonder how this works for people who have stayed up for multiple days at a time. I know of people who have underwent sleep deprivation studies for over several days. The current record, I think, is 2 weeks. Personally, I have stayed up 3 nights in a row once to study for a chemistry exam. I've had great mental clarity and focus during the entire time. Yes, it was harder to do than fully rested. But, I have often found that I do better under pressure anyways.

By the way, I also ended up getting the highest score on the exam and in the class. It was a brutal chemistry course. Only two of us got A's, and the other guy got an A-.

<comment><USER17> Did you use any kind of drugs?

</comment></comment><comment><USER18> This is really cool, and surprisingly similar to the way some software systems are designed. Probably because I have been researching it a lot, but this reminds me of a data replication system, where data builds and builds during active periods of the day, and then at night when activity slows, the back logs are processed and cleared by morning.

</comment><comment><USER19> No wonder that, very often, solutions to problems I struggled all day just pop up in the shower next morning.

</comment><comment><USER20> So, we have a choice! We need to be asleep or anaesthetised.

</comment><comment><USER21> I don't visit .GOV websites anymore. I'm sure the article was interesting.</comment>


Hello client, meet the DOM - <AUTHOR> http://leaningtech.com/duetto/examples/

<comment><USER2> What's the use case? i don't quite understand why generating js from c++. JS is arguably much better language than C++. It feels like GWT, which is (or should) be abandoned.</comment>


New isothermal Gibson Assembly – fraction of cost - <AUTHOR> https://www.biorxiv.org/content/10.1101/2020.06.14.150979v1 <comment><AUTHOR> Cepko Lab at Harvard Medical School created a small tweak to traditional Gibson Assembly and significantly lowered the cost!</comment>


Circl Images Phishing Open Dataset – 460 Pictures - <AUTHOR> https://www.circl.lu/opendata/circl-phishing-dataset-01/ <comment><USER2> It reminds me of the CIRCL' library for Image Matching [https://github.com/CIRCL/douglas-quaid](https://github.com/CIRCL/douglas- quaid) !

<comment><USER3> On that page, it says:

        Three main applications are envisioned :

        Match new screenshots to a known baseline. E.g. : Matching screenshots from phishing-like website to known legitimate wesite.

So, it seems likely to me that these two projects are probably closely linked, if not directly related.</comment></comment>


Terrain Rendering and GUIs with WebGL - <AUTHOR> http://zephyrosanemos.com <comment><USER2> I know not everything needs to be opensource but I can't shake the feeling that this project could be taken very far with a github link :)

</comment><comment><USER3> I don't understand why you wouldn't just use plain dom+css to render the gui ?! What's the benefit to recode the gui in WebGL ?

<comment><USER2> The author mentioned in the post that he didn't know anything about the dom at the time of writing it.

<comment><USER4> I don't know if this was at all on the author's mind, but by implementing the GUI in WebGL vs. DOM, they can now composite the GUI with the scene, rather than the GUI being strictly limited to the front of everything 3D. It's why I wrote Primrose[1], as source control editor that renders to Canvas instead of DOM. I intend to toss these things into 3D space.

[1] shameless plug: [http://capnmidnight.github.io/Primrose/](http://capnmidnight.github.io/Primrose/)

<comment><USER3> In your case it makes perfectly sense; except in the case of this topic the controls all seem to be overlays i.e. are never part of the scene.

</comment></comment></comment></comment><comment><USER5> The GUI alone is worthy of its own article. Holy crap.

</comment><comment><USER6> I really like the ui, but one difficulty I found with implementing ui in webgl is supporting the input box, especially input box that can accept Asian languages.

I couldn't see an example of input box on this page. I'm wondering if it is doable.

</comment><comment><USER7> That GUI is seriously impressive, especially the tile loading progress animation. He must be a truly talented developer that he came up with this soon after deciding to give web development a try.

<comment><USER8> He is a developer experienced with OpenGL on the desktop. From experience it's not a terribly difficult leap to WebGL.

<comment><USER9> Right - at the end he says "Oh I've been a developer on this CAD software for the past ten years"

</comment></comment></comment><comment><USER10> Great stuff and write up. What's the performance bottleneck? I feel like with all the LOD stuff you implemented this should be butter smooth

<comment><USER11> It is butter smooth @ 60Hz on my laptop with poor Intel graphics

<comment><USER12> Is butter actually smooth? In my experience butter is full of fat and hard to spread when it comes out of the fridge. Kinda the opposite of my reaction to this web app.

<comment><USER13> Many idioms are older than refrigerator technology. Butter is meant to be served at room temperature. A vessel called a butter crock preserves butter at room temperature by using a thin layer of water to create an airtight seal around an overturned cup of butter: [http://i.imgur.com/oiNjjaW.png](http://i.imgur.com/oiNjjaW.png)

</comment></comment></comment></comment><comment><USER14> This is really cool, locks up the tab in Safari 8.0.2 once in awhile though.

Also, the brushed metal is a nice nod to the late 90's.

Why Delphi for generation the terrain?

<comment><USER15> At the bottom of the page :

>During the last decade, I've helped build Anadelta Tessera, a desktop road design CAD written in Delphi.

</comment></comment><comment><USER16> Wow, it boggles my mind to think what we can do in a browser these days...

<comment><USER17> Unfortunately, WebGL hasn't been updated in a while and it is badly outdated. There's a bit of a mismatch between providing low level access to the GPU and allowing to run untrusted content from the Web. This has performance implications, particularly with this example that generates geometry dynamically.

There's a decade's worth of new graphics features that aren't available via WebGL, even though the hardware supports it (even mobile phones these days).

I am getting less than 25 frames per second and I have a high end GPU. This should easily run at 60 fps and have plenty of idle time (for CPU and GPU). Now it's consuming a lot of CPU and fans are spinning up.

I really hope that WebGL gets a long awaited update, and that there will be better sandboxing techniques employed. The issues with security can't be solved at the browser level alone and there's quite a big performance hit when done at that level.

There is hardware/driver level support for some of the security issues (via OpenGL robustness extensions), but even when they are available, there's still a redundant layer of userspace security applied.

This leads to some ridiculous implications when developing WebGL content, e.g. indexed rendering (glDrawElements) can't really be used (esp. with dynamic content) because the index buffer has to be inspected (with the CPU) for out- of-bounds indices. There is hardware support for bounds checking in many new GPUs (desktop and mobile) and it's easy to detect, but none of the popular implementations rely on that even when available.

WebGL might be impressive in the browser but unfortunately it's roughly equivalent to what was available on the desktop in 2004 and on the mobile in 2010.

<comment><USER18> Strange, the demo runs perfectly at 60fps on my 2012 MacBookPro with Intel HD4000 in Chrome, is your browser and graphics driver uptodate?

The new performance implications introduced by WebGL (like that dynamices indices are bad) are quite similar to restrictions of other platforms (for instance on tiled platform like PowerVR, any sort of transparency is much more expensive then on other platforms because it kills the per-tile hidden- surface-removal, etc). Basically, each GL platform has other performance characteristics that applications need to be aware of, write-once- run-(perfectly)-everywhere was never true for any 3D API, and WebGL is not different.

I think that WebGL+extensions provide a pretty good basic feature set for 3D apps and games, of course it could be better, but given the fact that WebGL needs to serve the widest range of target platforms of ANY 3D API, and it's miles better then no GPU access in the browser at all.

BTW, WebGL2 can already be tested in Firefox, this brings WebGL to the OpenGLES3 feature set: [https://wiki.mozilla.org/Platform/GFX/WebGL2](https://wiki.mozilla.org/Platform/GFX/WebGL2)

<comment><USER17> Yes, I'm up-to-date but in my experience Firefox has a worse WebGL implementation than Chrome. Didn't try with Chrome. I also have a not-so-great CPU (but a high end GPU) so that affects too. In any case, my computer is able to run quite high end games, it should easily be able to run a simple terrain demo if it weren't for the overhead.

There's certainly different performance characteristics in different OpenGL implementations (ie. GPUs) but WebGL overhead comes on top of that. So in addition to the performance characteristics of the GPU itself, you have to think about the browser's software implementation too.

WebGL is definitely a welcome addition to the facilities available in the browser, but getting more up-to-date features would be nice. And using the security features (especially bounds checking) of the hardware if available to avoid unnecessary overhead would make it a lot more appealing.

<comment><USER19> Have you checked to make sure that hardware acceleration is enabled?

[http://blog.mozilla.org/joe/2010/11/10/how-to-tell-if- youre-...](http://blog.mozilla.org/joe/2010/11/10/how-to-tell-if-youre-using- hardware-acceleration/)

</comment></comment></comment></comment></comment><comment><USER20> reminds me of dbz. nice.</comment>


China Summons Tech Giants to Warn Against Cooperating with Trump Ban - <AUTHOR> https://www.nytimes.com/2019/06/08/business/economy/china-huawei-trump.html <comment><USER2> To be clear: China bans foreign companies all the time, but doesn't like it when other countries do the same?

Seriously, as long as they ban, block, filter, and require Chinese ownership of foreign companies I don't see why they should expect or receive different from other countries.

<comment><USER3> Does China ban foreign companies? From what I've seen it's mainly companies that can't or won't comply with China's censorship laws.

So they just don't set up shop there.

Also I think China hasn't required Chinese ownership of foreign companies for over two decades now.

For example, Tesla in China is a Wholly Foreign-Owned Enterprise.

<comment><USER4> >Also I think China hasn't required Chinese ownership of foreign companies for over two decades now.

That is so far from the truth. And Tesla's case, ( I think ) it was because it was set up in a Special Economic Zone. Not to mention part of the deal was to have a JV / Partnership in battery construction. i.e Using Chinese Battery. ( Majority of the BOM in a EV )

China knows how to play its card.</comment></comment></comment>


Micro – a microservice toolkit - <AUTHOR> https://github.com/micro/micro <comment><USER2> Would like to hear the experiences from people who have used this in production

</comment><comment><USER3> This is awesome!</comment>


Instagram 3.0 deletes geotag data from photos you choose not to display on map - <AUTHOR> http://www.virtualpants.com/post/29565250248/instagram-3-0-deletes-geotag-data-from-photos-you

<comment><AUTHOR> Especially a bad policy because some of the business data associated with the photos is wrong. So, just because I don't want to associate a photo with a restaurant means the location data is deleted.

</comment><comment><USER2> Once fixed... this will be welcomed by those that desire a little privacy!</comment>


Fingerprints on Mobile Devices: Abusing and Leaking [pdf] - <AUTHOR> https://www.blackhat.com/docs/us-15/materials/us-15-Zhang-Fingerprints-On-Mobile-Devices-Abusing-And-Leaking-wp.pdf <comment><USER2> Fingerprints is really a bad authentication tool.

<comment><USER3> Well, yes and no. In the grand scheme of things, sure, there are more effective and secure methods of authentication. But like anything, you have to weigh security vs. usability. If you make things too secure (read: complex) then users won't use it.

There is also a huge difference between the $15 fingerprint reader you buy off of Amazon, and the "professional" scanner found in enterprise/secure devices (which in my experience, consist of a high resolution camera combined with software that detects (and looks for) movement of the finger on the scanner, "flattening" of the finger as its placed on the glass, among other things).

Further, there is the inherent need for someone (user or malicious person) to be on-site to present the biometric, as opposed 'remote' access using a username/password combination.

Like anything however, you also need to protect the core infrastructure, as well as the end-user interface. All authentication methods are useless if someone has direct access to the authentication server.

Just my $0.02</comment></comment>


Ask HN: Your tips for finding bloggers in a niche - <AUTHOR>

When you've got something to promote, how do you find popular bloggers that are involved in that niche? <comment><USER2> Talk to your customers and ask them who they read.

</comment><comment><USER3> Try <http://www.mcsquare.me> \+ Subdomains (channels)

2- <http://blogsearch.google.com/>

3- <http://www.technorati.com>

Disclosure: I'm the founder of <http://www.mcsquare.me>

</comment><comment><USER4> Try <http://AllTop.com> and <http://TweetMeme.com>

<comment><USER3> How can I get in touch with you? my email's on my profile!

</comment></comment><comment><USER5> Google. Find their blog, usually it'll have a contact email, send your elevator pitch. This method has been highly successful for when I'm doing PR for Phone Halo.</comment>


How does having Wikipedia at your fingertips change you? How does it change society? - <AUTHOR> http://wikip.blogspot.com/2007/11/information-age.html

<comment><USER2> I have the Firefox keyword 'w' set to <http://en.wikipedia.org/wiki/Special:Search?search=%s>

So it really is at my fingertips :)</comment>


The Two Cultures of Mathematics (2000) [pdf] - <AUTHOR> https://www.dpmms.cam.ac.uk/~wtg10/2cultures.pdf <comment><USER2> One technique Prof Gower's mentions (the phenomenon of the concentration of measure) has many applications in machine learning/statistics (which may be of more interest to HN readers than some of the probabilistic combinatorics mentioned in the paper).

A few (non-rigourous) examples in ML/statistics are:

\- The use of the LASSO estimator [0] (minimizer of |Y - β X|₂ + λ |β|₁) for variable selection is justified by Candes & Tao's 2005 results [1, 2] that show, under fairly general conditions, that this estimate exactly recovers the true set of active variables. A key step in the proof is finding a concentration of measure result for sub-Gaussian random matrices. A corollary is that (with high probability) we can exactly solve the non-convex problem |Y - β X|₂ + λ |β|₀ by passing to the convex relation |Y - β X|₂ + λ |β|₁ and have strong guarantees that our relaxed solution is optimal.

\- The Johnson-Lindenstrauss lemma for dimensionality reduction, etc [3] can be proven by essentially the same principle (random projections are "probably" nearly isometries) that Prof Gowers describes in this note.

[0]: [http://en.wikipedia.org/wiki/Lasso_regression#Lasso_method](http://en.wikipedia.org/wiki/Lasso_regression#Lasso_method)

[1]: [http://authors.library.caltech.edu/10092/1/CANieeespm08.pdf](http://authors.library.caltech.edu/10092/1/CANieeespm08.pdf)

[2]: [http://arxiv.org/pdf/math/0410542.pdf](http://arxiv.org/pdf/math/0410542.pdf)

[3]: [http://en.wikipedia.org/wiki/Johnson%E2%80%93Lindenstrauss_l...](http://en.wikipedia.org/wiki/Johnson%E2%80%93Lindenstrauss_lemma)

</comment><comment><USER3> I was lucky enough to have Tim Gowers as a lecturer in my first term of university (hmm... 2002) when he gave a lecture course introducing number theory, set theory, combinatorics and axiomatic construction of number systems. It was intoxicating to be taught by someone who was (a) brilliant, and (b) so thoroughly enthusiastic about mathematics. I eventually routed off into applied math and physics, but I look back on those initial lectures fondly, and still have an appreciation for the kind of "problem solving" mathematics that he taught.

</comment><comment><USER4> The argument can be adapted almost verbatim for hacker type vs theory type programmers. One is in the problem solver camp the other in the fundamental understanding and theory building camp. Silicon Valley is dominated by hackers and they are constantly re-inventing wheels because of lack of theoretical understanding, e.g. NoSQL, and the theory builders are working on problems that will almost surely collect dust in some dark corner of a university library.

<comment> loup-vaillant Funny… While I personally like beautiful theory, the last bit of deepish theoretical work I am studying was to solve a particular problem.

I'm currently delving into Earley Parsing, so I can write compilers easily, so I can write DSLs economically, so I can write short programs in any language, so I can spend less time writing those programs, so I can generate less bugs from those programs, so these programs ultimately cost less money$$$.

Then there is Bret Victor, who uses very simple principles to solve the long standing problem of understanding in various domains.

I probably stand in the _" the best solutions come from the deepest theories"_ camp. With the caveat that "deep" does not necessarily mean "complex", on the contrary. Lambda calculus is very deep, but quite simple. So, while I believe problems are the centre of our field, I also believe we need to break down those problems into deep and simple math before we can tackle them efficiently. Not doing so is a recipe for bloat.

<comment><USER4> I disagree about Bret Victor. There is nothing simple about the principles that he uses. In fact you need a whole lot of very deep theoretical understanding to even get to the point of Bret's abilities. Time traveling debuggers for one are very advanced technology. If anything Bret Victor is applying very advanced theory to mundane domains like programming.

<comment> loup-vaillant > _Time traveling debuggers for one are very advanced technology._

Yes they are. But the underlying principles are dead simple: just keep all the history of the memory, never erase anything!

Of course, the _implementation_ is not that simple, because efficiency, because complex imperative languages, because many other things. But the basic principles are still dead simple. You may be amazed by time travelling with GDB, but OCaml had that _years_ before GNU did it.

I feel the same way about Bret Victor. He does understand things that are hard to grok. Probably very abstract stuff. But I suspect it wouldn't take much space to write those things down.

I gather you have seen his videos, most notably the dead fish and dynamic visualization ones? Learnable Programming also counts. Tell, me, why did you find those presentations so amazing?

The reason _I_ found them so amazing was their simplicity. Bret's demos show incredibly innovative features, but at the same time, those features felt incredibly simple: easy to use, the feedback is obvious, and frankly, most of his particular examples don't seem that hard to implement. The hard part was coming up with the idea in the first place.

Plus, I can see 2 overarching principles in Bret's work: the first one is, using our visual system to see the relevant stuff at a glance. Give me a graph, not a listing. The second one is direct interaction. You could think of it as a REPL on steroids, or even a live image, but it's more than that. In a live environment, you would change a variable, and see the consequences in real time. Bret Victor goes beyond even _time_ , and let us manipulate systems from the outside, as if they were a block universe (where time is just another dimension).

In learnable programming, you can see how he slides the force of the jump, to make it just right so our little Mario can go through that little secret passage. We can visualize the whole path (that's the first principle), and we can see what that path _would have been_ if you change the laws of physics (that's the second principle).

Very deep stuff. Very _hard_ stuff. But as I said, very simple as well. And I expect future insights will make it even simpler.

\---

Let us go back to my Earley Parsing for a second, because it's quite illustrative. My journey began with this talk[1] by Ian Piumarta. He mentioned Earley parsing at some point saying it was very general, handles every possible context-free grammars, and is also very simple, very easy to implement: half an hour to translate the algorithm in any language.

Months later, I'm still at it.

But you know what? As I come to understand Earley parsing, I agree with him more and more. This thing is _genuinely_ simple. I wrote a recognizer in less than a hundred lines of Lua code, and the whole parser will likely take less than 200 lines. As I said, simple.

Simple does not mean easy however. Without the proper insights, I could only struggle. But then I stumble upon a sentence, a picture… and then something _clicks_. And I can see the simplicity, as well as the depth. And then it clicks _again_. And it becomes even simpler. To the point that now, I understand where Piumarta is coming from. And I still remember why it was so difficult for me back then.

I mean, Earley parsing did use to feel kinda complex, and quite ad-hoc. At the same time, it didn't seem too difficult. I was wrong. Earey parsing proved to be much more difficult, and at the same time much simpler, than I had expected.

[1]: [http://www.youtube.com/watch?v=EGeN2IC7N0Q](http://www.youtube.com/watch?v=EGeN2IC7N0Q)

\---

I think Bret's work is like that: deep, hard, and simple.

</comment></comment></comment></comment><comment><USER5> I am currently reading "The Master and His Emissary: The Divided Brain and the Making of the Western World" by Iain McGilchrist. It provides a good overview of current insight into the roles of the separate hemispheres of the brain (way beyond the usual hippy stuff). One of the distinctions made is that the left hemisphere creates "abstraction" and the right hemisphere works by using "examples". A good course in (pure) mathematics will emphasize both: understand the theorem but also consider these examples that demonstrate the theorem. Now it strikes me that this article by Gowers paints a deeper picture of this left/right brain divide in mathematics, and the tension between them that McGilchrist describes in his book. How remarkable.

</comment><comment><USER6> Related is Dijkstra's "on the fact that the ocean has two sides": [https://www.cs.utexas.edu/users/EWD/transcriptions/EWD06xx/E...](https://www.cs.utexas.edu/users/EWD/transcriptions/EWD06xx/EWD611.html)

</comment><comment><USER7> This isn't just with Mathematics. In general in any profession, people who start new things are valued more than the people who solve problems with existing things.

On earth day I was speaking to a volunteer, who talked about how people who talk about saving existing forests are taken to be anti industrial progress but people who plant new trees are considered as people who are changing the world.

This applies to any thing you will ever do.

This is also why you must avoid jobs and responsibilities that deal with legacy projects, and seek projects that are doing something new.

</comment><comment><USER8> Is this something really new? I've always thought that for any field of science, there are always those that research for the sake of understanding, and those that study/ research the field to be use as an abstraction for another, more practical field (as noted in [http://xkcd.com/435/](http://xkcd.com/435/) ). Even back hundreds of years ago, Newton developed Calculus for physics, but Euler is studying maths for the sake of understanding.

</comment><comment><USER9> Do we not see similar trends in every aspect of computer science and software development?

<comment><USER10> If you are referring to "the two cultures", what would those cultures be?

<comment><USER11> Computer Science vs. Software Engineering; although usually the label "Computer Science" is applied to both.

Paraphrasing the PDF:

Loosely speaking, I mean the distinction between programmers who regard their central aim as being to solve problems, and those who are more concerned with building and understanding theories... If you are unsure to which class you belong, then consider the following two statements. (i) The point of solving problems is to understand computation better. (ii) The point of understanding computation is to become better able to solve problems.

Here (i) corresponds to Computer Science and (ii) to Software Engineering.

<comment><USER10> > _If you are unsure to which class you belong, then consider the following > two statements. (i) The point of solving problems is to understand > computation better. (ii) The point of understanding computation is to become > better able to solve problems._

Like the original statement in the article, your paraphrasing strikes me as being _egg and chicken_. I think most mathematicians and hackers would sit on the fence.

<comment><USER12> Perhaps. But even those who sit on the fence lean toward one side or the other.

<comment><USER10> Or the fence sitters lean one way or the other depending on their mood/requirements.

</comment></comment></comment></comment></comment></comment><comment><USER13> Can someone please expand on this statement, "if one is counting solutions, inside a given set, to a linear equation, then it is enough, and usually easier, to estimate Fourier coefficients of the characteristic function of the set"

<comment><USER5> The characteristic function of a set is one in the set and zero outside [1]. Take fourier transform of this function. Fourier transform is a linear operator. Turn handle, bingo.

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

<comment><USER13> Ah, I didn't know 'characteristic' function and 'indicator' function were synonyms. Thanks!

</comment></comment></comment><comment><USER14> It looks from [http://www.americanscientist.org/bookshelf/pub/prove-and- con...](http://www.americanscientist.org/bookshelf/pub/prove-and-conjecture) like the proper date for this article is 2000.</comment>


Gophercises – Coding exercises for budding gophers - <AUTHOR> https://gophercises.com/ <comment><USER2> Are we using the word gophers now, my first thought was the internet protocol [https://en.wikipedia.org/wiki/Gopher_(protocol)](https://en.wikipedia.org/wiki/Gopher_\(protocol\))

</comment><comment><USER3> Perfect timing, just as the go exercises on Exercism have begun to feel a little small and isolated (which is great for the beginning)

</comment><comment><USER4> One of the best resources out there to learn Go and not only Go, but how stuff actually works. Highly recommend.

</comment><comment><USER5> Nice!</comment>


On-the-fly image resizing Rack application - <AUTHOR> http://blog.new-bamboo.co.uk/2010/1/2/dragonfly Dragonfly is a Rack app to handle image resizing on the fly, usually with S3 as the file store. <comment><USER2> Aside: Does anyone here see value in an image resizing web service? I think it could be useful, particularly in environments where imaging libraries are in short supply (i.e. shared hosting).

<comment><USER3> Given the right set of features, yes [translation: "if it does everything _I want_ " :) ].

Off the top of my head, if it worked like this gem (ability to request arbitrary sizes on the fly) and had the ability to do simple color transforms (B/W, Sepia) that would be cool.

If you could convert RAW files, that would be interesting as well.

</comment></comment><comment><AUTHOR> Hi, we are indeed working on a hosted version and hopefully will have it out later this month!</comment>


Machine Learning in the Cloud, with TensorFlow - <AUTHOR> http://googleresearch.blogspot.com/2016/03/machine-learning-in-cloud-with.html <comment><USER2> They say that they make use of GPUs. Anybody know if this means GPU VMs are coming to google compute engine? That would be amazing. AWS GPU instances are popular but somewhat limited as they use older hardware.

</comment><comment><USER3> Interesting to see the speech, vision API among others. I wonder what this means for metamind, clarifai and many other startups offering an API for doing something close?

</comment><comment><USER4> Pretty nice model and makes sense why they OSed Tensorflow: write, train using the API, and feel safe that you can run it on your own hardware as well.

</comment><comment><USER5> Seems it hasn't been fully release yet, getting a 404 on [https://cloud.google.com/ml/docs/](https://cloud.google.com/ml/docs/) nor can I find it in GCP console. This provides slightly more information. [https://cloudplatform.googleblog.com/2016/03/Google-takes- Cl...](https://cloudplatform.googleblog.com/2016/03/Google-takes-Cloud- Machine-Learning-service-mainstream.html)

<comment><USER6> Access to this API (and docs) is currently invite-only. Sign up for the limited preview: [https://services.google.com/fb/forms/machinelearningpreview/](https://services.google.com/fb/forms/machinelearningpreview/)

</comment></comment><comment><USER4> Also announced speech recognition API also powered by TF.

</comment><comment><USER7> Tried to sign up for the Speech API, but could not find the Google Cloud Platform user id. Would love to integrate this with our transcription editor.

<comment><USER8> You should see the (pile of numbers) project id when you visit [https://console.cloud.google.com](https://console.cloud.google.com) in the upper left inset. Alternatively, at any place in the console you can hit the Settings gear and select Project Info (which should have both your numeric project number as well as your alphanumeric project identifier).

Disclosure: I work on Compute Engine.

</comment></comment><comment><USER9> Does Google have any academic discounts? I'm using tensorflow for my thesis and wouldn't mind some free cycles :)

<comment><USER10> Yes. Have your advisor email me (dga at cs . cmu . edu) and I'll send him / her pointers to some of the programs Google has for faculty. Note: cloudml alpha is a limited invite-only thing, so is unlikely to work for you on a short timescale, but nothing stops you from using GCE as a source of cycles on which to run your own install of TF in the meantime.

</comment></comment><comment><USER11> I have a lot on my list of stuff I want to learn about but machine learning is at the top.

Damn you time! I need more of you!

</comment><comment><USER12> Would love to integrate and work on this

</comment><comment><USER13> So if I understand the situation correctly, using this offer, we all feed the AI Google is building, thereby creating another Google monopoly situation (the AI system that gets the most training will be the strongest, thereby attracting even more users/training and becoming even stronger).

<comment><USER10> At the risk of giving a serious answer when your phrasing makes it seem like you're trolling: No. The Cloud ML service is _your_ data and _your_ model and _your_ training results (except as required for google computers to touch it to train it and store it - but the results of that training are _yours_.)

The same question was asked earlier of the Vision API, with the same answer: [https://news.ycombinator.com/item?id=11128444](https://news.ycombinator.com/item?id=11128444)

At a high level, you can think of it as having mostly the same properties as if you rented a bunch of GCE machines (or AWS machines) and ran TensorFlow on them, with your data stored in GCS (or S3 or whatever). The difference is that Cloud ML handles the scaling pain for you -- managing the machines, starting and keeping tasks running, load balancing, etc.

(disclaimer: I'm working on TensorFlow, not Cloud ML.)</comment></comment>


CoThings is a realtime counter for shared things - <AUTHOR> I've started an open source project that helps us to avoid crowded areas if you live in a community, like a shared house or guest house, during COVID-19 pandemic.
It accounts for current number of people using shared areas or utilities in realtime. It uses Elixir + Phoenix's Socket for realtime communication.
Currently there's an only a web app and you need to update the counter manually. However, there's our iOS application that we're developing (and needs more contributors) to connect beacons and count the room usages automatically. https://github.com/rainlab-inc/cothings-ios
Project's website: https://cothings.app
GitHub Repos:
- https://github.com/rainlab-inc/cothings
- https://github.com/rainlab-inc/cothings-ios
- https://github.com/rainlab-inc/cothings-design
- https://github.com/rainlab-inc/cothings-website
Any contributions or feedbacks are welcome!
Thank you all! <comment><AUTHOR> now we have a demo web application. Check it out!

[https://cothings.app/demo/](https://cothings.app/demo/)

Thanks!

</comment><comment><AUTHOR> you can join our IRC channel on freenode.net #cothings</comment>


Guess what The PirateBay is down - <AUTHOR> http://thepiratebay.org

<comment><USER2> Now it is "The Promo Bay".</comment>


What Intuit knows about its users - <AUTHOR> https://www.axios.com/what-intuit-knows-about-you-d4ea9f53-c116-48e1-948f-e204c3767b54.html <comment><USER2> And if you use an accountant instead, what software does your accountant use, and does the publisher of that software claim rights to exploit your financial information?

(I've been buying the TurboTax personal and small business edition for a few years, on CD-ROM. I've had a protocol with a KVM virtual machine on Linux, in which the image is loaded into a new Windows 7 image, TurboTax installed and updated over the network, and then that image booted without network, and never again connected to the network, before I load last returns' data, and begin entering data for the new return. My sense is that this is probably not sustainable, and, any year, Intuit can make it so that you have to give them rights to your data if you want to prepare your tax return. A couple years ago, I implemented the entire federal form 1040 and some schedules as Scheme code, as an experiment, and it was a huge headache, but doable, for a startup. It seems like an unpleasant/disreputable business to be in, especially if companies are lobbying politicians to make the US tax return process a huge burden, so that people will buy their software/service. And perhaps share their private financial information.)

<comment><USER3> there is "Open Tax Solver" for US tax returns now, but it's written in C instead of FP, and the code quality is terrible even for C. off the top of my head, two of the biggest problems were huge arrays instead of structs and horribly inconsistent indentation.

<comment><USER4> It doesn't open any network connections or need any data from anything other than the XML files provided by the author.

I get that bad code is annoying if you want to modify it but I don't see how that's a real complaint here.

<comment><USER3> as a prospective user, bad code makes me skeptical of the computation accuracy.

</comment></comment></comment></comment><comment><USER5> Or, you know, have your federal government implement self-filing online which covers 80% of the population.

Tragedy of the Commons at its finest.

<comment><USER6> I don't know man, the redesigned 1040 forms are pretty easy to fill out:

[https://www.irs.gov/pub/irs-pdf/f1040.pdf](https://www.irs.gov/pub/irs- pdf/f1040.pdf)

<comment><USER7> Serious question from a non-American. Do you actually have to fill that out as part of doing your tax return?

<comment><USER8> That's the bare minimum you'll have to fill out. If you have investment accounts, you tack on more forms. If you have an inheritance, there's more paperwork. If you withdraw from your retirement accounts, you could have more.

<comment><USER9> not to mention filing state returns

<comment><USER7> WTF? I honestly had no idea that state returns were a thing.

</comment></comment></comment></comment></comment></comment><comment><USER10> This is why I wrote free, open-source budgeting software. All of the source is available on Github, and it is available on all OS-es.

[https://github.com/reZach/my-budget](https://github.com/reZach/my-budget)

I'm tired of people being sneaky and selling all of our information and making billions off of us. Of course, we let them, but only because it's very confusing reading (and understanding) all the legal jargon.

(FYI - I'm actively developing this software, so if you have comments or wants, let me know and I can see if I can make it happen for you. Thanks friends of HackerNews).

</comment><comment><USER11> Mining user data on Mint seems relatively understandable as Mint is free service. However, why bother do the same on TurboTax? TurboTax sells $60-$150 per copy per year, it has 31 million users in 2016, that's about $3B annual revenue. Isn't that profitable enough?

<comment><USER12> People always want more man

<comment><USER13> _People always want more_

Automated stock trading platforms operated by massive Wall Street investment banks always want more.

</comment></comment></comment><comment><USER14> Is there anything like a self-hosted alternative to Mint? The automated balance and expense tracking is really nice but it's obviously a security and privacy nightmare.

<comment><USER10> As the author of a free open-source budgeting software, you yourself own all your data, nothing goes off your computer. Of course it's not as fully-fleshed out as Mint yet, but it's getting better every commit:

[https://github.com/reZach/my-budget](https://github.com/reZach/my-budget)

<comment><USER15> The GP expressly mentioned the only selling point of Mint: "automated balance and expense tracking," Mint imports data automatically without any user action. Unless your software does this, your audience will be extremely limited.

Budgeting software has been ubiquitous since the dawn of personal computing, that's a solved problem.

<comment><USER10> There's support for this, but it's limited at the moment. Getting OFX supported is a priority of mine (in the meantime, it uses screen scraping to pull transaction data).

</comment></comment></comment></comment><comment><USER16> I love Mint but wow do they have more data on me than Google and Amazon combined.

I used to think that selling me credit cards is fine but now I'm sure my analytics are sold every which way.

</comment><comment><USER17> I used TurboTax for Windows for the first time this year to do my taxes. Since I don't trust them as a company, I set firewall rules to block all internet access to the program and all its other helper programs. It refused to run until I connected to the internet update it. So I let it connect and update and then blocked it again before starting to enter my data. I got everything entered and then tried to output the tax return for printing but it wouldn't let me finalize everything until I connected it back to the internet to do another update. Why even bother buying locally-run software if it requires an active connection to the internet? Very frustrating experience all around.

(Also it's super crappy software besides, I would not recommend it even if you get it for free. And even after you buy it, they upcharge you at the last second so be ready to pay more than expected. It's the Comcast of tax software.)

<comment><USER15> If you don't trust TurboTax as a company why did you use their software? It's not like they are the only tax prep software in existence.

</comment></comment><comment><USER18> I wonder if Mint is GDPR compliant? I am an EU citizen with an American bank account that's linked to Mint

<comment><USER19> A quick look at their privacy docs tells me there's no chance they're GDPR compliant. They use the phrase "comply with all applicable regulations" liberally (instead of saying they "comply with GDPR") which I suspect means they've taken the position that for one reason or another GDPR is not an applicable regulation. I suspect any plans to become GDPR compliant will be implemented as slowly as they can manage to get away with.

</comment></comment><comment><USER20> I hope mass users/customers of such applications start caring about things like GDPR compliance

<comment><USER21> GDPR doesn't apply to US citizens in the US, and I think no other country has a tax-filing software lobby that successfully keeps filing taxes as difficult as possible.

<comment><USER22> Speaking from a german perspective (who has lived and taxed in the US as well), let me point out to you that US tax forms are a piece of cake to fill compared to the djungle we have here.

<comment><USER23> Agreed.</comment></comment></comment></comment>


Vatican urges action on climate change - <AUTHOR> http://www.bbc.co.uk/news/science-environment-32487874

<comment><AUTHOR> Whatever your views on Christianity and the Catholic Church, if the official position of the Vatican becomes that Christians have a responsibility to protect the climate, then a huge number of people worldwide should start to take this more seriously.

Although as the article says: "Whether it will prove persuasive for American Republican lawmakers - around a third of whom are Catholic - is yet to be seen."

The actual statement is here: [http://www.casinapioiv.va/content/accademia/en/events/2014/s...](http://www.casinapioiv.va/content/accademia/en/events/2014/sustainable/statement.html)

Alternative article: [http://www.nytimes.com/2015/04/28/world/europe/pope- francis-...](http://www.nytimes.com/2015/04/28/world/europe/pope-francis- steps-up-campaign-on-climate-change-to-conservatives-alarm.html)

<comment><USER2> People are good disconnecting from what they ought to do, even in the face of their religious leaders.

Made men in the Mafia don't care about the church's teachings about murder. The catholics in Northern Ireland didn't, either.

American politicians defend the death penalty against the Pope speaking out against it (although in this case you can claim that "Render unto Caesar" is a valid rebuttal).

So don't hold your breath.</comment></comment>


Where's WALL-E, or damn, that's a lot of robots - <AUTHOR> http://i.imgur.com/U1GU1.jpg

<comment><USER2> A better game is to think of as many sci-fi tv shows and movies as possible and find those robots in there. Any self-respecting geek can find the Dalek, but where's the DRD from Farscape?</comment>


Ask HN: How can I use Computer Vision to track number of people entering a room? - <AUTHOR> <comment><USER2> A simple approach would be to use OpenCV and use something like Haar Cascades to detect the number of faces entering (assuming they are always visible). Or try experimenting with convolutional neural networks.

<comment><AUTHOR> I played around with OpenCV a lot in 2011. Just wondering what is the current playing field like in 2017.

<comment><USER3> If you have some more specifics (and maybe a few frames from example video) I could probably suggest a few simple approaches to try out. I do think a simple head-counter is probably not a bad approximation (assuming you don't need to know exactly how many people). Feel free to hit me up by email (in my profile).</comment></comment></comment>


Scientists Are Just Starting to Understand Earth's Eighth Continent, Zealandia - <AUTHOR> http://www.atlasobscura.com/articles/zealandia-continent-expedition-new-zealand-cores-tectonics <comment><USER2> Several commenters on _semantics_ in this thread (e.g., [https://news.ycombinator.com/item?id=15473604](https://news.ycombinator.com/item?id=15473604) , [https://news.ycombinator.com/item?id=15473705](https://news.ycombinator.com/item?id=15473705) , [https://news.ycombinator.com/item?id=15473402](https://news.ycombinator.com/item?id=15473402) ) seem to be missing the key empirical fact: that the Earth's crust comes in two distinct types: oceanic crust ([https://en.wikipedia.org/wiki/Oceanic_crust](https://en.wikipedia.org/wiki/Oceanic_crust)) and continental crust ([https://en.wikipedia.org/wiki/Continental_crust](https://en.wikipedia.org/wiki/Continental_crust)). More specifically, the distribution of crust density (and other properties) is _bimodal_ due to being caused by distinct formation processes. The presence/lack of ocean water on top of a location on Earth is a consequence, not cause, of the crust type. This is why the continents are clearly visible on the Earth's topographical map without water. Otherwise, you'd expect the visible shape of the continental land masses to be highly dependent on the exact waterline, which is mostly not the case.

So sure, popular media is often framed around silly terminology changes, but this does not mean that calling Zealandia a continent fails to have real empirical meaning, or detract from the fact that Zealandia _is_ unusual in being continental crust largely covered by water. Likewise, removing Pluto from the list of planets reflected the empirical fact that Pluto is qualitatively different than the other planets, and qualitatively similar to the other dwarf planets.

<comment><USER3> I think most of the semantic objections to the article's title are about it being earth's _eighth_ continent, rather than earth's eighth _continent_. If you're going by the tectonic plate definition, Eurasia is one continent (there's no distinct plate boundary between them), while India, Somalia, Arabia, Madagascar, the African Great Lakes, and much of Southeast Asia are all distinct continents.

<comment><USER4> I think the criterion is " _mostly_ contiguous region of continental crust", in which case the separation between Africa and Asia _might_ separate them, and the separation between the Americas similarly _might_ ; according to purely topological definitions there are precisely four continents (Americas, Eurasia/Africa, Australia, Antarctica and maybe Greenland). Tectonic plates don't correspond to very much from a geographic perspective -- Baja California would become _two_ new continents, one of which groups it with the South Island of New Zealand.

<comment><USER5> The continental distinctions as they are is pretty much geopolitics. There's no passable land route between North and South America, because the connection is through thick jungle. Similarly, pretty much nobody wants to go through the Ural mountains to go overland from Europe to Asia. Since little overland commerce or credible overland invasion routes exist between continents, they can be thought of mostly independently.

<comment><USER6> Why pass through Ural mountains when you could just pass through a bridge?

</comment></comment></comment></comment></comment><comment><USER7> As I've grown older, I've come to find peace in letting go of semantics. Is it a dwarf planet, or is it a planet? I'm content simply pointing at the things that I recognize and saying, "There is that thing. Whatever the kids / scientists are calling it these days. I know a lot about that thing, but perhaps not it's name."

<comment><USER8> Or as Feynman put it, Names Don't Constitute Knowledge: [https://youtu.be/lFIYKmos3-s](https://youtu.be/lFIYKmos3-s)

</comment></comment><comment><USER9> 8 continents? I guess that's Europe, Asia, Africa, North America, South America, Australia, Antarctica, and Zealandia.

But I see:

* 1 mega-continent, i.e. Eurasia, which has sub-continents Europe and India tacked on

* 3 normal continents, i.e. Africa, North America, South America

* 3 "dwarf" continents, i.e. Australia, Antarctica, Zealandia

Not only are those 3 dwarf continents far smaller than the others, but one's covered with sand, another with ice, and the other with water.

<comment><USER10> If we're talking geology, then we might as well look at the tectonic plates [0][1].

\- 14 or 15 major plates

\- 38 small plates

Yet people will talk about 5-7 continents all the time.

Because people will be confused no matter which ill-defined definition is used, I'm switching to the botanical one [2] with 9. It seems to at least have some practical value.

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

[1] [http://peterbird.name/publications/2003_PB2002/2003_PB2002.h...](http://peterbird.name/publications/2003_PB2002/2003_PB2002.htm)

[2] [https://en.wikipedia.org/wiki/Continent#Botanical_continents](https://en.wikipedia.org/wiki/Continent#Botanical_continents)

<comment><USER11> I presume a lot of those plates are ignored because they're entirely underwater.

<comment><USER12> If you leave the underwater parts out, you get a reasonable amount of continents. Sure Arabia and India would confuse people a bit, but besides them it seems to map well to what people expect.

</comment></comment></comment></comment><comment><USER13> It seems like tectonic plates are less arbitrarily defined than continents.

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

</comment><comment><USER14> Nothing like discovering a new continental shelf when an underwater mining gold rush is about to start.

</comment><comment><USER15> All the semantic arguments here would disappear if we all simply recognized the "set of continents" for what it really is: a set-valued sheaf on some parameter space ([https://xorshammer.com/2016/07/24/the-cgp-grey-topos-of- cont...](https://xorshammer.com/2016/07/24/the-cgp-grey-topos-of- continents/)).

</comment><comment><USER16> Zealandia, while interesting in many ways, doesn't come close to meeting my definition of a continent. I wish they would stop calling it that.

<comment><USER17> Well, plate tectonics is what, a 70 year old theory, at best? In the 1950's, it wasn't generally believed that continents _moved_.

So, I think the definition of what is, and what is not a continent is generally... fluid at this point.

See also: definition of a planet. How can you define what a planet is, if you keep discovering new ones, that don't quite fit the old definition? Pluto was "discovered" < 100 years ago.

I remember being taught in school that there was only three kingdoms of life!

Science! It changes. And that's a good thing.

<comment><USER16> Sure, the definition of a continent is somewhat subjective and subject to change, but in my personal opinion, continents are large land masses. Zealandia fails on two counts:

a) It is much too small. b) It is underwater.

The fact that it was at one time above sea level is not particularly relevant in this discussion. Much of the Mojave desert used to be underwater. Does that mean it is currently a sea?

<comment><USER18> > in my personal opinion, continents are large land masses

The point is that your personal opinion is badly formed. Your definition of a continent is almost completely useless, which is obvious when you just look at a map. How large is "large"? Is Greenland its own continent? How do you classify Indonesia?

The new definition at least makes sense. It updates the word's meaning to reflect a more scientifically literate understanding of continent formation.

<comment><USER16> There is a new definition? Pushing Zealandia as a continent is mostly just the opinion of one group of researchers. Granted their opinion may be more valid than mine in this matter, I don't see that there is yet a general consensus that I'm fighting against.

You are right, of course, that the term is poorly defined and not very useful. It is defined mostly by convention and somewhat inconsistently. I don't believe that Greenland is generally considered to be a continent by anyone nor any of the islands in Indonesia. In my mind, even Australia is borderline, but it is generally considered to be a continent. Anyway, my point was that Zealandia is so far outside the conventional definition of a continent that it is not useful to call it that. I realize not everyone will agree with me, and I would be less annoyed if people were to refer to it as "A submerged continent" rather than "THE eighth continent."

All that said, I've spent far more words on the subject than it is worth; I really don't care as much as it probably appears. I'm really only taking issue with your assertion that my _" personal opinion is badly formed."_

<comment><USER18> Yeah, same, I don't really care either. What actually bothers me is the concept that your personal opinion is a sufficient justification for perpetuating the status quo, regardless of the rigor of reasoning behind the proposal for the redefinition.

I like your second comment a lot better. I agree that calling it a submerged continent is much better than just calling it a continent.

</comment></comment></comment></comment></comment></comment><comment><USER19> Wow, it really is a lost continent, like Mu, or Hyrule from _Wind Waker_.

As I keep saying, the world is a strange and pretty awesome place.

</comment><comment><USER20> This is quite the extraordinary discovery.

</comment><comment><USER21> So we now have 8 continents and 8 planets? Just making sure my scientific knowledge is up-to-date.

<comment><USER22> It's not clear to me that there is a rigorous definition of "continent", since different cultures enumerate them differently.

For example, in the US, North America and South America are counted separately, whereas in many cultures "America" is one continent (and, a related issue is that many people in Latin America would consider the US and Canada and NOT Mexico as part of "North America"). Also in some cultures Europe and Asia are separate, and in some they are one continent.

<comment><USER23> When this first cropped up, I asked a few geologists and not even they know what a continent is. As near as I could tell, they preferred we stop using the term.

</comment></comment></comment><comment><USER24> Granted, the definition of "continent" is not rigorous, and depending on where you grew up in the world, you might have learned there are 5-7 "continents."

</comment><comment><USER25> Here I thought it was the Island of Sealand...</comment>


Google's self-driving car crash is a positive sign - <AUTHOR> http://ideas.4brad.com/googles-crash-very-positive-sign <comment><USER2> Being from India, Let me say that it will take huge advancements in AI before self-driving cars could drive on the streets here!

These advances would need to include :-

-Being able to decide what can be considered a road and what cannot.

-Knowledge of Human psychology which additionally needs to cover areas of suicide , homicide, etc.

-Knowledge of Animal psychology

-Understanding of different cultural norms both for humans and animals (I have found that the cows in Bangalore are much less likely to yield way than the cows in Kerala)

<comment><USER3> Comment of the year!

</comment></comment><comment><USER4> > A lot of people I talk to imagine that the tech problems have all been > solved and all that's left is getting legal and public acceptance. There is > great progress being made, but nobody should expect these cars to be perfect > today. That's why they run with safety drivers, and did even before the law > demanded it. This time the safety driver also decided the bus would yield > and so let the car try its merge. But expect more of this as time goes > forward.

I think most people who say the issues are social and legal don't think the technical problems are solved, they just think that we are inexorably progressing towards solving them at a more rapid rate than the social and legal problems.

</comment><comment><USER5> 1) i thought this meant stock crash, but it refers to the bus / automated SUV crash from 2/29/2016

2) Has anyone made an animated depiction of the crash, I'm curious if I have in my head the right idea about what actually happened

<comment><USER6> > Has anyone made an animated depiction of the crash

Was this a test-vehicle of Google? In that case, it probably had lots of cameras on board.

<comment><USER7> Yes, it was an autonomous vehicle (with a "test driver" in the car)…there are more details on [http://www.engadget.com/2016/02/29/google-self-driving- car-a...](http://www.engadget.com/2016/02/29/google-self-driving-car- accident/)

What I find interesting is this comment: _Our test driver, who had been watching the bus in the mirror, also expected the bus to slow or stop._

</comment></comment></comment><comment><USER8> The article mentions that the robocar can theoretically see other drivers intent: <i>It's worth noting that sometimes humans solve this problem by making eye contact, to know if the other car has seen you. Turns out that robots can do that as well, because the human eye flashes brightly in the red and infrared when looking directly at you — the "red eye" effect of small flash cameras.</i> But what about the other way? Perhaps the bus driver couldn't see Goog's flashing eyes, and assumed therefore it wouldn't attempt to merge back in.

</comment><comment> FLUX-YOU I'm wondering why there were enough sandbags around a storm drain to warrant the vehicle moving back into the left lane and not any indication before hand. The autonomous vehicle would know when a lane is blocked because of cones, right?

<comment><USER9> My understanding is that the car didn't change lanes. It was in the right lane the whole time,just hugging the curb. A bus (in the same lane) tried to pass, and hit the Google car when it got more centered in the right lane.

</comment></comment><comment><USER10> I'm glad that nobody was hurt. It takes some of the emotion about getting to the fixes.

<comment><USER11> And it's still hard to argue with the fact that out of several million miles driven, this is the first serious accident that was caused by the autonomous car (and the failure scenario looks to have been appreciably complex). You won't find a human with that clean of a record.

<comment><USER12> _You won 't find a human with that clean of a record._

Some number of us humans are better than that. In addition to my father who's in his early '80s who's lived almost all his life in Missouri, where driving instead of flying to other places is generally ideal, try this search: [https://www.google.com/search?q=truck+driver+million+mile+cl...](https://www.google.com/search?q=truck+driver+million+mile+club)

<comment><USER13> Humans only drive about 500K miles in a lifetime, though there are those who drive much more. 2 million miles would be a challenge in any human lifetime, but there would be some professional drivers which attain that.</comment></comment></comment></comment>


What the Sun Looks Like from Other Planets - <AUTHOR> http://www.huffingtonpost.com/entry/what-the-sun-looks-like-from-other-planets_us_577ec142e4b0344d514e9182 <comment><USER2> This seems wrong. The planets atmosphere should affect the coloring of the Suns hue. Size is only 1 variable...</comment>


Show HN: AskHN Digest – weekly recap of the best threads, including top comments - <AUTHOR> https://askhndigest.com/ <comment><AUTHOR> Hi! Creator here. I made this for myself to not miss any great discussion of the Ask section. After sharing it with several colleagues and friends, they also found it quite useful, so I hope it can benefit some of you too.</comment>


A lighter Core - <AUTHOR> https://blogs.janestreet.com/a-lighter-core/

<comment><USER2> For those unaware: Jane Street is probably one of the largest OCaml houses around, and probably one of the most successful algorithmic or high-frequency trading houses in the market.

The people who work there are very good at making money using software. :-)</comment>


The garage rocket revolution - mkr-hn http://bitoflife.mkronline.com/2011/10/10/the-garage-rocket-revolution/

<comment><AUTHOR> I'm almost with him on this: it looks like the amateur rocket folks are getting performance like von Braun and company were getting in 1939, but they have better electronics.

My thought is that any better performance will cause them to start to run afoul of various 3-letter agencies. Any better guidance systems will cause the US government to suppress them fairly quickly, as they'll be intruding on (1) the defence contractor's monopoly on flying fast, and (2) the government monopoly on shooting down flying things.

<comment> mkr-hn A lot of these efforts are getting funding straight from the government or companies that get substantial government funding. I think private and public interests are on the same page for once.

</comment></comment><comment><USER2> The article is pretty light on details but I can see the analogy being drawn between home-built computers and home-built rockets. Doesn't all technology eventually become commonplace? We lament the state of education, but look at the expanded amount of information that must be learned. What an amazing machine.

<comment> mkr-hn The trajectory of education seems to be that hard subjects become basic as we get better at teaching them. Especially as applications in technology make them easier to understand. A lot of stuff we call basic math today used to be the pinnacle of mathematics.

It's a running gag in the various Star Trek series that people learn how to build warp drives (and other very advanced things) in high school.

Paraphrasing a time travel episode: "in my time [the future] there's a [technobabble] in every desk."</comment></comment>