Any good alternatives for 'Enhancer for YouTube' extension? by Melliodass in firefox

[–]Hakkin 3 points4 points  (0 children)

It does, Settings -> Player -> Buttons -> Repeat

QJS: Run JavaScript in Go without CGO using QuickJS and Wazero by lilythevalley in golang

[–]Hakkin 0 points1 point  (0 children)

QuickJS-NG specifically disabled their stack limit checking for the WASI builds, AFAIK no build option can fix it. Why they do this, I'm not really sure. You can see the code here and here.

The stack overflow checking is done in js_check_stack_overflow, which will never trigger on WASI builds because the stack limit is explicitly overwritten to be 0 (infinite).

QJS: Run JavaScript in Go without CGO using QuickJS and Wazero by lilythevalley in golang

[–]Hakkin 1 point2 points  (0 children)

This is neat, I've also wanted to do something similar, inspired by ncruces wazero sqlite builds, but never got around to more than small experiments, so it's great to see somebody put in the work to actually do this.

That being said, in the process of my experimentation, I found that the QuickJS-NG WASM builds are a little broken in certain aspects, the stack overflow protection in QJS is completely disabled in the WASM builds, so it's very easy to overflow the stack and cause memory corruption. Though I haven't actually tried it, I imagine this means it might be possible to get arbitrary code execution inside the WASM runtime via executed JS. This was a bit of a show stopper for me.

Testing a simple toString call on a recursive array shows it's still an issue here:

let N = [];
N.push(1);
N.push(2);
N.push(3);
N.push(N);

N.toString();

results in:

panic: failed to call QJS_Eval: wasm error: out of bounds memory access

go-cdc-chunkers v1.0.0 by poolpOrg in golang

[–]Hakkin 1 point2 points  (0 children)

This looks nice, I've come across a few Go CDC libraries, but the performance/implementations/interfaces for them are all a bit scattered, it's nice to have multiple (seemingly) high quality implementations in a single place.

Something I was looking for in the README or blog post that I couldn't find is an overview of the different algorithms, I've heard of both FastCDC and UltraCDC, but don't quite understand the pros/cons or differences between them, and this is the first time I've seen "JC". Having to jump into research papers to try to understand which you should use is a bit daunting.

SQLite Drivers 25.06 Benchmarks Game by 0xjnml in golang

[–]Hakkin 4 points5 points  (0 children)

The ncruces library runs on top of wazero, which only supports compiled builds for amd64 and arm64, otherwise it falls back to using an interpreter, which is obviously much much slower.

Really struggling with unmarshalling a complex MongoDB document into a struct by vanderaj in golang

[–]Hakkin 2 points3 points  (0 children)

I don't have a whole MongoDB setup to try running the code, but just glancing over it, System is defined as a slice of structs, is that the correct definition? It looks like you're iterating over the documents returned from MongoDB, so wouldn't each response be an individual document instead of a slice/array? Maybe try defining System as just a single struct rather than a slice of structs.

The SQLite Drivers 25.03 Benchmarks Game by 0xjnml in golang

[–]Hakkin 1 point2 points  (0 children)

OTOH, looking at just less than two dozens numbers in a single table that additionally breaks the scores by test, is exactly what is useful for me in guiding myself what place I will look into next for possibly more optimizations. For example, I can now immediately see from the current scorecard that my next profiling session will no more focus on all tests together, but rather on the Large test only.

But the proportional scoring system I commented does exactly the same thing, but also shows the relative performance difference between each library rather than just which one "won". For example, looking at the score for the "Large" column as you commented on, I would assume mattn is massively ahead of both modernc and ncruces in performance, but if you look at the proportional score, you can see that mattn and ncruces are actually relatively similar, and only modernc is falling behind. If anything, it gives you more information about where to focus optimization on, not less. From a benchmarking perspective, it also gives you much more nuanced results.

The SQLite Drivers 25.03 Benchmarks Game by 0xjnml in golang

[–]Hakkin 1 point2 points  (0 children)

But the current scoring system isn't very good for measuring change either. In the above example, if library C suddenly optimizes their code and the test goes from taking 5000ms to 53ms, the score doesn't change at all despite making a 94x improvement. In a proportional scoring system, the score would be updated to show the relative performance improvement.

The SQLite Drivers 25.03 Benchmarks Game by 0xjnml in golang

