Reading Aloud to Young Children Has Benefits for Behavior and Attention - <AUTHOR> https://www.nytimes.com/2018/04/16/well/family/reading-aloud-to-young-children-has-benefits-for-behavior-and-attention.html <comment><USER2> Fine, as long as you accept that the main purpose of reading a story aloud is to relax and _enjoy the story together_ rather than to develop skills. Just as the main purpose of lego and similar toys is not to develop 'hand-eye coordination' but rather to build cool stuff. (Whatever claims are advertised on the packaging.)

This isn't a trivial point. If you read stories with the intention of fostering skill development you will neither inculcate skills nor get the most out of those stories.

 _> parenting coach_

Ha. The idea that there exist professional parents who explictly know what they are doing (with footnotes and sources) is a major conceit in our present culture.

<comment><USER3> The conceit exists with people who assume they are experts at something despite having very limited experience with the subject and zero attempts at research. Are you saying you or anyone else is equipped to be a decent parent just because you were a child and maybe had a parent? Or is it just because you are a decent person that you think you are equipped?

I know plenty of decent people who think it's okay to spank a child when we know full well that it results in kids thinking that violence is a solution to their problems. It took me years to unlearn yelling at people as a solution to my problems. It took me years to not fight every little semblance of stupidity I see. It took me decades to recover from depression induced by a father who still thinks to this day that he was doing the right thing by yelling at me for my every little wrong as a child.

This same ridiculous logic that spawned this frivolous criticism is the same logic that results in people saying "we've gotten along just fine for y years without x; you are being ridiculous for wanting or saying you need x." Feel free to substitute in electricity, clean water, doctors, internet, cars and child labor laws for x. And yes life finds a way despite a lack of technology or understanding but that doesn't mean we can't seriously improve our lives or the lives of our children by using either. If you took a second to look at current child development research you would see how out of your depth you are.

<comment><USER2> _> Are you saying you or anyone else is equipped to be a decent parent just because you were a child and maybe had a parent?_

Yes. I think that, as things stand, good parenting is largely a matter of being lucky enough to have oneself received good parenting, i.e. it's mainly a matter of tradition. This doesn't imply that one shouldn't attempt improvements here and there, some guided by science. My beef is principally with the idea that there's a scientific method to produce better people. Conceiving of people as _products_ rather than as ends-in-themselves.

<comment><USER4> > good parenting is largely a matter of being lucky enough to have oneself > received good parenting, i.e. it's mainly a matter of tradition

a) Tradition is extremely variable across both time and space, even within the West

b) we have largely moved away from some of the nastier edges of "traditional" parenting, with good reason

c) there has to be a huge number of people who feel they _don 't_ want to replicate the upbringing they had and instead want help, who deserve decent resources

d) given that parenting resources exist, it's better to have and use scientifically tested ones than ones that replicate the prejudices of the loudest voices

<comment><USER2> _> we have largely moved away from some of the nastier edges of "traditional" parenting, with good reason_

Corporal punishment, you mean. Yes. However we've regressed in at least one way: many toddlers are now in daycare for 30+ hours per week.

 _> given that parenting resources exist, it's better to have and use scientifically tested ones than ones that replicate the prejudices of the loudest voices_

Well, my original comment was more about how we _use_ resources. But it seems doubtful whether we can scientifically test for how good such resources are, except in terms of narrow criteria like safety. We can't yet look into children's imaginations and measure how fired up they are; we can only try to find out what our children enjoy and help them to do more of it.

Consider the Harry Potter books. They may have done more for literacy than _everything else combined_ since they arrived. Yet the first manuscript was rejected by many publishers, including some who no doubt had access to purportedly scientific advice.

Far better to look at what other families are doing, reading and playing with. And to read reviews online.

</comment></comment></comment></comment></comment><comment><USER5> I probably get as much out of reading to my daughter as she does. I absolutely love some of the stories. I will be very sad when she gets to an age when she no longer wants me to read to her. Mind you, a friend of mine was still reading to his daughter when she was 18, so hopefully I have a few years to go still!

Any recommendations for childrens stories that are a must read?

<comment><USER6> The Elephant & Piggie series, by Mo Willems.

IMHO, the best kids book we've encountered. Some of the nice features:

a) well drawn and sharply delineated characters. (One of my pet peeves about some kids books is difficult to distinguish images that tend to get lost in a sea of bright colors.)

b) the text is _large_ and changes size according to the emotions of the characters.

c) phrases are repeated -- great for language acquisition -- but not in a way that's irritating or vacuous.

d) funny stories; real emotions that toddlers can grok.

e) good construction -- high quality printing, thick pages, etc...

<comment><USER7> Completely unrelated & not meant to replace the books, which I adore.

Don't let the pigeon drive the bus, ios app is awesome. Exactly what I want in a kids app.

<comment><USER8> my kid loved this book, and I read it maybe 40 times, but the whole style + text, I still enjoyed it )

there is also one called (I think, not English native) 'it is not a box' really nice and kids love it

</comment></comment></comment></comment><comment><USER9> Why is this an article at all?

I also believe that playing video games with your kids has benefits. Also throwing a ball. Even kicking the ball with kids (btw, do not do that with baseball ball - lesson learned). Or just walking and talking about shit (sometimes literally).

I'm just sarcastic here (and angry on myself): I did many mistakes of not being around for my first kid but I'm trying to fix up with second and third. Please do listen to the old guy: spent time with your kids. Period.

<comment><USER10> I think that this is an article, because if children are read to they will be more literate, and then when they grow up their comments on the Internet will make more sense.

</comment></comment><comment><USER11> Studies which divide people into two groups and do "$THING_WITH_LIKELY_POSITIVE_EFFECT" on one group and _nothing_ on the other group are not very interesting or convincing IMO.

Normally, unless done really badly, initiatives like the one described here will have a significant positive effect.

More interesting studies follow the pattern of comparing different potential initiatives, or even better, comparing a surprising initiative with an obvious one. E.g. some studies have indicated that giving school children chess coaching improves their maths scores more than extra maths lessons.

That said, I'm hugely grateful to my parents for being very involved in reading aloud and telling stories while I was young. I'm convinced without the results of this study that there was a huge positive effect.

<comment><USER12> Would be nice to have a study on giving agenda-free positive undivided attention as a baseline and then variations with different activities.

<comment><USER13> Agreed. Kids need unstructured time too!

</comment></comment></comment><comment><USER14> It's sad that nowadays every second needs to be productive. The main benefit is to have a nice, focused time (device-free) with your kid.

<comment><USER15> Reading aloud is entertainment. It makes going to bed palatable and if you can master the pronunciation of the patois in the Joel Chandler Harris Br'er Rabbit books, little kids find dad talking that way totally hilarious.

</comment></comment><comment><USER16> I just want to share my story. My son always seemed to be behind his classmates. He's a bright, articulate, has an excellent spoken vocabulary, and a has wonderful sense of humor. He just always seemed to struggle in school through the early elementary years.

My son especially struggled with reading. In an effort to help him with reading, I spent huge amounts of time forcing him to read different books. I used Anki to help him memorize difficult words.

I did help him, but by the fourth grade he was still behind his classmates

Everything changed one day when I decided to back off and instead read to him (and my daughter) every night for pleasure. I stopped asking to read part of the book. I tried different books and quickly my son and daughter started to enjoy the nighttime ritual of being read to.

About half way through Roald Dahl's book the BFG, something clicked in my fourth grade son. He started reading the BFG on his own. Then he started to read during school downtime. When I'm driving him somewhere he is often now reading books in the backseat instead of playing games on his iPad.

My point is reading fun books to your children can help them fall in love with reading and thus make them want to read.

If I could give any advice to new parents is to read to your children every night (maybe take weekends off :-) ) and try and just have fun reading interesting stories to them.

Hopefully my son has found a lifelong love of reading, which will serve him well.

<comment><USER8> Don't take weekends off )

Really. Read to them every night in bed! It is an amazing bonding experience. Read fun books for both of you. I don't think you will have anything that you will regret less in your life!

</comment></comment><comment><USER17> There have been multiple and ongoing studies that show reading to your child helps develop multiple parts of the brain, including auditory processing capabilities that are essential to early reading development. The diversity of words matter, even the positive nature as opposed to negative tone of words matters.

