Better HN
topnewbestaskshowjobs
Log inSign up

jwngr

882 karma · joined Jan 4, 2015 (11y ago) · 102 submissions

Cofounder @ Shortwave

Shortwave: https://shortwave.com Personal: https://jwn.gr

Submissions

comment 4y ago · link · parent

Shortwave cofounder here. We totally get that. Gmail is just the start for us. We plan to support more providers in the future and even become our own provider long-term. Read more about our company mission on our blog [1].

[1] https://www.shortwave.com/blog/future-of-messaging/

comment 5y ago · link · parent

Creator here. It's exciting to see this back on the front page of HN! My poor little f1-micro instance is not holding up well against the traffic though I won't be able to migrate it to a bigger server today, but if you bookmark it and check back in a day or two, it'll be back up.

If you think this is cool, I'm working on a huge new thing with some former Firebasers and others. Follow me @_jwngr on Twitter (https://twitter.com/_jwngr) for a big reveal coming very soon!

Here is the original HN post for those who are interested: https://news.ycombinator.com/item?id=16468196

33.

Implementing Firebase Auth Session Durations(medium.com ↗)

2 points · by jwngr · 8y ago · discuss

34.

Demystifying Firebase Auth Tokens(medium.com ↗)

3 points · by jwngr · 8y ago · discuss

35.

Demystifying Firebase Auth Tokens(medium.com ↗)

3 points · by jwngr · 8y ago · discuss

comment 8y ago · link · parent

Hey everybody, my "Show HN: Six Degrees of Wikipedia" [1] from two weeks ago was really popular with this crowd and I enjoyed all the comments and discussion that resulted. Now that the site has handled half a million search results, there is a lot of interesting data which I know you will also enjoy seeing. So I put together this blog post and I plan to make a series of them on different aspects of this side project. All the code for my project is open source [2] and I'm happy to answer any questions or hear any suggestions you've got. If you want to get notified of future blog posts in this series, I have a low-volume personal newsletter [3] you can sign up for.

[1] https://news.ycombinator.com/item?id=16468196

[2] https://github.com/jwngr/sdow

[3] https://jwn.us15.list-manage.com/subscribe/post?u=d19fa80c86...

37.

Insights on Hitler and More from the First 500,000 Searches(sixdegreesofwikipedia.com ↗)

2 points · by jwngr · 8y ago · 1 comment

comment 8y ago · link · parent

Hey everybody, my "Show HN: Six Degrees of Wikipedia" [1] from two weeks ago was really popular with this crowd and I enjoyed all the comments and discussion that resulted. Now that the site has handled half a million search results, there is a lot of interesting data which I know you will also enjoy seeing. So I put together this blog post and I plan to make a series of them on different aspects of this side project.

All the code for my project is open source [2] and I'm happy to answer any questions or hear any suggestions you've got. If you want to get notified of future blog posts in this series, I have a low-volume personal newsletter [3] you can sign up for.

[1] https://news.ycombinator.com/item?id=16468196

[2] https://github.com/jwngr/sdow

[3] https://jwn.us15.list-manage.com/subscribe/post?u=d19fa80c86...

39.

Insights on Hitler and More from the First 500,000 Searches(sixdegreesofwikipedia.com ↗)

3 points · by jwngr · 8y ago · 1 comment

comment 8y ago · link · parent

Possibly... follow this GitHub issue[1] if you want to be notified about it.

[1] https://github.com/jwngr/sdow/issues/11

comment 8y ago · link · parent

I'd prefer you not send any additional load to my server (this is just a side project I'm paying out of pocket for), but you are welcome to download the data yourself. There are instructions in the project README[1] to download the SQLite files I use in the project and I should have documented enough about the schema for you to know what queries to make. I am happy to answer questions via GitHub issues if you have them.

[1] https://github.com/jwngr/sdow#get-the-data-yourself

comment 8y ago · link · parent

The full fact list is on GitHub[1]. The fact list was a lot more interesting and important when searches took longer to run. One of the bad things about improving the performance so much was the fact that the facts don't have as long to display :P

[1] https://github.com/jwngr/sdow/blob/master/website/src/resour...

comment 8y ago · link · parent

It was down for a little while due to the traffic but it's back up and running again.

comment 8y ago · link · parent

The autocomplete suggestions hit the live Wikipedia API[1]. The actual search algorithm is on a dump of Wikipedia[2], which I plan to update monthly.

[1] https://github.com/jwngr/sdow/blob/f39398d112fecf7b993c64bd4... [2] https://github.com/jwngr/sdow#data-source

comment 8y ago · link · parent

