HN user

amitp

924 karma

I try to write better explanations of algorithms. I'm in the Silicon Valley area (south bay) and am happy to meet for coffee or lunch. See my interactive tutorials at https://www.redblobgames.com/

twitter:@redblobgames

Posts0
Comments192
View on HN
No posts found.

I found https://www.youtube.com/watch?v=a_rAXF_btvE to be more balanced than the LTT video, but I think it mostly depends on your expectations of the cameras. The videos themselves are stored locally, not in the cloud. But if you have thumbnails turned on in the notifications, then the thumbnails have to be stored somewhere temporarily (I think this is an Apple/Google requirement), and they're being stored on a cloud server rather than in your home network (which would require opening up a port).

Slug preserves the vector shapes. MSDF first converts to a texture, which can lose small details. How much depends on the size of your texture and the complexity of the font. I expect MSDF will never look better than Slug.

However, MSDF can handle lots of distance-based effects (glow, shadow, outline, gradient, etc.)[1], and I don't think Slug does that. And MSDF is constant time whereas (I think) Slug is going to vary depending on the complexity of the font.

The Slug paper [2] says:

  All of the techniques that store data in a texture atlas are inherently using a discrete
  sampling of what is actually an infinitely precise description of a glyph outline. This
  inescapably leads to limitations that can be mitigated by increasing the resolution of
  the texture atlas, but that can never be completely removed. For applications that
  need to render a wide range of characters at potentially large font sizes, a texture atlas
  capable of producing glyphs at an acceptable level of quality may have prohibitively
  large storage requirements.
[1] https://www.redblobgames.com/articles/sdf-fonts/#demo

[2] https://jcgt.org/published/0006/02/02/

Some of these banks are ridiculous. HDFC bank insists that I send them my photo id, address, phone number, and my Indian id number to prove that I'm not their customer. I tried explaining that I don't have an Indian id number because I don't live in India but they insisted they can't help me unless I provide all of this. Then they sent me legal notices threatening me for not paying "my" bills. I send all their stuff to spam now.

No Comment 12 months ago

I love having comments on my site/blog. I learn so much from some of them. For example, on my hexagon page, someone said there's a connection with "Eisenstein integers". I had never heard of them, and they were fun to learn about. Another example, I don't know "doubled coordinates" that well, so some sections of the page are incomplete. In the comments people have pointed to resources and code that fill in the gaps in my knowledge. Most recently, someone pointed out an inconsistency in something I wrote, and they were right — I have updated the page to resolve it. Before that, someone pointed to an emacs package that might make my life easier, and it looks like it will indeed partially solve the problem I had posted about.

I spend almost zero time moderating, because I've outsourced it to blogger/disqus. I'm not a big fan of disqus but the comments provide so much value to me, and disqus does the moderation so well, that I keep using it for now.

I think of it like giving a talk at a conference, and having questions afterwards. At some conferences, the questions are a waste of time. But at other conferences, the questions are quite valuable. I think comments don't work well on all sites. But they work well on mine.

(author here) I agree, the `type` example could be done with regular expressions. In part 2 I'm planning to describe the real reason I was using tree-sitter here. I wanted to highlight certain combinations of operations based on the naming conventions I use in one of my projects. In particular, I want to catch a function call where a function named "x_to_y" has an argument with a name that does not appear to be an "x". However, while writing part 1 I realized that I could probably do that with a regular expression…

Fantastic article! I've been trying to figure out antialiasing for MSDF fonts, and have run across some claims:

1. antialiasing should be done in linear rgb space instead of srgb space [1] [2]

2. because of the lack of (1) for decades, fonts have been tweaked to compensate, so sometimes srgb is better [3] [4]

Do you have advice on linear vs srgb space antialiasing?

[1] https://www.puredevsoftware.com/blog/2019/01/22/sub-pixel-ga...

[2] http://hikogui.org/2022/10/24/the-trouble-with-anti-aliasing...

[3] https://news.ycombinator.com/item?id=12023985

[4] http://hikogui.org/2022/10/24/the-trouble-with-anti-aliasing...

