Readit News logoReadit News
thomas-st commented on Nullable but not null   efe.me/posts/nullable-but... · Posted by u/efeoge
deepsun · 5 months ago
I've seen worse. Some teams use JSON for their data. Not only each field can be missing (aka NULL), it can also be "null". Or a different type.

I envy your team who's only mistake is to forget setting NULLABLE. Rainbows and unicorns ;)

thomas-st · 5 months ago
That's just the JSON equivalent of "we have data, and it's null" vs "data is missing", and consistency could be enforced using a constraint or by making it non-NULL in the first place.

It's more common in string fields, which in many cases just get rendered on a web form that doesn't differentiate blank (empty string) from null state, therefore in the database we should in most cases set it up as follows:

- Value required: field should be non-NULL + at least length 1 (via check constraint)

- Value optional: either field is non-NULL, or field is nullable + at least length 1

I'm curious if you prefer to store optional strings as non-NULL and rely on the length, or as nullable and have a length constraint.

thomas-st commented on USB On-The-Go   computer.rip/2024-01-06-u... · Posted by u/jnord
thomas-st · a year ago
I have a power bank that is PD capable, but I cannot charge it from my MacBook even if the MacBook is plugged in to power. I get around it by using a USB-C/A dongle and corresponding USB-C/A cable. Presumably this "downgrades" the connection and since the MacBook doesn't support traditional USB charging it has to charge the power bank. Does USB-C not have a way to indicate that a potential power source is a battery so that the MacBook can charge it if it's plugged in to power, and reverse roles otherwise? Is this a fault how the power bank or macOS implements power negotiation, or is this scenario simply unaddressed in USB-C?

Funny enough, if I plug the USB-C/A dongle on the end of the power bank and the cable into the MacBook, it also won't charge.

I also have a Philips One toothbrush with a USB-C charging input. Similarly, I can't charge it with a USB-C cable directly from my MacBook but have to use A in between (I unsuccessfully tried using either a thinner "lower speed" or a thicker "higher speed" USB-C cable). I'm assuming the toothbrush doesn't support PD, so then why can't it fall back to traditional charging with a C-to-C cable?

thomas-st commented on Apple iPhone 16 Is Now Illegal in Indonesia, Ban Leaves Tourists in the Lurch   news18.com/tech/apple-iph... · Posted by u/thunderbong
thomas-st · a year ago
Use (and shipping via mail) is allowed according to this article, so one of the articles is wrong/outdated:

https://www.straitstimes.com/asia/se-asia/iphone-16-allowed-...

thomas-st commented on Atkinson Hyperlegible Font   brailleinstitute.org/free... · Posted by u/fanf2
mastazi · a year ago
I have an issue with the lowercase q which looks a lot like a lowercase a. In many other fonts, these two letters look quite different and it's unlikely that you would mix them up.
thomas-st · a year ago
It looks a bit like a handwritten Polish ą
thomas-st commented on Hacking the largest airline and hotel rewards platform (2023)   samcurry.net/points-com... · Posted by u/DavidChouinard
spi · a year ago
I know this is HN and here it's not a popular opinion, but maximum security is _not_ always a good idea. Even setting aside the problem of many different actors having to access these details mentioned below, there's value in a simple login process. Specifically for airplane tickets, the most common ones I had to struggle with multiple times are retrieving reservations bought from a different computer, or by a travel agency. In all these situations, it was exactly the simple approach that saved me. If 2FA was mandatory, the best case scenario was that the travel agency would have to send you a separate e-mail with details about how to access their portal where this 2FA would somehow work. The number of systems multiplies, the number of credentials to remember does, as well. If you are not from your usual workplace (and chances are, if you are travelling, you are not) or from a shaky connection (same), you are in a real problem. In a time-critical scenario, which makes it really worse.

Implementing a "secure" connection here would be a sure road for pain ahead, at least it would need the airplane company to increase customer support a lot, and likely a lot of bad publicity every time something fails. Delays cost money, especially in this industry. And what would you get for that? The safety that, if you publish a picture of your reservation / boarding pass online, nobody can log in with your credentials and cancel your flight? That's a rather niche and very targeted risk, which is better handled by a single customer support agent who, simply, issues you a new ticket.

(by the way, by the time you have checked in and your boarding pass has been issued, a lot of companies just don't allow you to cancel anymore, so it's really a non-issue?)

thomas-st · a year ago
> (by the way, by the time you have checked in and your boarding pass has been issued, a lot of companies just don't allow you to cancel anymore, so it's really a non-issue?)

Which companies have a cancellation policy that is contingent upon getting a boarding pass? I've cancelled checked-in tickets before. If the flight is operated by a different airline than the ticket issuer, you just have to call the operating airline first to undo the check-in (a few airline can even do this online). After that it should be possible to cancel the ticket by the ticket issuer without any problems.

thomas-st commented on ISPs complain that listing every fee is too hard, urge FCC to scrap new rule   arstechnica.com/tech-poli... · Posted by u/Bender
thomas-st · 2 years ago
A while ago I was helping a friend pick a cell phone plan with T-Mobile USA. If you study their plans, the "Essentials" plan does not include "taxes and fees", but their "Magenta" plan does. When contacting T-Mobile, they could not tell me what the fees were even after providing the specific ZIP code. They said I would have to sign up for the plan first, and could then see the fees on the bill. Even when I told them that the choice of plan would depend on the amount of taxes and fees, they were not able to tell me and said that I could look at the current cell phone bill with the current carrier, and that the taxes and fees should be similar.

It is crazy they can't tell you how much you'll be paying before signing up.

thomas-st commented on Where did all the “reject” buttons come from?   noyb.eu/en/where-did-all-... · Posted by u/dotcoma
thomas-st · 3 years ago
I wish cookie settings were part of the browser (e.g. I want to reject all marketing cookies but not essential ones), have a way in JS/HTTP to indicate the type of the cookie, and never see those cookie popups again.
thomas-st commented on Did anyone else just get signed up for “Amazon photos” out of the blue for $60?    · Posted by u/fshbbdssbbgdd
legrande · 3 years ago
If you're in the EU, try getting the Revolut app. They have a feature called 'virtual cards' which are great for e-commerce purchases. The idea being, you use a card once and then terminate it after making a purchase. This means you don't get unexpected charges a year (or two) later as most services keep your card 'on file' now, which is a dark pattern.
thomas-st · 3 years ago
Careful. My friend used Revolut virtual cards and forgot to deactivate the card after the purchase. Months (or a year) later he got a fraudulent charge and Revolut refused to waive it because they claim he should have deactivated the virtual card. If it were on a regular credit card he may have just been able to dispute it.

u/thomas-st

KarmaCake day674October 13, 2008
About
co-founder close.com, personal website thomasst.ch
View Original