HNHacker News
TopNewBestAskShowJobs

thomas-st

674 karma · joined October 13, 2008

co-founder close.com, personal website thomasst.ch
submissionscomments
thomas-st··on Nullable but not null
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··on Liberux Nexx: Linux smartphone (found on Galaxus, Swiss online reseller)
Previous discussion (with some calling it a scam): https://news.ycombinator.com/item?id=42803559
thomas-st··on USB On-The-Go
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··on Apple iPhone 16 Is Now Illegal in Indonesia, Ban Leaves Tourists in the Lurch
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··on Atkinson Hyperlegible Font
It looks a bit like a handwritten Polish ą
thomas-st··on Hacking the largest airline and hotel rewards platform (2023)
> (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··on ISPs complain that listing every fee is too hard, urge FCC to scrap new rule
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··on Where did all the “reject” buttons come from?
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··on Did anyone else just get signed up for “Amazon photos” out of the blue for $60?
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.
thomas-st··on MacBook Air M1 screen crack for no apparent reason
To be clear, it's completely unacceptable they are charging for this repair. My intent was to give some perspective on how the repair process went overall, I needed the device back for work.

While apart from the cracked screen issue the hardware is amazing in my opinion, the overall software issues make using macOS painful sometimes (processes running at high CPU -- now mostly offloaded to the efficiency cores, WebKit views having issues loading, anything syncing to iCloud sometimes not working, sometimes working on the 2nd try, Messages/Apple Mail search only finding some of the messages, audio crackling issues with wired headphones/AirPods/built-in speaker, etc.)

thomas-st··on MacBook Air M1 screen crack for no apparent reason
Honestly, if I had broken the screen, this seems like a fair cost for a new display like this. Apart from the the cost, I'd also like to mention the repair process (via mail at their Houston repair facility) was very speedy. I got a quote within hours of them receiving the product, and it was shipped the next day after I approved. The supervisor mentioned that if they ever set up a repair program for this issue, they will refund the fee.

Now, if only they could also fix the audio crackling issue that me and many other users are experiencing... (https://www.reddit.com/r/macbookpro/comments/s4r1m5/macbook_...)

thomas-st··on MacBook Air M1 screen crack for no apparent reason
My 14" M1 MacBook Pro screen repair cost was $809. Supervisor refused the waive the fee. The screen cracked for no apparent reason and then completely stopped working.

Some firm already filed a class action complaint, and I submitted my details: https://classlawdc.com/2021/08/04/m1-macbook-screen-crack-in...

thomas-st··on Ask HN: Who is hiring? (August 2021)
Close | Engineering and Product positions | REMOTE | https://jobs.close.com/

We're building the sales communication platform of the future. With our roots as the very first sales CRM to include built-in calling, we're leading the industry toward eliminating manual processes and helping companies to close more deals (faster). Since our founding in 2013, we've grown to become a profitable, 100% globally distributed team of ~45 high-performing, happy people that are dedicated to building a product our customers love.

We are currently hiring for a few 100% remote positions:

- Senior Frontend Engineer - React https://jobs.lever.co/close.io/10a1e32b-1a59-48dc-b8f4-e6f0d...

- Software Engineer - Backend/Python https://jobs.lever.co/close.io/592193bf-8a9c-43cf-86a1-faeb7...

thomas-st··on Ask HN: Who is hiring? (July 2021)
Close | Engineering and Product positions | REMOTE | https://jobs.close.com/

We're building the sales communication platform of the future. With our roots as the very first sales CRM to include built-in calling, we're leading the industry toward eliminating manual processes and helping companies to close more deals (faster). Since our founding in 2013, we've grown to become a profitable, 100% globally distributed team of ~45 high-performing, happy people that are dedicated to building a product our customers love.

We are currently hiring for a few 100% remote positions:

- Senior Frontend Engineer - React https://jobs.lever.co/close.io/10a1e32b-1a59-48dc-b8f4-e6f0d...

- Software Engineer - Backend/Python https://jobs.lever.co/close.io/592193bf-8a9c-43cf-86a1-faeb7...

- Product Manager - Americas https://jobs.lever.co/close.io/21dca90f-06a3-4050-81a0-9659d...

thomas-st··on How to hide from the AI surveillance state with a color printout
That's my main worry with Tesla not using LIDAR as a backup. Sure, the image recognition will work in almost all the cases, but occasionally (hopefully very rarely) there is going to be a pattern that it might not recognize (either deliberate by an attacker, or occurring naturally).
thomas-st··on My Laptop Bit Me – The Shocking Truth (2012)
That's a false rumor. https://forums.macrumors.com/threads/macbook-pro-16-17-comes...
thomas-st··on Timing the time it takes to parse time
See https://hack.close.io/posts/ciso8601 on the use case.
thomas-st··on Timing the time it takes to parse time
I had similar issues in Python, where the available date parsers weren't fast enough.

With my C module, I got 320ns, which was 62x faster than Python's less flexible strptime. See https://github.com/closeio/ciso8601/ for my benchmarks.

thomas-st··on Mac OS X: Sane way to switch between windows
I need to switch between two windows of different applications. Cmd+` only switches within the same application.
thomas-st··on Mac OS X: Sane way to switch between windows
Some other keys that work while using Cmd+Tab:

- Press "q" to quit the selected application

- Press "h" to toggle hiding the selected application

- Press "1" to show all open windows for the selected application

Does anyone know if there is a built-in way to only switch to the frontmost application window (by default Cmd+Tab puts all app windows in the foreground)? Sometimes I need to switch between two windows of different applications which I both want to keep visible on the screen, but switching to the destination app with Cmd+Tab ends up covering the entire screen because that application has other windows.

thomas-st··on Consistent hash ring Python library for building distributed apps with Redis
What's "dumb" about the hash ring, and how exactly is your solution faster/simpler?

One nice thing about the hash ring is that it nicely rebalances when you add or remove nodes. There is no need split any buckets.

thomas-st··on Show HN: A fast ISO8601 date-time parser for Python
I did all the timeit benchmarks on the latest 13" retina MacBook Pro, 2.6 GHz Intel Core i5. The profiler screenshot is from one of our serves on EC2.

Of course there is always potential for optimization, but at this point it's fast enough for our purposes. If you can make it significantly faster please don't hesitate to submit a PR though :)

EDIT: Wouldn't most C compilers unroll the simple "for" loops? Direct link to the C code: https://github.com/elasticsales/ciso8601/blob/master/module....

thomas-st··on Show HN: A fast ISO8601 date-time parser for Python
It doesn't cover all of it, for example week dates or ordinal dates are not currently supported. But feel free to submit any patches :)
thomas-st··on Show HN: A fast ISO8601 date-time parser for Python
Good idea with the regex, haven't tried it. That being said, you didn't take the time into account to construct a datetime object, let alone attach time zone information. ciso8601 supports time zones using pytz' FixedOffset and UTC classes, see https://github.com/elasticsales/ciso8601 for additional benchmarks. There's potential for further speedup by using a tzoffset subclass written in C, but in our cases all dates were UTC anyway and so we didn't need the time zone.
thomas-st··on Trousseau: an encrypted and networked key-value database
Does anyone know an encrypted database that allows for searches? E.g. implementing an algorithm similar to http://crypto.stanford.edu/~eujin/papers/secureindex/
thomas-st··on Self-Destructing Cookies – add-on for Firefox
Chrome: I use Vanilla Cookie Manager. https://chrome.google.com/webstore/detail/vanilla-cookie-man...

Would be interested in something comparable for Safari. Anyone?

thomas-st··on Introducing MongoMallard: A fast ORM based on MongoEngine
The thing that changed in 0.8 is that references are now stored as ObjectIds only instead of storing both the table name and the ObjectId (you can still get the old behavior by using dbref=True). However, you would still have to check whether or not the reference was an ObjectId to tell if it was valid.

We're using our fork of https://github.com/elasticsales/flask-mongoengine/ (which I admit is based on a flask-mongoengine version that is a little bit outdated).

Also, will add a link to the comments.

thomas-st··on Introducing MongoMallard: A fast ORM based on MongoEngine
Regarding schematics: We actually developed a object validation library that's very similar to it. It's called cleancat. It comes with some MongoEngine-specific fields to validate references. It's best to look at the unit tests to see how it works: https://github.com/elasticsales/cleancat/blob/master/tests/_...

Regarding collections and embeddeded documents: Yes, a lot of times it makes sense to split things out into separate collections instead of embedding them so you don't run into problems later. One nice thing about MongoEngine and MongoMallard is that they update only fields that have changed. So if you have a ListField(EmbeddedDocumentField()) and change one of the embedded documents, only that document gets sent in the update statement, which speeds things up. And yes, I wish MongoDB had better ways to ensure data integrity.

thomas-st··on Introducing MongoMallard: A fast ORM based on MongoEngine
Thanks Dorian, we write our posts in Markdown and use simple static content generation: https://github.com/elasticsales/hack.close.io
thomas-st··on Sweating the UI and UX details: Emails and Email Addresses
What is the specific problem with the top bar? It goes away for small window sizes.
Page 1 of 3Next →