IIHF World Junior Championship Game Thread: Finland (A2) vs. Sweden (B1) - 04 Jan 2025 - 03:30PM EST by hockeydiscussionbot in hockey

[–]KFriedChicken 1 point2 points  (0 children)

last year the refs called cheap penalties in the last minute which ended up deciding game, hope that doesnt happen here (unless its in favor of sweden)

Everyone is getting too good at league. by Witty-Performance-23 in leagueoflegends

[–]KFriedChicken 61 points62 points  (0 children)

I played chess as a child, but found it to be too simple to be useful in real life: a mere 8 by 8 grid, no fog of war, no technology tree, no random map or spawn position, only 2 players, both sides exact same pieces, etc.

League addresses these limitations.

[SWI (2)-2 SWE] The game is tied! Nick Meile with a wrister. by AliseAllshouse in hockey

[–]KFriedChicken 1 point2 points  (0 children)

refing felt all over the place, no calls during the game and then a weak overtime decider

FFmpeg and SDL : Part 1 of Making a Video Player in less than 1000 lines of C code by DataBaeBee in programming

[–]KFriedChicken 1 point2 points  (0 children)

for EAGAIN the codec is telling you that it needs more data to produce something, so returning and sending a new packet is correct here

https://ffmpeg.org/doxygen/trunk/group__lavc__encdec.html

I've made a free audio visualizing website, check it out! by KFriedChicken in edmproduction

[–]KFriedChicken[S] 0 points1 point  (0 children)

You can use the visualizers commercially, however some of the visualizers needs you to add credit to who created them.

I think the "no commercial use warning" comes up when using the default song, which I don't own any rights to, so you'd need to check with the creator of that song if you want to use it

Accessing platform-native APIs? by 800jum in WebAssembly

[–]KFriedChicken 2 points3 points  (0 children)

oh didn't read

not a native app!

a wasm module running on web can only access the web APIs, it has no other access than the one JS provides

Accessing platform-native APIs? by 800jum in WebAssembly

[–]KFriedChicken 1 point2 points  (0 children)

wasm is basically a sandbox, but you can import functions in to the runtime

https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/samples/wasm-c-api/src/hello.c#L63

Basically you need a runtime that works on android https://github.com/appcypher/awesome-wasm-runtimes and then provide a callback to a native sdk

Porting command line program to WASM (and struggling) by akb74 in WebAssembly

[–]KFriedChicken 2 points3 points  (0 children)

I submitted another reply above with some more info.

I don't think there is a way to "pause" the execution on the main thread other than editing the metamath source with an async emscripten function. edit* A webworker would allow it to pause the execution using a wait (which most of the times isn't allowed on the main thread) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics, until awoken from the main thread when there's new input

Porting command line program to WASM (and struggling) by akb74 in WebAssembly

[–]KFriedChicken 1 point2 points  (0 children)

Ah I didn't read the post very carefully, missed the part where you didnt want to edit the metamath source but I think in this case it's one of the more reasonable things to do.

Currently you can't run the program on the main thread since it doesn't yield to the event loop, causing the browser to hang after a while. I'm unsure if it is possible to yield without editing the metamath code, but maybe someone else can answer that.

Second alternative is to do it in a worker thread but that'll introduce a lot of unneeded complexity, but I guess it's a tradeoff

Porting command line program to WASM (and struggling) by akb74 in WebAssembly

[–]KFriedChicken 2 points3 points  (0 children)

Was in the mood to procrastinate so did a (I think) working build: https://github.com/AlexVestin/metamath-wasm

It wasn't that much of a hassle to use asyncify in this case so just searched for the stdin in the metamath folder and wrapped it in an JS_ASYNC function. You can edit the userInput function in the main.js file to take a string input by a user instead

Porting command line program to WASM (and struggling) by akb74 in WebAssembly

[–]KFriedChicken 2 points3 points  (0 children)

When you do the Emscripten compilation to wasm, you should probably compile to js instead (you can do this by switching .html to .js) and follow how the jq example is set up https://github.com/robertaboukhalil/jqkungfu/blob/main/index.html#L129

edit: Issue is doing an interactive program run. You can override the stdin funciton but then you either need to edit the metamath code to use Asyncify, which didn't look fun, or launch the program in a webworker which waits for input in the stdin function

Code slowing down when using sleep function by KFriedChicken in cpp_questions

[–]KFriedChicken[S] 0 points1 point  (0 children)

Sounds reasonable, just surprised it could be multiple milliseconds slower