Hacker Newsnew | past | comments | ask | show | jobs | submit | eni's commentslogin

How trustworthy is /haveibeenpwned.com? Is there a chance the password people enter there for checking will end up in the databases?


There is almost zero chance Troy Hunt would torpedo his carreer doing something as monumentally stupid as that.

It's possible, sure. But I'd trust him with my password sooner than I'd trust [INSERT SV COMPANY HERE].


The article explains how the site has been designed not to send passwords to the server. Of course, it's up to you to decide if you trust them to keep it that way.


Is there a realistic alternative?

I read a lot on entrepreneurship during 19th century and early 20th century US. My limited understanding: in those days entrepreneurs came from much wider range of demographics. In other words, entry barriers were much less during those days.


I mean many people start bodegas, restaurants, etc. I imagine that's more akin to 19th century entrepreneurship and still is by far the most prevalent form of entrepreneurship today (only like 1.3% of businesses are created in the Bay area and 1.1% of the population lives there).


Very good observations. I think it partly explains why innovation is so hard in places where people live hand to mouth. It is simply excludes those demographics from participating in innovation and changing status quo.


Can you please point to any resources that talk about heavy optimization options in c#. That 50-fold increase you talk about is very interesting. I would like to learn more.


Here is a list, not easy to track all of them down, but maybe as keywords to easy googling.

- structs

- unsafe code

- stack allocation in unsafe code (think alloca())

- attribute annotations for packing and inline calls across assemblies

- ref parameters

- ref returns

- readonly ref parameters

- Span<> and Memory<>

- Native memory allocation via MarshalInterop, SafeHandles

- Buffer and ArraySegment

- SIMD (with RyuJIT)

- Profiled code cache for JIT code background generation between executions (System.Runtime.ProfileOptimization)


Great list. It's important to understand when to use each one of these. Identify your bottleneck, through the use of profilers. Execution time is largely based on memory bus blocking I/O and not the CPU calculations, so if you start with writing SIMD, you're not going to get anywhere.

Accessing data on the stack instead of the heap is the #1 saver of execution time, in my experience. But your bottlenecks might be different. Locally scoped value-type variables are generally on the stack. Object-scoped and static fields and properties are on the heap.

Writes to local variables seem to be faster than reads, IIRC. The fastest operators seem to be the bitwise instructions, IIRC. If running in 32-bit mode, try to work with 32-bit integers. If running in 64-bit mode, try to work with 64-bit integers.

Here's an example of a major, major improvement in performance

for(int x = 0; x < this.Width; x++)

{

   for(int y = 0; y < this.Height; y++) { foo = bar; } 
}

Much faster version (due to storing a copy of Width and Height on the stack instead of the heap):

int width = this.Width;

int height = this.Height;

for(int x = 0; x < width; x++)

{

   for(int y = 0; y < height; y++) { foo = bar; }
}

My comment here describes roughly the approach I used to take advantage of stack-allocated memory (before Span<T> was available). https://news.ycombinator.com/item?id=15136627


Thanks! Your example is pretty interesting. Any reason why this is the case? In both cases, it is just accessing a memory location to read the value. Are there compiler optimization heuristics at play here? E.g., for the local variable compiler knows that its value is not changing during the loop execution, so it can be pushed to register for faster access.


Register access isn't the issue. In the first example, this.Width and this.Height are accessing the Width and Height property of the current object. This requires a heap fetch on each iteration of the loop. There may be OS-specific nuances with automatic caching that I can't remember clearly enough to reliably mention.

If you can get rid of all heap lookups in your iterative loop, then you'll see a large speed boost if that was the bottleneck. Local variables exist on the stack, which tends to exist in the CPU cache when the current thread is active. https://msdn.microsoft.com/en-us/library/windows/desktop/ms6...

Unfortunately, method calls in C# have a much higher overhead than in C and C++. If you must do a method call in your loop, be sure to read this to see if your method can be inlined. Only very small methods of 32 IL bytes or less can be inlined: https://stackoverflow.com/questions/473782/inline-functions-...


Thanks!


Also be sure to check this out https://gist.github.com/jboner/2841832 Notably the L1/L2 cache vs the main memory reference


