News for hackers. Stuff that matters.

NoInkling

Temporal.
Yeah a lot of these popular libraries - including Moment, Luxon, Day.js - commit the sin of using a single type of object for distinct concepts. Absolute time, civil time? Basically the same thing right? Just shoehorn them both in.
The IANA timezone database does occasionally revise historical rules when relevant information comes to light. So you might have calculated that some historical figure died at such-and-such a time UTC (based on a documented local time), but actually that's inaccurate and you might not know because you haven't redone the calculation with the new rules.
Re:Seconds Since the Epoch on Friday December 27, 2024 @12:20AM (#42520134)
> Most libraries implement timezone aware dates as an offset from UTC internally.

For what it's worth, the libraries that are generally considered "good" (e.g. java.time, Nodatime, Temporal) all offer a "zoned datetime" type which stores an IANA identifier (and maybe an offset, but it's only meant for disambiguation w.r.t. transitions). Postgres already ships tzinfo and works with those identifiers, it just expects you to manage them more manually (e.g. in a separate column or composite type). Also let's not pretend that "timestamp with time zone" isn't a huge misnomer that causes confusion when it refers to a simple instant.

I suspect you might be part of the contingent that considers such a combined type a fundamentally bad idea, however: https://errorprone.info/docs/time#zoned_datetime