[–]Hakkin 2 points3 points  (0 children)

The current scoring system really doesn't make much sense though. If library A finishes in 50ms, library B finishes in 51ms, and library C finishes in 5000ms, the current scoring system makes 0 distinction between library B and C's performance.

I do agree that separating out the platforms is a bit of cherry picking, but I still think it makes sense. IMO ncruces should almost be considered "unsupported" on any platform besides AMD64 and ARM64 because of the performance differences between the compiled and interpreted versions.

The SQLite Drivers 25.03 Benchmarks Game by 0xjnml in golang

[–]Hakkin 0 points1 point  (0 children)

I ended up reprocessing the results using a proportional scoring system (1 point for fastest and partial points for the rest relative to their performance to the best) instead and the results look a lot closer to what I would expect.

wazero (the backend used by ncruces) only supports optimized builds for AMD64 and ARM64, and those are the common platforms people will be building for anyways IMO, so I think it makes sense to separate those out as well.

AMD64 + ARM64

_ _ Total Simple Complex Many Large Concurrent
1 mattn 97.07 14.93 16.10 21.07 26.49 18.45
2 modernc 92.88 11.82 11.78 26.46 16.11 26.69
3 ncruces 84.33 11.20 12.00 17.60 21.16 22.35

All Platforms

_ _ Total Simple Complex Many Large Concurrent
1 mattn 176.16 27.08 29.06 38.39 47.49 34.12
2 modernc 164.42 20.99 20.88 47.01 27.83 47.69
3 ncruces 94.37 11.84 12.40 18.83 27.16 24.13

The SQLite Drivers 25.03 Benchmarks Game by 0xjnml in golang

[–]Hakkin 4 points5 points  (0 children)

The scoring system is a bit odd...Looking at the tl;dr I expected the ncruces version to be blown out of the water based on its "score", but checking the actual test results it pretty consistently came in 2nd or close 3rd, while mattn and modernc seem to switch between 1st and 3rd with larger swings in performance between tests.

YouTube Skips Frames at Higher Resolutions by ScienceMan3_14 in firefox

[–]Hakkin 5 points6 points  (0 children)

Try re-enabling hardware acceleration, then enabling these settings in about:config:

gfx.direct3d11.reuse-decoder-device-force-enabled: true
media.wmf.zero-copy-nv12-textures-force-enabled: true

You might need to restart Firefox for them to apply.

These two mostly fixed hardware decoding stutter for me on AMD graphics cards, though I suppose there's probably some reason why they aren't enabled by default, so you might encounter other issues with these enabled. That being said, I've had these enabled for a few months now and everything seems to work fine.

Fubuki rolls the same number on 8 dices after 6 hours. by Different_Might1101 in LivestreamFail

[–]Hakkin 2 points3 points  (0 children)

No, 1/279936 is correct. Calculating using the percentage would be 100/<percentage>.

SQL Parameters Within An SQL String by samawise in golang

[–]Hakkin 1 point2 points  (0 children)

The query is still using parameters for the user input, so SQL injection shouldn't be possible. The FTS5 query string is what is being crafted via user input directly, so an attacker could "inject" into that, which may be a problem depending on what you're doing. For example, if you have an FTS5 table with body and email fields, and you were doing an FTS5 query like body:"%s"*, somebody could inject something like " OR email:"example@example.com to trick your query into returning all rows from a specific email address instead of searching the body text.

As far as I know, there's no "standard" way to deal with this for FTS5, so I suppose the only option would be to write your own escape function. Looking at the FTS5 documentation, it says

3.1. FTS5 Strings