it's not turmeric, it's curcumin, which is about 2% of turmeric by mass (so, you'd need to eat ~4.5g turmeric daily to match study doses)

Typical Indian cooking uses turmeric in pretty much everything. I wouldn't be surprised if daily consumption of turmeric is very close to the figures you mentioned.


Interestingly, one of the recent fads I've been seeing has been for "turmeric lattes" - maybe can reach that level even if you're not keen on Indian cuisine?


Apparently, eating more than a teaspoon of tumeric a day increases the risk of kidney stones though, so don't overdo it.

I've been mixing it through my oatmeal, together with chilli-pepper and black pepper, a bit of cardamom, and a teaspoon of real cinnamon (the non-cumerin kind). While it feels like it works, I know that the placebo effect is probably much stronger than any real effect these foods have. Still, a placebo effect is still a real effect on my mood, so that's still a kind of health benefit I guess. If nothing else the spices help me wake up!

Tangent regarding health food fads: these days I mainly use nutritionfacts.org[0] to determine which of those are actually supported by the latest nutrition research. It is the only health food/diet website that I know of that directly cites nutrition research and continuously scours the latest papers for new findings - sources are always linked, and quotes are directly lifted from the papers with no modification (so less likely to suffer from "stronger or opposite of what the paper actually says"-shenanigans often seen elsewhere).

Some of the other things I tried out based on that website have too big of an effect to just be placebo: adding blue-berries to a meal really reduces sugar rushes/crashes in the hours after it[1]. Taking a table spoon of freshly broken flax seeds[2] does a lot to counter the rise in blood pressure due to my ADD medication (I measured it, plus I feel a lot less discomfort in my chest area and less jittery).

Last time I mentioned that website here, it was in a discussion of which diets are healthy. Ironically, it was the only comment in the discussion that attracted multiples downvotes without explanation, while everyone else was sharing their unsourced opinions.

[0] https://nutritionfacts.org/

[1] https://nutritionfacts.org/video/green-smoothies-what-does-t...

[2] https://nutritionfacts.org/video/flax-seeds-for-hypertension...


"turmeric lattes" :)

My kitchen medicine for running nose, soar throat is hot milk with turmeric. Works for me most of the times.


Also:

http://www.ijamhrjournal.org/article.asp?issn=2349-4220;year...

> Worldwide, esophageal cancer is the eighth most common cancer [...]. In India, it is the fourth most common cause of cancer-related deaths.

Granted it's probably due to alcohol and tobacco but curry probably won't save you from cancer.


This is spurious correlation at its best. Terrible science at it is worst.


chewing tobacco is more common, at least, on the uncles I watch.


1% of the Sun's output power seems really huge. Is this accurate? Any references?


According to this:

https://wattsupwiththat.com/2006/12/08/yottawatts/

Tsar Bomba - 5.3 YW

Sun - 386 YW

39 nanoseconds isn't very long (~39 light-feet).


~12 light-meters for our non-metrically challenge friends.


I was using feet to emphasise I was being silly ;-)


Yesterday this news was on HN homepage. I just wanted to submit this clarification.

It seems like a weird decision by the courts to block websites randomly to prevent piracy of some movies.


I think that is a very good advice.

Reminded me of my conversation with my son when he was three years old:

“I want to be brave. Tell me how to be brave” asked my darling son today before leaving for his school. I didn’t have an answer. As my eyes welled up, I asked if he is scared of anything in particular.”No, I am brave. I am not scared of anything” came back his reply.

https://introspeak.wordpress.com/2016/06/23/tell-me-how-to-b...


May be because we are used to dangers of water, and floods for millions of years.

On the other hand, dangers of nuclear is a very recent thing. Common people's primary recollection point of nuclear is probably nuclear bomb.


Interesting points!

I can't quite remember where I came across this (most likely in a TED talk), and details I can recollect are very vague but here is a horrifying tidbit from history:

In those days, apparently people used to collect excreta in some form of bins, and dump it out in the streets. People used to drop it from multi floor buildings also :(

It was mentioned that if a man is taking a woman on date, while walking in the street he has to keep the woman on the side of the street; While the man himself is walking on the side of the buildings (imagine man, woman walking hand in hand, side by side). Why? in case someone throws unpleasant things from a window above, it is the man who will take the (s)hit.

Sorry if it is unbelievably outrageous, but apparently that was our past :(


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: