skysight-inc/HackerNews huggingface dataset:
I got 3.1544 after 10000 iterations, which also didn't match my intuition of how quickly it "should" converge. So I decided to knock up a quick deterministic version in C that just iterated over all points in [0, 1), [0, 1) at various resolutions.

For 10x10 (100 iterations), I got 3.44

For 100x100 (10,000 iterations), I got 3.1796

For 1000x1000 (1,000,000 iters), I got 3.14552

For 10,000x10,000 (100,000,000 iters), I got 3.141990

For 100,000x100,000 (10,000,000,000 iters, 2m06s runtime), I got 3.141633.

So the deterministic version takes a long time to converge on the right answer too. Therefore, it seems that the Monte Carlo version appears less accurate than you'd think, not because of the stability of the randomness, but because your intuition (and mine) is way off about how good any kind of sampling is at converging on the right answer.

See @teisman's great reply for figuring out how many iterations you'd need for a given level of accuracy.

Edit: Looking back at the numbers, you need 100x as many samples to roughly get an extra digit of precision. That's 10x the iterations on each axis, which makes sense that that would give you an extra digit of precision in your answer. Therefore, after 10000 (100x100) iterations, you wouldn't expect better accuracy than 2 digits, or 3.1. Which is what we see.

Edit2: I'm an idiot. After converting my test from (sqrt((x * x + y * y)/(samples * samples)) < 1) to ((x * x + y * y) < (samples * samples)) and making the maths integer only, I got the 100,000x100,000 runtime down to 10.8s. (Same answer though.)
I'd like to know some performance and language/standard library differences between mono+linux and .NET+Windows (e.g. support for entity framework was not even planned for mono last time I used .NET, which is a lot of time ago).

I always liked C# but windows server for me is a complete showstopper, I'm too comfortable in unix envs for sysadmin/devops. Well also for desktop actually :)
Walmart hookers? That's gross.
USASpending.gov short of data on $619B worth of grants and awards
God, these comments are why people hate Hacker News.

If you want to post an awesome project like this one, better do it somewhere else, if you want to be encouraged to keep working on it.

The design is absolutely gorgeous, for what it's worth.
For anyone interested, the webpage of "Dark Mail / DIME":
https://www.darkmail.info/
The content on the site seems rather old?

Anyway best app to manage the menubar is imho http://www.macbartender.com/ and well worth the price.
> The monadic composition resolves each promise sequentially (via the Haskell operator `sequence`

Most monadic binds aren't sequential. It's only necessary for certain monads (like IO). Most monads can be evaluated in any order.
"given that shit salary"

This feeds painfully into the "HN is an echo chamber of rich yuppie coastal urban programmers out of touch with reality". Its roughly a median income for Americans. About half of all jobs are worse and about half of all jobs are better.

"choose between keeping their jobs or obeying safety regulations"

Isn't this like every blue collar job, ever? In my limited student years experience working thru school its a blue collar mgmt technique. So in programming if there's a woman or a black guy we tell lies about "not a cultural fit" or whatever other BS. But in blue collar orgs if your boss wants to fire you, you'll get fired either for not using safety gear or taking too long aka fired for using safety gear. In both cases it doesn't really matter, if you're not the same gender / orientation / religion / race as your boss you're going to end up equally unemployed, although with different lies told if you're white collar or blue collar. It doesn't really mean anything at all on the surface.
I am quite sure there's a lot more trafficked farm workers than prostitutes in the US. This is a simple question of supply and demand of work and workers, has very little to do with sex.
I don't think it matters. Just look at some of Microsoft's buys: Yammer (Java), Skype (not sure but not .NET), Hotmail (FreeBSD), etc. Traction is the key.

Sign up for Bizspark and you don't have to worry about licensing for 3? years.
Nice visualization! Some UI comments

I think the reset button should be smaller (you usually don't want to reset the simulation).

I expected that the number in the upper right corner is the number of additional simulations to do. For example, if n=1000 and box=200, the system makes 200 additional simulations and now n=1200.

Also, I'd like to see an advanced mode: (but perhaps I'm not a typical user)

I'd like to see a graph of pi_aproximation vs n, so I can see how the value "converges" to pi.

And I'd like to see an error estimation, for example, the expected variation is ~sqrt(n)/4 (I think that the correct constant is not 4, but it's a similar small number). So you can draw error bars or the pi+-sqrt(n)/4 "bounds".
Xiaomi issues fix amid privacy scare over its cloud messaging service
Even the state monad is not actually sequential. It just appears that way conceptually. It can, just like most haskell code, end up being computed in any order (because of laziness and lambda calculus reordering rules).