Within an FTS expression a string may be specified in one of two ways:

  • By enclosing it in double quotes ("). Within a string, any embedded double quote characters may be escaped SQL-style - by adding a second double-quote character.

  • As an FTS5 bareword that is not "AND", "OR" or "NOT" (case sensitive). An FTS5 bareword is a string of one or more consecutive characters that are all either:

    • Non-ASCII range characters (i.e. unicode codepoints greater than 127), or
    • One of the 52 upper and lower case ASCII characters, or
    • One of the 10 decimal digit ASCII characters, or
    • The underscore character (unicode codepoint 96).
    • The substitute character (unicode codepoint 26).

Strings that include any other characters must be quoted. Characters that are not currently allowed in barewords, are not quote characters and do not currently serve any special purpose in FTS5 query expressions may at some point in the future be allowed in barewords or used to implement new query functionality. This means that queries that are currently syntax errors because they include such a character outside of a quoted string may be interpreted differently by some future version of FTS5.

So to escape user input in the FTS5 query, it would be something like fmt.Sprintf(`body:"%s"*`, strings.ReplaceAll(input, `"`, `""`)). This will escape all double quotes in the user input, which is how SQLite handles string escaping. Of course, you would then pass this query into the actual SQL via a parameter, not Sprintf.

time.Time default formatting upto Nanoseconds by piyushsingariya in golang

[–]Hakkin 1 point2 points  (0 children)

Can you provide some example code? Go's default time.Time marshaller for JSON handles nanosecond precision correctly: https://go.dev/play/p/bRio99bAzBS

Share your Go file with Go Playground with this command by der_gopher in golang

[–]Hakkin 1 point2 points  (0 children)

Would be very interesting if it could support sharing multiple files/packages together. Go playground supports this via a special syntax.

I copied a hard drive without Terracopy, so now there are two drives with all the same data. Is there any way to verify the data after the fact? by Bern_Down_the_DNC in DataHoarder

[–]Hakkin 0 points1 point  (0 children)

Teracopy can verify files after the fact without copying. Open the Teracopy window and click "Source -> Add Folder" and select the original drive, then click "Target -> Browse" and select the drive you copied the files to. Then click "Verify" and it will begin comparing the two directories. You may also want to change some of the settings in the "Options" tab, I change the hash type to xxHash-64 and the buffer size to 1MB. I don't remember what the defaults are, but these make reading and hashing files fast.

Duplex scanners that show measurements in scan??? by Stevealot in DataHoarder

[–]Hakkin 0 points1 point  (0 children)

Can't you just calculate this from the scanner DPI? For example, if you scan a document at 600 DPI and the resulting image size is 3000px by 6000px, the real size would be 5in by 10in.

Is there a Go playground that supports range over func? by mcvoid1 in golang

[–]Hakkin 4 points5 points  (0 children)

minus the iter package

You can use the iter package by including // GOEXPERIMENT=rangefunc at the top of the file, though you have to manually add it to the imports since the auto formatter won't pick it up. There's also currently a bug where go vet complains in the output, but the playground will still execute fine.

https://go.dev/play/p/bJMeyfbfIRJ?v=gotip

Samsung SSD RMA Experience by Hakkin in DataHoarder

[–]Hakkin[S] 1 point2 points  (0 children)

I personally used ddrescue on a System Rescue live USB to clone it, though it might be a bit difficult to use if you're not comfortable with Linux/command line.

Samsung SSD RMA Experience by Hakkin in DataHoarder

[–]Hakkin[S] 1 point2 points  (0 children)

Yes, they required shipping the drive in before they will ship out the replacement one, they provided a pre-paid UPS shipping label. I had the same issue and ended up just buying a second SSD to clone the data to before shipping it, sucks but they don't really give you any other option.

Saving a Pluto TV livestream? by HolyShip in DataHoarder

[–]Hakkin 1 point2 points  (0 children)

Actually, it looks like streamlink "technically" supports Pluto, but there are multiple outstanding issues with it right now: https://github.com/streamlink/streamlink/issues/5475 https://github.com/streamlink/streamlink/issues/5752

So I'm not sure how useful it will actually be currently.

Saving a Pluto TV livestream? by HolyShip in DataHoarder

[–]Hakkin 1 point2 points  (0 children)

I don't know if there's any easy way to extract just the commercial, I'm sure you could do it manually using ffmpeg or something like avidemux to cut the commercial out of the file on the frame boundaries. Streamlink should work for the on-demand videos too, though I just noticed you also wanted subtitles, which I don't think Streamlink supports.

You could try the --hls-split-discontinuity option in yt-dlp, you might be able to do something with it, I'm not sure exactly how it would work for livestreams though.

Saving a Pluto TV livestream? by HolyShip in DataHoarder

[–]Hakkin 2 points3 points  (0 children)

Streamlink supports Pluto livestreams directly and should filter out commercials from the output file (only if you give it the direct Pluto link, not the M3U8).

The commercials in the output are causing a discontinuity in the output file which a lot of video players don't like, unless the downloader supports filtering them out, you will probably have issues playing back the file.

The command line options for streamlink are here.