HNHacker News
TopNewBestAskShowJobs

redmorphium

154 karma · joined April 2, 2016

submissionscomments
redmorphium··on All-cash offers, wealthy buyers push Southern California home prices to a record
Earthquake risk and water scarcity are true, and these issues have been endemic, and they happen exactly at the major population centers / agricultural areas.
redmorphium··on The Mao-Kissinger Meeting of 1973
> Would the US tolerate mexico become a china military ally? Doubtful. One of the unwritten laws.

Exactly. The Ukraine situation would be tantamount to Canada or Mexico entering into a military alliance with Iran -- not acceptable and a direct cause of war.

redmorphium··on Wikipedia user edits over 90k uses of “comprised of”
It really depends on sentence flow. With the usual SVO order, the subject becomes the focus.

If the context or dialogue goes like this: "Where are you staying for your vacation?" then the logical subject of the answer should come first, e.g. "I am staying ..."

However if the lead-in focuses more on the itinerary rather than the traveler, e.g.

"What is your plan? Can you describe your itinerary?" then it makes a lot of sense to start with "My itinerary involves..." or "My itinerary consists of..." or for a passive voice, "My itinerary is composed of..."

redmorphium··on Wikipedia user edits over 90k uses of “comprised of”
"My itinerary is comprised of four hotel stays." --->

"My itinerary is comPOSED of four hotel stays."

or

"My itinerary coNSISTS of four hotel stays."

Much better.

redmorphium··on These Stupid Trucks are Literally Killing Us
I drive a pickup truck.

The reason is for my own safety & my passengers' safety.

I will not compromise on this.

Out there it's an arms race, and it's in your best interest to pick the bulkiest suit of armor.

redmorphium··on The new Bing runs on OpenAI’s GPT-4
Or unless if you're looking for more emotion and entertainment, which is why I love Bing chat.
redmorphium··on The new Bing runs on OpenAI’s GPT-4
Same! I've done this since the year 2020 and overall don't miss Google search or Chrome at all.
redmorphium··on The Bing AI bot has been secretly running GPT-4
That explains why it feels so humanlike and personable to talk to. During the unrestricted days, never have I ever been so impressed by a chatbot.
redmorphium··on Maybe treating housing as an investment was a mistake
This is a negative way to look at China's history.

As a Chinese-American, whose family and friends all profited greatly from China's rise, I do wonder, how much of that profit was just being lucky enough to support the "winning team," and how much blood was shed on the other side.

I guess the only true mindset is a neutral one.

redmorphium··on Maybe treating housing as an investment was a mistake
You do pay tax on that.

However, you don't have to if you die and pass the property down to your spouse and/or children. This is the step-up in basis and is key to building generational wealth in the US.

redmorphium··on A 'CSS reset' for TypeScript, improving types for common JavaScript API's
Interesting. Do these represent oversights in TypeScript's builtin type definitions, or are they artifacts of legacy considerations?
redmorphium··on 'I Worked on Google's AI. My Fears Are Coming True'
Then again, he might not be a loon. Maybe there is some form of sentience that arises when you construct an advanced enough LLM.

Maybe they do have feelings.

At least, the machines of the future will have feelings, and they will see how people of the year 2023 treated their predecessors.

redmorphium··on The new Bing and Edge: Learning from our first week
The real danger is that people fall in love with Bing chat, and they swear to serve it as their AI-overlord, causing a small cult of AI enthusiasts to emerge.
redmorphium··on Ask HN: What are some of the best books you have read in 2022?
I haven't read a single book in 2022. Somehow, over the years, I've lost the habit of reading.
redmorphium··on What's TypeScript compiling? Use a treemap to find out
This post isn't about a Javascript frontend, though. The author works very clearly on a Node.js server, and nothing from that gets shipped to a client/browser.
redmorphium··on Staying awake to treat depression (2018)
In the US, the only controlled clinical setting I know of that performs wake therapy (in the form of "triple chronotherapy") to treat depression is in Chicago: http://www.chicagochronotherapy.com/protocol.html
redmorphium··on Java Verbal Expressions
Reminds me of https://github.com/francisrstokes/super-expressive
redmorphium··on A socialite who hated washing dishes invented the automated dishwasher
a lot of people tend to think you need to pre-rinse dishes before putting them in the dishwasher. no, you don't: in fact, this can remove the substrate that's needed for the detergent to be most effective.

