Hacker Newsnew | past | comments | ask | show | jobs | submit | RoyalSloth's commentslogin

If someone is curious about this data, I made a little analysis a while ago - Nobel Prize in numbers: https://blog.royalsloth.eu/posts/nobel-prize-in-numbers/#sec...


Deep APIs were mentioned in "A Philosophy of Software Design" (John Ousterhout)


Good job, this looks really well done. One thing I am wondering, however, is how easy it would be to integrate a pre-generated inverted index file into this fuzzy searcher?

Context: Say I have a bunch of blog posts from which I create an inverted index at "export to html" time, in order to avoid indexing the blog content at runtime on every page visit. Is there a way to persist the internal state of the fuzzy search across different page requests (e.g, /blog-post-1, /blog-post-2), so it only builds its internal state/index once?

The pre-generated inverted index could be quite large and I would like to avoid parsing it on every page request.


Thank you for your kind feedback! That's a great idea. I have implemented a memento object that can be used for transferring the serialized state of the searcher. The intent of the implementation was to transfer the searcher between a web worker and the main thread. You could try to serve the Memento from the server and store it in an index db. You may have a look at the web worker example I provide in the repository.


> You could try to serve the Memento from the server and store it in an index db

I am not sure what you mean by "store it in an index db", but I was thinking about using the searcher on a static website (no real backend, only a fileserver serving pre-generated html files). So if I understand you correctly, in order for this to work I would have to cache Memento via a local storage and load it on every page load/search request.

Unfortunately the index would change over time, thus one would have to detect this somehow and regenerate Memento as well.


Sorry for the confusion. I think you could generate the memento each time you compile your blog into HTML. The memento can be stored as a json file and served statically by your fileserver. When a user visits your page, retrieve the memento from the server. Then, initialize the searcher with it. In this way you avoid indexing content at runtime.

As a bonus you could cache the memento in the local storage or session storage.


When i did my static site search function some time ago, I used Elasticlunr. I was able to pregenerate the index file as a big json file that is loaded at the client.

http://elasticlunr.com/


I don't get it why the Microsoft Word team didn't create a good looking default template that people could just use without any fiddling necessary. They had more than 20 years at this point to create something that looks pleasing out of the box, but when you check the available templates they are all an ugly looking mess.


I built a Markdown like text format for writing technical reports. I was fed up with Word and I wanted a plain text language that supports tables, footnotes, auto validated references to any part of the document, syntax highlighting of code blocks, comments, math equations, table of contents, etc... Unfortunately, existing solutions are all slow or written with some bizarre toolchains that are a pain to set up.

I wrote it from scratch in Go with very few dependencies, so I can compile it to a single binary that should work on all platforms. It outputs .html or .tex which is then compiled to a PDF via Xelatex. Since Latex is pain to deal with, I wanted to generate pdf directly, but life got in a way so... it's not exactly a finished project, but at least I enjoy using it.


You should take a look at the markdown TUI glow (or some of the other projects on charmbracelet) and see if there's anything you can contribute from your work. It's all in Go as well iirc.


Tab vs spaces war has cooled off, so we have to start a new one.

A: If I do X, then this happens...

B: Yeah but I don't care about X.

A: You are not a professional if you don't care about what I care about.

Now that this debate has raised some dust, I guess Bob has already started writing the "Clean Performance" book in order to continue to milk the series and stay in the spotlight.


Sounds like a "no true Scotsman" argument


Author here. This is not related to this discussion, but does anybody know what causes these lines to appear in my server logs?

  <REDACTED> - - [14/Feb/2021:22:26:45 +0100] "GET /posts/the-complexity-that-lives-in-the-gui/ HTTP/1.1" 200 16798 "-" "HackerNews/1391 CFNetwork/1220.1 Darwin/20.3.0"
  <REDACTED> - - [14/Feb/2021:22:26:45 +0100] "GET /posts/the-complexity-that-lives-in-the-gui/ HTTP/1.1" 200 16798 "-" "HackerNews/1391 CFNetwork/1220.1 Darwin/20.3.0"
  <REDACTED> - - [14/Feb/2021:22:26:45 +0100] "GET /posts/the-complexity-that-lives-in-the-gui/ HTTP/1.1" 200 16798 "-" "HackerNews/1391 CFNetwork/1220.1 Darwin/20.3.0"
The requests usually come from a certain ip multiple times until fail2ban bans it. It's not just one offender, there are multiple behaving like that.


It's probably an iOS app client for HN. CFNetwork is like their URLConnection I think. You're blocking people who want to read your article!

As for why it occurs so often in quick succession, perhaps there's a bug in the app causing it to fetch several times instead of once.


Thanks, I thought it was a bug in some app and just wanted to be sure, so I don't have to babysit the server.

If anybody knows which app is that, please tell the maintainer that they have a serious bug. It's night here, so I am logging off.


> the producers and consumers of messages are completely decoupled, which makes debugging really annoying because you don't have anything like a stack trace

This is actually a really good point. I don't know why you were downvoted.


I think that the only thing that really works are code reviews. The best engineers on the team should have enough time to review what is being committed and provide suggestions for improvement. Things will start gradually improving, but it usually takes a very long time before you see any progress.

Like someone already mentioned in this thread before, an important part of this transformation is to not forget about the political aspects of such cleanup process. People don't like to hear criticism, so you will probably encounter a lot of pushback in the beginning.


Well, that's a surprise for sure. I wrote this article a few months ago and it gained no traction. Today I woke up and boom, front page.


I really connected with the writing. Thank you for taking that time.

There is a lot in my current context the writing resonates with. Nice to find that others have been on this path too, and that we benefit from a lot of the same techniques.

Thanks for putting this out there as an invitation to draw people together.


I am glad you liked it.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: