News for hackers. Stuff that matters.

klavinski

Re:Ask HN: How do you find new games to play? on Saturday July 13, 2024 @12:35AM (#40951794)
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/

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

Re:Building a hybrid native application with Gleam and Tauri on Tuesday February 20, 2024 @01:24AM (#39438548)
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...
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

Re:Find Legal Moves in Brass Birmingham with Datalog on Wednesday November 22, 2023 @07:23AM (#38378275)
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.
If you want a similar extension which works without sending data to an external server, I made Pinbot as an experiment: https://getpinbot.com
Re:Using popular font Proxima Nova could get you sued on Thursday September 14, 2023 @04:30PM (#37514441)
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

Re:Physics Engine 13x Faster than Matter.js on Wednesday August 30, 2023 @02:56PM (#37327129)
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?

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/

Re:Phind AI search engine system prompt (GPT-4) on Monday June 26, 2023 @11:28AM (#36480980)
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.
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...

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.
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.

How would you want to do it? Among the fields, have a checkbox "search among the bookmarks"?
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).
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.

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.

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!
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.

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!

No, that is what I find exciting! The AI model runs entirely on your device, and your data is never sent anywhere. You can inspect the Developer tools of the extension if you are interested: it works offline!
The extension uses an SQLite database in the Origin Private File System[0]. Disabling the extension keeps the database, while removing it deletes the database.

Regarding performance, here is how it works: the extension accumulates page changes (thanks to a Mutation Observer[1], so I do not have to regularly read and compare the page) for some time, then checks if the sentences are in the database. Only unknown sentences are converted to embeddings.

The extension is CPU-only currently (WebGPU support was not merged yet in transformers.js), so it may be slow. I understand your concern, while that is a proof of concept, I consider a good performance to be vital to a good user experience.

[0] https://developer.chrome.com/blog/sqlite-wasm-in-the-browser... [1] https://developer.mozilla.org/en-US/docs/Web/API/MutationObs...

Currently, yes. Allowing a user to crawl his recent history just after installing the extension is a great idea! I added it on the Discord server.
Hello HN, I’m Kamil.

The past months have been filled with news about ChatGPT, Bard, etc. Thankfully, there are some heroic attempts to bring that power to the users.

I wanted to contribute to that effort with my side project, an extension for Chrome: it makes searching the history by meaning – instead of the exact words – possible.

This is only a proof of concept, building on the excellent transformers.js[0], and running entirely in the browser. My goal here is to explore the possibilities unlocked by a client-side AI.

I would love to have your feedback, to know which direction that project should follow!

[0] https://xenova.github.io/transformers.js

See also the Higher-Order Virtual Machine for a functional, non-garbage-collected, and parallel runtime: https://github.com/HigherOrderCO/HVM
Re:Ask HN: Who wants to be hired? (March 2023) on Wednesday March 01, 2023 @03:06PM (#34987554)
Location: France

Remote: Yes, only

Willing to relocate: No

Technologies: currently using React (top 5% of LinkedIn test-takers), TypeScript (I can perform arithmetic with types), Next.js, Vite.js, TRPC, Tauri and Capacitor for cross-platform, CRDTs, other web technologies, Postgres, SQLite. Believer in statically-typed functional (like OCaml)/logic (like Prolog) programming, solvers (like Z3/CVC5), probabilistic programming.

Résumé/CV: https://drive.google.com/file/d/1HylyUPPZS2lcHLYTX0yI5OfdTsu...

Email: kamil (at) withcomment (dot) com

Hello, I am Kamil, an aspiring Renaissance humanist who became a frontend-leaning software engineer. Other than graduating as the top CS student from Sorbonne Université (1st/194 students), I have included my major professional achievements in my CV. Outside of work, I keep looking for the fundamental nature of things — through music theory, great tales, mathematics, or human virtue.

Nowadays, I want to focus on doing my best work, without other worries: work-life balance (ideally a 4-day week), pay, office politics, etc. Working with coworkers I can trust for their competence and integrity is important, as well as being challenged intellectually and keeping learning.

Emails require a salary range to be considered.

Not a drop-in replacement: the OCI image entry point is not automatically executed.

Issue opened in 2021: https://github.com/weaveworks/ignite/issues/874

Older »