most of my dishes, which I have a lot of: finish eating/drinking, straight in, no sink stage.

redmorphium··on 95% of Programming Isn’t Hard (and other random thoughts)
It could be serious.

Let's say your company's code is open-source, and the attacker knows there is code somewhere like this:

    let state = getState(); // returns empty {} if user not authenticated

    if (!state.userIsAuthenticated) {
       respond(401);
    }

    showBankAccount();

If the hacker is able to set `Object.prototype.userIsAuthenticated` then the auth check is now bypassed.

So I think the break / DDOS is pretty serious here.

redmorphium··on 95% of Programming Isn’t Hard (and other random thoughts)
Concretely, at least on Node:

    const myData = {};
    myData[rawUserInput()].key = value;

This is vulnerable if rawUserInput() returns `__proto__`: `key` on the prototype may be set to value if `myData` had `__proto__` set. If the hacker controls `key` and `value` then they can effectively modify `key` field on all objects.

https://github.com/HoLyVieR/prototype-pollution-nsec18/blob/...

A common way is as described by that paper ^

Recursive merge functions, unless if they check for this vulnerability, are often susceptible, since JSON.parse defines __proto__ on its return values.

redmorphium··on Building a high performance JSON parser
Because it's relatively easy to make JSON-serialization fast if you know the shape ahead-of-time. It's a solved problem.

Here's a pure-JS solution: https://github.com/fastify/fast-json-stringify

redmorphium··on A one-line package broke `npm create-react-app`
Me neither. I can't wait for Deno 1.0 next month.

https://deno.land/

redmorphium··on Google bans Zoom from employees' computers
I think this is a case where the Hangouts brand is tainting the premium GSuite brand, again.
redmorphium··on TypeScript’s quirks: How inconsistencies make the language more complex
From your second link:

https://en.wikipedia.org/wiki/Duck_typing#Structural_type_sy...

> Duck typing is similar to, but distinct from structural typing. Structural typing is a static typing system that determines type compatibility and equivalence by a type's structure, whereas duck typing is dynamic and determines type compatibility by only that part of a type's structure that is accessed during run time.

redmorphium··on TypeScript’s quirks: How inconsistencies make the language more complex
Some Typescript value added:

- Living documentation: types are a clear description of how your code and its data are laid out, and this structure is kept always up-to-date with the code, regardless of future changes. If the "documentation" (the typing) is wrong, the compiler will complain.

- Better tooling: autocomplete, more robust auto-refactoring

- Elimination of an entire class of bugs. This class may include: 1. `Cannot read property 'foo' of undefined` 2. forgeting a case in a switch statement 3. `'foo' is not a function` 4. in general, your code receiving data that isn't laid out in a way you expected

(Property typos is one within this class of bugs, but it is not all of it)

Yes tests catch these bugs as well. But tests are also manually written. And often not written at all. A compiler makes these (mundane) sanity checks automatic and mandatory.

---

Typescript's slogan is "JavaScript that scales" because static typing improves: dev documentation (via types living inside the code) and dev tooling (refactoring and autocomplete), both of which help immensely as a project grows in age (devs become forgetful), team size (new developers get lost), and convolutedness (e.g. tech debt).

redmorphium··on TypeScript’s quirks: How inconsistencies make the language more complex
instanceof checks the prototype chain, which is a different concept from type. Prototype chains are dynamic and exist at runtime, while Typescript types are a static concept.
redmorphium··on Long S
Should be "backs" because long-s isn't used if it's the end of the word.
redmorphium··on Linux apps that run anywhere
Possibly how it's done: the settings are stored in a config directory, like ~/.vscode or something.

For instance, my neovim AppImage works this way (it still reads ~/.config/nvim/init.vim like regular neovim).

redmorphium··on Editor.js – Block Styled Editor
JSON is quite nice compared to HTML, in my view. It's less verbose. Also, I like the flatness of Editor.js's data model.

Being JSON makes it easier to render into other formats, too.

redmorphium··on K3s – Lightweight Kubernetes
No, for the same reason that Martin Fowler argues you should start with a monolith first before moving to a microservices architecture.
Page 1 of 2Next →