In defense of <canvas> - <AUTHOR> http://www.holovaty.com/writing/in-defense-of-canvas/ <comment><USER8> I've done a large amount of canvas work over the past years, especially work with improving canvas performance (one of the articles on my site is linked-to by this article). What follows is fairly self-promotional, but relevant to the topic if you're interested in canvas performance.

I've been compiling canvas performance tips for two years now, and have a full-color (syntax highlighting and images) book coming out very soon[1] with its own Canvas performance chapter at about ~40 pages. The book has about ~200 pages total of Canvas tips, oddities and tutorials. These aren't fluff, I don't take pages and pages to re-implement stuff like gravity for a game example. I tried to keep it pertinent and pure.

If you're interested in Canvas, please give it a look[1]. The book will be out in June or July.

And if you're interested in getting help for Canvas, come to StackOverflow! Back when I had free time, if you asked a question on SO about canvas there was a +10% chance that I was the one who answered it. I've been too busy to participate in the last year, but I'm just beginning to come into some free time again these days, and there are several other wonderful people who also hound the canvas tag.

Also, if you're looking for live help with Canvas issues, give the StackOverflow JavaScript room a try[2]. They're very friendly if you are, and always love interesting (read: not jQuery) questions.

[1] <http://www.amazon.com/dp/0672336278/>

[2] <http://chat.stackoverflow.com/rooms/17/javascript>

<comment><USER9> Will you release an ebook? It seems interesting and I would pay paperback price for an ebook with no DRM.

I got a lot of technical books and they're a PITA to read and store as they are usually pretty big.

EDIT: Went back to the Amazon link and "Paperback: 700 pages", woah.

<comment><USER8> It's up to the publisher to do that, I know that there will be a kindle edition, but am not certain of any other formats. I imagine all of them will be DRM'd, sorry.

In the near future I will also have a performance chapter in a different book (written quite differently, and expecting more JS knowledge), but that title hasn't been announced yet. That text _will_ have a DRM-free ebook for it, but you'll have to wait a lot longer.

Lastly I'll have learncanvas.com up at some point this summer, where I will begin posting a lot of canvas performance tips with live examples, among other things.