The resulting SQLite database file is currently 8.3 GB, most of which is taken up by the `links` table. The big performance wins are having a handful of indexes (see the .sql files[1] for the database's schema) and preprocessing a lot of data so I don't have to do duplicate work every time a query occurs. For example, instead of the `links` table going from `source_id` to `target_id` and having a ton of rows which have the same `source_id`, I go from `id` to `outgoing_links` (which is a |-separate string of all source page IDs). Computing each page's incoming and outgoing links is the really heavy work and I only do that at database creation time, using a beefy GCP machine with 8 vCPUs, 52 GB RAM, and a 256 GB SSD. It still takes about an hour, but it's a one time cost and means I can run the actual service on a much smaller machine which won't cost me a fortune to maintain. Also, SQLite is just very fast and performant out of the box, so as usual, it's a matter of choosing the right tools for the job.

[1] https://github.com/jwngr/sdow/tree/master/database

comment 8y ago · link · parent

So the reason is that "Theodore Roosevelt" links to "Freddy Fazbear" (ctrl+f for "Articles related to Theodore Roosevelt" and then click it and then click "Teddy Bears") which redirects to "Friday Night at Freddy's". So, technically, there is a direct link there, albeit through the categories dropdowns. Unfortunately, Wikipedia doesn't have anything in their database dumps identifying if a link is in the article itself versus the categories dropdowns or sources, so I include them all.

comment 8y ago · link · parent

Check out an earlier comment I made[1] which has some information about this. It also includes links to the relevant code, which is all open source.

[1] https://news.ycombinator.com/item?id=16469260

comment 8y ago · link · parent

The sheer scale of Wikipedia (5 millions pages, half a trillion links) made it difficult to make the searches fast. Simply downloading the Wikipedia database dumps and parsing them into my own database took over a day on my first successful attempt. The site returns most results in just a few seconds despite the giant graph size.

comment 8y ago · link · parent

Thanks, glad you enjoyed it!

> I was expecting the site to tell me how to start at page X and get to page Y with the min number of clicks.

Yup, this is exactly what the site does, and a bi-directional BFS is an efficient way to do it. The special thing about my bi-directional BFS is that I follow outgoing links when searching from the source page while following incoming links when searching from the target page[1].

> I did notice that someone pointed out that they get different results by swapping the order of X and Y. This seems pretty surprising?

This is expected, because it is a directed graph, with the links on Wikipedia being in one direction. Just because page A links to page B doesn't mean page B links to page A.

[1] https://github.com/jwngr/sdow/blob/master/sdow/breadth_first...

comment 8y ago · link · parent

Ooh cool idea! That certainly would improve the information density issue. I honestly never considered that at all and have no idea how I'd do it in d3, but I may try to hack it out. Thanks!

comment 8y ago · link · parent

Thank you! The graph is built using vanilla d3, no library on top of it. The code for it lives all in one file, ResultsGraph.js [1]. I pieced together the code from a handful of other attempts online. I am still not 100% pleased with the performance of it with a larger number of nodes (250+), but that seems to be a common complaint with the d3 force simulation layouts.

[1] https://github.com/jwngr/sdow/blob/master/website/src/compon...

comment 8y ago · link · parent

I do a bi-directional BFS, but the search from the target node traverses incoming links as opposed to outgoing links. That's why I have to store both in the `links` table[1].

[1] https://github.com/jwngr/sdow/blob/f0b5a9ebe47ea0eca49d8220a...

comment 8y ago · link · parent

The graph is most definitely directed. One small example is Facebook -> Narcissism (1 path of 1 degree)[1] compared to Narcissism -> Facebook (8 paths of 2 degrees)[2].

[1] https://www.sixdegreesofwikipedia.com/?source=Facebook&targe... [2] https://www.sixdegreesofwikipedia.com/?source=Narcissism&tar...

comment 8y ago · link · parent

The bi-directional nature of the search does not change the end result. It is simply a performance improvement.

comment 8y ago · link · parent

Very cool! Your UI is great. I like all the animations and the graph is super smooth. All my code is open source[1] and it is decently documented. I'm happy to answer any questions you have and you're more than welcome to use any of the code I wrote for your project.

[1] https://github.com/jwngr/sdow

comment 8y ago · link · parent

I just added the query string stuff in the URL this morning and didn't even think about this issue. Just made the change as you suggested[1]. Thanks!

[1] https://github.com/jwngr/sdow/commit/b9164b4455661d7775aeb78...

comment 8y ago · link · parent

This has been fixed[1] and should behave in a more intuitive way now. Thanks for the suggestion!

[1] https://github.com/jwngr/sdow/commit/6e42e06488a592784e5d3d2...

comment 8y ago · link · parent

I'm not sure caching would help a ton given how I structure the data and do my searches in batches of pages, not for individual pages. I already do some "caching" by precomputing all incoming and outgoing links for each page when I create the database, which, as you would expect, yields a huge performance improvement. A cache certainly would help, but I would expect the hit rate on it to be extremely low, making it not worth the effort. I may have a different opinion after analyzing some of today's results though. Thanks for the suggestion!
1234