256 CSS Classes Can Override an #id - <AUTHOR> http://codepen.io/chriscoyier/pen/lzjqh

<comment><USER4> Webkit source: [http://trac.webkit.org/browser/trunk/Source/WebCore/css/CSSS...](http://trac.webkit.org/browser/trunk/Source/WebCore/css/CSSSelector.cpp?rev=81845#L63)

Specifically:

      69	    case Id:
      70	        s += 0x10000;
      73	    case Class:
      88	            s += 0x100;

id selectors are worth (0x10000/0x100) == 0x100 == 256 class selectors.

This seems to be the mozilla source: [http://hg.mozilla.org/mozilla- central/file/17c65d32c7b8/layo...](http://hg.mozilla.org/mozilla- central/file/17c65d32c7b8/layout/style/StyleRule.cpp#l521)

      521   nsAtomList* list = mIDList;
      522   while (nsnull != list) {
      523     weight += 0x010000;
      524     list = list->mNext;
      525   }
      526   list = mClassList;
      527   while (nsnull != list) {
      528     weight += 0x000100;
      529     list = list->mNext;
      530   }

Same weights, Id = 0x10000, Class = 0x100

<comment><USER5> For some reason, based on the w3 documentation, I was under the impression that an id had an order of magnitude more specificity than a class.

<http://www.w3.org/TR/CSS2/cascade.html#specificity>

<comment><USER6> From that spec:

> Concatenating the four numbers a-b-c-d (in a number system with a large > base) gives the specificity.

So webkit is using 256 as "a large base".

I only just read this spec a few months ago. For years I was under the impression that the spec was "1 point for an element, 5 for a class, 10 for an id", and the selector with the highest point value won...

<comment><USER7> Actually, me too. Where does this misconception come from?

<comment><USER8> Under the same impression too, I definitely remember reading this on a W3C advice/info blog (dark brown background, white and blue header - <USER2> memory).

</comment></comment></comment></comment></comment><comment><USER9> [1] [http://coding.smashingmagazine.com/2007/07/27/css- specificit...](http://coding.smashingmagazine.com/2007/07/27/css-specificity- things-you-should-know/)

This is a feature, not a bug. Its called CSS specificity.

Although, the link[1] seems to suggest it should be 100, not 256... that might be a bug.

<comment><USER10> Read the spec instead. It says "in a number system with a large base". I suspect the unspecific wording is on purpose (to allow optimisation for sane conditions), but it should be fairly clear that the intent is that classes cannot override ids.

<comment><USER11> _"255 classes should be enough for everyone"_?

<comment><USER12> Seriously!

</comment></comment></comment></comment><comment><USER13> Stranger, perhaps, this also works with the same class 256 times. That is <div class="c"> with a style def .c.c[...256...].c {}.

<http://codepen.io/anon/pen/zbcxs>

<comment><USER14> if you change it to #id#id it needs another 256 .c classes, interesting!

<comment><USER15> That is perplexing! Is there a stack of some sort in play here?

</comment></comment></comment><comment><USER16> I guess the algorithm for specificity in all modern browsers involves a base-256 number. Why? I believe there are 4 slots for specificity - class, id, !important, and styles defined in the tag. 256^4 = 2^32, the size of an integer. Unfortunately we get this is as a side effect.

<comment><USER17> According to the CSS 2.1 spec, "Concatenating the four numbers a-b-c-d (in a number system with a large base) gives the specificity." Base-256 is the obvious way to encode each digit efficiently, and I suppose all browsers that do this are still in compliance with the spec.

<comment><USER18> It still works with > 256 classes. I was expecting it to overflow and go back to blue when I added a 257th class.

<comment><USER19> If it is adding numbers, it may be losing the ID altogether.

      spec = classes + (id>>8) + (important>>16) + (styles>>24);

If the assumption was that classes would "probably" be under 256 and wasn't put in a char, it could be messing with the whole value.

</comment></comment></comment></comment><comment><USER20> In the example, switch the order of the rules and the background will switch -- last rule wins, all things being equal. Not surprising...

      $ python
      >>> CLASS = 0x100
      >>> ID = 0x10000
      >>> CLASS * 256 == ID
      True

</comment><comment><USER21> This seems to be taken from this answer on a question about HTML/CSS specificity

<http://stackoverflow.com/a/11934505/950912>

<comment><USER22> This is where this whole thing came from today. Somebody submitted this earlier, but it never got to the front page. I suggest a detailed readthrough of the question and all the answers for a great overview of how this works.

</comment></comment><comment><USER23> For your sake, I hope this wasn't an actual bug you ran into :)

</comment><comment><USER24> Can someone explain the thinking behind this? Wouldn't it be much simpler to have #id always override a .class?

The way it is set up currently that's basically always the case (since 256 .classes are rarely used), but there is this weird edge case when as many .classes are used.

I don't think it's possible to meaningfully work with a rule like that. It just seems so non-sensical.

<comment><USER25> As far as I can tell from the specification posts here, it's entirely to make implementation more feasible. Rather than some complicated calculation of precedence, you can just assign each rule a single score. As long as the weird exception essentially never comes up (which is the point of specifying "a number system with a large base"), it's an efficient and sensible way to implement the desired rule.

</comment></comment><comment><USER26> Opera 12 displays a blue box while Chrome 21 and IE 9 show a red one. Another cross-browser incompatibility that we have to deal with...

<comment><USER27> Yay Opera!

Also, if you're really using >= 256 classes in your CSS you may have more systemic problems than just cross-brwoser compatibility.

<comment><USER28> What base does Opera use for specificity?

<comment><USER29> We use base 24, actually, but since we truncate before concatenating, we behave as expected here, unlike Gecko/WebKit. Obviously, a different TC that depends on one selector having more class names than another ("c" in CSS 2.1 6.4.3) will fail in Opera; it passes in GeckKit. See attachment at [http://lists.w3.org/Archives/Public/www- style/2012Aug/0493.h...](http://lists.w3.org/Archives/Public/www- style/2012Aug/0493.html) for an illustration.

<comment><USER29> Oops, should be base 25, obvs.

</comment></comment></comment></comment></comment><comment><USER30> I suppose someone should update this question then, because it looks like to me the limit is 255...

[http://stackoverflow.com/questions/4354921/css-is-there-a- li...](http://stackoverflow.com/questions/4354921/css-is-there-a-limit-on-how- many-classes-an-html-can-have)

<comment><USER31> I don't think the class limit is 255, it is still a fuzzy number as the post declares. Here, I've modified the codepen to include another 256th class, and the CSS declarations on that class are applied to the element. <http://codepen.io/anon/pen/cKuBx>

</comment></comment><comment><USER32> It's not a bug, OP found out about it from my question on Stack Overflow: [http://stackoverflow.com/questions/2809024/points-in-css- spe...](http://stackoverflow.com/questions/2809024/points-in-css-specificity)

</comment><comment><USER33> I recommend not using IDs due to selector specificity and the scenario where you most likely will run into annoying #ID issues and think about using `!important`.

I don't think it's absolute blasphemy to use #ids, but try to never use them. Think of it that way. I tend to use them only for #js-functionality hooks, which is also a good-practice to tell someone "don't freaking change this ID or you break the JS."

Tips from <http://www.betterfrontend.com>

<comment><USER25> I'm obviously lacking in imagination here. How would using an ID for styling a "clearly one-per-page" element lead to problems? I'm thinking of things like the main page title, or some sort of primary navigation block. The whole point there is that I want the specific rules for those elements to override the defaults, right?

<comment><USER33> It may be "clearly one-per-page" now, but it may not be. You don't really gain anything by using an ID. Keep the selector specificity simple so it doesn't bite you in the ass and cause a refactor.

.page-wrapper .page-main %article.main

There's no difference using that to

#page-wrapper #page-main %article#main

Psuedo example, those can be mix and matched with classes and IDS but doing so just complicates the selectors and the cascade.

There is of course exceptions and things that may just make total sense, but overall, it leads to complications. You don't gain any real benefits unless it's a JS hook for #id selector performance.

</comment></comment></comment><comment><USER34> Interesting current versions of the following on windows fail

\- Firefox \- Chrome \- Internet Explorer 9

Opera shows the expected result though.

<comment><USER35> I got a red box, chrome 21 on win 7.

<comment><USER36> I get a red box in everything but opera on linux. Seems to not be platform dependant at least.

<comment><USER37> I get a blue box on Opera for Windows.

</comment></comment></comment></comment><comment><USER38> Not a bug, probably just CSS's ridiculous selector algorithm. IIRC, the algorithm looks something like (100xid's) + (10xclasses) ...

<comment><USER10> The algorithm looks like that "in a number system with a large base". It is arguably not what the spec intended but probably acceptable in exchange for performance.

</comment></comment><comment><USER39> Awesome! I can't believe this is trending on HN. But that is very cool..

Now, how is this useful?

<comment><USER38> Knowing CSS's selector algorithm is useful as it helps rule out possibilities for CSS override situations.

Edit: punctuation

</comment></comment><comment><USER40> 256 nested ids seems to create an overflow. If you remove the #i000 at the beginning of the rule on this: <http://codepen.io/anon/pen/zefGg> it turns red, but otherwise it stays blue.

<comment><USER40> Here is a better example of ids overflowing: <http://codepen.io/anon/pen/Khwon>

</comment></comment><comment><USER10> Here's some of the specificity code from Webkit (right at the top of the file):

[http://trac.webkit.org/browser/trunk/Source/WebCore/css/CSSS...](http://trac.webkit.org/browser/trunk/Source/WebCore/css/CSSSelector.cpp?rev=121551)

Basically, selectors are summed together with class selectors given a weight of 0x100, and id selectors given a weight of 0x10000, so this is a simple overflow. It's worth noting that a mask of 0xffffff is used, so using 256 #id's should give a specificity of zero.

</comment><comment><USER41> I'm guessing that the implementation uses a 32-bit integer for calculating rule strengths as they apply to a selection. With that in mind, 8 bits used for each variable.. so it would make sense that 256 would overflow into the next value. see: [http://www.webteacher.ws/2008/05/19/tip-calculate-the- specif...](http://www.webteacher.ws/2008/05/19/tip-calculate-the-specificity- of-css-selectors/)

</comment><comment><USER42> I had the impression that class specificity (weight: 10) times 11 would weigh more than a single id (weight: 100), but I guess I'm wrong.

<comment><USER43> Weight 10 in a number system with a large enough base (e.g. webkit is using base 256).

I think the intent of the specification is that 1 id is always more specific than classes for any practical number of classes.

</comment></comment><comment><USER44> <http://code.google.com/edu/submissions/html-css-javascript/>

Look at the css section. id's, classes, and selectors have weights which are used to determine which rule wins in the event of a conflict.

</comment><comment><USER45> I just tried doing this with nested ids and it didn't work so perhaps this is for classes only. Might be worth trying layers of HTML tags also - <USER3> <http://pastebin.com/7BhQdNAn>

</comment><comment><USER46> Pretty awesome find. I imagine it will have some outrageous use some day for someone.

<comment><USER47> Or a way to alter the webpage when you get an XSS exploit..

<comment><USER48> There are easier ways that will work, so I can't see this being useful, only interesting.

</comment></comment></comment><comment><USER49> I'm surprised nobody linked to this yet? [http://www.stuffandnonsense.co.uk/archives/images/specificit...](http://www.stuffandnonsense.co.uk/archives/images/specificitywars-05v2.jpg)

</comment><comment><USER50> Interestingly, it doesn't seem like the classes need to be different for it to work, at least on Safari 6.0 if you change all the classes to .c000 it works just as well as having different ones.

</comment><comment><USER51> Don't worry guys, crisis averted:

#id { background: blue ! important;}

<comment><USER52> Add !important to the 256 classes too and they win.

</comment></comment><comment><USER53> Oh nice! Bug at international level :-) Looks like it is some kind of stack and overflow in play.

</comment><comment><USER54> It doesn't seem to work when you switch the order of the css selectors.

<comment><USER10> Both selectors have the same specificity, so the last one is applied. Add another class and the order won't matter.

<comment><USER54> Confused me for a second, but yeah your right.

</comment></comment></comment><comment><USER55> Are you sure this isn't a bug with Codepen.io?

<comment><USER56> It's very unlikely. I can't think of a scenario where it could be changing the CSS and/or HTML that still leaves it syntactically and semantically valid.

</comment></comment><comment><USER57> Nice one. That's a bug I guess.

</comment><comment><USER58> does that happen on all browsers?

</comment><comment><USER59> obscure++

</comment><comment><USER60> it's a feature not a bug. lol</comment>


Ask HN: Where do you draw the line between an ongoing and finished project? - <AUTHOR>

This question was meant for programming related projects, but I guess it can be good for any kind of projects. <comment><USER2> If you are charging money for it, it's never finished. You will be fixing bugs and adding new features.

<comment><AUTHOR> That is a very good point :)</comment></comment>


Show HN: Simplemvc.js – A highly opinionated web back end framework - <AUTHOR> https://jeremyaboyd.com/post/simplemvc-js <comment><AUTHOR> I built this to kind of scratch an itch. I wanted something that is easy to get a web application started like (old school php), but still structured enough to not be a huge mess (not like old school php). Coming from building almost exclusively in asp.net mvc since 2010, I had a few things I wanted this to do to make my life easy like asp.net mvc did (especially since routing attributes were added).

So if this looks familiar, it is a cross between express (which it is built atop), and asp.net mvc.

If you notice any issues, you can open an issue on github.

<comment> mind-blight I'm curious why you chose to build your own instead of go with something like NestJS?

<comment><AUTHOR> TL;DR; - I'm lazy. But maybe not as lazy as I should be?

The fun of the build. I knew the handful of packages I wanted by default in all of my future projects, so I thought, why not just build around those, package it up so I can just run `npm install simplemvcjs` and start building.

After decades of working on web applications all day everyday for my job, there was something that always kept me from building more side projects.

After some soul searching, I realized I am incredibly lazy, and what was keeping me from starting was all the upfront work needed to create a new project from creating the directory and committing the first line of code to having something that was actually rendering in the browser.

So the goal was to make this as easy as starting a new php project `touch index.php` but with the structure needed to keep the code from being too spaghetti-y.

Are there other frameworks I could have used, I'm sure, but I would still have to rewrite a membership service, and still have to set up their versions of controllers, and set their rendering engine, etc., etc.

<comment><USER2> > _I 'm lazy. But maybe not as lazy as I should be?_

This was such an delightfully-unexpected response that I almost did a spit- take with my morning coffee. Thank you!</comment></comment></comment></comment>


The Cold Rim of the World - <AUTHOR> http://blog.longreads.com/2015/03/18/the-cold-rim-of-the-world/

<comment><USER2> Been there last summer, it's really an interesting place. It's crazy to see how people left everything back when they leaved. The city seems to be stuck in 90's. Nothing changed since. Stunning..</comment>


#DojoDevCamp: New Provo, UT Python school - <AUTHOR> http://dojodevcamp.com

<comment><USER2> Wish this was In Seattle, WA I would have definitely joined this looks super duper awesome.

<comment><USER3> We've got hookups for housing if you want to head down! :) I'll be in Seattle in a couple weeks to chat with the CodeFellows guys. They have a sweet course too if you're interested in Ruby.

<comment><USER2> I would love to.

</comment></comment></comment><comment><AUTHOR> This is an intensive developer school, located in Provo, UT, specializing in Python.

<comment><USER2> Do you guys guarantee a job offer after the program? what about housing hook- ups</comment></comment>


Soft Launch Beta Testing - <AUTHOR> http://foodio.network/ <comment><AUTHOR> Today is my first day in YC and wanted to do some relevant and share with the community my MVP v1. Your help and comments are most welcome. www.foodio.network</comment>


Automatically grading multiple choice exams from photos using Python and OpenCV - <AUTHOR> http://www.pyimagesearch.com/2016/10/03/bubble-sheet-multiple-choice-scanner-and-test-grader-using-omr-python-and-opencv/ <comment><USER2> There's an even cooler thing you can do with automatic grading. I saw this idea on another HN comment once. The computer can figure out the answers without programming them in. Or it can figure out mistakes in the real answer key.

The idea is that answers are highly correlated. Better students are more likely to get all answers correct, worse students are more likely to make mistakes. So if you do something like PCA on all the students' answers, the first dimension will represent the quality of the student. And the weights will represent which answers are correct.

<comment><USER3> Interesting, but how would PCA work with a discretely-valued, unordered, metric-less data like multiple choice answers? (Actual question, not snark, I only know the basics of PCA.)

<comment><USER2> I would imagine you would assign each multiple choice answer a value of 0 or 1, based on whether they selected that answer or not. So if there was just one question, and the student answered 'A', it would produce a vector like [1, 0, 0, 0].

In fact I believe there are similar but better algorithms than PCA for handling mutually exclusive binary variables. I just don't know what they are called.

</comment></comment></comment><comment><USER4> The author has been pretty good at documenting a number of simple projects that can start you off in OpenCV.

Disclaimer: I bought his eBook bundle.

<comment><USER5> How are the eBooks? Do you like them?

<comment><USER4> I am very happy with them. It wasn't full of fluff but was very targeted. I have the prior edition, so at some point I'll have to go back and buy the basic package again to upgrade.

</comment></comment></comment><comment><USER6> So back in the Bronze Age my teacher would collect all the scantron cards -- which by the way can already be automatically graded; that is the entire point of the scantron -- and put them on the overhead projector with the correct answers masked out. Overhead projector was more than bright enough to shine through the paper card. The teacher could easily grade the entire class in a minute or two, no cameras or computers needed.

<comment><USER4> I had a biology teacher who would put them into a plywood form and drive a nail through a giant stack of papers.

<comment><USER6> I don't clearly understand how that is effective, but it sounds like fun, and a good way to impress kids.

<comment><USER4> She would drive nails through the forms and then count where the marked answer matched the hole. I suspect she got her husband to help too.

It was easy for the students to double check that their tests were marked correctly as well.

</comment></comment></comment></comment><comment><USER7> This is pretty cool. I am getting ready to embark on camera projects with a Raspberry Pi 3 and saw this project. Since I will be using python and OpenCV anyway this is a motivator.

<comment><AUTHOR> Combining the Raspberry Pi + Python + OpenCV is a lot of fun. If you feel like sharing the details on your project I might be able to point you in the right direction.

<comment><USER7> You wrote the ebook right? I think I'll get it.

<comment><AUTHOR> Correct, I am the author of Practical Python and OpenCV.

</comment></comment></comment></comment><comment><USER8> Do you take off points if they don't use a #2 pencil?

</comment><comment><USER9> Here's a similar service: [http://bubblevision.org/](http://bubblevision.org/)

<comment><USER6> If only I had Adobe Flash, I could learn all about this!

<comment><USER10> VLC -> open network -> [http://embed.wistia.com/deliveries/5bed39f586d77c4436f569d16...](http://embed.wistia.com/deliveries/5bed39f586d77c4436f569d164e910dbe75eb739.bin) if you actually want to

</comment></comment></comment><comment><USER11> Processing well-known forms (AP, PSAT, SAT, etc.) would be sweet. The one for AP is 4 pages in color, but one might have a greyscale printer or decide to print only one page of it.

</comment><comment><USER12> I just need 20 years to modify this to grade my short and long answer tests and I'll be sitting pretty.

<comment><USER13> If Gradescope[0] starts allowing public signups it might be sooner than you think....

[0] [https://blogs.nvidia.com/blog/2016/09/02/gradescope- brings-a...](https://blogs.nvidia.com/blog/2016/09/02/gradescope-brings-ai-to- grading/)</comment></comment>


How Many Hours Is "Part Time"? It's Complicated - <AUTHOR> https://30hourjobs.com/blog/how-many-hours-is-part-time/ <comment><AUTHOR> An interesting analysis of "part time" from both the law's perspective (for US, Canada, and EU), but also from a practical point of view.

The bottom-line: It's part-time if you can spend the same amount of time for another "job" (payed or personal) and not pass the 40 h/week threshold. I.e. under 20 h/week.</comment>


A couple bought one of the most exclusive streets in San Francisco for $90,000 - <AUTHOR> http://www.businessinsider.com/photos-of-presidio-terrace-san-francisco-street-2017-8/ <comment><USER2> Discussion from 4 days ago: [https://news.ycombinator.com/item?id=14948392](https://news.ycombinator.com/item?id=14948392)

</comment><comment><USER3> And if we really try hard enough as the cable newscaster says[1], maybe one day we too can spend a few moments in this world

[1] [http://fair.org/home/medias-grim-addiction-to- perseverance-p...](http://fair.org/home/medias-grim-addiction-to-perseverance- porn/)</comment>


Obama announces hacker sanctions amid cyber-security 'national emergency' - <AUTHOR> http://rt.com/usa/245949-executive-order-cyber-sanctions/

<comment><USER2> A 'national emergency' that cannot be addressed by a lawful act of congress!</comment>


TapZou: A New game available on the App Store - <AUTHOR>

TapZou is a new game available on the App Store. I invite you to try it and give me your feedback :) Enjoy it! <comment><USER2> Awesome and addictive app!</comment>


The $35 Tablet (Akaash) Review - <AUTHOR> http://www.thinkdigit.com/Mobiles-PDAs/Your-guide-to-the-new-35-Aakash_7700.html

<comment><USER2> Well, doesn't look like a review to me. It's rather a collection of data gathered from various sources.

<comment><USER3> Yeah, it looks like a rehash of the data available on their official website. <http://www.aakashcomputer.in/index.html>

</comment></comment><comment><USER4> > Plans: As per official website, UbiSlate will come with an unlimited mobile > Internet at Rs.98/month.

That's roughly $2. What am I not understanding here? Is there no coverage? Is this for WiFi? I'm all for cheap, unlimited mobile Internet, and I think American offerings are overpriced and underprovisioned, but I don't think $2 is possible.

<comment><USER5> Rs 98 / month is for 2 GB of EDGE data per month. That is the normal charge in India for every mobile customer. This is not a special tariff for this tablet.

<comment><USER3> Seconded. I currently live in Bangalore and pay just Rs 400 (about $8) per month for blackberry services + unlimited 3G usage. I had this Rs 98 plan a few _years_ ago when I was in college and didn't have a 3G capable phone.

</comment></comment></comment><comment><USER6> The only interesting thing here is that the author has found similar tablets with comparable or even better specs for similar or even better prices.

What we don't know is whether these tablets deliver as promised and whether or not they suck.

</comment><comment><USER7> First sentence of article: "Indian government's ultra low-cost tablet 'Aakash' is finally in front of us."

My comment: "Wow, actually in front of the reviewer, so they've already shipped review tablets to journalists, that's amazing, I guess they really are building these in bulk now, the tablet is real."

Last sentence of article: "We hope to get our hands on the $35 gadget soon, we will reserve our final verdict for the detailed review."

My comment: "WTF, I just been gypped reading this fake propaganda review. thinkdigit.com whoever they are gets a nice new entry to my /etc/hosts file for this inexcusable tactic."

<comment><USER8> I think this is just a case of ESL, not fraud.

The second sentence reads: "The official launch comes after nearly one year telecom minister Kapil Sibal flaunted a prototype of the device."

Also: "he device will bridge the gap between the rural India and the ongoing technology boom in the country."

My guess is "in front of us" should be "coming soon", "almost here" or "on the horizon".

</comment></comment><comment><USER9> Honestly, I don't think the reviewer saw or used the Tablet. This is more of a collection of data from sources.

I'd really wish this becomes true and Indian students have access to something cheap and affordable. At that advertised cost, I'd say it's perfectly OK to have rough edges.</comment>


San Francisco team wins paper shredder puzzle prize - <AUTHOR> http://www.sfgate.com/cgi-bin/article.cgi?f=/c/a/2011/12/18/BU4I1MD3O9.DTL&tsp=1 <comment><USER2> Big thanks to Hacker News for helping us win the DARPA Shredder Challenge. That's where some of our team heard about the challenge in the first place and that's where we found out about the yellow dot patterns that gave us a huge advantage over the competition that didn't read Hacker News. :P

</comment><comment><USER3> The following caught my eye:

 _Then he happened on an article about a little-known government project: The Secret Service has been working with manufacturers of color laser printers to place tiny, imperceptible yellow dots on printed pages so that the government can track the machine that produced them. Good put the puzzle under a blue- light filter and saw the dots._

That's a great hack! Kudos to the team.

<comment><USER2> Where do you think I found out about the yellow dots? I was stuck on puzzle four and procrastinating by reading hacker news. Just in time, there was an article here about the yellow dots. I looked at the shredded pieces and they were there in a nice pattern. Hacker news FTW!

<comment><USER4> This is amazingly clever. Congratulations on the win! Would you consider posting something about the process you took?

<comment><USER2> We have been meaning to do that but have been distracted by real life. Hopefully we'll get it together soon. I'll post a link on HN when we do.

</comment></comment></comment></comment><comment><USER5> This is similar to the optional programming question at ai-class.org. NLP.

</comment><comment><USER6> "All Your Shreds Are Belong to U.S." clever name.</comment>


Visualizing Concurrency in Go (2016) - <AUTHOR> http://divan.github.io/posts/go_concurrency_visualize/ <comment><USER2> This is very nice. Does anyone have an idea of how to extend the visualization so that they could be rendered based on the actual runtime of a real program?

I have a theory that much complexity could be understood if humans could just see the interactions and the data flowing.

Even if the program took 100X longer to run, if you can see the bug, you can fix it. If you can see the complexity, you can understand it.

<comment><USER3> This is an oft used technique in gamedev, where instead of print statements we will print out visualisations to the screen, such as bounding boxes, trajectory lines, etc.

</comment></comment><comment><USER4> I saw the video a while ago - really neat technique, I love the visual differences between patterns. Love that it's written down - far too much great material is locked up, unsearchable, in videos.

</comment><comment><USER5> That's a really neat way of explaining concurrency model.

I did something similar for Erlang VM [http://eddwardo.github.io/elixir/links/2015/11/04/links- in-e...](http://eddwardo.github.io/elixir/links/2015/11/04/links-in-elixir/) (less advanced). I'd love to see comparison of these two models.

</comment><comment><USER6> > If I ask you something involving "numbers from 1 to 100" you will have your > own image of the series in your head, even without realizing it. For > example, I imagine it as a line going from me with numbers from 1 to 20, > then it turns 90 degrees to the right and continues to the 1000+.

Actually no, perhaps you're not aware of this, but you have a condition called spatial-sequence Synesthesia. It's a harmless and fascinating condition in which the senses have arbitrary connections to each other (numbers have colours, sounds have tastes). Many people are unaware of it. I've only heard of it because a friend at university (and also a Synesthete) researches it.

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

[https://www.psychologytoday.com/blog/finding- butterfly/20110...](https://www.psychologytoday.com/blog/finding- butterfly/201104/are-you-synesthete)

<comment><USER3> Quite a leap to diagnose such a condition over the internet. To me it just seemed like a bad example. His second example works though, if you try to force a visualisation in your mind:

"Another common example is the visual representation of the full year with four seasons"

<comment><USER6> True, I should say the author "may" have Synaesthesia. But the spacial appearance of a number line is an absolutely textbook example of it. The interesting thing about his choice of example is that's what he perceives and he assumes everyone else also has a spacial representation of numbers.

Most Synaesthestes don't realise there's anything different about their thinking until they hear about the condition. So, I just wanted to make the author (and others) aware of it for their interest.

</comment></comment></comment><comment><USER7> This looks like a useful approach to visualize the interactions between different services in a SOA or microservice-based architecture. (You'd need some way for each service to log its send and receive events without the logging slowing everything down though)

In any case, a very cool idea. I really like the use of 3D to fit more nodes into the diagram without it getting unreadable. I think this is an approach that could help with visualizing large graphs in general - it would be cool if there was more research about that.

</comment><comment><USER8> This is powerful, I wish ideas like that might impact debuggers and provide alternative ways of visualizing code, programs and even whole systems running in production.

</comment><comment><USER9> previous discussion: [https://news.ycombinator.com/item?id=10981616](https://news.ycombinator.com/item?id=10981616)

</comment><comment><USER10> This is really cool.

I wonder at what point WebGL craps out. How many concurrent processes can it handle?

</comment><comment><USER11> This is nice. I'm wondering how you would use it though. Probably you'd start analyzing the diagram at the top, then look at what will happen next, and then the next, etc.

But this is basically the same as just looking at the log.

Am I missing something?

</comment><comment><USER12> Tony Hoare's paper is one of the most amazing papers i read (not that i understood all of it).

You can get it at [http://www.usingcsp.com/](http://www.usingcsp.com/)

</comment><comment><USER13> Great Job!</comment>


6 simple questions a venture capitalist should ask before making an investment - <AUTHOR> https://medium.com/@Pjparson/6-simple-questions-a-venture-capitalist-should-ask-before-making-an-investment-decision-6a23f1b462d7#.hy9s684kx <comment><USER2> You wouldn't have any returns because you would have never invested in anything because every question was about you having invested in something similar before. I think there is an explore/exploit type of dynamic going on. You should allocate a small amount in risky things so you can expand your horizons.</comment>


ZeroMQ - Disconnects are Good for You - <AUTHOR> http://lucumr.pocoo.org/2012/6/26/disconnects-are-good-for-you/ <comment><USER2> Yeah, don't use REQ/REP.

I used to be a big ZeroMQ fan, but honestly, the library trades sanity for performance and has collapsed in on itself because the code is no longer maintainable. Last I checked, it's being completely rewritten in a different programming language. Maybe the result will be fine, but the core features of retrying connections and remembering dropped messages for clients that disappear temporarily are easy enough to write yourself.

(I do like Mongrel2's use of that feature to allow me to make an HTTP request and _then_ start the backend server. And the right place for this is a library. It's just that ZeroMQ had too many features and too much code.)

<comment><USER3> _It's just that ZeroMQ had too many features and too much code._

Wasn't ZeroMQ supposed to be the simple, lightweight alternative?

I'm feeling better about my decision to ignore all the whole *MQ circus.

<comment><USER4> Too much code?

0MQ ~15k LOC RabbitMQ ~107k LOC AMQP Qpid ~542k LOC ActiveMQ ~1160k LOC

<comment><USER5> i'm sorry but comparing 0MQ to these other systems is caca doodoo. i'm telling you as a developer who has on multiple occasions considered using 0MQ it lowers my trust in you as an evangelist for the platform to suggest that this is a relevant or worthwhile comparison to make.

<comment><USER4> Consider my comment in the context. The comment I was replying to says that 0MQ/XS is not lightweight because it has too much code. That's simply not true and that's what I was alluding to.

</comment></comment></comment></comment></comment><comment><USER6> A implementation of this kind of usage pattern is already provided in the ZMQ guide:

[http://zguide.zeromq.org/page:all#Client-side-Reliability- La...](http://zguide.zeromq.org/page:all#Client-side-Reliability-Lazy-Pirate- Pattern)

If the client has not received a response by the timeout it should close the connection itself and reopen a new one. Whether this is a sutible solution for the blog author issue I don't know, but work well for RPC connections with little or no state.

<comment><USER7> Indeed. ZMQ has other capabilities beyond REQ/REP exactly for this situation, and helps you layer "patterns" on top of them.

I found working through all five chapters of the ZeroMQ guide unusually educational. It's full of the wisdom of people writing message oriented software for years, and includes frank discussions and solutions for several of these performance and reliability situations. (Don't miss the adventures of the suicidal snail in chapter 5!)

I found it worthwhile even to spend the time to work through all the examples in both C and Python.

In the author's situation, the normal loop of the client shouldn't be to just call blocking receive forever, as he discovered. Instead it should loop, polling the socket with some reasonable timeout, and between iterations do things like check for shutdown signals, parent process exiting, and the other typical housekeeping tasks. Then you only call receive when poll has told you there are messages waiting, and then you call it without blocking.

This sort of loop gives an obvious place to also integrate timeouts. You can also watch multiple sockets. Blocking receive forever is appropriate for a prototype sort of client but as things grow, generally more sophistication is needed.

<comment><USER8> > In the author's situation, the normal loop of the client shouldn't be to > just call blocking receive forever, as he discovered. Instead it should > loop, polling the socket with some reasonable timeout, and between > iterations do things like check for shutdown signals, parent process > exiting, and the other typical housekeeping tasks. Then you only call > receive when poll has told you there are messages waiting, and then you call > it without blocking.

I think in my case the confusion behavior came from the fact that I started using a project that used ZeroMQ and build part of its implementation on REP/REQ sockets and showed that behavior. Then I went to the ZeroMQ documentation and it does not present the REP/REQ examples with a caveat that they might block the client if the "server" goes away unexpected.

</comment></comment></comment><comment><USER9> > This could probably be improved by having a background thread that uses a > ZeroMQ socket for heartbeating.

Don't use heartbeats on REQ/REP, because they won't work well with the lockstep communication fashion of those socket types. Also, you have to be careful because ZeroMQ sockets are not thread-safe, so the background and active thread must coordinate through a lock, or work in an implementation that handles this implicitly for you.

In ZeroRPC, we solve this by using XREQ/XREP with heartbeats. This has worked out pretty well in practice.

</comment><comment><USER10> Rather than polling, zeromq >= 2.2 allows you to set ZMQ_RCVTIMEO on the socket which seems to be what the author is after. It would be nice to be notified of disconnected peers, but the timeout + retry approach has been good enough for me.

</comment><comment><USER11> Great article. ZeroMQ had a "smell" that I couldn't put my finger and thing article kind of nailed it. In retrospect I guess the smell is that it is tightly couples both sides of the network to make performance claims. It sacrifices robustness for performance.

I guess that it was developed for financial trading applications. Maybe it will work fine for those -- you have a few machines and high network connectivity between them. But people started doing "data center" stuff with 0MQ. Then you have geographical separation, and WAN latency and reliability.

</comment><comment><USER12> I think the problem is people come into zeromq expecting a high level library that handles all the details, zeromq does not do that, you need to handle reliability and disconnect behavior yourself. I agree that the default behavior in this case could be saner, but it's pretty easy to build reliable request reply in many different ways as illustrated in the guide, so I'm fine with it.

The benefit though, is that in zeromq you get to (and are forced to) choose exactly how your messaging patterns are reliable (or not)

</comment><comment><USER13> The better solution? That the 0mq libs do the right thing and don't get wedged. It shouldn't be on the users of the API to handle this.

EDITED: my point is general; it should be 0mq libs doing the timeouts and keepalives and so on and only pushing meaningful error handling like "the server has gone away and cannot reconnect" back up to the user.

<comment><USER14> There's a problem when you restart servers at the wrong moment, though, as the article mentions...

<comment><USER15> So ... in other words there is a serious problem.

Restarting server / a server crash / a network outage and now potentially thousands of clients are in a bad state they cannot recover from. And this was by design. That was the point of the post I think. This isn't as much as an oversight as a bad design decision.

<comment><USER7> Agreed, but the bad design is not in ZMQ, but the way it is being used.

A client should never just wait forever for a response to a message. Any reliable system has to implement something like timeouts our immediate message acknowledgement (at which point maybe you can wait forever for a reply.)

There's a comprehensive discussion of this in chapter 4 "Reliable Request Reply" of the ZMQ guide.

TCP doesn't give you guaranteed response either. Just guaranteed delivery (or error.) In this case, this is exactly what the author's getting with ZMQ. The client's Request socket makes a successful delivery, then the server crashes before generating a response, and the client waits forever for the response that will not come.

</comment></comment></comment></comment><comment><USER16> It seems to be that the better solution might be just using Twisted and regular networking techniques.

<comment><USER14> So whenever there's a small problem with something, the solution is to discard the whole thing and go down a layer?

I don't like some of Python's warts, but you don't see me writing assembly.

<comment><USER16> One could argue whether using Twisted as opposed to ZMQ is going down a layer at all.

</comment></comment></comment><comment><USER17> Sure, the REQ/REQ sockets are limited, especially because they force the Request/Reply/Request/Reply/... series. I don't think any complex applications use this. I recently built an application using DEALER/ROUTER sockets, where you can send multiple requests, without having to wait for responses, etc. Additionally, no application should rely on receiving a response, the poller he suggests solves this problem nicely (although I don't think it necessary to wrap it into send/recv methods as pyzmq offers a nice polling API).

</comment><comment><USER18> _Carries messages across inproc, IPC, TCP, and multicast._

so when you are using actual sockets across the network, it uses TCP. So ZMQ should be able to detect disconnects rather easily.

</comment><comment><USER19> The solution I use is the one I mentioned to Armin on twitter: <https://gist.github.com/2994781>

It's not really idea that a synchronous connection doesn't have notification of a connection failure, but this has been working fine for us for ages.

<comment><USER4> Armin is right that the timeout works, but delays the signal about connection failure from TCP. If anyone feels like implementing automatic resend inside 0MQ/XS (in case of timeout or TCP connection failure), give it a go and submit a patch. If noone submits the patch, I'll fix the problem once I have more free time.

<comment> X-Istence As far as I was aware there was a patch like that available for the ZMQ 3.0 but was nixed for 3.1, same with a patch to deal with the issue of 1000 clients on an XREP socket, where the first 999 disappear and thus don't need to have their messages processed and should just be dropped on the XREP socket... that was added in 3.0 and then reverted in 3.1.

I've worked around a lot of issues in ZeroMQ with retries, heartbeats, and stuff like that, but it just feels kludgy and like I am writing code that should be part of the library. I've looked at adding the functionality myself from the old patchsets that were available and neither were straight forward to implement. The code (at least ZeroMQ) is somewhat of a mess and difficult to follow/understand and I am saying that as a C++ programmer working on large enterprise applications.

<comment><USER4> Yep. The patches were reverted because they've broker wire-level compatibility with older versions of 0MQ. The good news is that I protocol versioning will be available in next release of crossroads.io and thus the patches like that can be applied without breaking backward compatibility (the library will just speak two different protocol versions).

As for the code quality, I would say the code is complex to the extent where it's almost impossible to maintain and improve it. (In case of need here's the overview of the architecture: <http://www.aosabook.org/en/zeromq.html>) However, it's not a mess in sense of being lousy. I've spent literally months of my time cleaning it up. Although it may have got worse since I've started working on the fork.

<comment> X-Istence I can understand the need for them to be reverted, although I honestly think that the patches provided functionality that should have already existed. Worst case the patched could have stayed and they could have been made available through certain flags (much like the HWM, LWM, and others).

I wouldn't say that the code quality is lousy, au contraire I think overall the code quality is very good, just very difficult to figure out where everything goes. I found it difficult to "brain" map it such that I could get proficient at following what was going on while reading different sections of the code.

Is there any effort under way in crossroads to make the notification level triggered and not just edge triggered? For example sticking ZeroMQ into a libev loop is a pain because if two messages arrive at the same time I only get notified once and I have to loop through and zmq_read(), which if the ZeroMQ backend is sending really fast means I now starve all my other sockets!

<comment><USER4> As for the options: Yes. There's patch that supports protocol versioning (version=socket option) already applied to crossroads.io. That in turn makes it possible to improve the protocol without breaking backward compatibility.

As for code complexity: It's hard to brain-map it for me as well, which is pretty alarming given that I am the author :) I am working on major rewrite of the codebase (simplification of the threading model) but that'll take some time to finish.

As for level-triggering, that's a problem with POSIX, not 0MQ. There's no way in POSIX to simulate a file descriptor in the user space. The closest you can get is eventfd() which is a) Linux-specific b) doesn't allow to signal both !POLLIN and !POLLOUT at the same time :(

</comment></comment></comment></comment></comment></comment><comment><USER20> This badly reminds me at my MQSeries experience.

I wonder - is there any MQ that does not suck ?

<comment><USER21> ZeroMQ isn't a MQ ( Message Queue ). It's a message passing library. You can use it to build message queues though.

<comment><USER22> I really despise the name ZeroMQ for this reason. First time you hear it "Is it an MQ and Zero is just a fun clever name" or "Is it not an MQ"? People seem to go with the latter. Then what is it? Why define itself by what it isn't?</rant>

</comment></comment></comment><comment><USER23> The TCP stack takes care of this problem this is an insane attempt at POST mature optimization.</comment>


Regarding Unit Tests - <AUTHOR> http://winterazalea.livejournal.com/136061.html

<comment><USER2> Instead of focusing on how (not) useful automated tests are, we need to admit one thing. They are often a daunting time sink, for whichever reason. You can make them habitual, but it's hard to sustainably enjoy writing them. You wish they took less time and gave more benefit. I bet if that was the case, we wouldn't have so many debates on whether tests are needed.

In the recent story about human-powered airplanes they finally came up with the right question: "How can we make the flying machine easy to fix when it crashes?". Imo, here we need to ask the right question as well: How can we minimize the time consumed by test-writing while maximizing their usefullness? Maybe we should drop the practice of 1 assertion per test, or the notion that tests are also documentation. Maybe we should embrace integration tests. Maybe not. Maybe we should strip all the cruft around the point of tests "it helps you think, it documents your code, it leads to better design" and get back to the roots. Tests are there to make sure that critical parts of your code keep working. That's it. It's better that we sustainably write useful occasional tests for critical code than lie to ourselves about how disciplined we are, burn out, and condemn the whole thing.

</comment><comment><USER3> it sounds like he(?)'s a relatively new programmer whose jumped from a place where they don't test at all to somewhere where they are forced to be written before code.

fact is, they're a tool. i don't write tests for everything. and i don't care much if they are unit or integration or regression or xxx tests. i write tests where i know they will help (and i write my code so it can be tested, but how can you separate that from "good design" anyway?). that comes from experience and requires freedom - the freedom to decide when to use them and when not.

which sucks if you're new and clueless and in a shop with "rules". but then the rules are there because you're young and clueless and this is your first job where you get to write tests...

if the poster is reading this, all i can suggest is: suck it up, get better, and get to the point where you know what to do, and where you're good enough to get a job where you're trusted. it will happen with time, if you stick at it.

</comment><comment><USER4> Looks to me like he went from one extreme to another and managed to get burnt in the process.

I am sure someone else is going to say this but tests are a another tool towards software quality. They are not the only tool to achieve this goal nor are they a silver bullet.

They really save you when six months down the track and you are refactoring a fairly hairy piece of code you hammered out to fix some critical bug.

This is where I find myself. All critical paths have unit tests (which helps enforce a clean design) and as such I am not afraid to make sweeping changes to the codebase.

</comment><comment><USER5> "IV) Use the Intel Model. Do not have one product that you iterate on indefinitely. Rather, start over from scratch every so often. ... Intel learns its lessons and carries them over in spirit to the next model each and every time. Even though they start designing the implementation from scratch each time, they in essence remember the important bits from before, and have a Science for reproducing their implementation from their principles and learned lessons."

The whole article is worth thinking about, but this is the gem for me.

</comment><comment><USER6> I think there are three more reasons to do unit tests I wish the author had mentioned:

1\. Not only do they prevent you from messing your code up because you forgot how it actually worked, they prevent you from having to _think_ about how and whether you've messed something up. I find this to be a creativity boost.

2\. By helping you maintain the same level of quality, they ensure that if you don't add any new features but keep fixing bugs (and unit testing the fixes), your bug-count will go down. That's a good property for a system to have.

3\. They give you the freedom to quickly and securely change your design, which in turn means you can keep improving quality, which in turn means you maintain higher productivity in the long run.

With this in mind the it seems the author's suggested alternative approaches fall short of what unit tests can do.

</comment><comment> alok-g An interesting quote from the article:

"I will say that I prefer Unit Tests to none when I'm forced to work with stateless programmers who can't remember what they were programming two weeks ago and operate without a design. They'll see a bug, tunnel vision on it, and wreck the whole code base trying to rewrite things to fix it. What's fun is watching them oscillate between two bugs over time without realizing it, fixing one while breaking the other, and vice versa."

I have certainly come across cases when programmers created >1 bug while fixing one (chain reaction!), but never oscillations like the author mentions. Has anyone else witnessed this? If so, can you provide an example?

</comment><comment><USER7> I find unit tests are useful due to a property they share with types, paired programming or formal specifications: you are forced to describe your program in two different "languages", and therefore have to think deeper about the problem. All of the aforementioned methods force one to code, as well as describe the intent behind the code. E.g., a unit test forces the programmer to describe the relationship of input/output, while the code describes the actual mechanism of linking input with output.

Code is always the most fundamental "description" of a program, but all the methods have some descriptive power. The process of having two separate descriptions should lead to a higher quality output, as divergences between the two show a possible misunderstanding of the problem, and hence a source of bugs.</comment>


Host Your Own Blog with Gitlab and Netlify - <AUTHOR> https://brainfood.xyz/post/20190518-host-your-own-blog-in-1-hour/ <comment><USER2> You know, I've been using the Bitbucket & Netlify ecosystem for my Wild Mind[1] website for a little over a year. I moved from a self-install of WordPress on Digital Ocean to the Victor Hugo[2] boilerplate and then used my own theme. It's been an absolute joy to build with and I've actually been excited to continue to write because the friction to doing so is largely gone. Really can't recommend Netlify or Hugo enough.

[1]: [https://www.wildmind.io](https://www.wildmind.io)

[2]: [https://github.com/netlify-templates/victor- hugo](https://github.com/netlify-templates/victor-hugo)

Edit: formatting

<comment><USER3> Beautiful! I've been loving Hugo for a while now, using it for a neighborhood organization, but I've yet to find a non-technical front-end for managing the content. I built this great thing but no-one else in the non-profit can contribute because they (understandably) don't want to or can't take the time to learn Markdown. Have you (or anyone) found a Hugo friendly front end?

<comment><USER4> One click Hugo cms [0] which provides a user friendly front end.

[0] [https://github.com/netlify-templates/one-click-hugo- cms](https://github.com/netlify-templates/one-click-hugo-cms)

<comment><USER3> Thanks, but we don't have the budget necessary for Netlify Identity. At least last time I checked, it is only free for a very limited number of users.

</comment></comment></comment></comment><comment><USER5> It's not using a blog hosting service but it's also not really hosting your own since Netlify is actually hosting it.

<comment><USER6> I think even using WordPress.com would be considered "hosting your own" in this context.

I think most of the time, "host your own" means you can do more or less whatever you want with your site. Rather than putting your content somewhere like medium or Facebook or Instagram where you are in a closed and controlled system.

</comment></comment><comment><USER7> I did almost exactly the same yesterday.

[https://blog.omerh.me/post/2019/05/17/first_post/](https://blog.omerh.me/post/2019/05/17/first_post/)

<comment><USER8> Nice theme, I built one some months ago I found none to my taste, so I modified my own

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

Now I just need to _start writing_

</comment></comment><comment><USER9> Also did something similar two weeks ago.[1] It's a big work in progress!

I'm using Rstudio's Distill framework[2], writing RMarkdown, hosting on Gitlab and publishing on Netlify.

Netlify is dead simple to setup, even the domain name and DNS re-direction. I'm also using one of their contact forms.

[1] [https://goodinplaces.net/](https://goodinplaces.net/)

[2] [https://rstudio.github.io/distill/](https://rstudio.github.io/distill/)

</comment><comment><USER10> I'm interested to know what the advantage of using Netlify is over simply using Github Pages.

<comment><USER11> idk if GH pages has added this, but Netlify lets you determine your build command and environment for deployments. You can also have different deployments per branch with easy rollback functionality. In short, its built for this exact problem where GH pages is a tacked on feature for repos.

<comment><USER12> You need "different deployments per branch with easy rollback functionality" to run a blog with a couple markdown files? Talk about over-engineering.

<comment><USER11> There's utility for different deployments per branch and rollbacks when you're connected to a headless CMS (Contentful, Wordpress API) and managing more complex statically-generated web sites.

</comment></comment></comment></comment><comment><USER13> This is a nice write-up, and it's great that it includes instructions for things like creating a GitLab account, which may be unfamiliar for non- developers.

But if you're going to maintain a blog as a set of markdown files, it'a worth considering using Netlify CMS (a web-based CMS for managing markdown files in a git repo).

This is especially the case if you don't use a command line or git often, e.g. if you're not a developer or sysadmin.

A good starter repo for a blog based on Gatsby, git and Netlify CMS:

[https://github.com/alxshelepenok/gatsby-starter- lumen](https://github.com/alxshelepenok/gatsby-starter-lumen)

I used the above for my blog, with only minor changes:

[https://www.encona.com/](https://www.encona.com/)

<comment><USER14> So if you're not a developer and familiar with git you suggest for people to use the ridiculously complex, react-based gatsy, and still use git too?

<comment><USER13> Not exactly. I suggest using Netlify CMS, which uses git under the hood, and means git is invisible to you.

One way to set something like this up is to use the gatsby template I linked, which can be used without knowing what React, GraphQL (or even Gatsby) are.

</comment></comment></comment><comment><USER15> Why u dont use just regular Gitlab Pages without Netlify?

<comment><USER16> What does Netlify bring to the table? Gitlab already has CI/CD.

[https://docs.gitlab.com/ee/ci/](https://docs.gitlab.com/ee/ci/)

Deploy a Blog site with Gitlab pages and Cloudflare [https://blog.zenggyu.com/en/post/2019-02-08/deploying-a- blog...](https://blog.zenggyu.com/en/post/2019-02-08/deploying-a-blogdown- website-with-gitlab-pages/)

<comment><AUTHOR> I've done such setups as well. E.g. my "personal" website cimnine.ch is set up like that.

Netlify was just a lot quicker to get started. It automatically compresses images, js, etc., if you tell it to. It automatically deploys branches to a special subdomain, so you can share previews of branches with other people. Also, though I haven't used that yet, it has this "Functions" thing that would allow you to add dynamic behaviour to your static website.

</comment></comment></comment><comment><USER17> I am loving Netlify!

However:

> The site will have free TLS and IPv6

Unfortunately, the DNS provider (dns1) does not expose DNS over IPv6. Therefore your site is exposed over IPv6 by Netlify, but it will not be reachable by a (probably non-existant) IPv6-only client.

Try:

dig AAAA dns1.p04.nsone.net

<comment><USER18> This not correct. The auth DNS resolves ipv6 records for that domain:

bash-4.4$ dig @dns1.p04.nsone.net AAAA brainfood.xyz +short 2604:a880:400:d1::8b0:4001

<comment><AUTHOR> The thing is that `dig AAAA dns1.p04.nsone.net` does not resolve anything. A pure-ipv6 network would not be able to resolve my domain, as there is no way to contact dns1.p04.nsone.net via IPv6.

<comment><USER18> Ah, ok I get now.

</comment></comment></comment></comment><comment><USER19> Why would you do this? Who else does it? And how is it superior to just signing up with a hosted Wordpress (like 30% of the Internet)?

EDIT: Feel free to downvote but please answer. TFA does not answer it.

<comment><USER20> Please avoid "why would you do X?" when discussing some tool or workflow. It's needlessly confrontational (and through that, restrictive of diversity, as different groups can have different needs and preferences), devoid of information (it doesn't explain the converse, _why you shouldn 't do X_), and lacking in imagination (establishes tradition as a hard principle, and not just a guideline that can be broken depending on the context).

It's good to want to know why some people want to _do X_ , but try to ask it in a way that doesn't make a negative assumption about the people taking a certain approach.

<comment><USER21> _try to ask it in a way that doesn 't make a negative assumption about the people taking a certain approach._

I feel like there is a LOT in this comment that is reading much more into a question that very likely are not even there, to take the position of scolding someone just because their inquiry was delivered in brevity.

<comment><USER20> I don't mean to scold, but I understand that it comes across as pedantry.

It's hard to give good advice in a tone that isn't paternalistic, and I should get better at doing that. Sometimes you just want to ask a genuine question without somebody questioning your phrasing.

What prompted me to give out advice is "Feel free to downvote but please answer". I don't believe the comment deserves a downvote, but I _assume_ (and it may be, as you put it, reading too much into it) that some downvotes come from people who are tired of seeing the attitude I describe in my reply ([https://news.ycombinator.com/item?id=7650799#7651343](https://news.ycombinator.com/item?id=7650799#7651343)).

It's a case of greedy matching /why would you do/.

</comment></comment></comment></comment><comment><USER22> Ha-ha, good one! I did the same but in 2 hours. Really recommend Netlify + GoHugo.

Here is my review of popular static site generators plus hosting: [https://medium.com/@tarasmatsyk/how-to-kick-off-a-blog- in-2-...](https://medium.com/@tarasmatsyk/how-to-kick-off-a-blog- in-2-hours-4bb142922185)

</comment><comment><USER23> We use Django + Distill on Netlify for static output from Django projects. Netlify is awesome. Example: [https://github.com/mgrp/django-distill- example](https://github.com/mgrp/django-distill-example)

</comment><comment><USER24> That is pretty cheap ($10/year with own domain), but I pay $12/year for a full-blown VPS and it is pretty stable (would not use it if my life depended on it though but it is more stable then my Comcast Internet service)... found it here: [https://www.lowendstock.com/](https://www.lowendstock.com/)

<comment><USER25> How legit is this? Seems too good to be true and more like a scam. Any experience anyone?

<comment><USER18> It's legit. Not a scam. I have no idea how Netlify can offer so much in their free tier, but they do. They are likely to get bought out by a Cloudflare, etc, at some point, so time will tell if the free tier will remain so feature- full.

<comment><USER18> Oh you were referring to lowendstock.com. Yeah, you'll need to be careful when considering low-end price VPS providers in general. Some can certainly be fly- by-night. You can find reviews and discussion at lowendtalk.com and lowendbox.com.

Here's some that are for sure legit and been around for a long time though (does not imply necessarily that providers not listed are not legit though):

Ramnode BuyVM Securedragon Lowendspirit

I personally use BuyVM and Netcup.eu.

</comment></comment></comment></comment><comment><USER26> I've hosted several small apps with Netlify, and I recently setup my first blog/brochure type site using Netlify CMS. It's awkward, but it's amazing to me what you can accomplish with a (free) build server, a couple small 3p services, and a CDN with so little effort.

Great dev experience, great user experience.

</comment><comment><USER27> I guess this is might be easier to set up but you could get something similar on AWS by posting to an S3 bucket and putting pages into CloudFront CDN. Adding CodeCommit could automate deployment for $1/month or you could write a script to publish new pages for free.

<comment><USER28> You've just reinvented netlify without the polish. But the polish is what makes it great. I've moved a few websites off S3 to netlify and the level of integration they offer is great. DNS, TLS certs via let's encrypt, preview builds for PRs, ..., that's exactly what I'm willing to pay for. And I know that if they make a business move I don't like, I can always move off again. No lock-in except the polish.

</comment></comment><comment><USER29> I have done the same for [https://jimmyislive.dev/](https://jimmyislive.dev/) (using Github and Netlify). All the code for this site is on GitHub (see the About page)

</comment><comment><USER30> I just did this for my product website. It's been wonderful using netlify and Hugo with the universal theme.

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

</comment><comment><USER31> just started using netlify after making my own tool that did something similar and being a holdout for awhile. it was a smooth experience and i am now a happy user. put up a mortgage calculator app: [https://www.mortgagecalculator.io/](https://www.mortgagecalculator.io/)

</comment><comment><USER32> i've used netlify for a few years, its great.

I use it with github. wanted to use github pages but was tired with having to use submodules in order for it to recognize the docs folder.

</comment><comment><USER33> Has anyone done something similar with GatsbyJS by any chance?

<comment><USER18> Browse down to rahimnathwani's comment

</comment></comment><comment><USER34> Its cool but I think hosting and configuring your own site/blog can be a rewarding experience.

Only last week I had to figure out why a file called btmp in /var/log was so huge.

Then I discovered fail2ban</comment>


Startup funding is slowing in San Francisco - <AUTHOR> http://qz.com/660835/you-dont-need-to-be-in-california-to-build-a-lucrative-startup/ <comment><USER2> This is non-sensical: "The biggest winners, by contrast, are much smaller, less coastal, and low-cost cities just starting to incubate their own ecosystem"

Since when was Boston, which experienced a 45% increase in VC investment and which still ranks #2 in total Venture investment a NON-Coastal, low-cost city? And the top growth location is San Diego (coastal, high cost). I think the key is to look at which sectors are experiencing growth and shrinkage in VC investment and see how that correlates to the locations in which those investments are happening.

BTW, Austin - it's not doing well.

<comment><USER3> Non-sensical is hyperbolic. You're pulling those two examples from a table that includes these rows:

Dallas $127,715,000 / 147% / $75,940,000

Detroit $66,985,000 / 145% / $39,640,000

Portland $42,600,000 / 675% / $37,100,000

St. Louis $23,930,000 / 327% / $18,330,000

Kansas City $13,670,000 / 297% / $10,230,000

<comment><USER4> Yes, but the two examples are at the top of the table and together significantly exceed the sum of the rest of the table.

<comment><USER2> exactly. And while the fly-over country (as they say) might indeed be non- coastal and lower-cost the quantities are sufficiently small to indicate that the conclusion is incorrect. It's not that being non-coastal or low-cost is an indication of where the money is going (Portland, San Diego, and Boston are clear counter-examples), it's that the ones that are non-coastal and showing growth in VC funding are being driven by a small number of large investments that are outliers.

So, when it says the "biggest winners"... they really don't mean the biggest winners. They mean that there are some winners that are interesting non- coastal low-cost living locations, but these are interesting winners, not the biggest ones. And of course the big winners are still coastal and high cost of living cities. There's nothing contraindicating in the research that VC patterns have shifted. EXCEPT in the case of Austin, which interestingly is the opposite of what they claim about the biggest winners. Austin was a big loser in Q1.

</comment></comment></comment></comment><comment><USER5> Isn't it just a maturation of the process? First we throw everything at a dart board, then we take notes on what sticks, and finally we repeat the steps that made them stick as best we can while wasting fewer darts.

Many of us here are founders and we'd love it if funding was effortless, but at the same time we can't allow hubris or denial to turn us into doomsayers. Things don't last forever.

</comment><comment><USER6> Here is a theory, Software as a Culture and Info vehicle is pretty much mature, the social, the news, etc. An average 20 year old is not well equipped with deep domain knowledge, a good example is flexport, I do not know much about founders but its a business, you need to have a deeper understanding where a 30+ would usually have. So, you will see start-up coming from much older people at the helm and not the younger people. May be this is my bias, but Software fed a cultural need, a communication and information need, we are moving into different realms. Realms which are distributed across the country and world and over all need DEPTH(in Domain) rather than horizontal trends.

<comment><USER7> The average founder is (or was) already 30+:

[https://hbr.org/2014/04/how-old-are-silicon-valleys-top- foun...](https://hbr.org/2014/04/how-old-are-silicon-valleys-top-founders- heres-the-data/)

<comment><USER8> But will it trend upward as the gold rush ends? I'd argue yes.

</comment></comment></comment><comment> rm_-rf_slash Here's the problem: most VC firms understand that 9/10 investments will fizzle out or make modest returns. 1/10 is the unicorn, the 100x. Everything depends on finding the unicorn and growing it like a weed, so every investment has to be treated like a unicorn - grow fast grow large NOW NOW NOW - whether it's actually beneficial for the company or not.

There's so much money sloshing around in the valley that when stupid apps that make no money like Yo or Yik Yak get enough attention, there is inevitably ONE investor who will think "what the hell, if I throw in 10k it could end up becoming the next Instagram or snapchat." As long as people keep joining, more investors will pile in, then the VCs, then Titans like Google will hopefully have their eyes on a shiny new acquisition.

The focus on huge fast returns when they seem to be happening all around you inevitably crowds out investments in companies that can create modest growth from real profit, and it makes investing in "slow" companies downright unfashionable.

To inverse the old Wall Street expression: "Nobody ever got rich from buying Big Blue."

<comment><USER9> Unicorns are rarer than 1/10 and 30% of investments generally pay off, according to research, with some positive results.

<comment> rm_-rf_slash Ok so my numbers aren't exact but you are right, the aggregate return of VC investments tend to be positive. Same with the stock market.

However, VCs are in more of a position to influence the growth of their investments. There is nonstop hype for companies that make zero profit because of the hope that it will enable bigger funding rounds, a buyout, or an IPO.

The only difference between overhyped no-profit startups and a Ponzi scheme is that the latter knows the investment is a bust, while the former isn't sure.

<comment><USER10> Actually, there are quite a few other differences, including the fact that Ponzi schemes are intentionally fraudulent, and the fact that the many of the "overhyped" startups actually do have a chance at succeeding, which is proved by the fact that some do succeed.

</comment></comment></comment></comment><comment><USER11> Surprise for me at the end of the article; I went to college with the Chicago guy who sold his startup to IBM. I should be happy for the guy but all I can muster is feeling intensely bad about my own startup failures.

Oddly, it felt good to confess that to strangers on HackerNews. Thanks for reading

</comment><comment><USER12> Remember Yo[0]? Maybe it's just stuff like that not getting funded anymore.

[0] [http://techcrunch.com/2014/07/18/yo-raises-1-5m-in- funding-a...](http://techcrunch.com/2014/07/18/yo-raises-1-5m-in-funding- at-a-10m-valuation-investors-include-betaworks-and-pete-cashmore/)

<comment><USER13> LOL That's still around? You just reminded me of this: [https://www.youtube.com/watch?v=vGFmJ631JBM](https://www.youtube.com/watch?v=vGFmJ631JBM)

</comment></comment><comment><USER14> I've seen Detroit mentioned as a potential tech city due to low costs, was not expecting to see that much funding there already. What companies/categories is that $66m going into?

<comment><USER15> This may be a case where the companies largely follow the funding as opposed to the companies following specific industries. The money is largely coming from public funding, and from Dan Gilbert (and similar investors) who are dedicated to growing the area. As far as I can tell, surprisingly few of the startups are automotive related.

</comment></comment><comment><USER16> "To be sure, the numbers outside the Bay Area are still relatively small. More capital was invested in Bay Area startups in the first three months of the year—$1.7 billion—than Boston and New York combined."

Have we seen anything to confirm that this statistic will change in the next 5-10 years? Boom and busts are quite normal but maybe the real-estate market will make this slowdown permanent? Is that with precedent?

</comment><comment><USER14> How come Raleigh never appears in these lists? Does it just not have much of a startup scene, despite being a tech hub with software company presence?

<comment><USER17> It's not about software companies. It's about the cool kids' club.

Think city/country club membership You might be doing well, but if you aren't in the club, you're nothing.

For all the talk of "techies" ruling the world, it's still the VC's that anoint people to the club.

</comment></comment><comment><USER18> What about the number of startups asking for money vs the number of startups that received funding. I don't think you can compare dollar amounts here making the assumption that there are a constant or growing number of companies requesting money.

</comment><comment><USER19> Denver has not felt like it has slowed down at all, though it has seen a -45% drop. I guess these numbers are somewhat divorced from the 'feeling' of an area then. It'll be interesting to watch.

</comment><comment><USER20> I had no idea that the Seattle VC market was that much smaller than San Francisco's (less than 10% the size), and I never would have guessed that San Diego's is nearly 70% larger.

</comment><comment><USER21> For markets with <200m of funding, a few big rounds could skew the entire market as being way up or down.

</comment><comment><USER13> I will be interested to see a study one day that shows the exact moment silicon valley investors decided enough was enough, and stopped investing in ventures that failed to generate returns.

<comment> rm_-rf_slash That was around the year 2000.

People eventually stopped joking about how stupid "eyeballs" are as a metric and forgot all about the late 90s. Now they make the same mistake because, well, take your pick:

-Mobile phones aren't desktops

-Big data

-This time it's different(TM)

<comment><USER22> -Cheap money with nowhere to go.

<comment> rm_-rf_slash -Someone you envy made lots of money on an investment you turned down and now you feel compelled to catch up.</comment></comment></comment></comment>


High-Level Comparison of JavaScript and Go - <AUTHOR> https://medium.com/xo-tech/from-node-to-go-a-high-level-comparison-56c8b717324a#.8oglxxg8x <comment><USER2> So very tired of "less punctuation saves typing time" fluff here. If ()'s etc are really that much of your typing time I question what you're doing.

Readability is a subjective concept but many of these "remove unnecessary parens" languages irk me because I would argue that they /do/ make code more readable (subjective!).

A lot of the "unnecessary" syntax has never been necessary for a parser - it's there to make the code easier for /people/ to interact with.

it also counts the benefits of static typing multiple times (seemingly not acknowledging that the earlier compiler errors are a by product of static typing not an addition to).

It tries to make a reasonable argument about how errors are handled in JS vs Go, but instead of saying "JS uses exceptions for error handling, whereas Go uses explicit error return codes" it goes into a weird "coding style" ramble where it complains vehemently about stack unwinding, but ignores verbosity (that a few paragraphs earlier was the worst thing in the world) of explicit error handling.

I think if the author hadn't tried to say this was a comparison, but instead said "reasons I like Go more than JS" I would not have had as much of a problem with this article.</comment>


Theranos Stops Drawing Blood from Patients at Capital BlueCross Store - <AUTHOR> http://www.wsj.com/articles/theranos-stops-drawing-blood-from-patients-at-capital-bluecross-pennsylvania-store-1454093470 <comment><USER2> Healthcare startups are like Cleantech startups were.

There is large amounts of capital being deployed, there are going to be high profile failures like Theranos, but at the end of the day the world will be better because of the few that succeeded beyond our wildest imaginations.

This is how innovation works.

<comment><USER3> This wouldn't be that big of a story if Theranos just failed. The story here is that they lied repeatedly to the press and possibly to investors.

Elizabeth Holmes' ability to raise money also seemed to be based entirely on nepotism, rather than the meritocracy that people want to believe SV has accomplished.

<comment><USER4> >Elizabeth Holmes' ability to raise money also seemed to be based entirely on nepotism.

Right, she should've rejected that money, it would only be fair if it was as hard for her as it is for us.

Why is it important that she has connections? Does being upset about that help you in any way?

Sorry, I'm really jaded about this kind of victim mentality. Ignore what advantages others have and build your tower as high as you can.

<comment><USER5> It's important because it means that capital is not being allocated optimally.

From an individual point of view, sure, you really can't control stuff like that, and you're better off concentrating on making your own stuff better.

But that's not the conversation here. This discussion is about the whole system, and particularly the statement that "this is how innovation works."

<comment><USER4> Who would you personally feel more comfortable lending money to, a complete stranger (who might very well need it more -- aka optimal distribution of resources) or someone within your family or close circle of friends, where you have some level of confidence that they will simply run off with your money or squander it?

<comment><USER5> Virtually everyone finds the stranger more comfortable. They may not say so, but a quick look at their finances will reveal most of their assets in bank accounts, stocks, bonds, etc., and almost none in the form of loans to family members.

<comment><USER4> Quite a perverse strawman from someone who just a second ago asserted what "this discussion is about".

<comment><USER5> Uh, you're the one who asked who I'd be more comfortable lending money to. If it's not relevant then why did you bring it up?

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> Interesting comment by a reader of the WSJ article: a former director of Theranos works for a company that manages investments for Capital BlueCross. He could have been instrumental when the initial cooperation formed. Of course, this is just a speculation.

</comment><comment><USER7> What! they can now do it without even a blood draw ? :=D

</comment><comment><USER8> A good time to be a lawyer in the Valley...</comment>


Apple Watch sales to consumers set record in holiday week, says Apple's Cook - <AUTHOR> http://www.reuters.com/article/us-apple-watch-idUSKBN13V0BT <comment><USER2> Is this real or some accounting trick? Anecdotally, I saw a lot of these being worn in public after they first came out, but there's been a sharp drop-off since then. This applies to Android watches too -- I don't think the product has been compelling enough for people to put up with nightly charging.

So are we supposed to see another glut of people wearing these things after this holiday season? Then maybe followed by another drop-off?

<comment><USER3> It would be extremely unwise for the CEO of a very public company to make such a statement if it weren't true.

The lift in units sold must definitely be affected by the recent price drop.

Anecdotal evidence: we have a fitness app that connects with the Apple Watch, and we have seen a large number of users connect their Apple Watch (about 7% of our total user base). We get data from these watches on a regular basis which means the watches are on and being used.

The battery is still terrible (barely runs a day) compared to Fitbit Blaze (5-7 days).

<comment><USER4> Maybe I do not use mine to its potential, but it is midnight here just before bed, and my series 2 is at 73%. Certainly not 5 to 7 days, but far longer than barely a day.

<comment><USER5> Same -- my series 1 is at 75%, and it's 9pm...

<comment><USER6> Also the Fitbit Blaze has 1/100th the functionality and cpu power.

<comment><USER3> Believe me, I'm a big fan of the Apple Watch.

Everytime I meet someone who uses (used to use) the Watch, it usually turns out they have given up because of short battery life. I have a series 1: looks like it has improved in recent versions. I'm glad to hear that. Mine barely lasts a day.

Battery life is really important. Many of my friends see smartwatches as primarily a fitness device, and when the comparison with Fitbit (or anyone else) happens, it usually comes last.

My hope is that Apple focusses aggressively on making the iWatch battery life longer. That would undoubtedly lead to further lift in sales and happier customers.

<comment><USER7> Unless you got it in the last two months, you don't have a series 1. You have an "Apple Watch".

* Apple Watch - released last year

* Apple Watch Series 1 - released in September of this year, has new CPU, but otherwise mostly same

* Apple Watch Series 2 - latest edition

</comment></comment></comment></comment></comment></comment></comment><comment><USER8> I laughed on "Apple's Cook" in the link title

</comment><comment><USER9> I just bought one of the nike+ ones to replace my year old fitbit. Built in GPS + Waterproof is what finally sold me.

Unfortunately and I'm guessing related to the story it is expected to be 10 business days from order for it to actually ship(across all models). Pick up in store was even longer with it being over 20 days at all the Apple stores I checked.

<comment><USER10> Waterproof or "waterproof"? My fitbit charge is "waterproof" but not recommended for swimming.

What's the software like too? From a brief look it seems like nike+ is mostly focused on running which fitbit has been moving beyond.

<comment><USER9> Waterproof to 50m. I'm replacing a charge HR which isn't even "waterproof" as far as I was aware(pretty sure they said to not even shower with it in the instructions).

To answer your second question:

I got the nike+ because I've started to get more into running lately. The only difference between the nike+ model and the others is a special interface for the nike run club app and a different wrist strap so not a huge difference but enough to make me choose it.

<comment><USER11> I'm having trouble figuring out what the Nike+ running app on the new watch does.

Does it do things like mapping of your route, graphing it, showing elevation and pace on sections, things like that? Can you run programs for intervals or hills sessions or advanced things like that?

I tried it in an Apple store and it just seemed like a stopwatch, but I wasn't sure if I was just not looking in the right place.

<comment><USER9> Yeah it will map your route using the built in GPS and show you Time/Distance/Pace/HR. I don't think it handles splits yet. I am doing one of the my coach training programs on the phone so I'm hoping it is seamless to the watch but I don't know for sure yet. If it sucks though I can always just go back to Runkeeper. :)

</comment></comment></comment></comment></comment><comment><USER12> That may partially be because of the timing of the releases. This is only the second holiday season for the Apple Watch, and this one coincides better with the wave of sales that is to be expected shortly after releasing a product (the original Watch was released in April 2015, the updated one in September 2016)

</comment><comment><USER13> It's the holidays, these are gifts. At this time of year sales <> adoption.

<comment><USER14> Would increased adoption rates drive app dev in significant new areas? Or does a bigger base primarily mean iterations on the same type fitness apps?

<comment><USER13> Personally I think it's a fad and not long for this world.</comment></comment></comment>


ISIS Kills Norwegian, Chinese Captives – What Do They Really Want? - <AUTHOR> http://www.nbcnews.com/storyline/isis-terror/isis-kills-norwegian-chinese-captives-dabiq-propaganda-magazine-n465536 <comment><AUTHOR> ISIS is really trying to become enemy of the world, terrorizing everyone with no countries left behind..</comment>


A14X Bionic to Be 'Nearly on Par' with 8-Core Intel Core I9-9880H - <AUTHOR> https://wccftech.com/apple-a14x-bionic-leaked-performance-results-comparable-to-core-i9-9880h/ <comment><USER2> Dangerous headline. ThIs is only according to a guy who estimated the gains between A14 and A14X based on previous gains.

</comment><comment><USER3> The i9 9880H requires 45 watts of power, an A12 Bionic uses what, 8 watts? Then there is the corresponding difference between active and passive cooling and having a larger mass to soak up heat.

If the first round of Apple Silicon for laptops doesn't leave the i9 in the dust, someone at Apple needs to be fired.

</comment><comment><USER4> No real data, only someone extrapolating</comment>


Bitcoin Guarantees Strong, Not Eventual, Consistency - <AUTHOR> http://hackingdistributed.com/2016/03/01/bitcoin-guarantees-strong-not-eventual-consistency/ <comment><USER2> I think people get consensus finality mixed up with eventual consistency. (To be fair, they do sound like similar things.)

Nakamoto Consensus (used by Bitcoin and others) never reaches consensus finality, i.e. a point in time when you can be sure that consensus has been achieved. All you can do is estimate the probability that a block is in the final chain.

That said, Nakamoto Consensus has some really nice properties compared to classical consensus algorithms. For example, most "classical" BFT consensus algorithms have a worst-case message complexity of O(N^2) (or in some new highly-academic algorithms O(N polylog(N))). Nakamoto Consensus, in contrast, has O(N) worst-case message complexity. That's what enables Bitcoin (and the like) to scale so nicely to thousands of nodes.

Of course, if you're building a permissioned ledger with 25 nodes, that's irrelevant; the classical algorithms will work fine.

There's more discussion of this in the SCP paper: Luu, Loi, Viswesh Narayanan, Kunal Baweja, Chaodong Zheng, Seth Gilbert, and Prateek Saxena. "SCP: A Computationally-Scalable Byzantine Consensus Protocol For Blockchains."

<comment><USER3> IMO, more interesting property than the messaging complexity is, bitcoin (in theory) allows <50% malicious actors in the consensus group. Lamport BFT only allows <33% malicious actors.

Of course, this comparison is not really fair because Lamport BFT achieves deterministic consensus, where as, bitcoin only gives probabilistic consensus.

I hope there is room for Deterministic BFT with <50% malicious actors.

> or in some new highly-academic algorithms O(N polylog(N))

Could you point me to this algorithm? I am not aware of any BFT solution other Lamport BFT.

<comment><USER2> There are many deterministic BFT protocols. PBFT is probably the most well- known. [1]

The SCP paper points to several BFT protocols with message complexity of O(N polylog(N)), e.g. [2]

[1] Miguel Castro and Barbara Liskov. Practical byzantine fault tolerance. In Proceedings of the Third Symposium on Operating Systems Design and Implementation, pages 173–186. USENIX Association, 1999.

[2] Valerie King, Steven Lonargan, Jared Saia, and Amitabh Trehan. Load balanced scalable byzantine agreement through quorum building, with full information. In MarcosK. Aguilera, Haifeng Yu, Nitin H. Vaidya, Vikram Srinivasan, and RomitRoy Choudhury, editors, Distributed Computing and Networking, volume 6522 of Lecture Notes in Computer Science, pages 203–214. Springer Berlin Heidelberg, 2011.

</comment></comment></comment><comment><USER4> This really highlights the differences between trying to understand and formalise the theory behind distributed systems and trying to practically build and use distributed systems.

In a practical sense, bitcoin pretty much has the property of strong consistency. That is a useful thing for people to know and understand. However, none of the theory that applies to strongly consistent systems necessarily _needs_ to apply to bitcoin, because bitcoin is not theoretically perfectly strongly consistent. This is also important for people to understand, as otherwise they may incorrectly assume that certain results apply to bitcoin, e.g. the CAP theorem, leading to confusion.

So, I really do believe it is important to differentiate between talking about the properties of distributed systems in a theoretical sense and talking about them in a practical sense. The current formalisations of distributed systems have mainly been built to understand the theoretical properties, which while can be useful as a starting point to understand the practical properties, its always important to note that distributed systems may have good enough approximations to useful theoretical properties for a particular use case.

<comment><USER5> From the standpoint of a single transaction, Bitcoin is consistent eventually. It's certainly not consistent immediately. Only when the transaction has been accepted into the blockchain and many blocks built upon its block is it effectively irrevocable. Early in the transaction's life, it's still revocable.

(The people behind Satoshi Dice found this out the hard way. They accepted bets with zero confirmations. Someone realized they could cancel a losing bet after losing by double-spending. Oops.)

</comment></comment><comment><USER6> Like several others (who got downvoted, I don't know why) who have pointed out - this article provides no citations and confusing reasoning. The definition of "eventual consistency" is that all systems converge to the same state after enough time. Yet the author seems to be saying Bitcoin is strongly consistent because (if we ignore things in their variable state) it will converge to an agreed upon state.

Apparently it is up to you how you want to interpret the use of "strong" or "eventual" here.

</comment><comment><USER7> This article has a very denigrating tone. And it doesn't even cite the research that it is trying to disprove.

</comment><comment><USER8> Given that the blockchain can split at any time with a probability based on incentive that approaches infitesmal values as chain size goes to infinity, the blockchain is not even eventually consistent. It is never consistent, only probabilisticly consistent.

<comment><USER9> What the probabilistic approach misses is that the blockchain can split for other reasons, so the exponentially small chance of inconsistency is irrelevant. For instance, in 2013 the blockchain was split for 6 hours (24 blocks) due to a block with more than 10,000 transactions that different software versions handled incompatibly.

The other thing the probabilistic discussion skirts is that even with an exponentially small probability, you need to wait inconveniently long. A Ω value of 6 corresponds to 1 hour. To get down to "alpha particle" levels of probability you've got a much longer wait.

<comment><USER8> How is the nonzero probabilistic chance of a split not a problem considering that vendors are relying on the durability of transactions that may appear in one chain but not the other?

</comment></comment></comment><comment><USER10> tldr: author claims if you only look at transactions with 6 or more confirmations, it's strong consistency (or rather, "your chances of observing an anomaly are exponentially small")

Anyone not using Satoshi's 6 confirmation rule is No true Scotsman.

No statistics are done on actual, real-life blockchain orphans to prove his claims.

<comment><USER11> This is why faster confirmations eg. Litecoin mean nothing. It's computing power and time.

<comment><USER12> It makes a difference to mining centralization. If you have a short confirmation time, it decreases the variance in revenue for individual miners and thus the incentive to join a mining pool.

Similar for the mining algorithm itself; memory-bound algorithms decrease mining centralization because ASICs become less useful.

</comment></comment></comment><comment><USER13> How is omega not equivalent to the time interval in common EC strategies. Also, saying that "EC" doesn't guarantee serializability sounds strange. It does, over t. And yes, CAP is widely misunderstood, but I'm not sure this is the fault of the academics.

Sounds kind of like this was written to a certain audience that is in a bubble wrt the wider field.

</comment><comment><USER14> > Because the probability drops exponentially with Ω, it's easy to pick an Ω > such that the chance of observing a blockchain reorganization is less likely > than having the processor miscompute values due to strikes by alpha > particles. If that's not sufficient for pedants, one can pick a slightly > higher Ω such that the chances of observing a reorganization are lower than > the likelihood that all the oxygen molecules in the room, via random > Brownian motion, will pile up into one corner of the room and leave one to > suffocate in the other corner.

This guy obviously doesn't understand what he is talking about. I would more probably remine the whole bitcoin blockchain on my cpu in a second than this thing happens.</comment>


Playstation 5 specifications revealed – but design is still a mystery - <AUTHOR> https://www.theguardian.com/games/2020/mar/19/playstation-5-specifications-revealed-but-design-is-still-a-mystery <comment><AUTHOR> Seems like a better (albeit similar) article has been submitted at almost the same time:

[https://www.eurogamer.net/articles/digitalfoundry-2020-plays...](https://www.eurogamer.net/articles/digitalfoundry-2020-playstation-5-specs- and-tech-that-deliver-sonys-next-gen-vision)

Discussed here: [https://news.ycombinator.com/item?id=22627899](https://news.ycombinator.com/item?id=22627899)

Mods, feel free to merge or whatever if this gets traction.</comment>


BrainChip Provides Details of Neural Network Architecture - <AUTHOR> http://www.eetimes.com/document.asp?doc_id=1328503&print=yes <comment><USER2> I don't really understand why they chose to simulate spiking neurons. The deep learning community uses simpler models based on ReLUs and such, so it seems that BrainChip will be missing on that market, which is currently huge. Do we have training algorithms for spiking neurons? Is this aimed mostly at biological simulations?

<comment><AUTHOR> I don't know anything about neural networks but the video in the article alludes to some advantage in terms of learning on the fly, which I'd appreciate if some expert could clarify.

What I'm trying to say is that perhaps the flexibility of spiking neurons is that the training can be done "online", in the sense of an online algorithm, i.e. the data is processed as it arrives instead of existing entirely in memory beforehand. Perhaps traditional methods used by the deep learning community don't have good properties in this instance?

Still, I believe there's a lot of future in "analog-esque" computation as we probe the frontiers of what's possible to fab and the cost of straight- jacketing the digital illusion onto tinier and tinier transistors.</comment></comment>