For the most part, only "special" monads like IO enforce sequential computation.
It doesn't matter at all. In general investors have no clue about coding.
If you are technical founder then go with what you know. No questions here. Regarding licensing, you will anyway then run on Azure so licensing costs might not be so terrible.

If you not a technical founder and your goal is being acquired than technology does matter. For example, if you are in the market where, Oracle or Salesforce are potential acquirers then do not use .Net. Be more SQL / Java oriented.

And if your end-goal is getting revenue and profit, then it does not matter.
"that UB is apparently explicitly (or maybe implicitly) recognized"

Potential UB is identified, but that's absolutely not the same as identifying certain or even likely UB.

For the cases where it's certain or likely as determinable by the compiler: Yes, please turn these into errors and warnings. As I've said, "I would agree it should not be taken as "you should do anything"". But that's as little as I address certain UB, the majority of my post then talks about potential UB in general.

I want the optimizer to have free reign to let "anything" happen, by ignoring scenarios which would cause UB, if those scenarios are sufficiently unlikely. Even if that means occasionally backfiring as "unexpected stupid stuff" when statistics catch up to me. I suspect I have a higher tolerance for weirdness in the name of performance than the topic article's author.

The majority of my post (including what you quote) then centers on justifying this higher tolerance.
There really isn't anything at all special about this, the jQuery equivalent wouldn't have made it to 5.
How does that differ from the guitar teacher example?
While this looks good aesthetically, this is a prime example of needlessly using JavaScript for the hell of it. This is like an anti best practice. It loads 4 extra resources (Angular, Angular Cookie, Angular UI Bootstrap and the custom bootstrap.js) for no legitimate reason. And the CSS is inexplicably written using selectors like the following: "#page-wrapper:not(.active)". Why not target "#page-wrapper" and then "#page-wrapper.active" instead?
They do hire "deal breakers" (experienced programmers which work in a basement of a VC firm whose only job to convince VC not to invest :-)). At least they had them in early 2000s. Not sure if that is case now.
I can't edit anymore, so I'll reply to my own post:

People are pointing out there is no known hash function that will map every word within a same distance D to the same hash. That is correct, and I was just meaning to explain the process at a high level. Levenshtein-locality sensitive hashing is not a solved problem in CS.

And you know what else in the algorithm I described is not a solved problem? Efficient nearest neighbor search. In a space with more than a few dimensions, we actually don't know any better way to perform exact NNS than brute forcing the search space.

And you know what? None of that matter, since we have inexact yet statistically excellent processes to perform both of these tasks. That's the really cool thing about engineering as opposed to math or computer science: it doesn't have to be exact to be useful.

A trivial way to build an inexact, yet useful levenshtein hash function is to pick a random sample of words from your dictionary, define them as hash values, and assign to any input the closest word from your sample. Now work with a large family (100+) of such grossly approximate hashes and you can build a statistically excellent algorithm. (and of course this is just an example, there are countless better ways to do the same thing).
Teachers become excellent with this one weird trick.

10 things you've been doing wrong for years.

etc.
Could you explain what you mean? I think my comment does a pretty good job of demonstrating that the scalig is nicely suited to the temperatures a human being experiences over the course of each year.
You should never forget your licensing costs if you ever need to scale to "internet scale". However, it's more important to get a product out the door than to have a hugely scalable thing. If .Net is the best tool for your team to do it, then use it and work out the scalability issues later (you may consider keeping an eye on migration costs - it's easier to add app servers than to scale a RDBMS) and always having a plan on how do you turn what you have into what you'll need. You may even be very successful and not need to change too much: the Stack Exchange folks run a lot of their infrastructure on Windows.