[https://www.greatschools.org/gk/articles/word-gap-speak- more...](https://www.greatschools.org/gk/articles/word-gap-speak-more-words- to-your-preschooler-daily/) is one article that discusses some options but the original study can be found here:

[http://www.aft.org//sites/default/files/periodicals/TheEarly...](http://www.aft.org//sites/default/files/periodicals/TheEarlyCatastrophe.pdf)

There have been follow on studies discussed here

[https://www.edweek.org/ew/articles/2015/04/22/key-to- vocabul...](https://www.edweek.org/ew/articles/2015/04/22/key-to-vocabulary- gap-is-quality-of.html)

That show it also has to do with the diversity of words, and even their tone (the positive vs negative) that is a key driver towards how well they engage and grow.

</comment><comment><USER18> Just anecdotally, reading is the most powerfully positive shared experience I have with my kids, and we do everything together. We paint pictures, play outside, eat dinner, watch movies, play video games together, etc. But reading is different; when I read to them, they're quiet, they're well-behaved. They are really paying attention.

It's not the activity they _enjoy_ the most, and it's not proactively educational (at least not in the sense that I'm forcing numbers and letters down their throat), but it just seems to turn them into a different sort of kid for a few moments.

</comment><comment><USER19> Tldr</comment>


Forced Savings: Malinvestment and Overconsumption - <AUTHOR> http://www.acting-man.com/?p=25709

<comment><AUTHOR> I found this through a friend and it is a very interesting analysis of the impact of artificially low interest rates on the economy, in particular this intro:

 _" We want to discuss the problem of forced saving as it seems to us that it is of particular relevance to the current 'echo boom'. Also, it complements what we have previously written about capital consumption and the pool of real funding. In Mises' rendition of the business cycle, we can find two different conceptions of the term forced saving. A classical boom based on credit expansion results in both malinvestment and overconsumption, as the accounting profits of entrepreneurs and capitalists in the higher order stages of the production structure, as well as the increase in wages of workers employed in them, leads with a very small time lag to higher consumption expenditures. Not only that, but the artificially lowered interest rate provides a disincentive to saving, so that consumption overall actually tends to increase relative to the pre-boom configuration of the economy. Consequently, resources are not only drawn toward the early stages of production (that are temporally most removed from the final goods production stages) as lower interest rates make these investment projects seemingly profitable, but also toward the late stages, which experience a surge in demand."_

Which really resonated with me, it seems with interest rates so low people are drawn to invest in startups more aggressively than they might if there was a more reliable return in the markets.</comment>


Ask HN: Career advice – (long) LOA after taking a new SWE position - throwaway-loa I'm currently studying for tech interviews after leaving previous company (after 6 years) for hiking few thousand miles (Pacific Crest Trail + more). I have the privilege to be able to dedicate a lot of time for studying at the moment, which might help increasing my chances of passing interviews at Google/Amazon/FB. However, it's likely that I'll want to go on another 4-6 months hike (CDT) in a year from now. It'd make no sense for me to invest so much of my time to try and get an offer from one of these companies just to quit a year later (or even perhaps even two), which leaves me with other options whose feasibility is a big unknown for me:
1. Get an unpaid leave of absence - that would be ideal, though I have no idea how long after one starts working in any of these companies, it's possible to get 5 months off.
2. Delayed contract - use this one year to work for another company while preparing for job interviews at Google/Amazon/Facebook. Attempt to interview 2-3 months before quitting for hiking and if I get offers, I'll try to sign a contract that starts shortly after my hike should end. I've heard (I think it was on SE daily) Google offering contracts for up to a year forward but I'm not sure if it's a standard thing and how it'd work on the other two.
3. Combine these strategies - try to sign a contract with one of the big four that's not on the top of your list, interview for the others before going for a hike and attempt to leverage the current position in order to get better offer on a delayed contract. This is obviously is the least likely option with a lot of unknowns to it.
So, my questions are: What do you know of Unpaid LOA in these companies? Same for delayed contracts and finally - are these options I described here even make sense? What other options would you come up with if you had some time to spend on studying now but you wanted time of in about a year from now?
Thanks. <comment><AUTHOR> Go on your trip and come back, study and do something with your life.

<comment> throwaway-loa I will, in a year and a bit, but my questions remain.</comment></comment>


Ask HN: Why is it fashionable to grin like the Chesire Cat in profile photos? - <AUTHOR>

Title says it all. If you haven't noticed them already just search for 'ruby developer' in Google images.<p>It seems to be most pervasive among people in finance, followed by the startup crowd. <comment><USER2> I did the search and they're just smiling.... I'm not sure what you're seeing. Some clarification or examples might help.</comment>


Free SSL Certificates and SSL Tools  ZeroSSL – Zero Cost SSL - e-sushi https://zerossl.com/ <comment><AUTHOR> Nice idea, beautiful execution.

I would make it more clear that you are just using Lets Encrypt tho. My first thought was just "lol, why should i trust this". Anyway, i started the same (based on the same code as you) but never finished :) Kudos</comment>


Deep Learning: What, Why and Applications - <AUTHOR> http://aiehive.com/deep-learning-applications/ <comment><USER2> The cached content: [http://webcache.googleusercontent.com/search?q=cache:http://...](http://webcache.googleusercontent.com/search?q=cache:http://aiehive.com/deep- learning-applications/)

</comment><comment><USER3> If you already know a bit about Machine Learning don't read this, you will gain nothing. If you don't already know about Machine Learning don't read this, you will not learn anything here. I have no idea how this can be trending. Over-simplified, generalized bs.

<comment><USER4> > If you already know a bit about Machine Learning don't read this, you will > gain nothing. If you don't already know about Machine Learning don't read > this, you will not learn anything here. I have no idea how this can be > trending. Over-simplified, generalized bs.

indeed. much better off reading this instead: [http://karpathy.github.io/neuralnets/](http://karpathy.github.io/neuralnets/)

<comment><USER5> For me the dificult is rising too fast after "Strategy 1"

First they come with

        f(x,y) = xy

Well, sounds easy.

suddendly

        df(x,y)/dx = (f(x+h,y)-f(x,y))/h

wait what?!

<comment><USER6> This is essential knowledge you can get from a number of different places: first semester of university, any sort of 3d or image/signal processing, or just plain old wikipedia.

You could still use a deep learning framework as a black box without knowing how to differentiate a function. However, you'd have trouble following any relevant blog post / scientific paper, understanding _how_ it works or developing any relevant new algorithm.

<comment><USER5> Okay, I'm sorry.

The article is well written, my brain just turns off if I read higher math.

</comment></comment></comment></comment></comment><comment><USER7> >> Figure-2 shows that performance of deep learning is much better than non- deep learning algorithm.

This is a nonsensical over-generalization.

>> In addition, it is automatically do the feature extraction.

At the cost of interpretability. Let's not even mention the dreadful nights of tweaking parameters (such as dropout probability, activation function, network architecture, learning rate, optimization function, various pre-processing tricks, pre-training to warm-start, convolution parameters, maxpool parameters, and so much more).

<comment><USER8> I know nothing about deep learning but I'm curious. Why can't tweaking parameters be automated? Why is human intuition necessary here?

<comment><USER9> > Why can't tweaking parameters be automated?

Not only that it can be done, but it works even by random trial. Sophisticated optimization techniques work out just 2x faster, so if you have cheap GPU, you can run 2x more trials and get your hyperparameters fine tuned.

If you want to apply optimization, you can use one of the popular libraries like hyperopt and MOE.

<comment><USER10> This really depends on what the hyperparameter landscape looks like. In general, global optimisation is a very hard problem and doing it by random sampling might take longer than the lifetime of the universe (cf Levinthal's paradox for proteins).

</comment></comment></comment></comment><comment><USER11> Slashdot/HN effect:

Resource Limit Is Reached

The website is temporarily unable to service your request as it exceeded resource limit. Please try again later.

<comment><USER12> Well, at least he set one. Imagine this poor guy would have needed to oay over $1000 :)</comment></comment>


New York's last remaining independent bookshops - <AUTHOR> https://www.theguardian.com/books/2018/jun/02/new-york-remaining-independent-bookshops-booksellers-ungar-bohbot <comment><USER3> I'm guessing the problem - as with most small retail stores in Manhattan - <USER2> rising rent. Ironically, that is resulting in plenty of retail vacancies.

<comment><USER4> I have a hard time believing that this is the main problem. I used to live near the mentioned St. Marks Bookstore and visited it several times a month. I moved before it closed in 2016, but I remember what it was like when it was fighting hard via crowdfunding [0] to stay alive. Even at that critical time, the place felt like a ghost town. Yes, high rent was a factor, but only because it didn't seem to get much business as Amazon/Kindle continued to grow.

From the article:

> _That extends to its bookshops, many of which have fallen to astronomically > rising rents. St Mark's Bookshop, for example, which opened in 1977 and > became a sort of literary HQ for punks, was the oldest independent bookshop > in Manhattan until it closed in 2016, despite celebrity support from Patti > Smith and Salman Rushdie._

I'm confused. Isn't The Strand (just a few blocks away from St Mark's original location) an independent bookstore too? Wikipedia says it was founded in 1927 [1]. That was another bookstore that I visited frequently, though I would argue that it's reached a certain level of critical mass and success that makes it able to buck the general trend -- even if Amazon has a bigger selection and better prices, visiting The Strand is a worthwhile experience in itself. Similar to B&H Photo Video [2]

[0] [https://www.huffingtonpost.com/2012/08/01/st-marks- bookshop-...](https://www.huffingtonpost.com/2012/08/01/st-marks-bookshop- crowdfunding_n_1729819.html)

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

[2] [https://www.bloomreach.com/en/blog/2016/03/bh-photo- competes...](https://www.bloomreach.com/en/blog/2016/03/bh-photo-competes-in- the-amazon-era.html)

<comment><USER5> I think there's two elements. One is rent, which is a very real issue: Saint's Alp and The Cheese Shop never had a quiet moment, were basically on the same block, and have both gone belly up.

That said, the bookstore sucked. It had far too few books per square foot - easily an order of magnitude or more less than the Strand - but their curation was, outside of political tracts, bland and unsurprising. I'd never walk in there and find the book I was looking for; I'd never walk in there and find an unexpected gem. You have to deliver at least one of those, and your curation had better be top notch if your position is "we will only stock a (relative) handful of books."

They went out of business because they were bad at what they did, but great stores on the same block can't cope with the rent either.

</comment></comment></comment><comment><USER6> For those wondering where the list of bookstores actually is there are about 25-28 here :

1\. [https://mymodernmet.com/ny-indie-booksellers-bohbot- ungar/](https://mymodernmet.com/ny-indie-booksellers-bohbot-ungar/) 2\. [http://www.franckbohbot.com/nyib](http://www.franckbohbot.com/nyib)

I think the full book including interviews is yet to be published.

<comment><USER7> Ah thank you. This is a great list. Surprised to see that Argosy didn't make the cut. Its actually the oldest indie bookstore in NYC now. Also started on book row back in the 1920s. The place is a treasure trove. I would highly recommend it. You can kill an afternoon in there [1]

I love that they included that woman on Astor Place though.

[1] [https://www.argosybooks.com/](https://www.argosybooks.com/)

<comment><USER6> Thank you. I have to check it out next time I am in NYC. The article also reminded me of the roughly 200 Seine-side booksellers in Paris.

<comment><USER7> The "bouquinistes" of Paris, yes. There used to be more of that style along stretch across from Cooper Union before the IBM building was built. That's why I loved that they included that one woman who is still there hawking used books on the sidewalk.

Definitely give Argosy a visit, you won't be disappointed. If you are a bibliophile and want to see the rare book offering on the 5th and 6th floors you can do so by simply making an appointment ahead of time. But even just visiting the other 3 floors is more than worthwhile. Cheers.

</comment></comment></comment></comment><comment><USER8> Since I did not see any entries from Queens (One of the five boroughs of NYC), I would like to add Astoria bookshop and a new entrant in Kew Gardens - Kew & Willow.

The story of how Kew & Willow came to be is also interesting: [https://www.kickstarter.com/projects/1844468864/lets- bring-a...](https://www.kickstarter.com/projects/1844468864/lets-bring-a- bookshop-back-to-queens-ny?ref=thanks_tweet)

</comment><comment><USER9> This is a example of great photojournalism. The images of the booksellers tell a great story on their own.

</comment><comment><USER10> What's sad is that the great neighborhood bookstores never manage to own their spaces. That was just as true 40 years ago (when my favorite in a retired old- fashioned brick firestation went under.)

I'm probably wrong (never talked to an insider) but owning just doesn't seem to be in the DNA of the store owners to go for that. A shame for them, and for the fate of the thousands of books that make them special in the first place.

<comment><USER11> Running a business is about cash flow.

<comment><USER12> Yes, and if you have a landlord then the cash will always end up flowing in their direction.

</comment></comment></comment><comment><USER7> Did I miss something obvious where is the actual list of the 50 independent book sellers?</comment>


Sunrise - Your New Calendar - <AUTHOR> http://www.sunrise.am

<comment><USER2> I like the UI and the fact that is not another Metro style app.</comment>


How long does it take to create a website from scratch? - <AUTHOR> https://toolbox.humandeluxe.com/2020/08/12/website-in-5-weeks <comment><USER2> The actual title of this is "How we Approach Website Design at Human Deluxe" and doesn't appear to have anything to do with the submitted title</comment>


Ask HN: Any bare metal server service to setup hackintosh for CI? - sahin-boydas <comment><AUTHOR> never thought of this before but i like your thinking</comment>


Train Derailment Caught Live on Web Cam – September 15, 2020 - <AUTHOR> https://www.youtube.com/watch?v=4oyMx-ta_sY <comment><AUTHOR> Here is the live Youtube Link so you can see their (amazingly quick) cleanup progress. [https://www.youtube.com/watch?v=hNvU59Ld8aA](https://www.youtube.com/watch?v=hNvU59Ld8aA)</comment>


Don't let the cheap Comcast HBO deal fool you, cord-cutters - <AUTHOR> http://news.cnet.com/8301-1023_3-57609299-93/dont-let-the-cheap-comcast-hbo-deal-fool-you-cord-cutters/

<comment><USER2> Money quote:

The No. 1 reason Comcast's offer shouldn't signal the start to an HBO-loving cord-cutter's dream: Time Warner brass isn't interested in them as customers, even though there's definite demand. The JP Morgan study found that a stand- alone premium content service like HBO Go or Showtime Anytime could sway 62 percent of that group to drop their existing cable service.

</comment><comment><AUTHOR> Hey everyone, I posted this in the related thread, but I'm really curious about it:

Has anyone in the U.S. had any success signing up for and using the HBO Go standalone service "HBO Nordic AB" through a VPN? It's only $12 a month in Sweden, Norway, Finland, and Denmark.

Is the content automatically subbed or dubbed, or is English the default?</comment>


Ask HN: Practical CS papers you've read and would recommend? - <AUTHOR>

By practical, I mean papers that explain individual concepts that you can implement over a weekend, preferably systems-oriented rather than math-oriented. I'd welcome papers from the earlier days of computing that contain an idea that has stood the test of time. At the top of my head are areas such as compilers or implementation of particular algorithms.
Reason:
I'm a soon to graduate CS student, and although I've learnt a whole bunch of things and can code reasonably well, I feel that I'm not as well-grounded as I should be in CS theory.
I'd rather not move on the grad school immediately as I'd like to get some industry experience, but I plan to work through TAOCP volume 1, and then the dragon book (compilers). I feel that working through some CS papers first would prepare me for this exercise. <comment><USER2> I'm not sure whether you would consider this paper systems-oriented, but it's fun and sort of practical. "A Play on Regular Expressions" is literally a 3 act play about efficiently implementing regular expressions with code in Haskell. I've been working through it and trying to adapt some of the code for a workshop I'm giving this summer, and it's been very readable and interesting.

<http://sebfisch.github.io/haskell-regexp/regexp-play.pdf>

<comment><AUTHOR> Thanks! I'll try it out once I can understand Haskell syntax..

</comment></comment><comment><USER3> "The Anatomy of a Large-Scale Hypertextual Web Search Engine" (PageRank) <http://ilpubs.stanford.edu:8090/361/>

"A Method for the Construction of Minimum-Redundancy Codes" (Huffman Coding) [http://www.ic.tu-berlin.de/fileadmin/fg121/Source- Coding_WS1...](http://www.ic.tu-berlin.de/fileadmin/fg121/Source- Coding_WS12/selected-readings/10_04051119.pdf)

</comment><comment><USER4> Dancing Links - Donald Knuth - <http://arxiv.org/abs/cs/0011047>

Lots of fun and is a weekender, but you can expand it to solve anything from sudoku to all kinds of tiling problems. David Goodger's webpage, <http://puzzler.sourceforge.net/>, solves all sorts of polyform puzzles using DLX algorithm.</comment>


How to know when to break the rules (of design) - <AUTHOR> http://www.6wunderkinder.com/blog/break-rules-to-design-better-products

<comment><USER2> FYI: You can click the images with the blue plus to open a slideshow that shows what the article actually means.</comment>


Show HN: Nodal. Next-Generation Node.js Server and Framework - <AUTHOR> http://www.nodaljs.com/ <comment><USER3> Long time Django (and occassional rails) dev here.. I've messed with Node from time to time but never really been wowed by the fragmented eco-system around Express (or flask either for that matter).

This looks like a node framework that I'd really enjoy using - first time I see a framework that feels like it fits around ES6. For me personally, having a good ORM and models layer, coupled with migrations have been a deal breaker in choosing a framework, and I'm very happy to see that here.

Is everything written from scratch or are there dependencies? If so, it sounds like its actually quite an opinionated microservice architecture.. Lately I've felt like microservice and microframeworks have gone hand in hand :)

Great job!

<comment><USER4> It's been a while for me since I last used Django but i recall it not having a migration framework (besides south).

Language preference aside, I feel as though rails might be a better Django than Django is in almost all areas that you define as deal breakers.

<comment><USER5> Starting with Django 1.7, migrations have been available in the core package.

</comment></comment></comment><comment><USER6> A little off-topic, but I figured the people reading the comments here would be the best place to ask. Why use JavaScript on the server at all? I've developed on both the front end and back end, and written non-trivial server- side code in a number of languages, and I don't see any use-case where JavaScript is "best-in-class." It seems like whether you're aiming for ease/speed of prototyping, pure performance, a good concurrency model, or... any other task I can think of, there's a better tool for the job. There seems to be a decent number of people and companies using Node, though, so let me know what I'm missing!

<comment><USER7> One language to rule them all. There is no way to handle complex UIs in the browser without JavaScript. So while you absolutely need JS developers, why not make the API/backned in the same language so that you can hire additional developers that know the same language your existing employees already do. From an employer's perspective, it's easier to manage and (re-)allocate resources if need be.

JavaScript is becoming the web darling (or it already is?), whether we like it or not. And with some nice syntactic improvements ES6 brings, I don't mind.

<comment><USER8> >There is no way to handle complex UIs in the browser without JavaScript

Dart, ClojureScript, TS (technically JS superset but still a considerable improvement) are just the ones I've used.

And I'd rather use both of them on server (Dart/Clojure) than JS.

There are other languages as well.

ES6 is a pain in the ass - no browser supports it and using transpilers + polyfills and the JS build/package tools to set that up is a PITA that only grows as you add dependencies and it bloats your code size to be comparable or larger than the compile-to-JS languages without making the language significantly better.

<comment><USER9> Why is transpiling ES6 any more of a PITA than transpiling Clojurescript? ES6 to ES5 is a one shell command with Babel. And TS is ES6 but with type annotations. And ignore all of the myriad of high quality plain JS modules on npm at your peril. I like Dart and ClojureScript too, but I've really enjoyed working on ES6 and ES5 projects too. I don't doubt your Dart and ClojureScript credentials, but your comment betrays ignorance of ES6 and the plain JS ecosystem.

<comment><USER8> >ES6 to ES5 is a one shell command with Babel.

You still need to include core.js to polyfil basically everything from standard library. And then you need to make sure Babel works with your framework (like Polymer or what not), and that's just the start of the interop hell that is using different JS libraries together. Rule of thumb - <USER2> you add to your JS build system = increase in the likelihood of hair pulling when things break - and babel and core.js are two such things.

The value I get from ES6 compared to the CLJS change how much I'm willing to tolerate the PITA factor of the build system.

In dart I don't have to do any of that, just add few lines to pubspec.yaml with dependencies and transform directives and off I go. And every other library uses the same build system and the same package manager and the same standard library !

<comment><USER10> I have not found that to be the case. I run my code through gulp-babel and done. There is no runtime AFAIK, although there was one for traceur.

I have also had no real problems interopping with other big libraries. I think the biggest point of discontinuity would be the class keyword vs other class- like libraries (like coffeescript's implementation). Even that's not too bad, I'm able to extend those using es6 class syntax, I just need to be careful about calling super and setting up the constructor properly.

</comment></comment></comment></comment></comment></comment><comment><USER11> Great work and very good presentation.

(These comments are just from watching the first video.)

But how is this next-generation? It seems to be very inspired by established widely used web frameworks such as Ruby on Rails. With elements such as ORM, routing, controllers, HTML templates.

It also seems to require a lot of code generation. Is that really constructive? (What happens if I edit the various generated files, would I still be able to add field to a record using the command line tools). Couldn't you have moved some of the boilerplate into the framework?

Why not use ES6 imports? (Rather than require / Nodal.require)

Why create an ORM rather than use a JavaScript-orientated NoSQL database? (mongo, couch etc.)

<comment><USER12> >Why create an ORM rather than use a JavaScript-orientated NoSQL database? (mongo, couch etc.)

I could be way off here (and I probably am) but shouldn't frameworks abstain from being too opinionated about the particular technologies that you use? The database (or type of db) you choose seems like something that should be based on what your application's requirements dictate not what your framework prefers right?

<comment><USER13> My opinion differs: if you're going to package your tool as a "framework" rather than a "library", you should integrate a large vertical section of the technology being used. This doesn't mean you have to be coupled with a particular database server, but you should at least have special support for one that can be swapped out for something else.

If a framework can't offer me this kind of functionality, why would I want to use it over a library with all the control benefits that brings.

</comment></comment></comment><comment><USER14> The project is still 0.5 and it has a lot of cool ideas that most other NodeJS frameworks lack. That being said, here are the things I feel would be worth improving, based on the first video:

Writing tests for the Controllers would be a real pain, because you would have to do a lot of ad hoc mocking, it would be better if the controllers would return something instead of calling the this.render.

You might be able to make the the controllers into POJO's.

The file naming conventions are weird, mixing camel case coding with underscore filenames is just unnatural.

Having a custom 'require' function in the framework, means that any code I write, is dependent on the framework itself.

The automatic migration generation is pretty sweet.

Coupling the data models with DB configuration is a bad habit.

The use of static methods to define aspects doesn't feel natural.

Having one big routing file doesn't scale, the routings should be expressed in the controllers.

Overall I would recommend adding in TypeScript, it would allow a lot more cleaner code.

<comment><AUTHOR> Thanks for the suggestions, but a lot of the things you dislike were choices made very purposefully.

1\. POJOs are ugly and you must revert back to using Object.create() for inheritance, breaking the design pattern of using ES6's class syntax.

2\. PascalCase class <-> camelCase instance <-> underscore_filename <-> underscore_tablename is a standard borrowed from Rails and easily managed through the npm inflect module (i).

3\. It's just a shortcut. You can use normal CommonJS require(), you'll just have to resolve the relative path yourself.

4\. Thanks! :)

5\. Models can exist without database connections and with manually defined schemas. If you check through the commit history, I used to keep database and model completely separate but there was way too much code reuse / smell (passing in a db as a parameter on every function call).

6\. The alternative is setting properties with ClassName.prototype.value = 'xyz'; or ClassName.value = 'abc'; Static methods provide an easy to read + concise way to do this for you (and take care of additional functionality). Also borrowed from Rails.

7\. Chose that pattern because it is very explicit / ordered. How do I determine what order the routes are hit when I specify them per Controller? And if I define them on the Controller, that means I need to load all Controllers globally on Application start.

8\. I'm happy with how clean the code is now. :)

</comment></comment><comment><USER10> This looks interesting, and although I'm already committed to an ad-hoc framework on my current projects, I'll check it out for future ideas (or to import some of your ideas into my current projects).

Having the framework be batteries-included is nice, but also nice would be decomposing it into modules. For a good example of this, check out the Hapi.js server ecosystem. Lots of different plugins, and if you want object validation outside of the hapi.js world, you can just use Joi alone. It lets me mix-and- match stuff. A concrete thing here is the ORM layer (which hapi.js doesn't have). If I could pull your ORM out from the server stuff, I'd be a lot more likely to take that part at least for a spin.

<comment><USER10> Some other minor things:

promises are rad, and I know I can just use Bluebird's promisifyAll to wrap your code. But still, it would be nice if I didn't have to muck around with that and async methods called without a callback returned a promise by default.

middleware is rad, it lets me abstract out pre-processing that happens on (say) every POST route to validate parameters. It doesn't look really feasible to do that with this system. I'd basically just have to bake all that into the post() method, which isn't super-modular and is probably harder to write unit tests for.

can't say that I'm wild about regex routes by default. I dig stuff like 'items/:itemId' with named parameters in a microsyntax. Makes life a lot easier.

<comment><AUTHOR> Nodal supports Middleware for _post-processing_ controller output (gzip, etc.) and I could do something similar for pre-processing but right now it's just encouraged that you write your own intermediate controller, get all controllers to inherit from it and do something like a super call. Will think about what pre-processing middleware would look like / be called.

<comment><USER10> Yah, I had thought about inheritance and super, but without multiple inheritance, it'd be tricky.

Basically a lot of my routes do stuff like parameter validation (I store specific criteria on the model class, but apply them in the route), creating a new object from validated post params, loading from the database, storing to the database, authorizing and authenticating, etc. Then my route definition declares the per route middleware and the specific controller only has to encapsulate route specific business logic.

I could do that just by putting it all in a utils package and calling loadItem(), validate params() etc at the top of each handler, but that feels less elegant.

It may be that I've just been using hapi.js for too long, the modularity and composition in that framewrok.is quite elegant, IMO.

</comment></comment></comment></comment><comment><USER15> You'd save yourself one line of indentation if you encouraged module.exports = Controller; at the end of the file instead. Node already puts a closure around the module, no need for another one.

<comment><AUTHOR> I like the IIFE because of the way it reads. A developer new to Node.js It's impossible to miss. Putting your export line at the bottom is begging for silly bugs. Even if they're quick fixes, still annoying.

<comment><USER16> Seems like:

      export default class ...

would be the clearest and least bug-prone and satisfies the "no extra closures" complaint. Considering you're buying into other ES6isms, why not use that one too?

<comment><AUTHOR> Will definitely be changing the module system to ES6 in the future. For now I prefer this pattern. :)

</comment></comment></comment></comment><comment><USER17> That is one blatant ripoff of the Nordic semiconductor logo... [http://www.nordicsemi.com/extension/nordic/design/bootnordic...](http://www.nordicsemi.com/extension/nordic/design/bootnordic/images/NordicS_smarter- things.png)

<comment><AUTHOR> Haha! Wow! A friend I've known since 5th grade made a bunch of different logo variations and I chose that one. Swear neither of us have ever seen / heard of this company. Hilarious (?). I liked it because it reminded me loosely of the N64 logo.

<comment><USER18> For what it's worth, I prefer your friend's version :)

</comment></comment></comment><comment><USER19> Perhaps it is just me, but I much prefer functionality broken down in small packages, rather than offered as a complete framework. The advantage is that module boundaries are more clearly defined, and that parts can be more easily understood, and, most importantly, they can be more easily replaced.

<comment><USER20> That only works if they are made by the same "team". Otherwise you end up with the current mess that is the JS-ecosystem.

</comment></comment><comment><USER21> If the developers are lurking, here's some feedback on the site: please fix the light blue on light blue text.

Edit: I'm on my phone and I zoomed all the way in, and I see that it's actually white text, which is still bad.

<comment><USER22> Yeah, I know not everyone puts much stock in accessibility but this is actually really hard to read thanks to the contrast. Hopefully if the devs do see this they can check their colours here:

[http://webaim.org/resources/contrastchecker/?fcolor=00E1FF&b...](http://webaim.org/resources/contrastchecker/?fcolor=00E1FF&bcolor=ffffff)

<comment><AUTHOR> Thanks for this. I'm not a (visual) designer by nature so I often miss things like this. I've made a small adjustment, but I'll make a bigger one as soon as I can!

<comment><USER23> I would check it on mobile when you update it. I usually do the majority of my HN browsing on my phone, and I don't think I'm alone.

Good job btw, this looks very nice as an alternative to the micro-framework world of Express.

</comment></comment></comment></comment><comment><USER24> I honestly prefer developing the application from ground and having more control. The framework may be handy for short time to market requirements.

Anyway, I found one or two interesting things reading the source code, so even not being a Nodal user it delivered value to me.

<comment><AUTHOR> Understand completely. I share the same feelings, which is why I built Nodal. I was building my Node applications from the ground and building the same things each time ;), felt I wanted a standard set of tools.

I'm really flattered you found things you thought were interesting! Would you care to share?

</comment></comment><comment><USER25> It seems like Node is steadily advancing toward being more enterprise-ready in terms of its frameworks.

<comment><USER14> enterprise-ready would mean that it is well documented, stable and mature, which it is not.

</comment></comment><comment><USER20> I'm slowly starting to genuinely understand DHH Omakase rant. The whole "modularity" part of Node doesn't seem to work out so well. Constantly have to look for third party support for simple but necessary things. Eg Strong Params, json builders or a Mailer. I wish there was JS framework that offered everything out of the box as a first party support or at least a decent API libraries could use. Like ActiveModel is used by various NoSQL gems.

<comment><USER3> I think it depends on what you do. I spent first half of my career ordering a la carte.. In hindsight, I ended up building a lot of crap that the framework should have provided for me.

This is the major reason why I have learned to be cautious with getting wowed by the apparent simplicity of micro frameworks.

At the very minimum, I want a framework to have an opinionated model layer with migration support, and chances are you will get trickle down benefits from frameworks that have opinionated M layer..

Look at djangos form abstraction for instance. Or the way validation is handled in Django models, which in turn opens up for the possibility of creating a neat REST abstraction. These are the types of abstractions that you end up writing yourself or not writing at all when you go the 'light framework' route, but they are almost always handy and will save you time.

</comment></comment><comment><USER26> The docs do seem to be a little lacking - it's mostly technical stuff about methods and might not be what the developer is looking for. Looking at documentations from Laravel, SailsJS, even Django, it's easier to get the point of what you're expected to do to get X done.

Other notes on the documentation:

* Very little info on how the templates (views) work. Can I use a different engine for them? No info about that.

* (just as an example of many) I've noticed that a scheduler is implemented and that it's mentioned in the site. It is also noted on github that there's no info on the scheduler _yet_. So, why would you include the features that no one will be able to use unless they're willing to get into the source code of Nodal itself?

I see that the project has been going for almost a year now and it looks like it's going a great direction. Just needs a more user friendly documentation to be fully usable, I'd say.

<comment><AUTHOR> I still have _so much_ work to do to ensure there's great community support. I've been too cautious to release software in the past and over-optimized for the wrong things. My goal is to get this out in the wild so I can learn what people are most interested in, and optimize from there. Everything will be covered soon!

</comment></comment><comment><USER27> Nice to see Postgres as a/the first-class citizen here!

From a quick glance at the documentation, the "server types" seem very sensible.

</comment><comment><USER28> I won't speak for anyone else, but looking at the code samples, pretty much everything I was worried about in terms of readability for ES6/silly uses of 'this' is present here. It just looks a bit arcane.

I appreciate the DSL-for-problem approach, but this is kinda exactly what some of us were worried about.

</comment><comment><USER20> The source is amazing for anyone wanting to learn how to write decent MVC framework. Though I got some reservation about letting users write regex for routes and middleware execution being so far late in the chain (at render).

</comment><comment><USER29> While looking through the documentation for reasons to use this, I stumbled upon some points regarding modularity in the "Why Nodal?" section of the readme. I think that this should be emphasised.

<comment><USER30> But not is inherently modular, in-and-of-itself. Wouldn't Nodal make it _less_ so? Because now I have this ORM built-in, the router built-in, the scheduler built-in, etc. With a standard Node project, I can just pick my own ORM, router, and scheduler, as I see fit.

It may be a great framework, but that strikes me as an odd point to make about the project.

<comment><AUTHOR> Systems modularity. Nodal is about building independent micro services which each have their own internal consistency (the Nodal environment) but are not tied to each other. Nodal just encourages you to optimize for systems first to build a product / business and spend less time worrying about granular technical decisions.

</comment></comment></comment><comment><USER31> FWIW, I checked out at the "go install PostGres" pre-requisite. I'd prefer either being less opinionated about pgsql or making the dependency transparent via something like Docker.

<comment><USER32> I've not read all the documentation yet, but I'm assuming you can tell Nodal to use any arbitrary IP:PORT for the database, which would allow for Docker.

</comment></comment><comment><USER33> Doesn't seem to have transaction support for the ORM

<comment><AUTHOR> Not yet. Migrations are done transactionally, and it's something I really want to have, but there are complexities I have yet to tackle.

</comment></comment><comment><USER34> This looks awesome. The ORM itself may be the thing that makes me switch to Node.

Are soft deletes planned in the future? I saw that cascading is on the roadmap.

</comment><comment><USER35> it would be great if it was called, node on nails

</comment><comment><USER36> What does "next-generation" mean?

</comment><comment><USER37> This is awesome, how about mysql users?

</comment><comment><USER38> This looks fantastic, I can't wait to try this.

</comment><comment><USER39> FMIW has to say superb work to look-after form now

</comment><comment><USER40> The framework might be good, but you need to ditch that video and replace it with some example code. I need to know why it is better than Express or other Node frameworks and what it is like to work with - also you claimed it was next generation. How do you justify that claim?

It could the best framework ever, but without an example all that stuff is useless. The video could help, but it is a) way too long and b) appears to be pretty slow in showing the meat.

</comment><comment><USER41> Fix problems with node and develop the library ecosystem first.

<comment><USER3> > Fix problems with node

Do you care to elaborate further?

<comment><USER41> Problem is that node is buggy as hell. Try and do something more trivial than basic I/O and you are going to face lots of them. Its almost a decade since node hype has begun and still you will hardly find any large, well-known website being powered by node is the testament to this fact.

Also, if you read the docs of any major API implementation, you will find examples in python, php, java, etc. but I'm yet to come across a node example. Node ain't ready for the real world yet.

<comment><USER42> It sounds like you haven't used Node or read API docs in several years. Developing for Node full-time for the past few years, I've yet to find any bugs in the standard library or runtime. And, just glancing around at a few "major API docs" that come to mind, all that included code examples (PayPal, Stripe, IBM Bluemix, MaxMind) included Node.js examples.</comment></comment></comment></comment>


Show HN: A UIKit Game Engine - <AUTHOR> https://github.com/MosheBerman/MBTileParser

<comment><USER3> I don't know if I'm lazy or not, but the fact that I have to commit to downloading and running it before I can see what exactly it does is pretty off putting to me.

<comment><USER4> Agree, I think having at least a screenshot is a must. Or even an animated gif if it's some interaction (e.g. see plug [1]) you're trying to present.

[1] <https://github.com/shurcooL/Slide#slide>

<comment><USER5> The only sites blocked in China that bother me are like dropbox and youtube. Suffice it to say, I see nothing on your github page, and all the links are broken.

<comment><USER3> <http://i40.tinypic.com/21dkpx.gif>

Re-uploaded the GIF file for him, hopefully this one loads for you.

<comment><USER5> TIL tinypic.com is blocked also :) CMCC wifi is a bit more strict than the other Chinese ISPs, they block imugr also while many other ISPs do not.

My problems are admittedly very niche, and I will get to see everything when I'm at work tomorrow (if my VPN was working, I could see them now...drats). Thanks for the try though!

<comment><USER6> Here, let me see if I can get blocked in china now: <http://www.simcop2387.info/Slide_1.gif>

<comment><USER5> Yes, that works, thanks!

</comment></comment></comment></comment></comment></comment></comment><comment><USER7> Wouldn't drawing with UIKit be less efficient than using an OpenGL backend?

SDL[1] on Windows for instance, falls back to GDL when proper DirectX support isn't available. GDI is what most GUI apps use to draw their elements on Windows. It is akin to UIKit on iOS. But GDI is horribly slow as all the computation is done on the CPU.

In fact, realizing this fact, Microsoft has recently developed Direct2D, which does the computation on the GPU and which regular GUI apps can use to achieve better performance. (BTW, I believe Direct2D is somewhat similar to Cairo 2D.)

[1] Simple DirectMedia Layer -- used by plenty of games to achieve cross- platform compatibility. Most games in the Humble Indie Bundle use this.

<comment><USER8> Yep. While UIKit is going to draw using OpenGL anyway with this case you're missing a big optimisation in being able do batch drawing of the tiles and using VBO's etc.

UIKit is fantastic for normal UI's and the 'general case' but almost certainly isnt optimised for doing efficient drawing of a large number of sprites / tiles (trading efficiency for flexibility).

Couple years ago I actually wrote my own API compatible version of UIKit but backed by OpenGL , and then extended support for these type of cases. As it was basically a drop in replacement I was able to confirm UIKit (at least at the time) was not very clever or fast when it came to a large view hierarchy. So my fraemwork was optimising for large batch drawing from a single texture mostly which is what you really want in the OP's case.

I should release it one day as open source.. though is all OpenGL 1 so a little outdated on iOS these days.

<comment><USER7> > I should release it one day as open source.. though is all OpenGL 1 so a > little outdated on iOS these days.

You definitely should! :-D

You can worry about porting/updating it later. You might even get help in doing so, once you open-source it.

</comment></comment></comment><comment><USER9> This is an admirable effort, but I would not recommend ever using this in practice. I am saying this from experience: I wrote a game engine on top of UIKit, which I spent months trying to fine-tune before finally ditching it and re-writing everything to use Cocos2d.

The performance aspect is just not there. Once you get to a game with a large number of sprites and animations, animations will jitter and glitch. You're really going to be stretching what Core Animation can handle.

What I usually recommend these days is to use Cocos2d for your main game view, but using UIKit for the rest of the interface (menus, score screens, etc.).

<comment><USER10> Yeah, I wonder why you would even try this when something like Cocos2d already exists and is awesome.

<comment><AUTHOR> Cocos2d (at least when I was using it) engendered some really bad anti- patterns in regards to memory management and architecture. MBTileParser doesn't just offer a way to show graphics onscreen, but it considers the MVC architecture in a way that cocos2d doesn't. (When I started, cocos2d was somewhere between 0.9 and 1.1. The state of the engine has very likely improved since, but that's why I wrote this.) Cocos2d didn't even support ARC back then.

</comment></comment></comment><comment><USER11> +1 for native!

</comment><comment><USER12> Who knew a fellow Landow grad knows how to code? ;)

<comment><AUTHOR> Landow? No clue what you're talking about, but feel free to email me - <USER2> handle at gmail.com</comment></comment>


Ask HN: Where is all the web traffic from China? - <AUTHOR>

Hey all.
I help run a small web blog and have been messing around in the analytics a bit. Despite getting a good amount of traffic from all over the world, we get almost no visitors from China - social, organic search, or referral.
So what's going on here?
- Is it possible our site is blocked by the Great Firewall of China? How can we check?
- Does Baidu not care much for indexing US or English speaking sites?
- Maybe web dev isn't as popular in China as other places in the world?
- Language barrier and lack of site language options?
Thanks guys. Any suggestions on how to improve this would be helpful. Would love any insight on the topic. <comment><USER2> It is possible that you are getting visitors from China, but this would not be clear from your logs due to the use of proxies as a precaution.

The language barrier creates a great divide. It takes more effort to browse a foreign language site (even if one competent in that language). If one is browsing for leisure, or just following idle curiosity, this is enough to tip the scales against you. Added to that, distance makes browsing the web frustrating and flaky.

This also affects SEO. It is not necessarily clear which search terms will gain you a favourable ranking on Baidu, or how to spell them, or which system of writing will make your site visible to someone searching from China on your subject matter. Web dev (and programming in general) is an important topic in China, but web culture is very different in China in terms of page design and user interaction. Most of those issues will be already addressed in a more relevant and immediately practical way already by the Chinese competition.

You cannot rely on a 'build it and they will come' position. Right now China is in the exciting process of discovering itself through the mass communication of the web as it becomes available to the population in general, and not just the elite. It is like the wild west times at the inception of the world wide web in the West. They are forging a common culture of shared understanding, points of reference and even a distinct lingua-franca to facilitate communication between the different regions of China.

In short, the Chinese are not looking to the West right now because it is far more interesting and engaging to focus 'inwards' in what is happening in China. If you wish to draw a Chinese audience to your blog, you will have to immerse yourself in this emerging culture, discover which topics are of interest there, and learn how to communicate in the evolving local idiom. In short, you will have to grapple with the same barrier that keeps the Chinese from visiting your site.

I suspect that there are Chinese bloggers wondering as you are, why there are so few visitors from the West.

<comment><AUTHOR> Great response. I really appreciate it.

</comment></comment><comment><USER3> "Is it possible our site is blocked by the Great Firewall of China? How can we check?"

It is possible. Post your site URL as a comment here, or use one of these sites:

\- [http://www.blockedinchina.net/](http://www.blockedinchina.net/)

\- [https://en.greatfire.org/](https://en.greatfire.org/)

"Does Baidu not care much for indexing US or English speaking sites?"

When I search for stuff on the web, I search in English and expect results in English. Search engines don't usually return links to German pages, as I don't understand German. I would guess that someone entering search terms in Chinese would expect (and receive) results in Chinese.

I just searched Baidu for 'ruby' and got a mixture of English and Chinese results. I then searched for 'ruby 怎么用' (how to use ruby) and got all Chinese results.

"Maybe web dev isn't as popular in China as other places in the world?"

That seems unlikely. China has more internet users than any other country. Also, those people are predominantly using Chinese-languages sites, developed in China.

"Language barrier and lack of site language options?"

Yup.</comment>


Show HN: Ask the NSA - <AUTHOR> http://askthensa.com/ "The NSA Transparency Initiative was undertaken in response to the recent unauthorized disclosure of classified information. This website will answer your questions about the NSA's programs." <comment><USER2> I lost the number of the girl I phoned three weeks ago. Can you help me out?

</comment><comment><USER3> Brilliant: I put in a question and it returned "405 Not Allowed".

<comment><USER4> Same. I don't know if it's a real NSA website that contains a bug (maybe because I am not based in the US?) or just some HNer who set up the whole thing as a joke.

<comment><USER5> The fact that this could be mistaken for a real NSA website really speaks to the sad state of affairs the NSA has put itself in.

<comment><USER6> Look at the bottom of this file [http://askthensa.com/js/bootstrap.js](http://askthensa.com/js/bootstrap.js) you'll know what to type.

</comment></comment></comment></comment><comment><USER7> Am I mistaken, or have these guys actually managed to infringe on the WTFPL?

[https://github.com/hiddentao/askthensa](https://github.com/hiddentao/askthensa) [http://www.wtfpl.net/faq/](http://www.wtfpl.net/faq/)

<comment><USER8> How have they infringed?

<comment><USER9> I think this line "Copyright (C) 2004 Ramesh Nair firstname.lastname@example.com and Nick Budden firstname.lastname@example.com" should read "Copyright (C) 2004 Sam Hocevar". It is the copyright statement for the license text, not the program, so cannot be changed without changing the name of the license.

</comment></comment></comment><comment><USER6> Look at the bottom of this file: [http://askthensa.com/js/bootstrap.js](http://askthensa.com/js/bootstrap.js)

</comment><comment><USER10> I asked if I'm on a shitlist and it said I'm an Al Queda associative force. I'll take that as a yes.

</comment><comment><USER11> Is tracking an IP address scary? :p

<comment><USER12> To many, yes. I did that once, using SMF forum's "who is online" page and a bit of PHP code to display a signature image "Hello $username, your IP $ip has been saved to the database!". That _really_ pissed them off, though I could have just tracked/saved it without telling them.

</comment></comment><comment><USER13> >nginx/1.1.19

meh, even the al-qaeda website runs a more up-to-date web server...

</comment><comment><USER14> When that FBI WML came on, I burst out laughing; the execution here is awesome.

</comment><comment><USER15> As if they are going to tell us the REALITY.. :D

</comment><comment><USER16> The eagle is wearing headphones...I love it

</comment><comment><USER17> Very funny! Also, I like the design.

</comment><comment><USER18> You got me for a moment there!

</comment><comment><USER19> brilliant but all too realistic alas</comment>


Stockton, CA to provide a universal basic income for its poorest residents - <AUTHOR> http://time.com/money/5114349/universal-basic-income-stockton/ <comment><USER2> Since this is income-qualified, it's not a UBI, it's a classic means-tested benefit coupled with a lottery (since not everyone in the target jurisdiction and income level will get it.) Now, if the population is identified at the start of the demonstration and no _further_ income testing is done, it may provide some indication (though no definitive answers) of behavioral impacts of UBI on recipients who start in particular economic conditions, but it's not very much like a UBI in general.

</comment><comment><USER3> Another example of concept dilution. "For its poorest residents" isn't "universal".

<comment><USER4> If they gave it to everyone in Stockton or even everyone in California it wouldn't be universal. One tenant of UBI is the money comes with no strings attached such as only legal to use for food purchases or only available if the person is looking for work or in an approved training/education program, or etc.

In other words, "universal" is quantified across the person's spending and behavior. UBI can be spent on weed to smoke while playing Call of Duty. That's the core. The core is not whether or not astronauts on the ISS get a check.</comment></comment>


The Archive Team are here to save you from the digital apocalypse - <AUTHOR> http://archiveteam.org/Main_Page

<comment><AUTHOR> Sorry, I had posted this earlier but the site went down while being set up.

The idea is from Jason Scott and you can read more about it here: <http://ascii.textfiles.com/archives/1649></comment>


Paul Kedrosky: The Best Book for Startups - <AUTHOR> http://paul.kedrosky.com/archives/2007/02/25/the_best_book_f.html? <comment><USER2> I agree with everything PK says and would add one more thing: JL does an amazing job of staying out of the way of the answers. Most interview style books allow way too much truncation of the answers by the ego driven interviewer, usually right when you can tell the answer was about to get interesting. Well done.

<comment><USER3> She's a superb interviewer. This isn't your 60 Minutes style of interviewer where she's the star and the subject is simply the vehicle to make her look smart, etc. Also, Paul Graham's forward is one of the best essays I've read in a long time. And, perhaps, the best opening paragraph. Damn, the man should be hired just to do that. The sprinter metaphor: genius.

</comment></comment><comment><USER4> How does he sleep at night? He writes ten or eleven blog posts a day, reads half a dozen papers, dozens of blogs, writes weekly newspaper columns, and runs a VC firm. And on top of that he still reads a ton of books. Amazing.

</comment><comment><USER5> dupe (1133)- but we forgive you because you're pg :)</comment>


A Laravel 5 Package for AdminLTE and Pratt Landing Page - <AUTHOR> https://github.com/acacha/adminlte-laravel <comment><USER2> This is very cool. Will it work with all the Laravel Spark components?</comment>


Lead pollution in ancient ice cores may track rise and fall of medieval kings - <AUTHOR> https://www.sciencemag.org/news/2020/03/lead-pollution-ancient-ice-cores-may-track-rise-and-fall-medieval-kings <comment><USER2> They claim that the graph in the post shows a good correlation with the succession of new kings and taxes paid on smelting silver and lead ore with the lead in the ice core, but the graph shows a weak correlation at best. However, the graph is on a log scale, so it might be hard to see.

</comment><comment><USER3> The 1200s was the end of the Medieval Warm Period, the rise of the Bubonic Plague, also associated with a number of famines that wiped out huge portions of the European population. It was a time of great upheaval, so correlating to taxes is just a weird metric. It's interesting to note the decline in lead but I would assume this to be true of any period which led to population decline.

</comment><comment><USER4> > the team used a laser to carve 120-micron slivers of ice

I want to know more about this process. The kerf of a laser cutter tends to be around 1000 microns, so are they just throwing away 90% of their material or is their laser something special?

</comment><comment><USER5> Im confused what is so interesting about this. The Greenland Ice Core Project tracked ancient pollution in snow 20+ years ago, and they even discovered interesting spikes all the way back to the Roman Empire

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

<comment><USER6> Different data source and as stated in the article they use a different and more accurate technique. I guess that's the interest.

</comment></comment><comment><USER7> Does anyone know where to find the longest time series of this kind of data? Would be awesome to see the ebbs and flows against the long term trend of industrialization.</comment>


Ok, Google. What have I done? - <AUTHOR> You guys know me. I've been here since the board opened almost.
I go through spells of blogging a lot, then nothing, then another binge.
I used to be interested in content marketing, but that was years ago. It was a complete waste of time.
I've always been interested in programming, startups, philosophy, history, tech, etc.
I'm trying to post this link on the G+ Agile forum. I have been a member in good standing in the forum for years. I know the moderators. People like my content. I engage with folks.
Google won't let me post it. It keeps telling me it's spam.
http://tiny-giant-books.com/blog/information-accounting-budget-your-code/
I've taken any kind of pop-ops off the blog. I've removed any tool or add-on that might offend folks. I spend a lot of time trying to create content to share with people.
But this is spam? What the fuck, Google? Who do I go complain to? The wall? I don't even know what I've done, much less how to stop doing it.
This BigTech gatekeeper situation is insane. People have to go on HN begging for attention so that somebody at Google will do their freaking job? <comment><USER2> Google's been really shady about moderation for quite a long time (as you probably know). I don't think Google really listens to even HN.

<comment><AUTHOR> It's a very good way to make lifelong enemies.

I could understand if the content was spammy, if I were sending out emails, if there were some kind of link-jacking or paid referrals or something.

But no. This is a group _which I 'm a member of and consistently likes my posts_. But Google says I'm not allowed to post there any more. Why?

Who knows?

</comment></comment><comment><USER3> I think the best procedure would be to host your blogging content on a private platform and only link and advertise the new articles on several platforms, like your google group.

<comment><AUTHOR> Yep.

My gut tells me that there is some mix of flags here that I somehow afoul of, although I have no idea what they were.

I did the best I could -- and I'm trying -- to just put out plain content. Yes, I wrote a book, and yes, that's _one_ of the reasons I write. But it's a very small reason.

I'm using RamNode for this site. I have to have somewhere I own the box because at times I write demos and small apps.

The best guess I have is that after finishing the article this morning, I posted too quickly. I wanted to get through with whatever sharing I had to do so I could get back to coding. There are four or five places I hang out online, so I just went over there immediately and shared. I figured if folks didn't like it? So what? Happens all the time. Time is moving on today and I've got things to do.

Beats the living crap out of me. Worse, I don't know if it'll go away after a while or not. Fuck if I'm going to create a new blog or anything. I'm not doing anything wrong.

<comment><USER3> That's the problem with hosting content on a not-owned platform.

You may've done nothing wrong, but since it's _theirs_ , they can pretty much do whatever they want, including censorship or shadow-ban.

<comment><AUTHOR> So you're not saying to host my own blog, which I do. You're saying don't talk about anything I create on any kind privately-owned social media platform.

That makes sense. I'm not sure it's very useful, since most of the world's population are on these platforms and it's completely impossible to reach people without using them.

Doesn't matter to me how many people read what I write. I just want a chance along with everybody else. That's all. Not going online with the rest of the planet doesn't seem like a very useful piece of advice.

</comment></comment></comment></comment><comment><AUTHOR> They did this same thing a month ago. I changed the picture that went with the post from one image to another. Then it was fine.

Tried the same thing today, no joy.

I spent five hours writing this essay. This is a very good way to make people angry with you.</comment>


More gmail troubles - <AUTHOR> http://mail.google.com/support/ "Google Apps Status September 24, 2009 7:29:00 AM PDT<p>We're aware of a problem with Google Mail affecting a small subset of users. The affected users are unable to access Google Mail, but we've provided a workaround below. We will provide an update by September 24, 2009 8:29:00 AM PDT detailing when we expect to resolve the problem. Please note that this resolution time is an estimate and may change." <comment><AUTHOR> "Google Apps Status September 24, 2009 7:29:00 AM PDT

We're aware of a problem with Google Mail affecting a small subset of users. The affected users are unable to access Google Mail, but we've provided a workaround below. We will provide an update by September 24, 2009 8:29:00 AM PDT detailing when we expect to resolve the problem. Please note that this resolution time is an estimate and may change."

<comment><USER2> 8:39:00 AM PDT and still no update...</comment></comment>


Laser-switched magnetic storage is 1,000 times faster than current hard drives - <AUTHOR> http://www.extremetech.com/computing/117415-laser-switched-magnetic-storage-is-1000-times-faster-than-current-hard-drives <comment><USER2> Very misleading headline. There is nothing in here that can validate the claim made in the title. First this is not storage this is just changing magnetism ( only from 0 to 1 ) using a lazer. Also there is no way to read it as of yet without a scanning electron microscope.</comment>


Instructions per cycle: AMD Zen 2 versus Intel - <AUTHOR> https://lemire.me/blog/2019/12/05/instructions-per-cycle-amd-versus-intel/ <comment><USER2> In case anyone is not aware: This is a very small sample of microbenchmarks. When benchmarking very simple tasks like these performance tend to vary wildly between architectures.

For instance instructions are assigned to one of a handful of ports when executed, certain instructions may only be assigned to certain ports, what ports an instruction may be assigned to differ between architectures. If an inner loop use only a few different instructions one architecture may be unlucky in that most of the instructions need the same ports, and so it can execute fewer instruction overall.

For real benchmarking use lots of different complicated jobs. It is not perfect, but it is the best way we have of comparing different processors head to head.

<comment><USER3> Indeed. Back in 1999 the AMD K7 was a full _3 times faster_ than Intel on microbenchmarks measuring the performance of ROR/ROL instructions, because the throughput per clock of these rotate instructions was exactly 3 times higher than on Intel. Obviously this did not mean that AMD was 3 times faster than Intel.

Picking 1 or 2 random microbenchmarks like the blog post author did is not useful to categorize overall performance across all real-world workloads. If he had picked different ones, they might have shown AMD twice faster than Intel.

<comment><USER4> Examples like that still exist: AMD popcnt throughput is 4x Intel's, for example (4/cycle vs 1).

</comment></comment></comment><comment><USER5> Assuming both Intel and AMD implement performance monitors the same (i.e. same notion of instructions executed, which may be hard to measure with speculative execution), the comparison is still flawed because it doesn't matter if Intel can do more instruction per cycle if AMD can produce more cycles in a span of wall time.

> However, it is not clear whether these reports are genuinely based on > measures of instruction per cycle. Rather it appears that they are measures > of the amount of work done per unit of time normalized by processor > frequency.

That's precisely why nobody really uses IPC as a way to compare processors. "How much work done per unit of time" is a much better measurement and I guess for historical reasons, people conflate it with IPC.

But real textbook IPC is useless for comparison.

<comment><USER6> > But real textbook IPC is useless for comparison.

It's useful for comparing architectures and the implementation thereof, to gauge the potential of one line of processors over the other.

I agree that for the customer it's not the right thing to be looking for.

<comment><USER7> It's really not useful for gauging potential. There are tradeoffs in how deeply you pipeline your architectures that'll tend to result in higher clock rates for shorter pipeline stages but higher IPC for longer pipeline stages, for instance. It's pretty easy to make a design with an IPC that'll blow everything else out of the water if it only needs to hit 100 MHz. For instance the slower a clock cycle is the larger you can make your caches and the less clock cycles it takes to read from them.

Also, on real world benchmarks that don't fit neatly in cache, for a given chip IPC will tend to increase as you underclock it because that will cause memory latency to go down.

<comment><USER8> IPC is _usually_ a good measure for the last phase of optimization. But it is only the local Δ that is meaningful, comparing IPC across different vendors is only useful as a gross measure.

<comment><USER9> It's not even useful as a gross measure, unfortunately. Too many moving parts in the way.

Say, if you used IPC only then you'd probably pick the latest Apple ARM CPU. Except it cannot go as high clock in any of the subunits as top AMD and Intel, cache is slower, and memory bandwidth abysmal in comparison.

Performance in seconds or performance per watt (unit is 1/(W*s)) in the workload you want to run is useful.

You cannot even estimate anything using microbenchmarks anymore easily since they expanded per unit local clocking in x86... (AMD in Zen+ and expanded in Zen 2, most ARM mobile CPUS, Intel since Broadwell E, expanded in Skylake.)

You get traps such as going for AVX and locally overheating the CPU where SSE2 equivalent would go faster in real life. It's all funny business.

IPC also heavily favors RISC instead of SIMD, likewise is biased against multicore. (Though not as much.) What counts as an instruction anyway?

</comment></comment></comment></comment></comment><comment><USER10> It's depressing how many comments here are quick to dismiss the benchmarking/article. Yes, yes, memory bandwidth, I/O, and cache hierarchies are all important, but Daniel Lemire is one of the top people in the world when it comes to optimizing algorithms for modern CPUs. Do you like search engines? Lemire has made them significantly faster. He is often able to take code/algorithms that already seem fast, and make them much faster. He's recently branched out beyond search engine core algorithms into some aspects of string processing (base64, UTF-8 validation, JSON parsing).

In this blog post, he's paying attention to IPC because he's typically working with inner loops where the data's being delivered from RAM to L1 as efficiently as possible.

<comment><USER4> I have plenty of respect for Daniel (and you can even find me below in this discussion defending some aspects of this test), but I too find some fault with this article.

The main problem I have is that the claim in dispute seems to be that Zen 2 has comparable (perhaps slightly higher) IPC to Skylake, and then Daniel picks out two benchmarks and shows that Skylake has higher IPC than Zen 2... proving what exactly?

Contradicting people who said that Zen 2 had a higher IPC on _every_ benchmark? Yes, those people were wrong, but it's easy to prove a point if you pick an argument almost no one was making it in the first place.

In the same (second) benchmark that he selected the "basic_decoder" sub- benchmark, but there is also another benchmark "bogus" which tests the empty function calling time, and this case I measure a reversed scenario: Intel at IPC 2.25 and AMD at 3.43. So should we now say that Intel IPC is "quite poor"?

<comment><USER10> Ha, I'm not referencing _your_ comments here, and I am curious about how you couldn't reproduce his results; he's quick to publish and seems happy to correct so we'll see. I'm referencing more the other comments here saying things about the benchmarks not being realistic because good benchmarks need to have a mix of tasks, like memory and I/O—this ain't a Phoronix post, folks.

I started reading through your blog last night. I'm slowly trying to learn how to go from being a programmer who doesn't write slow code, to one who writes fast code, so absorbing a lot about vectorization and ILW, etc.

<comment><USER4> He's corrected the results (possibly even before I wrote the post you responded to this AM): they originally showed Intel at 2.8 IPC in the second table, they now show 2.1.

I measured 2.0, but I guess Daniel is using docker w/ a slightly different compiler version, so I think it the gap is sufficiently small that we can declare "close enough". I also measured quite different numbers for SKL (2.0) vs SKX (1.7), which is quite odd given the non-memory intensive behavior of the test: in that scenario, I'd expect SKL and SKX to perform identically.

</comment></comment></comment></comment><comment><USER11> The second example is just a benchmark of tzcnt, added in BMI1. It's a very specific and very bizarre benchmark to do when you could just look up the reciprocal throughput (unfortunately Zen 2 has not yet been added).

[https://www.agner.org/optimize/instruction_tables.pdf](https://www.agner.org/optimize/instruction_tables.pdf)

Edit: This is wrong as BeeOnRope points out below.

The first is SIMD heavy, so Zen 2 mostly closing the gap with Intel in one of the areas where Zen 1 was very weak is a good thing.

<comment><USER4> Zen2 is on uops.info, it's 2L0.5T on Zen, 3L1T on Intel, so slight theoretical edge for AMD (2 vs 1 uops tho).

That said, I don't agree it's a tzcnt benchmark - there are about 9 instructions only one of which is tzcnt. I'm not sure why Zen2 is worse here.

<comment><USER11> You're right, I messed that up (though I'll leave it for posterity). I went into it with a bias thinking BMI was slow on Zen, since PDEP is 18 cycles vs 1 on Skylake, much to my disappointment back in the day.

After reviewing the example again, there's no obvious reason why Zen 2 is slower, although it's likely a rare edge case. Too bad there's nothing decent like VTune on AMD platforms.

I remember one session where my choice of temporary register significantly impacted throughput while implementing an unrolled int[] hash fn on my Kaby Lake processor. I never figured out exactly why, but sharp edges do exist even on Intel chips.

<comment><USER4> This benchmark heavily stresses branch misprediction recovery, so that could be worse on Zen.

Also, I could not reproduce Daniel's results: I got IPC of 1.77 (SKX) or 2.00 (SKL) compared to Daniel's reported 2.80 (SKL, I think), so Intel still better but by a smaller margin. Waiting for clarification on that one.

</comment></comment></comment></comment><comment><USER12> I think the only real way to compare IPC is to actually talk to the architects. Trying to write microbenchmarks is a fools errand when you aren't aware of how the cpu processes the instructions you give it. Are you actually stressing the fpu, or is the cpu speculatively executing and then branch predicting the workload (common for micro loops)? If it is, is that what you meant to test? Are you trying to compare like for like (in which case you have to write assembly), or are you trying to write performance benchmarks (and then the only meaningful metric is cpu time)?

This is an interesting idea, but I'm not sure how you could derive meaning from comparing two vastly different architectures at such a high level.

</comment><comment><USER13> Useless, strictly academic interest.

There is more than execution ports in design of processors. Not every task can be SIMD optimized to extent of approaching theoretical IPC limits, most will be bottlenecked by memory access or even IO.

I prefer the "fake" but real-world IPC. Same clocks, same real world task, measure time to finish.

<comment><USER14> I think this was more of a response to the linked benchmark at guru3d which said:

> Instructions per cycle (IPC)

> For many people, this is the holy grail of CPU measurements in terms of how > fast an architecture per core really is.

Based on his work with simdjson, professor Lemire seems to be quite aware of microbenchmarks being problematic. But general articles out here and on HN are proclaiming Intel is doomed and can never recover, due to mitigations/lack of cores/lack of chiplets. Those concerns have yet to be reflected in the stock price.

<comment><USER15> Intel are behind. They have a pretty big cash buffer and a solid sales channel, as well as being pretty entrenched in OEMs. So they are a very long way from being doomed, even if it takes them a long time to turn the ship around (like 00's Microsoft).

</comment></comment></comment><comment><USER16> IPC microbenchmarks do not properly reflect the complex workloads running on post Zen2 microarchitecture. Zen2 upends microarchitecture schematics enough to warrant a different metric.

IPC MB's, in my experience, tend to benchmark best case scenarios and that is probably the exception rather than the rule for application workloads in modern MA's. Case in point, microbenchmarks showed significant improvements in IPC for Zen2 in lieu of Skylake yet for the application workload (CPU data bound), Skylake held up neck and neck.

The more appropriate benchmarking metric for post-Zen2 processors is CPI [0].

[0] [https://john.e-wilkes.com/papers/2013-EuroSys- CPI2.pdf](https://john.e-wilkes.com/papers/2013-EuroSys-CPI2.pdf)

<comment><USER17> But isn't CPI is just reverse of IPC, and CPI just makes the IPC score being bounded between 0..1?

</comment></comment><comment><USER18> Heh, I'm curious if he used the mitigations for all the side channel flaws for the intel processors.

<comment><USER4> The mitigations don't affect CPU bound benchmarks [1] which don't call into the kernel or use specific user-space mitigations, so it won't matter here.

[1] There are some rare exceptions, such as [https://travisdowns.github.io/blog/2019/03/19/random- writes-...](https://travisdowns.github.io/blog/2019/03/19/random-writes-and- microcode-oh-my.html) , but it is unlikely to matter here.

<comment><USER19> That may have been true, but it is rather dramatically false with the new JCC erratum workaround.

It's also false if you're using a hypervisor that mitigates the iTLB multihit issue.

<comment><USER4> Good point, I forgot about that one, although here there is only a single hot loop with one jump so a high chance the crossing doesn't occur, and even if it does the IPC is low enough the legacy decoder probably does OK (although it adds a cycle or two to misprediction recovery, which matters here).

So it's something worth checking.

No hypervisor involved.

</comment></comment></comment></comment><comment><USER20> While only being part of the performance equation, analyzing IPC can be quite interesting in understanding the design of the processor and how performance might be achieved.

One thing itches me with the presented comparison: it is running very few benchmarks generated with the same compiler. For a thorough IPC analysis, shouldn't the tests rather being programmed in assembly to exclude any influence by the compiler choice? Also probably a wider range of algorithms should be checked, as IPC on modern processors depends less on how many cycles a certain instruction takes (you should be able to find that in the manuals), but how well multiple components of the processor can be utilized at the same time. Which extremely depends on the actual program to be run.

</comment><comment><USER21> I'm rather surprised at the claim that "but it might easily execute 7 billion instructions per second on a single core". I'd even question it except the author's an expert.

If you can keep it fed then ok but one cache miss to main mem, either instruction or data, will allow the instruction buffers to completely empty and stay empty for quite a long time. I don't think you can control placement to reasonably assure cache hits always for anything but the most trivial code, am I missing something?

Also if you could keep a consistent throughput like this I wonder if thermal throttling might have to kick in. I mean you're doing a lot of work...

<comment><USER22> I can't find it back but in a recent article I read that it was useful to have an idea of the upper-boundary abilities of an arch+algorithm, so that you 'know' what you're aiming for, but it might not be attainable practically without huge human or decades of superoptimizer effort... Yes if your algorithm reaches for cold data, you'll get hit. Can you get around that? Do you really need to hit the cache when you're computing the seven-billionth decimal of pi or factoring numbers ? This work is quite interesting, if only for compilers or superoptimizers.

</comment></comment><comment> Const-me I wonder how reliable are these Linux syscalls?

Found this [http://manpages.ubuntu.com/manpages/trusty/man2/perf_event_o...](http://manpages.ubuntu.com/manpages/trusty/man2/perf_event_open.2.html) and that article doesn't instill much confidence in the reliability of these counters. Comment for CPU_CYCLES says "Be wary of what happens during CPU frequency scaling", comment for INSTRUCTIONS says "these can be affected by various issues, most notably hardware interrupt counts", BRANCH_INSTRUCTIONS says "Prior to Linux 2.6.34, this used the wrong event on AMD processors" and so on.

If I wanted to measure what OP was measuring, I would disable frequency scaling (probably doable on overclocker-targeted motherboards, also search finds some utilities which claim to do that, both windows and linux ones), measure time, then divide by frequency.

<comment><USER19> CPU_CYCLES counts cycles. This means that the _time_ per cycle varies with frequency. If you're trying to see how many cycles something that fits in L1 takes, CPU_CYCLES is the right thing to measure.

<comment><USER11> Parent is pointing to documentation suggesting that it's measuring time and dividing it by frequency, and perhaps not perfectly in the case of dynamic scaling. They seem aware of what CPU_CYCLES is _supposed_ to do.

<comment><USER19> The documentation is not the best. CPU_CYCLES is genuinely counting cycles.

perf is all about reading actual hardware counters. It's awesome for this. There is essentially nothing made up about perf's output, except to the extent that the hardware itself reports inexact output. (For example, perf annotate may attribute events to an instruction near the instruction in question on older hardware, because older hardware has a small amount of skew when sampling.)

</comment></comment></comment></comment><comment><USER23> In more comprehensive single thread benchmarks (single thread POV Ray) Intel can still beat Zen 2 architecture sometimes. This test seems to indicate the reason why.

</comment><comment><USER24> ITT: AMD apologists.

Sorry guys but Intel is still king of single core performance. But that's not a problem because I'm sure by 2050 most desktop applications and games will correctly make use of many cores, then AMD will reign

<comment><USER21> Worth responding to blatant troll to point out it's not about performance but performance by price for 99% of uses.

<comment><USER12> Or performance per watt in server land. Which is a metric that zen 2 dominates in. Very few applications truly care about maxing performance at all costs.

<comment><USER25> But, indeed, some do. They will provide as much power and as much cooling as they need to get that performance.</comment></comment></comment></comment>


What happens when you hit Ctrl-C? - <AUTHOR> http://plaban123.tumblr.com/post/117417983794/what-happens-when-you-hit-ctrl-c

<comment><USER2> Actually, that's not quite right. With pretty much all modern Unix systems, the kernel supports process groups, and the control-C gets sent to the tty's foreground process group. Since the shell will set up a new process group when it sets up a new command (or command pipeline) to be run, and then sets it to be the foreground process group, the shell never gets the signal, and isn't involved in forwarding the signal to the job. Instead the tty sends it directly to the command currently attached to the tty.

</comment><comment><USER3> > All signals' handling can be overridden except the SIGKILL.

... and SIGSTOP and SIGCONT.

<comment><USER4> SIGCONT can be handled just fine, both according to the manual, and in practice... (at least under Linux, been there, done that.)

<comment><USER3> Sure, but you cannot override or ignore the default action: that of continuing execution.

</comment></comment></comment><comment><USER5> Not really that relevant, but it always sort of bugs me when people use the `kill` command with numbers instead of symbol names. I think it's the programmer in me getting scared of "magic numbers", but I find it much nicer to be able to write `kill -KILL <pid>` or `kill -HUP <pid>` than remembering all of the numbers.

<comment><USER6> Once you've used enough platforms, you get used to "kill -KILL <pid>", because "kill -9" doesn't work everywhere (being less standard), while the former is the POSIX way.

</comment></comment><comment><USER7> also relevant (found here on HN last month)

what happens when you... [https://github.com/alex/what-happens- when](https://github.com/alex/what-happens-when)</comment>


Ask HN: Work alone or in a team? - <AUTHOR>

I was in an entrepreneurship in residence after graduating college. My mentor told me, that when most people commit a crime, they won't do it alone. He then told me, the same goes for starting a small business. The idea being, that people are afraid of taking that much risk (and cost) all on their own.
Personally, I like working with others - whenever I have a new project brewing I like to have a team of 3. Sometimes I wonder if I'd be better off doing it all alone - if I fall into this category of people who is just too afraid to take on that much risk.
That said, when you start a new project, do you prefer to include others? Or would you rather attack everything by your lonesome (coding, design, marketing/sales, business/accounting, fixed and variable costs). <comment><USER2> Our startup would not be as fleshed out if we only had one person. In addition to having two minds and four hands working at the same time. We actually have synergy going when it comes to fine tuning our vision and then putting it into operation.

We eat dinner together every night and most of the time, the focus of conversation revolves around where we are now and what needs to be done to get where we are going. It really serves to keep the fire lit on our efforts. It's like having a half-time pep talk in a football locker room every night. If you sat in on one of these dinners with us you would come away confident and energized, ready to put your all into it without reservation. Synergy is an amazing asset.

I think that there is so much to do on a startup that having the right person to work with makes it more valuable, especial if you have synergy between the founders.

</comment><comment><USER3> I freelanced for years, doing projects for small business, where I would often go in and work and be the only developer working on the project-often working remotely, from my home.

The best thing I ever did was find another like-minded person to work with (well, actually, he found me, but I stuck around). It was quite an adjustment at first, since I wasn't used to working so closely with another developer, but it's made the good parts tons more fun, having someone to share them with, and has made the unpleasant bits all the more barable as well.

It has also greatly increased my productivity and the quality of work I'm producing. I've learned, from his perspective, to think in ways I never would have before.

I wouldn't want to work with just anyone, I don't think, but I do believe I have been fortunate enough to find the perfect co-worker.

</comment><comment><USER4> I enjoying working with others. The issue I face is many people might "like" an idea, but so few are willing to commit to it. So I am currently working on my own just out of shear tenacity.

I'm almost of the opinion to work on a startup with someone you have to come up with an idea with thatperson/those people.

<comment><AUTHOR> "I'm almost of the opinion to work on a startup with someone you have to come up with an idea with thatperson/those people."

I've done that a few times - and once both people could almost contribute nothing at all, besides sales/marketing. And neither wanted to do sales or marketing. It was a big lesson learned. Certainly taught me something about picking partners.

<comment><USER4> Yes, that is definitely a lesson well leant.</comment></comment></comment>