HNHacker News
TopNewBestAskShowJobs

stygiansonic

3,703 karma · joined August 1, 2012

https://peterchng.com

Email: 01endive-thunder@icloud.com

submissionscomments
stygiansonic··on Branch prediction: fundamentals every programmer need not know
Rekated: Dan Luu's article on branch prediction is pretty good: https://danluu.com/branch-prediction/
stygiansonic··on New antiviral treatment made from sugar
Isn't this the paper? It was linked to at the bottom of the article: https://dx.doi.org/10.1126/sciadv.aax9318
stygiansonic··on 5/3nm Wars Begin
nm is the new GHz/MHz.
stygiansonic··on Don't rinse with water straight after toothbrushing
Also from the article: "It's best to floss before brushing your teeth."
stygiansonic··on Super-Spreader
Also of note: asymptomatic carriers like Typhoid Mary: https://en.m.wikipedia.org/wiki/Mary_Mallon
stygiansonic··on Epic Tells Customers It Will Stop Google Cloud Integrations
I talked to a doctor at Stanford and he mentioned to me one reason why the main Stanford Health and Stanford Children's Health have separate patient portals (not unified) that you have to create separate logins for is because of the huge amount Epic wanted to charge to merge them. (They both run separate Epic instances as far as I can tell)
stygiansonic··on Measure code execution time accurately in Python
Great point about using JMH. As of JDK 12, it’s included in the SDK: https://openjdk.java.net/jeps/230

What’s the equivalent of JMH for Python?

stygiansonic··on Ask HN: What has your work taught you that other people don't realize?
Physical stores can track you as well: https://www.cnbc.com/2019/03/08/how-retailers-can-track-your...
stygiansonic··on US government-funded phones come pre-installed with unremovable malware
If the devices have Bluetooth or similar, couldn’t they function as some distributed monitoring network for other Bluetooth devices, building a database over time of devices?

Maybe I’m just being paranoid.

stygiansonic··on A 1942 List of Hitler’s Lies (2016)
Perhaps one of the most ironic Nazi lies was the last planned Nuremberg Rally, entitled the “Rally of Peace”. It was planned for September 1939 but was cancelled when Germany invaded Poland:

https://en.m.wikipedia.org/wiki/Nuremberg_Rally#Rallies

stygiansonic··on A lazy fix 20 years ago means the Y2K bug is taking down computers now
The article linked to from this one from 1999 quite rightly points out the probable cause of this “lazy” fix:

“In certain cases, corporate executives and government bureaucrats approved using the method knowing that problems won’t resurface until after they retire or change jobs.”

https://www.hpcwire.com/1999/03/19/common-y2k-quick-fix-last...

stygiansonic··on Ask HN: Are RSUs worth your loyalty?
This isn’t true when you consider how RSUs are typically granted and vested.

When you are hired you are given a certain number of units based on your RSU package and the current stock price. Example: 400k package over 4 years, current stock price $1000. This means you get 400 units total or 100 vesting per year.

If the stock prices goes (up/down) the number of units do not change but the total value does. This could result in significantly (more/less) for your total compensation in a way that cannot be achieved by what you have described due to the timing differences in when cash from base pay becomes available.

stygiansonic··on Ask HN: Joining Big Tech in One’s 40s
Not the OP, but there can be a perception (whether justified or not) that people who "just write docs" aren't coding (taken as "contributing in a meaningful way") but instead optimizing for their own career/promotion. (This is not a viewpoint I personally hold)
stygiansonic··on Battle of Alesia
Another comment mentioned it, but I like the Historia Civilis YouTube channel: https://www.youtube.com/channel/UCv_vLHiWVBh_FR9vbeuiY-A

After watching a video, you can then research further but generally I've found his videos have sufficient detail and are accurate.

stygiansonic··on Notes on Technical Writing
At the end of this article the author links to and mentions the four types of technical documentation: https://www.divio.com/blog/documentation/

I’ve found this to be especially useful when writing documentation. If you don’t think in this way them your documentation may end up being an impromptu blend of more than one type, and hence may not be useful for a specific use case. Instead I try to structure the documentation for one of these.

stygiansonic··on Is Fry’s Electronics in trouble?
This was my experience as well, going into the Sunnyvale store even 2-3 years ago. Their lineup of laptops were all the previous generation from what was currently available, and nothing was priced that well. I doubt that's changed.

Contrast to going into a local computer store, they had full stock of all the latest parts/components and competitive prices.

Would be interesting to know what's going on within the leadership of this company. They must know what the situation is, but how do they turn things around?

stygiansonic··on A single character code change
In my opinion this behaviour shouldn’t be considered strange - “new” always means instantiation of a new object and the “==“ operator for objects always checks for object identity. Since both operands are objects, the above would apply.