I make my PoCs with Python on Google's App Engine. It's zero management and any individual idea is far more likely to fail than to be an overwhelming success, so it's reasonable to think about costs if and when the idea gains traction.

Another thing you should consider is how the stack you pick will affect your ability to hire great talent in your region.

Note: I really hate .Net (and Windows) but these are not decision one makes based on passion.
Can't disagree more. That completely misunderstands the motivating philosophy behind effort expenditure given to FLOSS.

It isn't about motivating people to do things; that creates abandonware. It is about solving a problem that needs solving.
Yes, it probably won't affect your revenue. Your profit however is likely to be affected; how much depends on your architecture and scale.
Your comment could apply equally to any medical research; do you believe any medical research is a good idea? If so, how do you decide where to draw the line?
Your supervisor is 1000 miles away, you can listen to whatever you want on the radio, no one else has control over the HVAC controls, its not as physically relaxing as being a programmer (which might be good?) but its incredibly physically easier than virtually all other craftsperson / labor blue collar jobs, the constant change in scenery is almost better than one of those C-level corner window office jobs, the employers are fairly interchangeable so the best drivers "naturally" tend to pair up with the best employers and there's massive flexibility in where you live because there's jobs everywhere across the country (across the world?). Its both more introverted and more extroverted than programming work, varies greatly thru the day, and some like that variety.

Sometimes its interesting from an alternative history perspective to think about what to do if you were born into a world without computers. Or if you don't have the "knack" for hard science-ish work. You could live a lot worse than driving a truck around all day.

Also depending on your risk tolerance there are higher level certs, if you want to drive tank cars full of liquid hydrogen or plutonium around all day or whatever. Less hazmat jobs, but marginally better pay and working conditions.

To some extent, more than most jobs, you choose what you want to do. My semi-retired uncle who took up trucking in the 90s simply refused to drive in snow and hated driving in big cities. So he didn't. It really was that simple. There are very few other jobs where the market is so flexible that you can simply do what you want, when you want. If you want, you can get a truck driving job where you carry two beer barrels at a time uphill both ways into bars, but as an old semi-disabled guy he chose to haul five ton machine tools so in his entire career he never personally lifted anything heavier than a bottled water. If he wanted to spend a week at the grand canyon instead of being paid, he simply did so.
I have experience with this. We started a company based on a product written in C#, and were acquired by a company by a company whose product was predominantly written in Java. It was never really a concern during the acquisition.

The software world is so diverse now that you could never predict who would be interested. If you ended up writing your product in a JVM language, you may end up with a Ruby suitor, etc. It's always best to just use the tool that you'll be most productive with, and will result in the best product.
I think it wouldn't hurt and if anything would allow you to find developers easier than if you did it in Rails, Node.js, Scala, or Go.

There are a ton of developers doing .NET or Java EE for large companies everywhere. Having that talent pool available is more convenient than having to recruit in more obscure platforms.
For having a few teaching experience, I would say that this is completely ignoring the fact that JavaScript is about callbacks and asynchronous operations. Those concepts are really hard for new comers (even for some professional) who expect the program flow to be completely different.
Shameless plug: I made a silly little Mac menu bar app called Satellite Eyes that automatically changes your desktop image to the satellite/map view from overhead your current location. I just pushed out a version that supports retina quality tiles, where available.

http://satelliteeyes.tomtaylor.co.uk
It's a different species, cougars, but this is an interesting story of one that was killed by a car in Connecticut, and which was identified as having come from South Dakota, 1,800 miles away.

http://griffinsguide.com/content/2014/01/06/cougar-makes-an-...
Every primitive Pythagorean triple has c odd, so strictly speaking (+/-1,0) and (0,+/-1) are the only points with binary FP coordinates that have distance exactly 1 from the origin (decimal FP is more interesting in this regard).

Of course, there are more points with binary FP coordinates whose magnitude computed naively as sqrt(xx + yy) produces a rounded result of 1.0 in binary floating-point; (3/5,4/5) is one such example.