(The page count surprised me too. This is my first book, and it's been quite the overwhelming experience!)

<comment><USER10> <http://www.informit.com/store/html5-unleashed-9780672336270>

Informit sells PDF, mobi and epub versions of all Pearson books. They print "From the library of Your Name" as a footer on every page but there's no additional copy protection as far as I know.

<comment><USER11> Thanks for sharing this link. For e-books I find PDF a superior format, as it maintains the original design and layout of the book best, while still having all the advantages of an e-book, searchable, etc. Appreciate that informit.com has that option.

</comment></comment></comment></comment></comment><comment><USER12> For me learning to use canvas was easy. But I had learned graphics programming when I was a kid messing with SCREEN 13 in QBasic. And a lot of the lessons I picked up then, apply to canvas today.

I found canvas is actually a lot faster than I expected. I made a little graphical Roguelike that was drawing hundreds of sprites at 30fps in all modern browsers easily even on my iPhone (some browsers on some systems are able to maintain 60fps or higher.)

There's certainly plenty of reasons to make native apps. But I was pleasantly surprised by canvas performance, personally.

<comment><USER13> > For me learning to use canvas was easy. But I had learned graphics > programming when I was a kid messing with SCREEN 13 in QBasic. And a lot of > the lessons I picked up then, apply to canvas today.

Funny that you mention it, the canvas drawing api seems to be inspired by the QBasic-style drawing apis of the 1980s. Unfortunately, computers have moved on since then and these days we have dedicated silicon for drawing and the "immediate mode" way of drawing things became obsolete.

> I found canvas is actually a lot faster than I expected. I made a little > graphical Roguelike that was drawing hundreds of sprites at 30fps in all > modern browsers easily even on my iPhone (some browsers on some systems are > able to maintain 60fps or higher.)

This is not fast. A typical smartphone these days can do thousands of textured 3d models at 60 fps. Hundreds of sprites is next to nothing on modern standards.

It seems like <canvas> was designed for simplicity, to make it really easy to a few draw lines, boxes and ellipses at the cost of performance.

</comment></comment><comment><USER14> > _On Soundslice, we're drawing guitar-chord charts completely on the fly > (again, see an example), which is a relatively involved drawing routine -- > and it's still near-instant performance. That's across all modern browsers > (Chrome, Safari, Firefox and IE 10)._

OK, let me get this out of the way. Drawing guitar tabs on the fly is not by a long shot an "involved drawing routine".

If that's his standard for canvas performance, then sure, canvas is plenty of fast for that.

(I don't say it's not a quite complex algorithm to position and determine the guitar tabs: I say that it's not that graphically demanding to draw them. It's easier on the canvas/CPU than even the tamest of platform scrollers for example).

<comment><USER15> I agree. I'm sincerely impressed by the Soundslice application, it's really awesome how the videos move along with the tab to show how every chord is played, and the UI is fast, responsive and easy to use. That said, I'm also inclined to say this particular application simply falls beyond the threshold where UI performance becomes an issue.

</comment></comment><comment><USER16> Canvas may be pretty well optimized by now, but it's far from perfect. When I was using it a few months ago, I needed to draw into a temporary context then draw the result into the main canvas, because of unusual composite operations. This worked well on most browsers, but Safari incurred a massive slowdown which, according to Instruments, was largely caused by time spent in memcpy and some sort of surface locking. I'm not sure why memcpying relatively small images on a powerful CPU was using so much time, but a more performant implementation would use render-to-texture and not do a round trip through the CPU, and whatever their implementations other browsers had no such problems. It was slow enough - just drawing a few 300x300 or so images at 60fps! - <USER2> on x86 it might well have ended up faster to just construct the frame in JS using array buffers; unfortunately, I was also trying to target Safari for iOS.

Considering that Canvas also has hard limits on what sort of effects you can implement with it, I hope WebGL is supported in Safari and IE soon.

<comment><USER17> Yeah, my experience roughly matches yours. In practice Firefox, IE and Chrome currently have very fast 'fast paths' for Canvas, but if you hit the slow path - some operation that isn't optimized - you can see a 5x performance hit, or a 50x performance hit. And because Canvas's feature set is so limited your only workaround is usually to do it in software. Composite operations are definitely not consistently optimized across browsers.

It's worse on mobile, where for some reason way less effort has gone into hardware accelerated canvas - there I think you may just be stuck using WebGL.

<comment><USER18> WebGL support on mobile is pretty rare. I think only a few browsers like Firefox mobile and Opera mobile support it.

<comment><USER19> Chrome as well. I forget if it has to be enabled in a flag / only on beta builds still, but it does work.

</comment></comment></comment></comment><comment><USER20> Should you be using canvas directly?

I'm currently writing my 3rd HTML based game, and I'm so tired of using jQuery and DOM directly, so I want to replace it with canvas. Game is a turn-based strategy, so performance is not an issue (there will be some animations, but rare).

I looked at the canvas and then at a lot of 2D libraries that can speed the development and prevent me from reinventing the wheel. I'm overwhelmed with options. From some 20+ I investigated I narrowed the list down to these:

      - <USER3>
      - <USER4>
      - <USER5>
      - <USER6>
      - <USER7>

I have no idea which one to pick. Any tips?

<comment><USER21> If you want a scene graph, have you evaluated fabric.js? It's a popular canvas library, providing mouse events, and import/export to SVG.

<comment><USER22> The browser already has a scene graph library, it's called the DOM.

</comment></comment></comment><comment><USER23> The major problem with the <canvas> vs WebGL is excessive amounts of draw calls. You can't create ship a display list/vertex buffer, and so there's a ton of JS->Native Browser binding calls. They've recently changed this with CanvasRenderingContext2D version 2(adding Path objects). None-the-less, right now, it's much faster to use WebGL and layer over a 2d canvas for text or curves.

</comment><comment><USER24> I really like this Soundslice canvas app. Why didn't Soundslice use Scalable Vector Graphics? CSS Animations would replace a whole heap of code: the entire requestAnimationFrame callback, for example, would be eliminated. Text rendering would be handled by the browser, instead of taking the performance hit of being rendered to the canvas bitmap every frame, so text rendering caching would not be necessary. Element stacking would be handled by the browser's built-in compositor. You wouldn't have to think about crazy microoptimizations like grouping fillStyles together. SVG can easily be accelerated by the browser, since you're describing intent instead of specific procedures, unlike Canvas' immediate mode drawing. Finally, vector graphics aren't locked to 72dpi, so they look amazing on a MacBook Pro Retina or other device with high DPI (unlike the canvas implementation, which looks pretty chunky!)

<comment><AUTHOR> Hey -- I didn't spend much time exploring SVG, to be honest. It could very well be faster!

And you're right that it would be much better on retina screens. I've had it on my to-do list to make the canvas implementation take the device pixel ratio into account, but it hasn't been a huge priority.

<comment><USER25> Here's a little demo I whipped up with just the play head (hover-glow, dragging, and animation).

<http://github.johntantalo.com/soundslice-svg/>

</comment></comment></comment><comment><USER26> These seem like the same sorts of guidelines you want to follow when writing native apps too. It seems fair to treat a <canvas> element like a CALayer.

<comment><USER27> There's actually a pretty deep connection there. In Firefox, a canvas typically becomes a separate CanvasLayer in the layers stack. The layers implementation in Firefox is very similar to Core Animation—they're composited together using OpenGL (or Direct3D on Windows), animations can happen on the layer tree, scrolling is performed on the layer tree, and so on.

</comment></comment><comment><USER28> So, all these tip's I've seen focus on improving canvas performance by somehow splitting the drawing into small pieces .. but what if one is working on a drawing app that absolutely needs to redraw a large area most of the time, think sizes like 800x600 or 1024x768.

Any good tips to optimize this kind of use-case ? I am developing an online Geometry Generator (<http://GeoKone.NET>) that uses a large canvas that is redrawing complex geometry, with paths that almost always change completely when being modified, thus invalidating the "render to image" option almost in all cases, except maybe when moving the formations around.

Good tips though and nice to read about people's experience. Too bad I am using Processing.js so I am kinda stuck with the optimizations Processing.js is using.

</comment><comment><USER29> A few years ago, my friend Austin Sarner and I were writing a user friendly content publishing system in Objective-J. We designed a majority of the controls and UI components using canvas and found it incredibly fast when the proper caching techniques were used.

One of the components of the application I worked on was a text editor that resembled Apple's Pages software. The text editor was implemented entirely in canvas and would wrap live in response objects intersecting the text. Redrawing the text live was slow but we ended up finding a solution. We cached bitmaps of the characters, lines and paragraphs and only re-rendered areas of the canvas that changed.

The code was open sourced and put on GitHub, if anyone is interested:

[https://github.com/austinsarner/Frappuccino/tree/master/Frap...](https://github.com/austinsarner/Frappuccino/tree/master/FrappKit)

P.S. There's also a really fast iPhoto-style media browser in the repository that is implemented in canvas. It uses image caching techniques for animation.

</comment><comment><USER30> I too have developed a pretty "serious" Canvas application that people actually use on a large scale, <http://www.luckyvoice.com/sing>

While I agree with your suggestions (caching is absolutely a must, as is batched rendering etc), but I think the real issue is the lack of good-quality canvas _libraries_ that have the kind of breadth of functionality that their native counterparts have have. All of these "performance hacks" are certainly not unique to canvas, but what is is unique is the developer (user of these APIs) having to care about them. They should be abstracted away.

Libraries like Paper.js (which I've used and extended a lot) and EaselJS are bridging the gap, but they aren't there yet — either because they aren't feature-complete in the way that they need to be, they're buggy, and/or they don't seem to be getting enough community development (or in some cases, want it).

</comment><comment><USER31> Canvas may need a lot of sweat to get some performance [1] but there is something it does really well. What strikes me is the lovely API. It just great to use it for charts, procedural UIs, etc... and it also somewhat work with games.

[1] <http://www.gamesfrommars.fr/demojsv2>

<comment><USER32> Really? I thought the API was pretty silly compared to for example Flash Drawing API. Why doesn't it have circle(x,y,radius) for example?

<comment><USER19> because that's better suited for a library?

</comment></comment></comment><comment><USER33> If you are doing a lot of canvas drawing, you should really check out WebCode (<http://www.webcodeapp.com/>). It's a drawing app that automatically writes the canvas JavaScript code for you.

</comment><comment><USER34> I've found canvas to be more than powerful enough for my 2d game <http://www.towerstorm.com> even with hundreds of animated minions and thousand of bullets moving across the screen. I'm using the impactjs engine which has made things easier as it has a few of these tweaks built in.

Multiple canvas layers is an awesome idea, as things such as the game background never change so it's a waste re-rendering it every frame. will try it out soon and see how it goes.

</comment><comment><USER35> re: canvas stacking, check out <http://kineticjs.com/>

<comment><USER36> Funny how few canvas libs use stacking of interaction layers. Obviously the slowest part is redrawing quickly for a drag/hover operation. Only one charting example that I know of (CytoscapeWeb) drops the interaction elements to an otherwise empty canvas for the interaction to minimize the redraws needed, and then brings them back when done.

Most just seem to render everything, all the time, in the same canvas element and pray that browsers keep getting more optimized. Funny.

<comment><USER17> There are problems with stacking multiple canvas elements, of course - increased memory usage and significantly increased composition overhead to name two.

</comment></comment></comment><comment><USER37> the soundslice example might be a bit flawed. It's fast for a canvas app but not even close to "native magic" on my pc using chrome.

I feel like some sort of html luddite, but am I the only one who preferred flash/actionscript3 to canvas/javascript? I get that the web should be open, but beyond the idealism the flash drawing tools were much better. I feel that the criticisms currently levied against flash will come up again with html/js/canvas/svg as apps get more complex.

<comment><AUTHOR> Hey, thanks for the feedback! What were you doing with Soundslice when it felt slow -- were you zoomed out (such that there were a ton of annotations visible on the page)? Or was it just slow in general, even when it was zoomed in?

<comment><USER37> it's quite fast actually, I'm very impressed. I think what I was trying to say is that it doesn't feel native at times, but it's difficult to articulate why. Maybe I'm just conditioned to use webapps differently, and pick up on cues like slightly lagging cursors and such.

<comment><AUTHOR> Ahh, cool -- got it. Thanks!

</comment></comment></comment></comment><comment><USER38> My guess is that most people who hit a performance wall with canvas are using overly complex vector graphics and not caching bitmaps as often as they could. While things like OpenVG are on the horizon, vector drawing is still a CPU- bound activity most of the time, while bitmap blitting is all GPU. This is the case whether you're using canvas or a native graphics library.

</comment><comment><USER39> Well, I loaded the Super Mario Bros Soundslice, set it to scrolling, hit play, then put on my ear defenders as the MBP tried to commit fan-suicide. Maybe it's just a Firefoxism but normally only Flash makes the fans go that hard...

</comment><comment><USER40> The only thing slow about Canvas I've found is when the canvas area needs to be resized : i.e. canvas.height or canvas.width changes. Drawing itself hasnt been an issue for me.

<comment><USER41> Try changing fonts often on Firefox. That's ludicrously slow. To the point where anyone doing lots of text on a canvas that might need to support Firefox will need to take special measures to get decent performance (caching, lots of caching, and ordering updates to minimize font changes)

</comment></comment><comment><USER42> canvas is incredibly fast. I think its 100% capable for anythign except 3d games.

<comment><USER43> You do realize that you can get a 2D and a 3D context from a canvas element, right?

<comment><USER42> yes, but WebGL seems to be a better solution for 3d. It actually renders into a canvas element, but its does enjoy the same cross-browser support that canvas currently has.</comment></comment></comment>


Zero overhead deterministic failure: A unified mechanism for C and C++ [pdf] - <AUTHOR> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2289.pdf <comment><USER2> I opened the document and immediately searched for "Sutter" to see how this interacts with Herbceptions. It turns out, nicely. Well done!

That said, the rationale seems a bit bogus to me:

> The C calling convention has the caller allocate the space for the returned > value before calling a function. union { T value; E error; } takes the size > of whichever the bigger of types T or E is, which is as optimal as it can > be. However the additional discriminant in struct { union { T value; E > error; }; _Bool failed; }; could take up to eight additional bytes more than > that, or worse, depending on packing. This may not seem like much, but it is > more than optimal.

> For fails(E) returns, it is proposed for at least AArch64, ARM, x86 and x64, > that the discriminant be returned via the CPU's carry flag. This is because > compilers can often fold the setting or clearing of the CPU's carry flag > into the ordering of other operations, thus making this a zero runtime > overhead choice of discriminant.

If the ABI for returning discriminated unions is inefficient, then change the ABI. Don't add a whole new language feature and then only give that an efficient ABI.

As for the errno delaying stuff, how about adding a new function consume_errno(), which (up to "as if") reads errno and then sets it to an undefined value? Compilers would then be free not to set the real errno at all if they could prove that a setting of errno was always followed by a call to consume_errno.

I chuckled at this:

> There are two specific subcategories of C++ types which C can transport > safely:

... followed by descriptions of Rust types which are Copy, and Rust types which aren't!

The concept of being "insufficiently zero overhead" is also a good one, a bit like being a little bit pregnant.

<comment><USER3> > If the ABI for returning discriminated unions is inefficient, then change > the ABI. Don't add a whole new language feature and then only give that an > efficient ABI.

That's exactly what they did; there's nothing preventing the compiler from reusing that signalling mechanism for generic (binary) discriminated unions.

<comment><USER4> I'm not sure that's true. For ZOE, the compiler knows whether it's returning a failure or not, and thus whether to set/clear the carry flag. The callee immediately handles it so there's no need to store the carry flag. For a generic user defined union, neither of those is true; the compiler won't be able to deduce which field is active in all situations and won't be able to preserve the carry flag (even if it wasn't modified by other instructions, how would you handle 2 discriminated union variables?) so the flag needs to be stored in the union. The compiler could automatically add a flag variable and update it appropriately, but then again, that can be done today in c++ ... call it std::variant.

</comment></comment></comment><comment><USER5> Note that this seems to mean "zero extra cost over existing solutions in C", not "zero extra cost over C++ exceptions" (though I guess they try to make that argument also): C++ exceptions have no runtime cost at all unless you throw an exception (which is supposed to be rare), but when that happens the cost is unpredictable (as the required tables might never have even been loaded to RAM). This solution is fast and deterministic during an error condition, but certainly has overhead during the success path: they argue in the paper that this overhead isn't as bad as you might _expect_ \--as one might expect a pipeline stall caused by a check on "did an error occur?", which doesn't happen due to speculative execution--but the reality is it still uses at least a couple extra instructions _for every function call that can fail_ (which rapidly becomes "all function calls"). To avoid burning an extra register (or making functions return aggregates), what they are proposing is: "for at least AArch64, ARM, x86 and x64, that the discriminant be returned via the CPU's carry flag. This is because compilers can often fold the setting or clearing of the CPU's carry flag into the ordering of other operations, thus making this a zero runtime overhead choice of discriminant." (with a footnote stating "As it is a single bit being branched upon, status register update pipeline stalls should not occur."). It seems like the key part of the argument is that "Adding explicit checks for whether an exception has been thrown to the successful code path is now usually free of cost on such CPUs, _as stalls in other parts of the pipeline will block the CPU, thus leaving idle spare CPU execution units_." (and so saying "we had spare capacity before we were wasting, so now we are filling it)... I guess I would feel more comfortable with benchmarks (as I could have sworn someone did benchmarks on similar schemes a few years ago, due to Rust, and showed what I considered to be a non-trivial overhead) :/. (Also, don't CPUs normally execute other hyperthreads during those stalls? I would want to know not just "my program isn't being extra limited _if on an otherwise idle machine_ ", but have a concept of what total system impact this change would have.)

<comment><USER6> I'm no C++ expert (I'm actually just starting my first job in a few weeks using it!) but is it really true that C++ exceptions have no runtime cost at all? I thought various optimisations aren't possible to implement in the presence of exceptions; for example, a move constructor that isn't marked "noexcept" will not be used during a std::vector resize (instead it defers to the copy constructor), right? Isn't that a runtime cost?

<comment><USER7> That isn't a consequence of exceptions, it is a consequence of the fact that your move can fail and that std::vector has to maintain a sane state in the case of an error. You could write a bad::vector that just clears its contents in case of an error and it could use a throwing move just fine.

</comment></comment></comment><comment><USER8> Hmm, I am not sure what to think. I read through it, but C being able to call C++ functions and handle errors would be nice.

However, it does add things to both languages, and I generally think it's best to avoid adding things at all costs. It just makes things more complicated.

<comment><USER9> It trades false simplicity (errno) for explicit yet bounded implementation complexity, yielding a much simpler model for the programmer to actually use.

There may be a fatal flaw but at first glance I like it.

<comment><USER10> IMO the biggest advantage of this proposal is that it'd make error reporting part of the C ABI, which still is - and is likely to remain - the common base for all kinds of FFI.

<comment><USER11> Most languages will probably still do their own error reporting, so it will arguably not do very much, except make extra work for language maintainers to make their own error reporting coexist with the c type.

<comment><USER10> The point is that right now, that error reporting usually ends at the FFI boundary. But with this thing, it could be propagated _across_ the boundary, in a standard way that the other side hopefully has a meaningful projection for.

And if you cross the boundary twice (back and forth), and nothing in between handles the error, then it can even be propagated across both boundaries in a way that allows the _original_ error to be preserved or reconstituted. So you could e.g. throw Python exceptions across C++ stack frames and catch them on the other side - and C++ would correctly execute destructors etc.

</comment></comment></comment></comment></comment><comment><USER12> Definitely interesting, but the net result is a C code that lacks C's inherent simplicity. Too much declarative noise basically, and a lack of operational transparency. It basically makes C look (and feel) like it's been... erm... pollutted with C++.</comment>


Mental models - <AUTHOR> https://nesslabs.com/mental-models <comment><USER2> Using [https://web.archive.org/web/20190725120100/https://nesslabs....](https://web.archive.org/web/20190725120100/https://nesslabs.com/mental- models):

The article is a list of 30 items in the category "mental model" bracketed by some high-level opinions. Included on the list are:

\- areas of research ("game theory")

\- broad motivational factors ("incentive"

\- basic business terms ("margin of safety")

In other words, I wouldn't consider many of these things to be mental models.

Furthermore, the article offers no examples of the "great power" of mental models.

Unfortunately, this article isn't unique in mental model discussions. Most of them follow the same pattern.

To future authors: the world doesn't need yet another recapitulation of a list from Wikipedia on mental models.

Instead, try taking an item on the list and doing something surprising or unique with it.

If it seems like an anti-pattern ("tribalism"), show how useful it can be to the reader. If it's vague ("signaling theory"), give down-to-earth examples illustrating how to use its principles in daily life. If it seems like something that "mental gymnasts" would do all the time ("backward chaining"), expose its pitfalls.

Or, try to develop a good definition of the term "mental model." I see it used far too frequently with a citation to some other source. The author does this, but the quote doesn't clear up much. The definition on Wikipedia is just plain vague and may explain why these lists tend to include things that don't seem to be actual mental models but rather fields of study.

<comment><USER3> For anyone interested in mental models, I strongly recommend checking out Askeladden Capital's website ([http://www.askeladdencapital.com/](http://www.askeladdencapital.com/)). He's written something like 500k words on it.

</comment></comment><comment><USER4> Eric Weinstein wrote a good article several years ago arguing that the concept of kayfabe, taken form professional wrestling, is a great thing to have in your cognitive toolkit [https://www.edge.org/response- detail/11783](https://www.edge.org/response-detail/11783)

<comment><USER5> It's not his fault for his name, but it repeatedly frustrates me to see Eric Weinstein mentioned because every time I think the reference is to Eric Weisstein, who build the math encyclopedia. [https://en.m.wikipedia.org/wiki/Eric_W._Weisstein](https://en.m.wikipedia.org/wiki/Eric_W._Weisstein)

</comment></comment><comment><USER6> I have been working on this for a long time now. It helped me achieve small success in writing(My articles gained some attention and ended up publishing a book with packt). I am still a beginner, long way to become a good model thinker.

Here are a few books, I recommend.

1.The Great Mental Models : General Thinking Concepts (Beginner Level)

2.Super Thinking (Intermediate)

3.The Model Thinker (Intermediate-Advanced, you can also take the coursera MOOC "Model Thinking" by the same author)

I am also working on a tool to assit people in thinking with models. If anyone is interested to try out the beta, you can signup here. [https://forms.gle/xn9mESKZwUMD2y6RA](https://forms.gle/xn9mESKZwUMD2y6RA) I am hoping to release it next week.

Here are a few screenshots of the tool I am building. (Note: It's in MVP stage, not a finished product)

[https://imgur.com/Jzxw4uz](https://imgur.com/Jzxw4uz)

[https://imgur.com/XhiVJQM](https://imgur.com/XhiVJQM)

</comment><comment><USER7> The site looks like it's having a bad day right now, but in line with the subject I recently picked up "Super Thinking: The Big Book of Mental Models" [0] by Gabriel Weinberg of DuckDuckGo. Fantastic read on the topic. The audiobook is good as well, but if you go that route make sure you grab the illustration PDF as it's got some entertaining memes that go along with the topical areas.

[0] [https://www.goodreads.com/book/show/41181911-super- thinking](https://www.goodreads.com/book/show/41181911-super-thinking)

<comment><USER8> Were some of the models new to you? I read the first few chapters but found I was already familiar with all of them. Possibly I've just read too much on the topic already to get use out of it.

I read a lot of positive feedback about the book, so I'm wondering if I'm missing something.

<comment><USER9> It felt more like a beginner's intro. Some were new for me, but I would call myself a beginner.

<comment><USER7> Yes. I had exposure to a lot of the models but not in a formal way which is likely why it is enjoyable.

</comment></comment></comment></comment><comment><AUTHOR> I'm the author of the article. Thanks for the hug of death! Currently on the phone with my hosting provider. A friend will help me move to Netlify later.

If you did manage to read the article and enjoyed it, I write a weekly newsletter with stuff like that. Will actually send the next one in a few hours: [https://nesslabs.com/newsletter](https://nesslabs.com/newsletter)

<comment><USER10> It's worth gathering a list of things as a reference, but it's not very interesting to read. Worse, listicles are on so many "viral" pieces it's become a big turn-off.

It would be more engaging if you picked a few items and went into depth in their commonalities, differences or origins.

<comment><AUTHOR> Thanks for the feedback! I mostly write as a way to learn new stuff and it really helped me to create this list. Good idea for a follow up article.

</comment></comment></comment><comment><USER11> Some are very different from my names for them; Visualize Success is my #1. And the chant "how awesome this will be when it comes together." Then later on we would have this "Start with the Result/ What's the effect you want?" (also mainly as a vision, but maybe as a writing exercise of various sorts).

Now flip all your visualized result-thinking on its head and, having identified all your needs, find someone in the world who has the same needs and help them achieve them.

Superpower modes come when you're tuned into the needs of more beings than just yourself, which takes the emphasis away from "mental" and "my own" and puts it more on "the situation" and "the people in it"

</comment><comment><USER12> There are Nice Oss tools for playing with mental models, e.g. See [https://nocomplexity.com/causalloopdiagram/](https://nocomplexity.com/causalloopdiagram/) a clone of loopy.

<comment><USER13> This is amazing, it took me some time to understand it, but now I am blown away by the simplicity of the tool and the possibilities it holds.

I already started gaining insights in some systems I am currently involved with.

Could you point me to more resources like this?

</comment></comment><comment><USER14> 30 is a lot to keep top of mind, and there's more?!? It seems to me - and I have to give this some more thought myself - some of these can be grouped (read: chunked).

For example:

6\. Comparative advantage

7\. Diversification

8\. Economies of scale

In short, if you go for 7 you compromise 8, or vice versa. Also, 6 and 8 seem to couple.

Another example,

2\. Backward chaining

14\. Inversion principle

Both seem pretty similar.

Moi? I'd prefer a list of 10 that I can commit to memory and be able to recall without too much trouble, than a list of 30+ that I'm going to read, smile, think "that's nice" and then forget.

Does anyone have a more focused list they can recommend? 2\. Backward chaining

<comment><USER15> 6 and 8 don't naturally pair in the way people commonly think.

Comparative advantage is a confusing term in my mind. I typically substitute 'relative' for 'comparative'. It is an idea rooted in opportunity cost. The key insight of the concept is that there are benefits to exchange among two parties, even if one party holds an absolute advantage in production of all goods and services. There is a good discussion in the wikipedia article [0].

It is a useful exercise to work a couple of examples between two parties who each produce the same two goods, but at different costs.

When stripped down, it seems simplistic. But it is an incredibly useful mindset. A non-rigorous example, with completely made up nonsense numbers.

Consider an individual with a lawn. This individual needs their lawn mowed. They happen to be a superb lawn mower. They can mow their lawn in 30 minutes. Anyone they hire takes an hour to mow the lawn. This person has an absolute advantage in mowing their own lawn. Our hypothetical person can find someone who will mow their lawn (in an hour) for $1. Our hypothetical person can earn $10/hr. If they choose to mow their lawn (30min) they lose out on $5 of income. If they work 6 minutes, they can earn enough to pay for the lawn to be mowed. Thus our hypothetical person can choose to spend 30 minutes to mow their lawn, or they can spend 6 minutes to have their lawn mowed (async q;). Despite being a better lawn mower, our hypothetical person has a comparative disadvantage in lawn mowing.

[0] [https://en.wikipedia.org/wiki/Comparative_advantage#Ricardo'...](https://en.wikipedia.org/wiki/Comparative_advantage#Ricardo's_example)

</comment></comment><comment><USER16> Interesting, though the list is conspicuous for being almost entirely limited to 'models' from neoclassical economics and cognitive and social psychology.

</comment><comment><USER17> The comparative advantage description is not quite right. At least not detailed enough, it needs to point out that it's a relative efficiency, not absolute.

The canonical example is the CEO who is both better at strategy AND better at typing than his secretary.

<comment><USER15> I'll expand that it's a double relativity. It is my opportunity cost among options, relative to my counterparty's opportunuty cost among options.

It's not enough that the CEO is better at both strategy AND typing than his secretary. We must know the CEO's ratio of productivity between typing:strategy AND the secretary's ratio of productivity for the same.

Say the CEO can produce 5 strategies in an hour, or could spend the hour to produce 3 typings. And the secretary, in an hour can produce 1 strategy or 2 typings.

The CEO could give up 5/3 of a strategy to produce a typing. Her secretary, on the other hand, must only give up 1/2 a strategy to produce a typing. Thus it makes sense for the CEO to exchange her strategies for the typings produced by the secretary.

If the ratios were instead CEO 5/3 and secretary 3/1, then it would make sense for the secretary to produce strategies and trade them to the CEO for the CEO's typings.

</comment></comment><comment><USER18> Archive.org link: [https://web.archive.org/web/20190725120100/https://nesslabs....](https://web.archive.org/web/20190725120100/https://nesslabs.com/mental- models)

<comment><AUTHOR> Thank you!

<comment><USER19> Side note curiosity... I noticed your html tags were WordPress and that your site resolved to Godaddy servers. So I looked at Godaddy's Wordpress hosting costs.[1] I see that Godaddy's $6.99 price tier says it's appropriate for ~25k monthly visitors.

It would be interesting to see what your traffic stats were that caused the _" 503 Service Unavailable error"_ and _" Resource Limit Is Reached"_.

[To the downvoters, did I ask an inappropriate question about web hosting?]

[1] [https://www.godaddy.com/hosting/wordpress- hosting](https://www.godaddy.com/hosting/wordpress-hosting)

(I see that your live website is back up and the page transfers ~426kb. So multiply by 25k is ~10.7 GB of bandwidth. Following your comment about Netlify, I see that their $0 tier includes 100 GB of bandwidth.)

<comment><AUTHOR> I'm on the phone with them right now to upgrade and will then change hosting providers. They're way too expensive. I only installed Analytics yesterday, but got about a thousand hits in the past 30 minutes.

</comment></comment></comment></comment><comment><USER20> As the site is down: [http://web.archive.org/web/20190725120100/https://nesslabs.c...](http://web.archive.org/web/20190725120100/https://nesslabs.com/mental- models)

Here a "quick" summary:

        Anchoring: a cognitive bias where an individual relies too heavily on an
        initial piece of information—the "anchor"—when making decisions.

        Backward chaining: working backward from your goal.

        Classical conditioning: you've probably heard about Pavlov's dog. Classical
        conditioning is a learning method in which a biologically potent stimulus—such
        as food—is paired with a previously neutral stimulus—let's say a bell. The
        neutral stimulus comes to create a response (salivation) that is usually
        similar to the one created by the potent stimulus (in this case, food).

        Commitment and consistency bias: the desire to be and appear consistent with
        what we have already done.

        Common knowledge: knowledge that is known by everyone or nearly everyone,
        usually with reference to a particular community. Common knowledge doesn't
        necessarily mean truth, but most people will accept it as valid.

        Comparative advantage: the ability to carry out a particular economic
        activity—such as making a specific product—more efficiently than another
        activity.

        Diversification: the process of allocating your resources in a way that reduces
        the exposure to any one particular risk.

        Economies of scale: the cost advantages that businesses obtain due to their
        scale of operation. The larger the scale, the smaller the cost per unit.

        Efficient-market hypothesis: a theory that states that prices fully reflect all
        available information. The hypothesis implies that is should be impossible to
        consistently beat the market, since market prices should only react to new
        information.

        Game theory: an umbrella term for the science of logical decision making in
        humans, animals, and computers.

        Hyperbolic discounting: a model which states that, given two similar rewards,
        people show a preference for one that arrives sooner rather than later.

        Illusion of control: the tendency for people to overestimate their ability to
        control events.

        Incentive: something that motivates or encourages someone to do something.

        Inversion principle: the process of looking at a problem backward. For example,
        instead of brainstorming forward ideas, imagine everything that could make your
        project go terribly wrong.

        Loss aversion: people's tendency to prefer avoiding losses to acquiring
        equivalent gains. We are basically more upset about losing $10 than we are
        happy about finding $10.

        Margin of safety: in a business, how much sales level can fall before a company
        reaches its break-even point.

        Maslow's hierarchy of needs: a five-tier model of human needs, often depicted
        as a pyramid, in which needs lower down in the hierarchy must be satisfied
        before people can attend to needs higher up. In order, the needs are
        physiological needs, safety needs, love and belonging, esteem, and
        self-actualization.

        Mechanical advantage: also called the law of the lever, it's a measure of how
        much your strength is amplified by using a tool or mechanical device.

        Mere-exposure effect: a psychological phenomenon by which people tend to
        develop a preference for things merely because they are familiar with them.

        Norm of reciprocity: the expectation that we repay in kind what another has
        done for us.

        Normal distribution: a theory which states that averages of samples of
        observations of random variables become normally distributed when the number of
        observations is sufficiently large.

        Operant conditioning: a learning process where the strength of a behaviour is
        modified by reinforcement or punishment.

        Redundancy: the duplication of critical components of a system with the
        intention of increasing its reliability. For example, a backup or a fail-safe.

        Scarcity: the limited availability of a commodity, which may be in demand in
        the market. Basically, when something is in short supply.

        Signalling theory: the science of determining whether people with conflicting
        interests should be expected to provide honest signals rather than cheating.

        Status quo bias: a preference for the current state of affairs, where the
        current baseline is taken as a reference point, and any change from that
        baseline is perceived as a loss.

        Supply and demand: an economic model which postulates that, in a competitive
        market, the unit price for a particular good or service will vary until it
        settles at a point where the quantity demanded will equal the quantity
        supplied, resulting in an equilibrium for price and quantity transacted.

        Surfing: the business principle of "riding the wave" of a new technology,
        product, or trend.

        Survivorship bias: the logical error of concentrating on the people that made
        it past some selection process and overlooking those that did not, typically
        because of their lack of visibility. Happens a lot in entrepreneurship.

        Tribalism: a way of thinking in which people are loyal to their social group
        above all else.

<comment><AUTHOR> Thanks so much for pasting it here! That's my website and I'm on the phone with my hosting provider.

</comment></comment><comment><USER21> Had me until the fake Einstein quote and the misspelled link to Farnam Street. Lost me for good.

<comment><USER22> Einstein joke is a common meme. Typo is inconsequential and probably fixed in the non-archive version.

The article is substantive and interesting. Well worth a look.

<comment><USER21> You're absolutely right. I was unnecessarily snarky.</comment></comment></comment>


Nintendo got some boom after 3DS price cut - <AUTHOR> http://etechnoholik.in/gaming/nintendo-got-some-boom-after-3ds-price-cut/

<comment><AUTHOR> great</comment>


Show HN: SoundCloud Instant - <AUTHOR> http://karan.github.io/scInstant/ <comment><USER2> Hmmm...

> Blocked loading mixed active content "[http://code.jquery.com/jquery- > latest.js"](http://code.jquery.com/jquery-latest.js")

> Blocked loading mixed active content > "[http://connect.soundcloud.com/sdk.js"](http://connect.soundcloud.com/sdk.js")

You're trying to mix HTTPS and HTTP...

I also see that your API key is there in clear. I hope no one can do any bad stuff in your name.

Oh, and it looks like every action is sent to google for statistics ?

<comment><USER3> > I also see that your API key is there in clear. I hope no one can do any bad > stuff in your name.

To OP: The way to fix this is to have the JS make a request to your own server, have your own server make the request to Soundcloud and proxy it back to you. That way you don't have to put your key in the JS, you can keep it on your server.

<comment><AUTHOR> Is there any way where it does not use a server? I really do not want to use a server here.

<comment><USER3> Unfortunately not. Since all JS is going to be transferred to the client, if the key is in the JS the client has access to it.

</comment></comment></comment></comment><comment><AUTHOR> I made this small app last Saturday solely because I wanted to. Any feedback is welcome.

Oh, and the source code is open: [https://github.com/karan/scInstant](https://github.com/karan/scInstant)

EDIT: Right now, it's meant to be used only on desktop. I'm starting to get into frontend stuff, so don't really know how to touch optimize the app. Again, suggestions welcome.

<comment><USER4> This is great. It would be nice to see the next couple of songs that are going to play and maybe a delete button next to them. A Youtube version would also be useful.

<comment><USER5> I like the idea but search on YouTube seems to be so inaccurate I'm not sure if it would work nearly as well.

I'm having trouble thinking of how to improve scInstant as it is--it's so pared down and fast and just works! Great job!

<comment><AUTHOR> I'm glad you like it. Feel free to send any PRs. As long as the UI isn't bloated, I'm happy to merge. :)

</comment></comment></comment></comment><comment><USER6> This reminds me of Feross Aboukhadijeh his Youtube instant. ([http://www.quora.com/What-were-the-main-reasons-why- Feross-A...](http://www.quora.com/What-were-the-main-reasons-why-Feross- Aboukhadijeh-turned-down-a-job-offer-at-YouTube))

Does the API has rate limit? Are you sending a new query every 200ms? [https://github.com/karan/scInstant/blob/gh- pages/app.js#L98](https://github.com/karan/scInstant/blob/gh-pages/app.js#L98)

<comment><AUTHOR> SC doesn't mention a hard limit (it's vague). And yes, 200ms.

</comment></comment><comment><USER7> Very nice! I had some deja vu when I read the title. I posted an HN thread with the same exact title over two years ago!

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

I will sell you soundcloudinstant.com for 1 million dollhairs. But really, yours is much better :)

<comment><AUTHOR> Ah nice. Sorry but I don't have so much moneyz.

</comment></comment><comment><USER8> Nice work. I'm personally not a huge fan of autoplay, since there's a ton of stuff on SC and the search results aren't always accurate enough.

Volume control would also be ace. Not sure how easy that would be to implement - now that I think about it, I've never seen it on any of their widgets.

<comment><USER9> Personally I prefer Bandcamp's approach to volume control:

[http://bandcamp.com/help/audio_basics#volume](http://bandcamp.com/help/audio_basics#volume)

</comment></comment><comment><USER10> Chiming in with shameless me too self promotion...

I have a similar feature on [http://tuned.io/](http://tuned.io/) \- it's a soundcloud search with autocomplete; you can play any of the search results instantly, etc.

The music makes for good coding background.

</comment><comment><AUTHOR> Also, if anyone wants, I setup a list where you can get notified when I make something cool! [http://eepurl.com/SRIPT](http://eepurl.com/SRIPT)

</comment><comment><USER11> For all you SoundCloud and 8tracks users, here's a way to load tracks by voice: [http://bit.ly/1l8r5yf](http://bit.ly/1l8r5yf)

</comment><comment><USER12> Small bug: it reloads the track when I press the volume up / down keys on my keyboard. Using a samsung 7-series notebook.

<comment><AUTHOR> Well volume control keys don't have a keyCode (or vary from keyboard to keyboard) so I don't think it can be fixed ATM.

FWIW, I just added keyboard shortcuts for volume control though: `shift up/down - volume`

</comment></comment><comment><USER13> It only allows me to search once, if I try to search for something else, I have to refresh.

<comment><AUTHOR> That should be fixed now.

</comment></comment><comment><USER14> i love it but it would be cooler with a full screen UI, there was a soundcloud api hack that would play people's loved/favorited tracks that kind of did that..

<comment><AUTHOR> I don't think it would be very hard to do that. I implemented the streaming in <audio> tag, which means I'm free to implement the UI myself.

It's on the "audio" branch of my code.

<comment><USER14> awesome, i'll check it out.

</comment></comment></comment><comment><USER15> NICE. This shit is dope.</comment>


Newspaper ad-revenue forecast: down 42.5% over next seven years - <AUTHOR> http://seekingalpha.com/article/116232-sinking-ad-revenues-death-knell-for-newspapers

<comment><AUTHOR> From the article:

 _In its report, "Newspapers in Crisis: Migrating Online," the research firm estimates that newspaper advertising revenues dropped 16.4% to $37.9 billion in 2008 and expects that by 2012, those revenues will tumble to $28.4 billion - slightly more than one-half the industry's revenue peak of $49.4 billion in 2005.

Since 2006, ad revenues have declined quickly, eMarketer said, adding that it expects a 15.9% drop in 2009 that will pull ad revenues down to $31.9 billion._</comment>


Conspiracy and an off-by-one error - <AUTHOR> https://gist.github.com/klaufir/d1e694c064322a7fbc15 <comment><USER2> Very nice writeup!

To finish the puzzle, consider the following comment in one open-source mp4 library: [https://github.com/l-smash/l-smash/blob/master/core/box.h](https://github.com/l-smash/l-smash/blob/master/core/box.h)

"According to ISO/IEC-14496-5-2001, the difference between Unix time and Mac OS time is 2082758400. However this is wrong and 2082844800 is correct."

MP4 stores timestamps by Mac epochs. The wrong value of the difference between Unix and Mac epochs is wrong exactly by 24 hours and is hardcoded in the MPEG-4 reference software, from which it made its way into a number of libraries.

(I work for Google and have contacted the right people in the attempt to address this bug soon).

</comment><comment><USER3> Off by one errors affecting geopolitics. That's a scary thought. Any other examples out there? There are things like false missile launch positives during the Cuban missile crisis...

<comment><USER4> This doesn't really affect geopolitics any more than any other conspirology. No fingers changed direction because of this.

<comment><USER3> I agree, but change the context just a little and the same error could have convinced people the evidence was faked. The potential is there.

</comment></comment></comment><comment><USER5> Excellent review and analysis!

I watched the original video (about the time-stamp) yesterday and someone in the comments section said about the same (that there is a bug in the system).

But I wouldn't label the original poster a conspiracy theorist over this.

It's perfectly normal for someone to assume YouTube is working as it should, in which case, seeing the early time-stamp should definitely set off some question marks.

In combination with the current regime's use of indiscriminate violence, misinformation, and downright lies, it reasonable to question anything they put out.

<comment><USER6> When "elaborate multi-agency government conspiracy" and "off-by-one bug in non-critical section of code" are your two competing theories, both Occam's Razor and Hanlon's Razor (two important rules of reasoning) compel the selection of the latter. So it's not really "normal" (if by that you mean reasonable) for someone to assume that YouTube is elaborately bug free if that requires the existence of shadowy conspiracies that are unsupported by other evidence.

<comment><USER7> There seems to be two ways to apply Occam's Razor. The first, used by people actually tasked with investigating something, is to prioritize exploration of simpler explanations before more complex ones. The second, more commonly used by Internet bystanders, is to treat it like an iron law, immediately cut off all alternate avenues of inquiry and give people degrading labels. Occam's Razor is best as an investigatory rule of thumb and not a thought-terminating cliche.

<comment><USER8> In this case, even the most cursory attempt to explore the simple explanation would've shown it was the right one, though.

</comment></comment></comment></comment><comment><USER9> Great technical analysis, but poor choice of words. Why does the author deem it necessary to sensationalise it by using terms like _conspiracy theory_ and _conspiracy theorists_? Those are rather derogatory and loaded, but introduce no actual information except that a conspiracy is involved: [http://rationalwiki.org/wiki/Conspiracy_theory](http://rationalwiki.org/wiki/Conspiracy_theory)

Note that both the currently most accepted hypothesis (rebels armed by the Russians did it) as well as the Russian party line (Ukranians did it to frame the Russians) involve government conspiracies and are, thus, conspiracy theories.

<comment><USER10> Isn't the general hypothesis that whoever did it mistook the plane to be military. If so, this does not seem like a conspiracy, as much as a mistake (or incompetence) followed by a cover up.

<comment><USER11> Exactly. Most likely a military mistake similar to Iran Air Flight 655.

These things can happen. When political leaders seize on these types of events to promote their agendas however, some people understandably become more suspicious that a conspiracy is afoot.

<comment><USER12> [http://en.wikipedia.org/wiki/Iran_Air_Flight_655](http://en.wikipedia.org/wiki/Iran_Air_Flight_655)

"shot down by the United States Navy guided missile cruiser USS Vincennes on 3 July 1988," "All 290 on board, including 66 children and 16 crew, died"

"The Fogarty report stated, "The data from USS Vincennes tapes, information from USS Sides and reliable intelligence information, corroborate the fact that [Iran Air Flight 655] was on a normal commercial air flight plan profile, in the assigned airway, squawking Mode III 6760, on a continuous ascent in altitude from take-off at Bandar Abbas to shoot-down.""

</comment></comment></comment></comment><comment><AUTHOR> The comments on reddit are quite interesting too: [http://www.reddit.com/r/programming/comments/2b4kpg/conspira...](http://www.reddit.com/r/programming/comments/2b4kpg/conspiracy_and_an_offbyone_error/)

</comment><comment><USER13>
      Ecoded date from the downloaded youtube file:
      Encoded date : UTC 2014-07-17 10:44:19
      Exact upload date using the API:
      <yt:uploaded>2014-07-18T10:43:10.000Z</yt:uploaded>

> _" you will find that the encoded date timestamp is 24 hours behind the > upload date"_

Excellent analysis, but the last statement is reversed. It's probably just a typo/oversight (like that's never happened to me before (sigh)). The encode timestamp is 24 hours _before_ the upload timestamp, which is impossible since it must be uploaded before it's encoded.

<comment><USER14> "Behind" means "before," depending on whom you are speaking to. Relative-time prepositions in English are pretty badly messed up.

<comment><USER15> What's messed up about "before" and "after"?

I don't think native speakers will use "in front of" or "behind" to describe time coordinates. Those words are used to describe relative positioning of events, and in such use I think they have the opposite interpretation from what you suggested.

"Event A occurred behind event B", for example, or "A is behind schedule" (although you could then argue that scheduling has its own semantics for "behind"). However, even "I'm running behind" means running late, not early.

Even on a timeline, it's not clear whether the point of perspective for determining "in front of" or "behind" is a point in the past or a point in the future.

Simple: use before and after, or earlier and later.

btw, the overall semantics of "a means b, depending on whom you are speaking to" made me cringe even though I know you meant "A _usually_ means B, but it depends..." (which I don't think is even true—see above—but that's a factual not semantic complaint). Taken literally, you could just as easily have written "a means (not b)..."

<comment><USER14> "Before" and "After" are fine.

"Behind" is not incorrect in the original text, but it can be terribly, frustratingly ambiguous. As you've noted, "I'm running behind" means "I'm running late," i.e. I will arrive after the correct time. But "My clock is running behind" means "My clock is running slow," meaning it shows a time before the correct time.

Similarly, when projects are behind schedule (i.e. likely to complete after the correct time), we sometimes solve this by pushing the schedule back... Meaning by pushing the correct time into the future, as opposed to most contexts where "pushing something back" would mean "pushing it further behind." So we push schedules back to move deadlines forward.

Personally, I usually use "into the future" and "into the past" to be precise. Treating time with spatial-positional-relative language is fraught with inaccuracies.

(Fun fact: did you know "biweekly" means either "twice a week" or "once every other week?" I can't think of any other measurement unit that has a factor-of- four error built into its very definition).

<comment><USER16> There's biannual/biennial: think quick, which means twice a year and which means every two years?

[http://en.wiktionary.org/wiki/biannual](http://en.wiktionary.org/wiki/biannual) / [http://en.wiktionary.org/wiki/biennial](http://en.wiktionary.org/wiki/biennial)

<comment><USER17> Misleading question, since biannual means both!

</comment></comment></comment></comment></comment></comment><comment> dj-wonk There is considerable overlap between good investigative skills and debugging software. I'm glad to see both being used together!

</comment><comment><USER18> Superb investigative journalism. And love the idea of using GitHub, where anyone else can suggest improvements or additions, and it's all transparent.

<comment><AUTHOR> Well, it's a Gist, so it's tracked by git and can be forked, but I don't think you can make pull requests.

</comment></comment><comment><USER19> An astute consipracy theorytician will just claim that Google has changed their API and changes the timestamps on the fly after their initial blunder was discovered.

Just to stay, that evidence does not usually persuade beliebers.</comment>


All You Need to Know About Bitcoin's Rise, from $0.01 to $11,000 - <AUTHOR> https://www.bloomberg.com/news/articles/2017-12-01/understanding-bitcoin-s-rise-0-01-to-11-000-quicktake-q-a <comment><USER3> Many people discuss how much one could buy from the bitcoins today that where used for the first pizza purchase. Few people consider though, that today's value of a bitcoin might not exist without that order.

<comment><USER4> Yep. The most astonishing thing to me about the price of Bitcoin isn't that it went from $1000 to $11000 this year, it's that it ever made it above $0 in the first place!

</comment></comment><comment><USER5> > , a Nobel laureate in economics, said recently that bitcoin "ought to be > outlawed" because it's designed to evade regulation and "doesn't serve any > socially useful function."

A world where if something is not required it is forbidden is not a world that I want any part of Nobel winner or otherwise.

<comment><USER6> The Nobel prize in Economics isn't a real Alfred Nobel prize as set aside in his 1985 will, either... So you're not the only one :).

<comment><USER7> For anyone who cares to follow up here's a good article about it: [https://www.alternet.org/economy/there-no-nobel-prize- econom...](https://www.alternet.org/economy/there-no-nobel-prize-economics)

</comment></comment></comment><comment><USER8> Something I rarely see discussed is the gender breakdown of bitcoin ownership.

I'd be surprised if it wasn't something like 90%+ men mining, trading, and owning bitcoin. If bitcoin really takes over the world, it's going to look like a bunch of dudes printed themselves a fortune and then convinced the rest of the world to buy it from them.

<comment><USER9> What do you see as the barriers for women to participate in bitcoin?

<comment><USER10> >What do you see as the barriers for women to participate in bitcoin?

Why do you want to have a discussion involving logic when all I want to do is signal my virtues?

<comment><USER11> It's against HN's rules to use this site primarily for political or ideological battle. We ban accounts that do that, so please stop doing that. Flamebait, like the comment you posted here, is particularly against the rules.

[https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)

</comment></comment></comment></comment><comment><USER12> "Bitcoin's current estimated annual electricity consumption stands at 29.05 Terawatt hours"

I just leave that here...

<comment><USER6> Do you know what the estimated annual electricity consumption of VISA as a corporation is? What about the Treasury portion of the US government, let alone all the other parts.

I'll just leave that there :).

<comment><USER13> You could also compare it to how much Google consume.

And you should realize the mining electricity usage is in no way related to scaling Bitcoin.

<comment><USER12> "Google's many data centers around the world burn through 260 million watts" way less, besides Google's DC are rather modern and often are rather environmental friendly. Bitcoin on the other hand is mostly mined in China where the energy comes largely from fossil fuels

</comment></comment></comment></comment><comment><USER14> I am really sad that Bitcoin is the only cryptocurrency that ever managed to touch "mainstream" (it's on Steam, it has Stripe support, etc) and we fucked it up so hard that you need a $4 fee _just to pay for one thing with it_. I was really hoping it would catch on as a medium of exchange, because there's value in being able to pay for things quickly, cheaply and without giving people a bunch of info, but nope. Digital tulips.

<comment><USER15> Like many, you're not aware that the Lightning Network is on its way and will solve most of these issues.

Moreover, transactions between Segwit-compatible wallets is pretty fast and cheap.

I'm kind of tired to hear people complain about the fees while all they have to do is use a different wallet that supports Segwit.

Edit: Ah, the downvotes. I was expecting them.

<comment><USER16> Maybe I don't fully understand it but from what I've gathered, the Lightning Network is a plan to enable people to do transactions outside of the main blockchain and eventually sync them back. It seems to get touted as a magical plan to solve Bitcoin's scaling problems, but unless I'm missing something (which tbf is very possible) it seems more like a plan for bitcoin to abrogate its primary original purpose of handling end-user transactions.

<comment><USER17> Lightning Network seems to me to be a hybrid solution that uses the best of both worlds: the security and stability of the main block chain for the overall holding and occasional transfer of large amounts of wealth between large organizations, while having offchain networks to experiment with different solutions for handling lots of small transactions quickly, while address still bring compatible with the main block chain.

</comment></comment></comment></comment><comment><USER18> Interesting, are individuals factoring in the possible existence of quantum computers in the future? If Bitcoin does become a trillion dollar space I'd feel uncomfortable knowing there are technical limitations already in place.

Also, what does the end of Bitcoin generation look like? If Bitcoin is truly deflationary why would anyone trade it? The interesting thing about inflation is it requires investment to ensure your money doesn't lose value over time. Would Bitcoin be incentivizing a market where growth is extremely limited due to greed?

Not taking any sides, trying to understand the long term reprucussions of a substantial Bitcoin market.

</comment><comment><USER19> I got an international payment recently via bitcoin and the fee was under £2 on the sender side. If it had gone through my bank It would've costed me £7 to receive and way more on the other end to send.

So I do get the criticism about high fees when paying for a coffee, but maybe that's not the ideal use case for bitcoin. It could've been cheaper with another cryptocurrency but it's a tolerable enough percentage at the moment compared to another widely used solution for international transfers.

</comment><comment><USER20> I haven't been understanding bitcoin for the longest time: It has been more than five years since I first heard about it. I tried to look it up, I can never quite get the overall picture, why it works the way it is.

I finally understood the bitcoin mechanism and I can explain the original paper well just two days ago. I feel dumb reading this paper. Intellectually, I think it's a hallmark of many great inventions in the 20th and 21st century: public-key cryptography (to verify transactions), micro economics - <USER2> theory (to incentive people to mine), hashing (bounty), macro economics (to combat inflation), distributed computing synchronization (to trust the system while not trusting any single computer), statistics (to combat fake chains). Only when one has all the pieces of the puzzle together then the whole thing is possible to conceive.

But I feel a sense of achievement when I finally figured the whole thing by myself. If you don't understand bitcoin, I think you should understand bitcoin as a hacker, even you don't need to use it or intend to store money in it.

I only own a small fraction of a coin, I'm not a risk taker. I'm not going to be rich from bitcoins, I have no reason to shill it with memes. It's unlike anything you have encountered before, notably that the only reason why bitcoin is worth money, is because we are better off with it. I do believe the world is a better place when everyone agrees that bitcoin has values and can be traded, because that means many people can buy their own "insurance" should wars happen, which they do. Your money might turn into paper, you might get killed if you smuggle cows, gold, and diamond when you're running for life, but no one can know if you have bitcoins.

<comment><USER21> Why wouldn't those same people running for their lives store their money in a numbered bank account? If they need to hide from their own government they could use banks of one of the major players: US, EU, China, Russia. Whomever is the least friendly with your oppressor.

<comment><USER20> Store how? I was from a country that the money inflated 25% over a year, and the government made it extremely hard to send the money abroad.

In the US, it's not possible to open a bank account without a SSN. How do you get an SSN if you don't work in the US?

</comment></comment></comment><comment><USER22> Why was this thread nuked from the front page? It was like #2 when I checked and now a few minutes later it's gone.

</comment><comment><USER4> Wow, another obnoxious self-playing video in the corner. No thanks.

</comment><comment><USER23> Bitcoin is what's wrong with our society: An obsession with money over health, community, housing, food, etc. Bitcoin epitomizes our embrace of the new capitalist dystopia.

<comment><USER24> I've also seen this connected with the rise of individualism that's been going on since the early 80's.

Allegedly though, according to the historian Arthur Schlesinger Jr, societies tend to move in 40 year periods of either community or individualism. Assuming individualism started in 1980, this would have it end in 2020.

These two books sum it up well:

The Cycles of American History [https://www.amazon.com/dp/0395957931/ref=cm_sw_r_cp_api_hYSi...](https://www.amazon.com/dp/0395957931/ref=cm_sw_r_cp_api_hYSiAbHA3RN8Q)

The Revolt of the Elites and the Betrayal of Democracy [https://www.amazon.com/dp/0393313719/ref=cm_sw_r_cp_api_CXSi...](https://www.amazon.com/dp/0393313719/ref=cm_sw_r_cp_api_CXSiAbCKES8Z9)

</comment></comment><comment><USER25> Bloomberg? lol

Blockchain may be different. Deviousness is not: [https://medium.com/@bitfinexed/spoiler-alert-the- institution...](https://medium.com/@bitfinexed/spoiler-alert-the-institution- buying-tethers-is-bitfinex-themselves-f56af29ce60c)</comment>


Perfect forwarding and universal references in C++ - <AUTHOR> http://eli.thegreenplace.net/2014/perfect-forwarding-and-universal-references-in-c/

<comment><USER2> Here is what perfect forwarding looks like:

      (defun wrapper-function (&rest args)
        (apply target-function args))

Now kill some instances of that (from a few other languages, too), chop them up, sew the pieces together, apply high voltage, shout "give my creation life!" and you have C++ perfect forwarding!</comment>


Health Concerns Mount as More Old Sewer Pipes Are Lined with Plastic - <AUTHOR> https://www.scientificamerican.com/article/health-concerns-mount-as-more-old-sewer-pipes-are-lined-with-plastic/ <comment><USER2> Sounds like the building has other more serious plumbing issues. Gasses and odors of any type shouldn't be able to work their way back into a building via the sewer pipes. The pipes in the building can't leak and that's one of the reasons why properly installed drains have traps.

Code inspectors often use the "peppermint test" to test all the above. They dump concentrated peppermint oil into the sewer then go around the building and see if you can smell it. If you can then you have problems with the plumbing.

Buildings having issues likely have bad plumbing and thus their occupants were likely breathing sewer gasses for ages... the "liner fumes" just made all this more obvious.

<comment><USER3> I was wondering the same thing. But do you think it's possible that this process causes backpressure that forces the gases through a trap?

Maybe it shouldn't cause backpressure if done properly, but maybe some construction companies carelessly block one side of the pipe while it's curing?

<comment><USER4> I'd suspect it's more likely the opposite: as the pipe is dewatered it creates a negative pressure that pulls the water out of the p-traps which then temporarily allows gaseous exchange with the building air.

EDIT: Nevermind, I originally was thinking that a sufficiently negative pressure differential could overwhelm the capacity of the vent. But the more I think about it, the pressure range that I'd expect even with an unusual operation probably wouldn't be far enough outside normal range to do that. ...although there are definitely still some possibilities to do some stupid.

<comment><USER5> It's possible.

On the top floor of a building I worked at long ago, there was a drain in the floor of the men's bathroom. It had a p-trap but on windy days there was enough vacuum from the vent stack to drain it out. I encountered a neighbor pouring a cup of water into it one day and he explained the problem. I started doing the same, and had to do it every couple weeks during windy periods.

But I think that's a problem for the upper floors, both due to fluid dynamics and because the first trap that loses seal would mostly restore equilibrium.

<comment><USER6> My parents' house had a guest room addition with a bathroom which wasn't used for long periods of time, and it became apparent that if the water wasn't run enough it would start to let odors back through the pipes.

Anyway, everything uses PVC, right?

<comment><USER7> Not everywhere: [https://www.pmmag.com/articles/97318-plastic-pipe-still- limi...](https://www.pmmag.com/articles/97318-plastic-pipe-still-limited-in- plumbing-applications)

</comment></comment></comment></comment></comment></comment><comment><USER8> I'm a professional engineer with experience on these types of projects. CIPP has been used since the 80s, in the US as well as Europe (and I presume Asia and Oceania). Originally it was done with hot water, though steam curing processes have an economic advantage today. UV curing processes are now wide spread as well.

In the steam curing process high temperature water is circulated through the pipe to cause the resin compound to catalyze (industry term is "kick"). Steam is not allowed to escape from the liner into any sewer laterals. In fact, sewer laterals are plugged by the liner and have to be reinstated (cut out) by a robot afterwards. At the end of the process the steam is released to atmosphere, it tends to have an odor. From my understanding the odor is styrene, a common industrial solvent.

Sometimes people with flaws in their plumbing report the odor is coming from the drain. This indicates they could potentially have a more serious issue: chronic exposure to sewer gases. I always recommend they have a plumber investigate. Other times the airborne plume is enough to cause very sensitive individuals to complain. There are many industry veterans who have been working with these materials for decades - if you were serious about studying the potential for harm, you would follow this group. They are the canary in the coal mine. Folks with only transient exposures are at very low likelihood of harm.

The American Society of Civil Engineers gave the sewer systems in this country a grade of D+. Just above failing. In reality, and I see this every day, our sewer systems are in need of immediate overhaul. CIPP is a keystone technology for renewal of these assets, because excavation is too dangerous(!) and expensive to be our primary mode of repair.

FYI - pipeline characterization and renewal is a growth industry with a lot of opportunity for AI. In my opinion, a lot of these processes could be automated.

Video below shows the CIPP process. [https://www.youtube.com/watch?v=Swp81X4jSDk](https://www.youtube.com/watch?v=Swp81X4jSDk)

<comment><USER9> > Steam is not allowed to escape from the liner into any sewer laterals. In > fact, sewer laterals are plugged by the liner and have to be reinstated (cut > out) by a robot afterwards.

Is there resin on the side of the liner that's plugging the lateral? In other words, you may still get odors if the thing that's doing the plugging is releasing chemicals on its exterior.

<comment><USER10> The whole liner is resin. It is produced in a factory per job ("wetted out") and then brought to a job on a refrigerated truck then pulled into place and cured via steam/water/UV.

They're cured from the inside out but the whole thing is "resin".

The more important point though is that any odor that is coming in from the line is indicative of a problem with the lateral connection - if odor is bleeding off from the CIPP install then there is every indication that sewer gases are also making their way in. There is no positive air pressure exerted by the install on the lateral due to the curing process.

Edit - just to clarify, the point is that you shouldn't be smelling ANYTHING if the connection is in proper order - odor from the CIPP install or from sewage. If you smell one but not the other then it most likely is NOT the connection because there is no (substantial) difference in the driving air pressures between normal operation and during CIPP installation (because the CIPP seals across the lateral, preventing pressure in the lateral). If you smell the chemicals during install then it is imperative you get your line checked because you are most likely (~100%) also breathing in noxious fumes from sewage and you are so accustomed to it that you no longer notice it.

<comment><USER11> _...you are most likely (~100%) also breathing in noxious fumes from sewage and you are so accustomed to it that you no longer notice it._

Is this a thing that is possible for humans? I shudder to imagine this, so much exposure to sewage that one ceases to notice its odor.

<comment><USER10> You can get used to any smell given a long enough exposure. Ever been to someone's house that just reeks of dog or cat?

Beyond that, it can happen in an acute sense as well. Hydrogen sulfide becomes undetectable above a certain exposure. You will usually pass out shortly afterwards (and then die because hydrogen sulfide is heavier than air and you are now on the floor). The standard advice given for people who enter confined spaces is that if you smell hydrogen sulfide (rotten eggs) you should be aware and check your sniffer. If you are still in the confined space and you suddenly stop smelling rotten eggs, you are literally seconds away from dying and should retreat to fresh air immediately or deploy SCBA.

</comment></comment></comment></comment></comment><comment><USER12> > I see no mention of p-traps [1]. How exactly are these fumes getting into > places when there's essentially an airlock in every drain connection?

Well they are doing this because the underground piping is presumbly cracked and/or porous; this would enable fumes from the process to leech into buildings through the pipe walls. We are only protected from sewer gases if the entire system is air tight.

It is also possible that her building had some issues with its plumbing; for instance I have seen fitures removed either during renovation or even on a permanant basis that were not properly capped off--while there would be some constant leakage of sewer gas it is really not dangerous (or even that noxious) in low concentrations; the chemicals used in the lining process however might be.

<comment><USER13> This isn't in the building, it's way that municipal utilities retrofit pipes in the street that are leaking. If they catch the leak before it collapses, they are able to inject this sleeve and basically put a plastic cast inside the pipe.

They did it on my block when I was telecommuting from my front porch. The smell comes from the excavation holes. It's loud process and they use high pressure air to do it. It smelled like somebody stained a deck, and lasted about a half hour. There was some residual smell that mostly went away after they covered the hole. You wouldn't know it had happened a few hours later.

If you've ever dealt with the public with stuff, people freak out about anything smelly or any visible involving radio.

<comment><USER12> > This isn't in the building, it's

The building drainage system in many areas is not "protected" by a house trap. Many municipalities require a backwater water valve which is essentially a check valve with a mechanical moving part. I can easily envision (and I have held a Master Plumbers License) this failing.

Furthermore once you trench to bring sewer, and water into a building (these services while in a manner of speaking are kept separate they often share a common or very nearby trench) it's very easy to not backfill properly thereby also allowing vapors to enter a structure in some instances. It depends: did they use dynamite to blast for the foundation or to bring in these services? There are all kinds of variables that could allow trench to building fumes.

I agree people do freak involving odors, but on the other hand different people have different actual physical tolorances to chemicals.

</comment></comment></comment><comment><USER14> A couple items to note here:

\- while agreed that a trap should help contain gasses, in order to cure the resin involved they have to inject high-pressure steam into the piping... possible that it could cause bubbles to pass through functional traps

\- even if the trap system worked perfectly, the fumes from the cure process get vented to the local atmosphere through outlets set up during the CIPP process. This exposes workers to the largest amount of byproduct chemical vapors, but it's entirely reasonable to think that it could get accumulated or trapped in buildings as well.

The CDC has a good article about this very topic: [https://blogs.cdc.gov/niosh-science- blog/2017/09/26/cipp/](https://blogs.cdc.gov/niosh-science- blog/2017/09/26/cipp/)

<comment><USER15> I caught a whiff of this venting to the local atmosphere in downtown SF a few years ago, and it was shocking. The smell is so strong and noxious you can't believe that there isn't some serious problem happening in your midst. No warning either. It's about as frightened of a smell as I've ever been.

</comment></comment><comment><USER16> They did this in my City (the Netherlands) the fumes were really bad for some days and seemed to penetrate houses very well.

</comment><comment><USER17> I haven't read 100% of the article, but from skimming over it, I see no mention of p-traps [1]. How exactly are these fumes getting into places when there's essentially an airlock in every drain connection?

[1]: [https://en.wikipedia.org/wiki/Trap_(plumbing)](https://en.wikipedia.org/wiki/Trap_\(plumbing\))

<comment><USER18> Because you need to vent the pipes. Otherwise the sewer system would just be a giant vacuum pump.

It's even described in the article you mention.

[https://en.m.wikipedia.org/wiki/Drain-waste- vent_system](https://en.m.wikipedia.org/wiki/Drain-waste-vent_system)

<comment><USER17> I'm familiar with vents, but indoor vents are basically one-way air valves. I don't know if this is required by code, but it's definitely common practice (you don't want poop smell coming out of your vents)

<comment><USER19> Vent stacks need to be above _that_ roof's line, but your building might be next door and taller with open windows downwind.

Or a crack in the stack.

</comment></comment></comment></comment><comment><USER20> It should be noted the fumes are from the cast in place pipe liner (cipp) which is a Fiberglas style sock that is pulled through the existing pipe and then filled with compressed steam.

This has quite a few voc's that really give your stomach a churn if you are in close proximity.

</comment><comment><USER21> I found irrational preference for "retrofit" and "intermediate" solutions over proper replacement even costs are unfavourable rather puzzling.

ADSL — often required new wiring or a DSLAM on premises to deliver acceptable signal

DOCSiS — same, you have to rewire all coax in the building to deploy it.

House heat insulation — often ends up with inefficient house designs perpetuating because of hopes "we can always add insulation later"

Piping — used to work in a trade company in Canada for half a year as an intern. Tried to import and popularise polypropylene piping there. Got hit by ferocious marketing FUD counterattack by a company selling crap PVC piping in a month after I sent booklets to prospective clients. Their main argument was that "PVC piping is a cheaper "intermediary" solution for plastic piping as PVC pipe can still be joined by plain mechanical means, unlike polypropylene" even when doing so negates their entire point of using plastic piping for its physically continuous joints.

</comment><comment><USER22> For a second, I though they were referring to the trenchless piping method used on the sewer lateral. They pull a plastic pipe with a winch through a older pipe with a metal head that expands out the old pipe. Fortunately there are no fumes during this process.

</comment><comment><USER23> > _The sleeve hardens to form a continuous plastic liner along the old pipe's > inner walls._

I didn't finish reading the article, but this sounds amazing. Isn't plastic one of the least reactive materials we know about and an excellent choice for this? It seems like maybe the issue is in the curing process.

</comment><comment><USER24> This aside...hows the general plastic pipes & microplastics situation?

</comment><comment><USER25> Maybe is a Russian listening device with unintended side effects like in Cuba?

That would explain why 'workers' aren't dropping dead and people far away under the cube law are legitimately sick?

</comment><comment><USER26> " Davis has recovered from most of what she says her doctor told her were neurological effects from a chemical exposure."

Is this another way of saying the placebo effect?

</comment><comment><USER27> No mention of the actual chemicals being used. Seems they would at least include the MSDS sheets for the process for a well researched article.

<comment><USER28> The article mentions a number of chemicals and links to a paper describing the emissions at the job sites.

</comment></comment><comment><USER29> Seems like if we can just let people know ahead of time to not go inside for a while you'd be good.

</comment><comment><USER30> If anyone is interested in the subject this is my company. www.sewerai.com

</comment><comment><USER26> I thought plastic was inert?

</comment><comment><USER31> any great empire expands until it can no longer afford the maintenance of its own infrastructure, at which point it collapses under its own corpulence.

<comment><USER23> "Societies grow inexorably more complex until one day they become really simple again (collapse)"

</comment></comment><comment><USER32> Why do people act surprised when "a noxious odour that smells like paint thinner" makes them feel sick?</comment>


World's first tourist 'Spaceport'(Virgin) - <AUTHOR> http://www.news.com.au/travel/news/inside-the-worlds-first-tourist-spaceport/story-e6frfq80-1225943280099 <comment><USER2> So awesome - any bets on how long before they do the intercontinental flights? I'm thinking 10 years.</comment>


Opus Codec: royalty-free, better quality and lower latency than Vorbis/AAC/MP3 - <AUTHOR> http://www.opus-codec.org/comparison/ <comment><USER2> But everybody already knows this. And since we live in a meritocracy it's just a matter of time that a free codec with no marketing muscle behind it takes over the world, right?

The mob (Xiph) who designed it is responsible for the speex codec, and is trying to apply the same principles to video in a codec called daala. Sadly it appears to have died.

Regardless, we should hail them as heroes. They _gave_ the world the two best audio codecs we have. Suck on that, Fraunhofer.</comment>


Show HN: Standy, keep meetings running on time - <AUTHOR> http://www.standy.us <comment><AUTHOR> This is a VERY simple tool I made for keeping a timer running for various agenda items in a meeting and tracking action items. Let me know if you have any feedback or questions.</comment>


Show HN: Verifiable Data Structures - <AUTHOR> https://www.continusec.com/ <comment><AUTHOR> (founder here)

I recently launched Continusec, which provides hosted Verifiable Data Structures. These are verifiable logs and verifiable maps based on the same principles as Google's Certificate Transparency logs, generalized for any use, wrapped up in a hosted cloud service. You might of them as "S3 meets blockchain".

Would appreciate any feedback from the HN community.</comment>


Artificial intelligence pioneers win tech's 'Nobel Prize' - <AUTHOR> https://techxplore.com/news/2019-03-artificial-intelligence-tech-nobel-prize.html <comment><USER2> What is it with this tendency to speak of a 'Nobel prize' when it concerns a different, lesser known prestigious prize in a field for which there happens to be no Nobel prize (Abel prize, Turing award)? It's a lazy way to try to draw attention to it, and pernicious even because it makes the whole purpose of these named awards questionable.

<comment><USER3> Perhaps you answered your own question: "It's a lazy way to try to draw attention to it". It's not crazy, though, to me at least. The general population has some understanding of the Nobel but doesn't with others (e.g., Fields Medal). Why not give a comparison point?

The only one that sticks out as pernicious to me is the Economics Nobel, which was explicitly created to sound like a Nobel prize, but really isn't one.

<comment><USER4> true that @Upvoter33.Nice response</comment></comment></comment>


Algorithms-the beginning - <AUTHOR> http://www.geek-programmer.com/algorithms-the-beginning/ <comment><USER2> Please stop saying that algorithms let us solve problems or do day to day tasks. It is just wrong. An algorithm tells you how to find the solution to an instance of a computation problem. Cooking etc are not computation problems. People should understand what a computation problem is before trying to learn what an algorithm is. This whole idea that algorithm is just "how to do something" leads to many misconceptions.</comment>