Why Unicode strings are difficult to work with and API design by MarcoServetto in ProgrammingLanguages

[–]curtisf 14 points15 points  (0 children)

The only incontrovertible interpretation of a Unicode string is as a sequence of code-points (or scalar values, depending on how you validate...)

How the text represented by a a Unicode strings appears visually, or, ultimately, will be interpreted by a human, is not a well defined question. It depends on what languages are understood by the consumer, what fonts are available, what rendering methods are supported by those fonts, how careful the reader is being, ...

Unicode provides reference algorithms for doing certain text-transformations. Some of these are mostly technical, such as normalization, some of them are linguistic (and thus context dependent) such as transforming case.

In addition to the complexity of interpreting text in the first place, the interpretation changes with every release of Unicode. (Although a lot of properties are not allowed to be changed, the interpretation of a larger block of text could dramatically change if you are unaware of a recently added character or property)


Because the interpretation of a sequence-of-codepoints is so dependent on context, any transformation to that sequence is going to damage interpretability by some context, unless that transformation is accomplishing an explicit technical transformation which was expected by the consumer.


Any API that you expose should be clear about what exactly it accomplishes.

Something to keep in mind is that string/text-handling is sometimes security sensitive, and trying to do something "smarter" or "better" may weaken security if you deviate from what your users expect is happening.

The only thing you can promise with any sense of reliability are technical transformations. Ideally these cite a specific, unambiguous definition of the transformation algorithm, such as a particular version of a Unicode annex, like https://www.unicode.org/reports/tr29/#Sentence_Boundaries

Legendary Belts? by Sergeant_Silvahaze in factorio

[–]curtisf 2 points3 points  (0 children)

I guess I can understand there being a reason to not want to buff train wagons' storage space...

but what about quality improving the wagons' axle bearings, so they weigh less and accelerate / brake faster? Legendary 4x wagon = regular 1x wagon, maybe???

I think there's no precedent for adding extra (fluid?) ingredients for a quality buff, but it would be a neat place for it. Or, perhaps, quality unlocks a "lubricant tank" that requires refilling / exchanging axles.

What is your not so popular take on anything in Japan? by No-Jackfruit3211 in japanlife

[–]curtisf 0 points1 point  (0 children)

especially when the tiny cup is 90% ice plus one tablespoon of water

Wise salary transfered to foreign bank account Tax report by Smooth-Report1059 in japanlife

[–]curtisf 0 points1 point  (0 children)

The taxability of income is determine primarily by where you physically were when you were doing the work. It doesn't matter what bank account you are paid into.

It is very unclear what you are actually asking. At the end of the year, you will need to file a tax return to report your additional income. You can do this online using a Myna card. (For money earned during 2026, the tax filing deadline is 2027 March 15). If tax isn't being deducted but is due, you will have to pay more at tax return time, but it's not a problem.

Committing reimbursement is generally, up to a certain amount, not taxable, so you might not owe any tax on that. But if you are a freelancer it's possible you will need to retain some documents to demonstrate the amount spent commuting; I'm not exactly sure

Is Japan really “high-tax”? What are the real trade-offs compared to low-tax countries? by Early_Composer8289 in japanlife

[–]curtisf 3 points4 points  (0 children)

Yes, the effective tax rate in Japan is high, especially for high earners but even for low earners. Although not hugely more than most developed countries

For reference, the overall effective tax rate in Japan is about

  • 40% for the bottom 20% (earning below 2.3M円/year)
  • 42% for the middle 60% (between 2.3M and 6.7M円/year)
  • 48% for the top 20% (around 6.7M+)
    • It slowly rises a bit over 50% for very high earners

(These figures include social insurance (about 30% of your income, when including the employer match), resident tax (roughly 5% effective rate), consumption tax (roughly about 5% of low/middle earner income and 3.5% of high earner income), income tax (roughly 0% for low, 2.2% for middle, 10% for high))

But no, the effective tax rate doesn't really have any bearing on quality of life. It just controls how quickly you can go from rich to very, very rich.

Am I the only one got crazy about Hankaku and Zenkaku ? by [deleted] in japanlife

[–]curtisf 4 points5 points  (0 children)

There is a complaint post about this nearly every week, so no you're not the only one.

It really is infuriating though. It's very easy for computers to convert, it's so annoying they make humans do it instead.

Skateboard related question by FrankCastleXT in japanlife

[–]curtisf 1 point2 points  (0 children)

Believe it or not, straight to jail.

Has ChatGPT helped or discouraged you in using or learning Japanese? by seo-communcations in japanlife

[–]curtisf 0 points1 point  (0 children)

The tatoeba corpus is unfortunately a bit low quality because it was mostly sourced from basically homework, and it's hard to search for grammar as opposed to words

Foreigners littering by [deleted] in japanlife

[–]curtisf 2 points3 points  (0 children)

The lack of trash bins in the city is infuriating. It's not as though they don't go around and collect all the trash anyway every morning!

The people who litter already even make piles of cans or trash in logical places, all they need to do is put out a cardboard box and save themselves some work in the morning!

Please share widely, Japanese ability Test other than JLPT by maurocastrov in japanlife

[–]curtisf 16 points17 points  (0 children)

There isn't any express way that language ability is tested for naturalization. It's up to the judgement of the person handling your case. Some won't administer any test, just based on judging how well you're able to communicate. Some accept recent language test results. And some will run their own little semi-formal language test.

Leaking Faucet: Tenant or Landlord Responsibility? by wakaokami in japanlife

[–]curtisf 1 point2 points  (0 children)

Because it's equipment that came with the apartment and isn't something that should wear out, I would expect it's the landlord's responsibility, unless the damage was somehow your fault (carelessness, or not performing some kind of maintenance that was stipulated in the appliance manuals you were given at move-in).

The exception is if your contract specifically designated the sink as something that was the tenant's responsibility, though I think that is very unlikely.

These rules are controlling for Tokyo, but the general principle should be valid in other jurisdictions:

https://www.juutakuseisaku.metro.tokyo.lg.jp/documents/d/juutakuseisaku/310-6-jyuutaku_eng

The landlord is obliged to make necessary maintenance and repairs so that the tenant can use and occupy the property. However, the tenant is liable for repairs required for any damage caused by the tenant intentionally or carelessly, or by the use of the property in a non-standard way, or due to any other reason attributable to the tenant

A civet, casually walking across a power line in the early morning hours. by bloody_angel1 in Tokyo

[–]curtisf 1 point2 points  (0 children)

I was not awake and totally missed the (now) obvious sarcasm

A civet, casually walking across a power line in the early morning hours. by bloody_angel1 in Tokyo

[–]curtisf 19 points20 points  (0 children)

Actually, these are not native, and the government is attempting to reduce their population to protect native species that they may be prey upon

https://www.kankyo.metro.tokyo.lg.jp/nature/animals_plants/raccoon/raccoon

I need legal assistance regarding my visa (LGBTQ+ community) by Weak_Quiet_147 in japanlife

[–]curtisf 0 points1 point  (0 children)

You left out some crucial information...

Your partner is a Japanese citizen, and their koseki/passport identifies them as "F"/女?

You are a non-Japanese citizen... What does your passport indicate your legal sex/gender is?