Re:Seconds Since the Epoch on Thursday December 26, 2024 @11:13PM (#42519884)
PostgreSQL internally uses a 2000-01-01 epoch for storing timestamps.
Re:What I Wish Someone Told Me About Postgres on Tuesday November 19, 2024 @12:57AM (#42180424)
https://jdbc.postgresql.org/documentation/query/#using-java-...

> note that all OffsetDateTime instances will have be in UTC (have offset 0)

Is this not effectively an Instant? Are you saying that the instant it represents can be straight up wrong? Or are you saying that because it uses OffsetDateTime, issues are being caused based on people assuming that it represents an input offset (when in reality any such information was lost at input time)?

Also that page implies that they did it that way to align with the JDBC spec, rather than your assertions about misleading documentation.

Re:Australia/Lord_Howe is the weirdest timezone on Friday November 01, 2024 @12:56AM (#42014161)
Yeah you gotta watch out for those "Etc" identifiers, especially if you were thinking about exposing all the identifiers to your users wholesale. The file for them has this comment:

> POSIX has positive signs west of Greenwich, but many people expect positive signs east of Greenwich. For example, TZ='Etc/GMT+4' uses the abbreviation "-04" and corresponds to 4 hours behind UT (i.e. west of Greenwich) even though many people would expect it to mean 4 hours ahead of UT (i.e. east of Greenwich).

Re:Australia/Lord_Howe is the weirdest timezone on Friday November 01, 2024 @12:44AM (#42014115)
What happens if a country that's currently at the new UTC-12 anchor wants to move back an hour under that system? Are they forced to "wrap around" and move to the next day instead? Or do you move the anchor itself back (to UTC-13) just to accommodate them?
Re:Character Amnesia in China on Tuesday October 29, 2024 @01:56AM (#41979848)
喷 is included in HSK 5 and Heisig's version of the most common ~3000 characters, it can't be that infrequent.
Re:Character Amnesia in China on Tuesday October 29, 2024 @01:00AM (#41979526)
In addition, the Heisig method doesn't teach "meanings" at all, rather "keywords", which in many cases are only kinda sorta vaguely related to their respective characters' (fragment of) meaning. Either way, they're mainly useful as an "anchor" or name to refer to the character by, and in many cases might as well be arbitrary. The real purpose is just to turn an initially indecipherable blob that is a character into something recognizable (and writable, if you care about that). In general, you're not learning meaning to a useful degree until you start seeing or hearing (when you can associate pronunciation) those characters in context, as you imply. Yeah sure, with Heisig alone you'll be able to see 鸡 and know that it (most likely) refers to chicken, but characters like that are a relatively small proportion.
According to Wikipedia:

> "Since 2024 the capital ⟨ẞ⟩ is preferred over ⟨SS⟩."

https://en.wikipedia.org/wiki/%C3%9F

Check reference #5 and compare it to the older wording in reference #12.

Re:12 Months of Mandarin on Tuesday October 08, 2024 @12:59AM (#41773983)
Keep at it, consistently doing a bit every day, and you'll get there. I went through all the free beginner videos (at the time) before moving onto intermediate, then did the same before moving onto advanced, and only then was I really able to start watching stuff made for native speakers without feeling too lost. I'm not a CI purist though, I looked up words or grammar points occasionally, but I didn't actively try to study or memorize anything.
Re:12 Months of Mandarin on Monday October 07, 2024 @02:43AM (#41763375)
The idea that Mandarin grammar is easy only really applies at a surface level. Yeah for the most part it's SVO word order and there aren't any verb conjugations, but the deeper you get, the more you run into constructions that are completely alien from an English-speaker's perspective. I like how this image represents it: https://imgur.com/neBFnxc
Re:12 Months of Mandarin on Monday October 07, 2024 @02:15AM (#41763237)
The first book actually only contains the most common (by their methodology) 1000 characters:

> "The 55 lessons from Book 1 cover the 1,000 most commonly used characters in the Chinese writing system, plus another 500 included either because they are needed to preserve the logical ordering of the material or because they are especially easy to learn at this early stage."

Those 500 are still from the most common ~3000 total that comprise both books at least, but it means that you really have to learn 1500 characters before you're guaranteed to know the most common 1000. And learn all 3000 before you're guaranteed to know the most common 1500.

I've been going so slowly it's taken me years to reach my current point of character #2170, but eventually I'll get there, even if I've already been reading sentences with characters that I haven't gotten to yet for a while now.

Re:12 Months of Mandarin on Monday October 07, 2024 @12:53AM (#41762916)
Have a look at Dreaming Spanish, it exists precisely to bridge the "comprehensibility gap" for learners.

https://www.dreamingspanish.com (or find the Youtube channel)

There's tons of free content to keep you occupied for a while, and then there's a paid tier if you want more down the track. After choosing the level that's suitable, I recommend starting with Pablo's videos - he's the founder and I still like his style the most, particularly his older videos before things expanded. Just click on whatever looks interesting.

Re:12 Months of Mandarin on Sunday October 06, 2024 @11:43PM (#41762587)
The main thing learners utilizing comprehensible input need is volume, so if you actually want to make it useful as more than a one-off novelty, your priority kind of needs to be in pumping out the content (while keeping it relatively interesting since that's also important). That's really the hard part. I will also say that I'm not personally convinced that "here's the words you heard, now tap them in order" minigames are very helpful. Other than that, the features and functionality are nice. Reminds me of Duolingo stories, which is their best content IMO.
Re:Keep your phone number private with Signal usernames on Wednesday February 21, 2024 @09:18PM (#39462348)
Nope, Spain uses « » (though mostly only in formal writing these days) or English-style quotes.
Re:AI Graphics at JetBrains on Wednesday October 18, 2023 @01:30AM (#37925133)
VS Code has semantic highlighting too, and I'm pretty sure it works with Python these days (might need the right extension/colour scheme).
Re:TypeScript 5.0 on Thursday March 16, 2023 @11:32PM (#35192671)
> there is currently no sensible way to type a non empty array in Typescript

If we remove the "sensible" requirement:

    type NonEmptyArray = [any, ...any[]]
Re:TypeScript 5.0 on Thursday March 16, 2023 @11:12PM (#35192511)
> undo a very Microsoft oddity

I don't think Microsoft are the reason why JS uses UTF-16 strings.

Re:Duolingo Max, a learning experience powered by GPT-4 on Wednesday March 15, 2023 @02:02AM (#35164487)
Also worth checking out something like Clozemaster.
I think the part he left out is that (if I recall correctly) he was allegedly speeding to some degree.
Drunk people lying down in the street is definitely something I've seen several times in my life.
I was already tired of it a decade ago. It's ok when the service also offers a lifetime option though.
Re:EasyRPG on Tuesday August 02, 2022 @05:26AM (#32316665)
RPG Maker XP and later are very flexible because you can actually use code and modify major parts of the game engine (you're limited mostly by the actual editor). But yes, in RM2K/2K3 your ability to break away from the standard JRPG framework is much more limited. Regardless, I've been surprised in the past with what people have been able to achieve within those limitations. I haven't played Ultima VII but I can't imagine it's completely out of the question, it just might require quite a lot of "innovation".
Re:EasyRPG on Tuesday August 02, 2022 @05:02AM (#32316538)
Thanks for this! I've also been learning Spanish (for a while now) so I'm always on the lookout for input/practice material. I have a lot of nostalgia for RM2K/2K3 and the 16-bit era of RPGs, so it would be cool to check these out sometime.
Re:Soft deletion probably isn't worth it on Thursday July 21, 2022 @11:11AM (#32180340)
Here's an interesting approach using rules: https://evilmartians.com/chronicles/soft-deletion-with-postg...
Re:No Language Left Behind on Wednesday July 06, 2022 @10:15PM (#32009240)
I know DeepL doesn't do low-resource languages, but it would be interesting to see a translation quality comparison between the two.
Re:It's quite hard to lose a Duolingo streak on Tuesday July 05, 2022 @03:55AM (#31985563)
Duolingo does have the stories section for low-level, contextful reading/listening material.
Re:It's quite hard to lose a Duolingo streak on Tuesday July 05, 2022 @03:40AM (#31985449)
Sounds similar to Clozemaster (https://www.clozemaster.com/), which has a freemium model.

Older »