I would address this by using careful computation of the residual of xx + yy - 1.0 to determine which side of the circle the point lies on; something like the following sketch:

float residual = x*x + y*y - 1
if (residual == 0) {
/* x*x + y*y rounded to 1; we need to do a more careful check
to determine whether we're inside or outside. WLOG, assume
that |x| >= |y|. */
if (fabsf(x) < fabsf(y)) { float tmp = x; x = y; y = tmp; }
/* We know that 0.5 <= x*x < 1.0, from which it follows that
fmaf(x,x,-1) is computed without any rounding; we can then
do another fma to isolate the residual (this is also exact
because we know that y*y cannot be *too* tiny unless x is
exactly 1.0, in which case the first fma is exactly zero). */
residual = fmaf(y,y,fmaf(x,x,-1));
}
if (residual < 0) { /* inside circle */ }
else if (residual == 0) { /* on circle */ }
else { /* outside circle */ }

It's worth noting that fma isn't actually necessary here; it suffices to evaluate xx + yy in double precision, except in the |x| = 1 case, which is easy to detect. fma is conceptually cleaner (and faster on modern architectures that support it), however.
I agree it looks fine (though it's not exactly April Zero...), but I think the comments below legitimately address some of the issues with the JavaScript (60 or so poorly formatted lines, using Angular for no reason at all) and the CSS - and probably people are confused as to why this frankly somewhat amateurish project is currently at the top of HN.

From the title, I think you'd expect something that's cleverly using Angular to pull in data dynamically from disparate sources and plotting pretty charts from it, rather than just some static HTML and CSS.
Could you substantiate this with any references? I thought hard about this, and I find no reason to believe that equally-spaced points would give a biased estimator.
Yes Bartender really gives you back your clean menubar and enables you to regain control over it. Here is mine: http://cl.ly/image/0s0U2V0B000m

I really don't like the approach of some OSX developers to ignore Apples Interface guidelines regarding the menubar, either accidentally or at will, maybe to elevate their apps inside the menubar with colored icons.
But I thought that Netflix required Silverlight on the client to work. What is this using then?
I guess the nusances of the ten major languages spoken in the author's homeland of Kasmhir are as well developed and that you can point out minor nitpicks in the offical Kashmiri language of Urdu.
$ ruby -e 'puts (0...3).to_a' | ruby -ne 'p $_.to_i*7'
$ ruby -e 'puts (0...8).to_a' | ruby -ne 'puts $_ if $_.to_i % 2 == 0'
From the title, I think you'd expect something that's cleverly
using Angular to pull in data dynamically from disparate
sources and plotting pretty charts from it, rather than just
some static HTML and CSS.

There's nothing to suggest the creator submitted the link - and Hacker News enforces the dumb <title> rule - so I don't see why that's a reason to get pissy in the comments.

We all have some random crap lying around on GitHub, and anyone can submit it arbitrarily one day. That still does not excuse the absurd mentality here from people who seem to never have made nor submitted anything of their own, since they don't know how obnoxious it is to read comments like these for your own project.

+ + +

this frankly somewhat amateurish project

You are such an asshole for writing this. I rest my case.

I'm happy this project is at the top of Hacker News; it means there's a silent majority who are not represented by the people behind the comments on this thread.
Gevent Tutorial
>people are confused as to why this frankly somewhat amateurish project is currently at the top of HN.

Probably the GP's irritation comes from the same place as mine: needlessly abrasive remarks instead of encouragement and constructive criticism that a community like this should provide.

And why do people care so much that this is at the top of HN, as opposed to the bottom?

>I think you'd expect something that's cleverly using Angular to pull in data dynamically from disparate sources and plotting pretty charts from it,

That part is relatively easy to add, given the nice template this provides. Really, for me, creating this kind of layout is the time-consuming part. Pulling in data from some REST api is a relatively quick task.
Show HN: Simply eat right to fuel your body and mind
I'm confused by this.
How does contributing money to people developing software for the commons lead to abandonware? And is abandonware a problem if it is free/open-source? Should I avoid publishing my hobby projects that I'm not planning to support?
Right, but certain individual events are signifiers for larger systemic changes. If one needs reliable summer access through the arctic for this to work, relying on a fluke isn't going to work.

The problem with climate change is that there is plenty of rigorous statistical analysis... and yet ppl deny the analyses, deny the evidence collection, deny that there is any evidence. I'd like to think this is a different game now that business are making decisions predicated on it.
The HTML5 encrypted media extensions. Chrome has support for that
And in Siberia you sometimes encounter -70°C and in Dubai you measure 50°C (Both of which would be off the 0-100F scale).

Internationally Celsius make more sense.
> Microsoft licensing, particularly dev tools and SQL is incredibly expensive and an order of magnitude more expensive on deployment and diagnostic time than anything else.

Oracle? SAP?
That's obviously false. If there were an infinite supply of desperate people "willing to work more for less", wages would be zero, or minimum wage at most.

There is a finite supply of labor, and we are not anywhere near a level of technology where we no longer have an unbounded demand for labor.
it's an awful language, but it's ubiquitous, and it's flexible enough that libraries can smooth over the cracks.
Take a deep breath, seriously. It seems likely you're way more upset about it all than the guy who wrote the original repo.
It's just a smart-aleck comment pointing out that there is a "bias" because we're using a finite number of points and we get the same exact answer every time -- and since that answer isn't exactly equal to pi, the procedure is "biased".

Which no one cares about because (1) this isn't a probabilistic process in the first place, so "bias" itself is meaningless, and (2) there is now an exact bound on the error, unlike the previous case (I guess you can think of this as the "variance" if you want).
I'm sorry, do you find it uncomfortable to receive criticism on the Internet?
Completely agree. Remember, PG and team wrote Viaweb in Lisp because that is what they were comfortable with. They got acruired by Yahoo because they had the users and the best product in the market. The fact that it was built in Lisp did not deter Yahoo at all.

Stackoverflow is built on .Net and nobody is questioning that now.

It could turn out to be an advantage that the others keep writing you off as 'destined to doom' because you are on the .Net platform.
My short answer is, go with what you know, it's better to have a solid working product than a flakey pile of learner spaghetti.

I'm a .net dude at a startup though and to be fair long term costs should be factored in, but can be mitigated. For one BizSpark is an absolute must to get started, and once you graduate there are the Action Packed for a few hundred dollars a year.

I would however suggest you look rather at using oss where possible even from . Net. We have used MySQL, Mongodb and redis on Linux because it keeps scaling costs down, and to be frank they' re better supported on the platform.

We also leverage BitBucket and TeamCity rather than TFS for cost reasons.

Having said that both Azure and AWS have fairly scalable windows and SQL hosting services.
Do you think the Chinese toxic waste, aka "manufactured sodium fluoride and byproducts" that is put in public water supplies resembles anything like the calcium fluoride that the body needs?
Is there a way to run the app but hide the icon?
Humans are 80% Water.
It works out about the same as Oracle now from SQL 2012. Azure is the only way to cut costs but the managed SQL services are awful. Both are equally hassle-some. SAP is different - you're not paying for a product, you're paying for consultants on subscription and a product...

Oracle tooling I.e. JDK, Netbeans, Oracle Linux (repackaged RHEL) etc is 100% free. VS isn't.
> And why do people care so much that this is at the top of HN, as opposed to the bottom?

Well, there are only so many hours in the day, and it's nice to see exciting and innovative projects (and articles) gravitate towards the top - that is, surely, how HN is supposed to work.
Not at the moment. The icon shows useful information like whether a map is downloading or there's a location error. It's all open source, so happy to accept a pull request though.

https://github.com/tomtaylor/satellite-eyes/
One woman can’t have a baby in nine months (2007)
Most dev licensing are covered with an Action Pack for less than 500$, and once you gain some traction as a Silver Partner. SQL Server, while expensive, isn't that bad compared to similar supported RDMS, and in any case, nothing prevents you from using a free RDMS in place.
Latest tunnelblick beta comes with monochrome icons.