News for hackers. Stuff that matters.

redmorphium

Earthquake risk and water scarcity are true, and these issues have been endemic, and they happen exactly at the major population centers / agricultural areas.
Re:The Mao-Kissinger Meeting of 1973 on Saturday June 10, 2023 @05:11AM (#36268928)
> 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.

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..."

"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.

Re:These Stupid Trucks are Literally Killing Us on Friday March 17, 2023 @06:31PM (#35203751)
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.

Re:The new Bing runs on OpenAI’s GPT-4 on Tuesday March 14, 2023 @04:10PM (#35157657)
Or unless if you're looking for more emotion and entertainment, which is why I love Bing chat.
Re:The new Bing runs on OpenAI’s GPT-4 on Tuesday March 14, 2023 @04:08PM (#35157631)
Same! I've done this since the year 2020 and overall don't miss Google search or Chrome at all.
Re:The Bing AI bot has been secretly running GPT-4 on Tuesday March 14, 2023 @03:56PM (#35157414)
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.
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.

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.

Interesting. Do these represent oversights in TypeScript's builtin type definitions, or are they artifacts of legacy considerations?
Re:'I Worked on Google's AI. My Fears Are Coming True' on Wednesday March 01, 2023 @02:30AM (#34979715)
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.

Re:The new Bing and Edge: Learning from our first week on Thursday February 16, 2023 @04:57PM (#34827029)
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.
I haven't read a single book in 2022. Somehow, over the years, I've lost the habit of reading.
Re:What's TypeScript compiling? Use a treemap to find out on Monday August 01, 2022 @01:00PM (#32308970)
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.
Re:Staying awake to treat depression (2018) on Saturday April 03, 2021 @11:20PM (#26686638)
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
Re:Java Verbal Expressions on Wednesday November 25, 2020 @10:50AM (#25210478)
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.

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.

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.

Re:Building a high performance JSON parser on Sunday June 28, 2020 @08:46AM (#23668369)
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

Re:A one-line package broke `npm create-react-app` on Saturday April 25, 2020 @01:23PM (#22979586)
Me neither. I can't wait for Deno 1.0 next month.

https://deno.land/

Re:Google bans Zoom from employees' computers on Wednesday April 08, 2020 @05:18PM (#22817273)
I think this is a case where the Hangouts brand is tainting the premium GSuite brand, again.
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.

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).

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.
Re:Long S on Thursday December 05, 2019 @02:57AM (#21710671)
Should be "backs" because long-s isn't used if it's the end of the word.
Re:Linux apps that run anywhere on Wednesday May 22, 2019 @02:57AM (#19978528)
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).

Re:Editor.js – Block Styled Editor on Wednesday April 03, 2019 @02:11AM (#19561162)
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.

Older »