Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
bakkoting
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
91.
▲
by
bakkoting
3y ago
There are now builtin iterator versions of most of these looped functions [1], should be shipping in stable Chrome next month. The "give me an array at the end" function is spelled toArray. But it's not going to help all that
92.
▲
by
bakkoting
3y ago
You can now! The iterator helpers proposal is stage 3 and shipping in Chrome. (new Set([0, 1, 2])).values().map(x => x + 1).toArray() You can also reduce, filter, find, etc.
93.
▲
by
bakkoting
3y ago
It's not `await` which is doing that; it's the Promises themselves. For example: Promise.resolve(Promise.resolve("abc")).then(console.log) This will print `"abc"`, not `Promise.resolve("abc")`
94.
▲
by
bakkoting
3y ago
I don't know enough about how FTS works to help, I'm afraid. I don't know if it's possible to search across multiple rows. Were I in your position I'd just create a copy of the DB with the full transcript in each ro
95.
▲
by
bakkoting
3y ago
I've been using sql.js-httpvfs to get full-text search on a static Github Pages site [1]. (Just make sure you have fts5 enabled on your database.) It works astonishingly well. [1] https://matrixlogs.bakkot.com/WHATWG&#x
96.
▲
by
bakkoting
3y ago
> I wonder if they will put forth a new proposal for dependency injection next, at this rate. Yes, there is a new-ish proposal [1] which is motivated in large part by DI. (Full disclosure: I'm on the committee and don't really
97.
▲
by
bakkoting
3y ago
You can't use a WeakMap or a WeakSet, but you can use a WeakRef or a FinalizationRegistry.
98.
▲
by
bakkoting
3y ago
Only the value assigned to x.
99.
▲
by
bakkoting
3y ago
That's correct, there is no escape analysis or anything like it. Though there is a way to handle the "I want to return a resource" case: the DisposableStack class. You can call `stack.move()` to "move" ownership of
100.
▲
by
bakkoting
3y ago
Because it's usually an error, and the benefit of catching the error cases outweighs the cost of losing that flexibility.
101.
▲
by
bakkoting
3y ago
> not in for-in loops What would that even mean? The binding in a `for-in` can only ever hold a string, which can't be disposable. With a `for` or `for-of` the binding can hold an object, which is something you could dispose of.
102.
▲
by
bakkoting
3y ago
1. Scope exit. 2. Const. 3. On declaration. 4. I don't know what "chained resource" means. If you mean multiple declarations within the same scope, they all get disposed, in LIFO order (even if disposing one of them throws).
103.
▲
by
bakkoting
3y ago
The article is wrong. That's not going to be legal, specifically because it's confusing which object is being disposed.
104.
▲
by
bakkoting
3y ago
They actually just today released an update [1] with fixes for sleep: "We now have a cpuidle driver, which significantly lowers idle power consumption by enabling deep CPU sleep. You should also get better battery runtime both idle and
105.
▲
by
bakkoting
3y ago
There's a not-very-active proposal to add operator overloading to JS which takes a similar scoped approach: https://github.com/tc39/proposal-operator-overloading
106.
▲
by
bakkoting
4y ago
I'd guess the GPTQ-for-LLaMa repo is using a larger context size. Poking around it looks like GPTQ-for-llama is specifying 2048 [1] vs the default 512 for llama.cpp [2]. You can just specify a longer size on the CLI for llama.cpp if yo
107.
▲
by
bakkoting
4y ago
Some results here: https://github.com/ggerganov/llama.cpp/discussions/406 tl;dr quantizing the 13B model gives up about 30% of the improvement you get from moving from 7B to 13B - so quantized 13B is still mu
108.
▲
by
bakkoting
4y ago
> $ echo '{}' > package.json && npm i --save-dev typescript vite preact > added 17 packages, and audited 18 packages in 1s You're off by two orders of magnitude. I get not wanting a lot of transitive dependen
109.
▲
by
bakkoting
4y ago
Seconding tubearchivist. One of the killer features IMO is the browser extension [0], which adds a button on every video to send that video to the server to archive. [0] https://github.com/tubearchivist/browser-extensio
110.
▲
by
bakkoting
4y ago
Terence Tao is also concerned about that section: https://mathstodon.xyz/@tao/109554420101377184
111.
▲
by
bakkoting
4y ago
How about Manifold? https://manifold.markets/ZviMowshowitz/will-the-new-nonconst...
112.
▲
by
bakkoting
4y ago
The same options [1] are built into `String.prototype.localeCompare` (which is just a handy shortcut for calling `Collator` [2]). So for example: ``` ['B 1', 'A 20', 'A 3'].sort((a, b) => a.localeCompare(b,
113.
▲
by
bakkoting
4y ago
> The files actually do have a link at the top to the license file That's not actually the license for the file; it's the license for the resources it includes. The license for the file is available elsewhere but is not directl
114.
▲
by
bakkoting
4y ago
Here's [1] the actual JS file which Substack is loading, pulled directly from the network tab on the page linked in the thread. Notably, the first line is "For license information please see sodo-search.min.js.LICENSE.txt". B
115.
▲
by
bakkoting
4y ago
Note that caching resources across sites isn't really a thing anymore. See https://github.com/whatwg/fetch/issues/904
116.
▲
by
bakkoting
4y ago
There's an active proposal which would let you do exactly that, going for stage 3 (ready for implementations) at the end of the month: https://github.com/tc39/proposal-iterator-helpers
117.
▲
by
bakkoting
4y ago
Babel does this, using a library called gensync. I have a writeup which goes into more detail: https://writing.bakkot.com/gensync gensync instead creates two functions, one sync and one async, which is probably a more famil
118.
▲
by
bakkoting
4y ago
The first interesting thing happens when you have $5 of available funds. (Specifically, autoclippers become available to purchase.) When precisely you hit that point depends on how well you are managing the price to balance ensuring that yo
119.
▲
by
bakkoting
4y ago
You'll only be able to use that if you are using the non-default `--noEmit` configuration, which requires the use of some other tool to strip types. Even after that change, using `tsc` to strip types will still force you to write `.js`
120.
▲
by
bakkoting
4y ago
There's a proposal for syntax to help with this in JS, incidentally: https://github.com/tc39/proposal-explicit-resource-managemen...
More ›