HackerTrans
TopNewTrendsCommentsPastAskShowJobs

klavinski

no profile record

Submissions

RenderFormer: Neural rendering of triangle meshes with global illumination

microsoft.github.io
276 points·by klavinski·last year·53 comments

Open Source Icon Sets

icon-sets.iconify.design
17 points·by klavinski·2 years ago·4 comments

Show HN: Pinbot – An extension to privately search one's browser history with AI

getpinbot.com
98 points·by klavinski·3 years ago·36 comments

comments

klavinski
·2 years ago·discuss
Steam250 [0] lists top games on Steam, and you can filter by tag and period. Additionally, it features a "hidden gems" section, with highly-rated but unpopular titles.

[0] https://steam250.com/
klavinski
·2 years ago·discuss
I have built a Chrome extension to do this one year ago: [0]

Here is the list of technological problems:

1. When is a page ready to be indexed? Many websites are dynamic.

2. How to find the relevant content? (To avoid indexing noise)

3. How to keep an acceptable performance? Computing embeddings on each page is enough to transform a laptop into a small helicopter with its fans. (I used 384 as the embedding dimension. Below, too imprecise; above, too compute-heavy).

4. How to chunk a page? It is not enough to split the content into sentences. You must add context to them.

5. How to rank the results of a search? PageRank is not applicable here.

[0] https://www.youtube.com/watch?v=GYwJu5Kv-rA
klavinski
·2 years ago·discuss
For the most straightforward nominative pattern matching, I would write a small match function:

    type A = { kind: "kindA", a: "dataA" }
    type B = { kind: "kindB", b: "dataB" }
    type Sum = A | B

    const match = <
        const V extends { kind: string },
        const C extends { [ kind in V[ "kind" ] ]: ( value: V & { kind: kind } ) => unknown }
    >( value: V, cases: C ) => cases[ value.kind as V[ "kind" ] ]( value ) as ReturnType<C[ V[ "kind" ] ]>

    // You check the type of result, change the type of value to A or B, make the cases non-exhaustive...
    const howToUse = ( value: Sum ) => {
        const result = match( value, {
            kindA: _ => _.a,
            kindB: _ => _.b
        } )
    }
You can test it here: https://www.typescriptlang.org/play?#code/C4TwDgpgBAglC8UDeU...
klavinski
·2 years ago·discuss
I also built such an extension half a year ago [0]. The first iteration was a local-first natural-language full-text search for the browser history [1]. The second iteration was focusing on bookmarks [2].

None of these could spark enough interest to get feedback on what users want. I am sharing this experience so that you may study my attempt, if you want.

[0] https://getpinbot.com/

[1] https://www.youtube.com/watch?v=GYwJu5Kv-rA

[2] https://www.youtube.com/watch?v=PQh1qhvxZzc
klavinski
·3 years ago·discuss
The most clever way I have found is through a mathematic structure with the same shape, i.e., a magic square:

  2 7 6
  9 5 1
  4 3 8
Here, if a triplet of one player's cells sums to 15, that player has won.
klavinski
·3 years ago·discuss
If you want a similar extension which works without sending data to an external server, I made Pinbot as an experiment: https://getpinbot.com
klavinski
·3 years ago·discuss
If you need a free alternative, the closest I know of is Metropolis[0] by Chris Simpson, although it is closer to Gotham.

[0] https://github.com/dw5/metropolis
klavinski
·3 years ago·discuss
Good work, Altanis! After exactness, speed is certainly a priority. For my engine, I settled on Rapier, which also offers excellent performance (and determinism!). Do you think you could compare it with Kinetics?

Can you provide a high-level view of how you achieve that speed? I have also heard of eXtended Position-Based Dynamics as one of the latest improvements in physics engine. Do you have a perspective on that?
klavinski
·3 years ago·discuss
Steam 250 [0] lists the top-rated games. You can filter by tags, price, date; but the most interesting category for me is the "hidden gems".

[0] https://steam250.com/
klavinski
·3 years ago·discuss
Probably A/B testing. If I ran such a service, I would try different prompts to find the best, by checking the user behaviour: do they stop rephrasing the question? If so, the prompt was probably effective.
klavinski
·3 years ago·discuss
Actually, a tab only sends its content to a unique offscreen document[0], and because of the single-threaded nature of JS, it works as a queue. So, you are right, throttling might be feasible without too much hurdle.

[0] https://developer.chrome.com/docs/extensions/reference/offsc...
klavinski
·3 years ago·discuss
I often prototype in Greasemonkey myself, so I understand and agree with your point. However, there are many requirements (the AI model weighs 90Mb; I run it in a sandboxed iframe because it uses `eval` and I want to guarantee it would not do something bad; but initialising the iframe and loading the model on every page would be quite cumbersome; etc.) that made more sense in an extension.
klavinski
·3 years ago·discuss
That information is very important for me, thank you.

Currently, to avoid computing the embedding of a sentence twice, I put them in a JS Map as a cache. I will find a way to empty the cache.
klavinski
·3 years ago·discuss
How would you want to do it? Among the fields, have a checkbox "search among the bookmarks"?
klavinski
·3 years ago·discuss
Yes, for the proof of concept. It is an arbitrary limit, as I am not completely sure how people would use the extension: it may fill the users' storage too quickly. In the future, I may consider adding a counter instead (removing websites which have not been visited/searched for X days).
klavinski
·3 years ago·discuss
It does not work yet for PDFs, but I agree it would be amazing. Full-text search for one's library and documents!

Thank you for reporting the bug regarding Twitter. I will investigate.
klavinski
·3 years ago·discuss
Thank you for letting me know, this information is crucial. The CPU-only compatibility of transformers.js might make it too slow for text-heavy websites. I will immediately study a way to throttle it.

However, the Chrome web store review might take some time to allow the update.
klavinski
·3 years ago·discuss
VoidTools Everything is truly an excellent tool! I have indeed considered making a desktop version. It is more complex than the current proof of concept, but a private one-stop shop for AI search is definitely a great vision!
klavinski
·3 years ago·discuss
Thank you the for the idea! I will add "allow a user-defined forbidden list of websites" to the ideas on the Discord server.

Regarding the privacy policy, you have a point: I did not put one on the website, as everything works offline, but people may indeed look for one.
klavinski
·3 years ago·discuss
I targeted Chrome for the proof of concept because of its market share, but to be honest, I use and prefer Firefox as my default browser.

Manifest v3 is a remarkably hostile development environment: Google knows that people block advertisements with extensions and want to limit their scope. I had to adapt a lot of code, and as such, making it work cross-browser would require more than a few changes. But I understand your point and want Pinbot to run on more browsers, especially Firefox!