This is another reason to avoid boxed primitive whenever possible.

stygiansonic··on A single character code change
Although the article is a bit long-winded as others have pointed out, it did mention the importance of profiling your application before making any changes.

In particular, you should always aim to profile your app when running under a production load so that you do not have to make assumptions about its behaviour. Something like async-profiler[0] is good, since it avoids the safepoint bias issue and can also track heap allocations.

0. https://github.com/jvm-profiling-tools/async-profiler

stygiansonic··on A single character code change
What's weird about the original article is that my understanding of HashMap (which as you pointed out, is the backing data structure of for HashSet) does not initialize the underlying hash table until first use - so if a bunch of new HashSets were created but never added to, the memory impact should be minimal irregardless of what the initial capacity was set to. (So there should not have been much of a difference between "new HashSet()" and "new HashSet(0)" if no items were ever added)

See this comment, and also the implementation of putVal()/resize(): https://hg.openjdk.java.net/jdk/jdk14/file/f77e9e27b68d/src/...

Perhaps things were different back in Java 1.3.

EDIT: Apologies, I completely missed this in the article, where it's explicitly called out.

This particular trick also no longer works. As I found out while writing this article, modern JDKs do not allocate any space in a HashSet until something is added. If I had kept applying this trick pre-emptively I would have been wasting my time.

stygiansonic··on I’m on Medicare, but I still got stuck with a $25k hospital bill
Of note, the author is a physician and also a professor: “Andrew Taylor is a professor of radiology and imaging sciences at Emory University School of Medicine.”
stygiansonic··on Java JIT vs. Java AOT vs. Go for Small, Short-Lived Processes
“Last-drop throughput improvements. Even for non-allocating workloads, the choice of GC means choosing the set of GC barriers that the workload has to use, even if no GC cycle actually happens. All OpenJDK GCs are generational (with the notable exceptions of non-mainline Shenandoah and ZGC), and they emit at least one reference write barrier. Avoiding this barrier can bring the last bit of throughput improvement. There are locality caveats to this, see below.”

From: https://openjdk.java.net/jeps/318

stygiansonic··on You might literally be buying trash on Amazon
I can’t answer the question about cat food but there are fakes for one of the cheapest Casio watches out there, so it seems plausible.

https://www.burningimage.net/genuine-and-fake-casio-f91w/

stygiansonic··on Indexing Billions of Text Vectors
In general, the individual coordinates of a word embedding (and hence a sentence embedding) have no semantic meaning, at least not in any "normal" sense.

The n-dimensional space into which the embeddings have been represented is mainly just a space such that similarity between two vectors/embeddings in this space has some semantic meaning, e.g. query or word similarity.

A few more details are here: https://www.quora.com/Do-the-dimensions-of-Word2Vec-have-an-...

stygiansonic··on Critical Security Issue Identified in iTerm2
Why would the web server need to be running macOS? From my understanding an admin could be ssh’d into a server and tailing/gripping the logs there while using iTerm. If the malicious input was in the logs, then the attacker could take over the admins machine, and by extension, possibly any machine the admin had access to.
stygiansonic··on Report: WeWork expected to cut 500 tech roles
Even though this article's title sounds like it, this isn't meant to be flippant: https://danluu.com/sounds-easy/

Also see the other child comment: Once you have a significant amount of revenue, investing the effort improve things by 0.1% (or even 0.01%) can have a not-insignificant impact on the bottom line.

stygiansonic··on HP Plans to offer “unlocked” printers
You can't make this stuff up:

"Taking a page out of the mobile-phone industry’s playbook, HP plans to offer both locked and unlocked printers. Buy the locked version, and you pay less upfront, but lock yourself into buying supplies from HP. Unlocked printers will cost more, but customers will be free to use supplies from any third-party vendor."

stygiansonic··on Drone pilots could be experiencing 'sniper's syndrome'
There was a movie, Good Kill, that came out a few years ago. Its plot dealt with similar topics.
stygiansonic··on For Airbnb employees, dream turns into disillusionment
Interesting:

“It added independent board members and hired Dave Stephenson, a seasoned finance executive, from Amazon to become its chief financial officer. Current and former employees said they had taken the moves as signs that the company was finally set to reach the stock market.

In February, Stephenson was injured in a skiing accident. That slowed Airbnb’s IPO timeline, two people with knowledge of the situation said. An Airbnb spokesman said the accident did not have any impact.”

stygiansonic··on The True Size Of
Obligatory: https://www.youtube.com/watch?v=OH1bZ0F3zVU
stygiansonic··on What Happened in the UK Blackouts?
For a related read: the Northeast blackout of 2003: https://en.m.wikipedia.org/wiki/Northeast_blackout_of_2003
← PreviousPage 5 of 18Next →