I'm happy with Steam on Windows but hate its behavior on Mac. It's slow and keeps stealing focus while starting up. I haven't gotten the "choose user" thing though. Cmd-Q does quit Steam for me.

I use a solid box in a terminal and for coding, and a vertical bar for writing in emacs org-mode. But I recently tried out a one-third box[1] in emacs and I am really loving it! It's partway between a box and an underline. Some software has a half-box option but I don't think MacOS Terminal or iTerm2 have that. [Edit: I was wrong — iTerm2 has an advanced setting for "underline cursor width"]

I used to use flashing but have that turned off right now, for reasons I can't remember.

[1] (setq-local cursor-type '(hbar . 8))

You're welcome! I try to keep the pages fast loading with minimal dependencies but have varying success depending on the needs of each page.

Thanks! Yes, I've been making interactive diagrams for a long time. I wrote about my motivation in 2007 [1]. In the early 2000s it was Java applets, and then I switched to Flash applets, and then HTML5 in 2011. That was also around the time I ran out of disk space on my stanford site (they give me 100MB) so I bought a domain name, redblobgames.com. That was also around the time there was enough cross-browser support for me to switch to HTML5. And then in 2014 Bret Victor wrote about "explorable explanations" — that's when I felt like I wasn't alone in wanting this type of thing.

[1] https://simblob.blogspot.com/2007/07/interactive-illustratio...

Author here. A surprise seeing this on HN!

The context: I'm writing my own blog software for various reasons [1], including my desire to post less to social media. As much as possible I'm trying to reuse the build system for the rest of the site, including the template. I have worked on and off on this for the past two months and I expect to keep adding features for another month or two. I'm currently adding categories not only for the blog but to the whole site. After that I'll work on archives by month. And I want to import the 21 years of old blog content [2] which is stored on blogger.com, and put it on the new blog, which is just a folder [3] on my existing site.

I'm writing some blog posts to test out the workflow (integrating into emacs, my build script, an internal status page) and also various content types (images, video, source code, figures, links). Each time I post I find some more things to tweak.

This post to HN made me realize that it's not labeled as a blog post. Oops. I guess that's one of the downsides of reusing the exact same template! So another tweak coming…

[1] https://www.redblobgames.com/blog/2024-03-08-new-blog/

[2] https://simblob.blogspot.com/

[3] https://www.redblobgames.com/blog/

There are lots of variants of A* that depend on what you can assume about your graph, whether you can preprocess, how often the graph changes, etc. Contraction hierarchies, subgoals, bidirectional A*, hierarchical search, all-pairs compression, moving obstacles, group movement, coordinated movement, landmarks, labeling algorithms, transit nodes, arc flags, cluster distances, vertex separators, reach, highway hiearchies, etc. Differential heuristics are my favorite for "bang for the buck", as they are fairly low effort (maybe <20 lines of code) for good speedup (3-5X on my game map tests [1]).

There's lots of research papers out there, especially for road maps. I tried keeping track of them all and gave up :-( But you might find these two papers useful:

* https://arxiv.org/pdf/1504.05140.pdf

* https://i11www.iti.kit.edu/extra/publications/dssw-erpa-09.p...

[1] https://www.redblobgames.com/pathfinding/heuristics/differen...

I tried googling "What is the fifth book in the wheel of time series" and got

1. Wikipedia - The Fires of Heaven

2. Amazon - The Fires of Heaven (The Wheel of Time, Book 5)

3. a bunch of videos which I skipped over

4. Wheel of Time Wiki - The Fires of Heaven

5. Macmillan Publishers - The Wheel of Time, Books 5-9

6. Goodreads - The Fires of Heaven (The Wheel of Time, #5)

7. Novelnotions - Book Review: The Fires of Heaven (maybe this is spam?)

8. Esquire.com - Wheel of Time Books in Order (not specific to book 5)

9. FictionDb - Wheel of Time Series in Order (not specific to book 5)

10. Barnes And Noble - The Fires of Heaven

I am wondering how different everyone's results must be. [Also, I don't know how to format a list on HN…]