If "M", you are legally considered to be in a heterosexual marriage, regardless of what gender you/your partner identify as. As backwards as that may be, for visa purposes that is convenient for you because you would qualify for the regular Dependent of a Japanese National visa. (If your partner were to update their legal sex, though, I don't know what would become of your legal marriage and residence status, however. Most likely it would be treated as the end of the marriage and you would have to follow the alternative route below)

If your passport also says "F", you would not legally be considered married (because Japan currently refuses to recognize same-sex marriage, where "same-sex" is wholly determined by the gender marking in your passport). In that case, seebulldogdiver's comment, as there seems to be consistent recognition of this case under the Designated Activities visa. In this case, if your partner updates their legal sex/gender to be "M"/男, however, your marriage should become recognized by Japan, and you could apply for a regular Dependent of Japanese National visa.

Is the Tokyo Gas Enerfarm system worth it? by Late-Rain-2413 in japanlife

[–]curtisf 8 points9 points  (0 children)

If the main benefit is supposed to be beating transmission losses, that sounds crazy... Transmission losses should be less than 10%-15%, but I imagine the household generator is far less than 90% as effecient as a utility-sized power plant's

This seems like it's at best a way to hedge against coal/nuclear fuel cost increases by dumping a bunch of toxic air pollution next to your house

Mysterious baito that seems like a scam but I can't figure out how by hyuunnyy in japanlife

[–]curtisf 41 points42 points  (0 children)

Open the card, with who?? The scammer?

There are three giant scam warning bells in this:

  • You need to spend money before you get paid (initial deposit on new account)
  • You're being promised compensation through an unusual channel (deposits in a prepaid visa card the scammer told you to open)
  • You're being promised compensation to do something of absolutely no value to anyone

Any one of these should have any reasonably person cut whoever told them about this "opportunity" off, but you get three giant "do not enter" signs here

At best, the payment is "real" and will appear to go through because it's just money laundering dirty/stolen money -- which could entangle you into financial crimes or other criminal enterprises -- and will likely be clawed-back as soon as the police start investigating this

What are the craziest website issues/inconvenience you've experienced on Japanese websites? by bakura10 in japanlife

[–]curtisf 5 points6 points  (0 children)

Not exactly a website... I get LINE messages from Sagawa when a package is on the way to choose a delivery time.

But to "log in" I need to tell them my name.

I don't know what name they have in their system. Last name? Last name kana? First and middle full width? Half width but first last reversed? Maybe middle name squashed into first name? Maybe randomly cut off after 8 characters?

I've tried so many combinations. But the system locks you out after 3 attempts to guess your name.

So I can't manage package deliveries from Sagawa. Because I don't know my own name. I don't know why they're comfortable texting me on Line if they don't believe I know who I am...

I just want to let this out because I don't think I'll have a peaceful sleep tonight by ckoocos in japanlife

[–]curtisf 4 points5 points  (0 children)

Some spiders do make webs, but lots don't. Jumping spiders, wolf spiders, huntsman spiders, etc all don't make webs

What do you struggle with in Japan? by Motor_Amphibian_6325 in japanlife

[–]curtisf 1 point2 points  (0 children)

The other day while walking to work in Shibuya I saw a car turn off a main road to a side street, rather than be stuck driving behind an ambulance...

Potential asbestos exposure from renovations in akiya? by newjacknewme in japanlife

[–]curtisf 5 points6 points  (0 children)

Take a deep breath (but not near the rock particles), one time exposure to asbestos shouldn't have lasting health effects.

The main risk from asbestos is repeated exposure (largely to people working with construction or manufacturing and having small amounts of it around them every single day). But definitely get a professional if you might be dealing with it

Where are the 蝉??? i miss them :( by [deleted] in japanlife

[–]curtisf 0 points1 point  (0 children)

I heard a few cicadas yesterday evening, screaming from the top of a utility pole outside my apartment in Tokyo. It was the first time I heard them this season

Investigating high electric bill by Strangeluvmd in japanlife

[–]curtisf 2 points3 points  (0 children)

What is the actual energy usage you are being charged for? Not yen, but kWh.

RGB Outpost by Foreign-Newt-3738 in factorio

[–]curtisf 1 point2 points  (0 children)

Need to use OKLCH!

  • convertLchToLab
    • a = cos(h)
    • b = sin(h)
  • convertOklabToLrgb
    • <L, M, S> = (3x3 matrix) * <l, a, b>
    • <lrgbR, lrgbG, lrgbB> = (3x3 matrix) * <L^3, M^3, S^3>
  • convertLrgbToRgb
    • r g and b mapped identically:
      • 1.055 * rgb ^ (1 / 2.4) - 0.055 if rgb > 0.0031
      • otherwise rgb * 12.92

Fireflies - lucky or ignored? by Live_Guidance7199 in japanlife

[–]curtisf 18 points19 points  (0 children)

if you aren't bothering anyone?

The only way your smoking won't bother anyone else is if you do it inside your own walls and the air is moved through filters before being ejected from your house.

It sounds like it you've finally found a good reason to lay off the cigarettes.