HNHacker News
TopNewBestAskShowJobs

tidwall

883 karma · joined February 3, 2015

submissionscomments
tidwall··on Counted B-Trees (2017)
A working example in Go. https://github.com/tidwall/btree
tidwall··on Show HN: Neco – Coroutine Library for C
Also it is possible to start multiple Neco schedulers in different threads, there’s an example in the readme.
tidwall··on Germany set to eclipse Japan as No. 3 economy in 2023, IMF says
Japan is geographically larger than Germany.

https://en.wikipedia.org/wiki/List_of_countries_and_dependen...

tidwall··on Show HN: TG – Fast geometry library for C
TG isn't spherical and wasn't designed to be. It's 2D and projection agnostic. Crossing the antimeridian is a user problem to solve. I recommend following the GeoJSON rule of antimeridian cutting [1].

As I said in the README. My goals are fast point-in-polygon, geometry intersections, and low memory footprint. Those are my bread-and-butter.

From what I know about S2, it has different goals. Such as being spherical and using discrete cells for distributed spatial indexes. Those are great things of course, but not really what I need.

This is the second comment that recommends using Shewchuk’s methods. And while yes I agree that that may be a superior way to go, and always on the table for the future, I'm still able to achieve my goals without those methods. At least for now.

[1] https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.9

tidwall··on Show HN: TG – Fast geometry library for C
I can't stop precision loss in all cases, but I do my darnedest to avoid loss when it causes false positives, especially for stuff like intersect detection code. For example the collinear [1] function looks really big for a seemingly simple operation, but there are extra checks built in for precision loss and in the cases of compiler associate math issues (like a user borking a build with -ffast-math).

I'm sure it's not all perfect but I feel pretty good about it overall. It certainly helps that much of the logic derived from the Tile38 [2] project, which has 8 years of use in production. I ported many of the tests too, which make me warm and fuzzy every time they pass.

[1] https://github.com/tidwall/tg/blob/v0.1.0/tg.c#L389

[2] https://github.com/tidwall/tile38

tidwall··on Show HN: TG – Fast geometry library for C
I have strict safety rules for this project, one of which requires that all geometries are thread-safe pointers. So in the example you show, it would not be safe to share the tg_geom pointer with other threads because it belongs on the stack instead of the heap.

Yet I do see the need for avoiding allocations when working with lots of simple geometries like points and rects, and for my use I made functions like tg_geom_intersects_xy and tg_geom_intersects_rect to perform relation operations directly on point and rectangle values.

tidwall··on Show HN: TG – Fast geometry library for C
It’s a new structure I came up with as described in the docs/POLYGON_INDEXING.md document. https://github.com/tidwall/tg/blob/main/docs/POLYGON_INDEXIN...
tidwall··on Show HN: TG – Fast geometry library for C
Yes, I used wasm as one of the targets during development.
tidwall··on Geo-Assist – An in-memory spatial engine to store and query spatial data
Yes. That library has a flexible kNN method built in. https://pkg.go.dev/github.com/tidwall/rtree#RTree.Nearby
tidwall··on The “Build Your Own Redis” Book Is Completed
Maybe I'm missing something but the server application resulting from the source code in this book does not actually work with redis-cli or any Redis clients. It appears to be using a custom binary protocol, not valid RESP. I feel that the RESP protocol itself is the most challenging task of building ones own Redis.
tidwall··on Making Faster B-Trees with Go Generics
Integer keys are not uncommon. It's just that they are usually combined as key/value map entry, like the BTreeMap in Rust, such as BTreeMap[int, *myObj] or BTreeMap[string, string]. Another interesting use is ordered set like BTreeSet[int].
tidwall··on B-tree Path Hints
It’s a 1M items, not nodes. Each item is a Go interface{}, about 16 bytes each. the benchmarks actually show that the tree is around 36MB.
tidwall··on Starlink dishes go into “thermal shutdown” once they hit 122° Fahrenheit
When my family moved to Arizona in 1987 we brought along our Pontiac Firebird. My mom loved that car. But it melted in the summer heat. Literally the glue that adhered the the interior materials could not handle the heat and stuff just started falling down. Goop flowing down the walls and windows.
tidwall··on Why trademark Open Source software
I made a walkthrough on cheaply registering a trademark without an attorney. It’s a couple years old now and the rules and processes may have changed. But for what it’s worth. https://github.com/tidwall/uspto-trademark
tidwall··on Tesla skips 401(k) match for third straight year
Tesla is not a private company. And private companies cannot do whatever they want.
tidwall··on Tesla worst for reliability in American driver survey
I traded in my Tesla Model S last December due to its degrading reliability. I ran into numerous issues towards the end such as:

- The touchscreen bubbling and tearing away due to "delamination". - Door handles "not presenting". - The radiator breaking and dumping all its fluid on the garage floor. - The fast wall charger overheating. It got so hot I often needed to use my shirt as a buffer between my hand and charger handle. I was told it was normal behavior for summer time.

Then there were driving issues such as autopilot glitching out and steering out of the lane. It got frequent enough that I had just stopped using that feature altogether. Then there was the time when I was on the I-10 going 75 mph in the HOV lane and the car beeped a warning and quickly slowed down to 15 mph. I had to put on my hazards and weave through rush hour traffic to get off the freeway and park the car. I got out of the car and back in, rebooted the computer and it started worked normally. Rebooting seemed to fix various things.

This isn't to say that my entire Tesla experience was entirely bad. I use to be a big fanboy, and in fact this was my second Tesla Model S, my first being a 2013 P85+. But sadly that era has passed I don't see myself ever buying a Tesla again.

tidwall··on When you type realty.com into Safari it takes you to realtor.com
I only use Safari and I’ve actually been on realtor.com a ton the past few days. I just punched in realty.com and it directed me to realtor.com. If I do http://realty.com it takes me to the correct site.
tidwall··on Show HN: A job board for companies fighting ageism in tech
So leetcode is code that is written by the interviewee during an interview? Sounds tough. I never had to do that. I would probably clam up and fail.
tidwall··on Show HN: A job board for companies fighting ageism in tech
What is “leetcode”?
tidwall··on Ask HN: Starting Your Own LLC?
Sounds like you want a Single Member LLC. This is the easiest to start. From a tax perspective you can file as a Disregarded Entity, which means you'll report taxes your (the owner's) personal tax return.

I've started a few different business this way and the nicest thing about a disregarded entity is that if you need to sell or fold the business, you won't have any complicated forms to fill out with the IRS. You just stop reporting the following year.

tidwall··on Show HN: A Color Picker I Made
Very nice!
tidwall··on Game Detection/Identification API Using Tensorflow and Go
This is really interesting. Shouldn't it have a "Show HN" prefix?
tidwall··on Show HN: Tile38 – Realtime geofencing and geospatial index
Hi! I recommend converting the target geohash to a lat lon first and then using the NEARBY command.

  NEARBY fleet HASH POINT lat lon
This will return back all points as geohashes.
tidwall··on Show HN: Tile38 – Realtime geofencing and geospatial index
You're welcome and thanks so much for kind words!
tidwall··on Show HN: Tile38 – Realtime geofencing and geospatial index
The Z coord is a flexible field that can handle any numerical range. Zoom level, elevation, timestamp, etc.
tidwall··on Show HN: Tile38 – Realtime geofencing and geospatial index
Sweet! I'd love to hear more about your implementation.
tidwall··on Show HN: Tile38 – Realtime geofencing and geospatial index
Oh thanks! I just fixed it.
tidwall··on Show HN: Tile38 – Realtime geofencing and geospatial index
I'm glad you like the product. Today it's possible to assign a Z coordinate to an object, which allows for querying on Lat/Lon and filtering on Z.
tidwall··on Two creators are not always better than one
But are solos happier?
tidwall··on Tile38 – Geospatial database and real-time geofencing server, v1.15.0
Released v1.15.0 Added official support for ARM/ARM64. There's also new commands, fixes, and optimizations.
← PreviousPage 2 of 4Next →