Better HN
topnewbestaskshowjobs
Log inSign up

maggit

1,755 karma · joined Oct 14, 2008 (18y ago) · 340 submissions

https://magnushoff.com
Submissions

comment 4mo ago · link · parent

It's worth noting that Swiftfin finally had a new release for tvOS this summer which is worth checking out if you're interested in Jellyfin on Apple TV

comment 11mo ago · link · parent

It is indeed badly aliased. The technique demonstrated does not take into account antialiasing in the initial render, which causes this issue. There are ways to improve it, but I would advise against this approach in general since it doesn't handle these edge cases well.

comment 1y ago · link · parent

x86-64 introduced a `syscall` instruction to allow syscalls with a lower overhead than going through interrupts. I don't know any reason to prefer `int 80h` over `syscall` when the latter is available. For documentation, see for example https://www.felixcloutier.com/x86/syscall

comment 1y ago · link · parent

There was a Minesweeper on here that used a SAT solver, but I cannot find it at the moment. As I recall, it never had any issue with resolving the board quickly. I think it dynamically resolved where the mines would be as you played the game, and if you clicked a square that could be a mine, it would be a mine, except, I believe, when there were no open squares that were safe.

(Edit: Here it is! https://pwmarcz.pl/kaboom/ And the write-up: https://pwmarcz.pl/blog/kaboom/ )

This is similar in spirit to my take on the game: https://magnushoff.com/articles/minesweeper/

Unfortunately, not being familiar with SAT solvers, my implementation can grind to a halt in some configurations :)

comment 1y ago · link · parent

It's more a matter of your personal preference and previous exposure to different languages. The way Rust reads is one of its super strengths in my book. I also really enjoyed Standard ML in university, and Rust picks up some of that (via OCaml).

comment 1y ago · link · parent

Adding some detail to this: With three buffers, you have one front-buffer (what's currently visible on screen) and two back-buffers. Let's call them A, B and C, respectively. This lets you work on the next frame in, say, B, and when it's ready, you queue it up for presentation. At the right time, then, the roles of the buffers will be switched, making B the front-buffer and A a back-buffer.

The third buffer comes into play if you want to start working on the next frame _before_ the switch has occurred. So you start drawing in C, and if the right time should hit, the display system can still flip A and B. In this case, triple buffering gave you a head-start with drawing the frame in C.

Going further, if you complete the frame in C still before the A/B switch has happened, you queue up C as the next frame, instead of B. Then, you can start working on the next frame again in B. With this scheme, there is no sense in having more buffers than three.

comment 1y ago · link · parent

Exact integers doesn't seem to be its strong suite. Can it even represent 3 exactly?

Running code from the linked notebook (https://github.com/AdamScherlis/notebooks-python/blob/main/m...), I can see that a 32 bit representation of the number 3 decodes to the following float: 2.999999983422908

(This is from running `decode(encode(3, 32))`)

comment 1y ago · link · parent

That's true for normal binary encoding of integers, but I think we should understand the question in context of the post: What's the number of bits required in iterated log coding?

comment 1y ago · link · parent

Cute! I wonder if it would be amenable for use as a variable-width encoding for, say, DCT coefficients in a JPEG-like codec..?

comment 2y ago · link · parent

I have realized that there is a big design space here, as I recently did a write-up of my take, Id30. 30 bits of information encoded base 32 into six chars, eg bpv3uq, zvaec2 or rfmbyz, with some handling of ambiguous chars on decoding.

https://magnushoff.com/blog/id30/

11.

Id30: Humanized IDs for URLs and More(magnushoff.com ↗)

1 points · by maggit · 2y ago · discuss

12.

Id30: An Identifier Scheme for URLs(magnushoff.com ↗)

6 points · by maggit · 2y ago · 1 comment

comment 3y ago · link · parent

There's 12 parts to this in total:

1. https://pharr.org/matt/blog/2018/04/18/ispc-origins

2. https://pharr.org/matt/blog/2018/04/19/ispc-volta-is-born

3. https://pharr.org/matt/blog/2018/04/20/ispc-volta-going-all-...

4. https://pharr.org/matt/blog/2018/04/21/ispc-volta-c-and-spmd

5. https://pharr.org/matt/blog/2018/04/22/ispc-volta-first-resu...

6. https://pharr.org/matt/blog/2018/04/23/ispc-volta-users-and-...

7. https://pharr.org/matt/blog/2018/04/25/ispc-volta-avx

8. https://pharr.org/matt/blog/2018/04/26/ispc-volta-more-on-pe...

9. https://pharr.org/matt/blog/2018/04/27/ispc-volta-open-sourc...

10. https://pharr.org/matt/blog/2018/04/28/ispc-talks-and-depart...

11. https://pharr.org/matt/blog/2018/04/29/ispc-retrospective

12. https://pharr.org/matt/blog/2018/04/30/ispc-fin

comment 3y ago · link · parent

"System Integrity Protection (SIP)" seems to be the correct name here, for anyone as confused as me :)

(More details here: https://support.apple.com/en-us/102149 )

comment 3y ago · link · parent

Ah! That's what got me. Private mode is my default. I can confirm that I get it working in Firefox outside of private mode. Thanks :)

comment 3y ago · link · parent

Same experience with Firefox, seems to require Chrome. There is a security-related error in the console.

comment 5y ago · link · parent

It looks like it implements hardware acceleration of the VP9 codec for some specific hardware (Rockchip VDEC and Hantro G2). This opens up playing, for example, lots of YouTube videos with less CPU usage on devices with that hardware. I can't comment on whether or not it "took so long" as I have no idea which hardware this is.

The title makes it out to be something fundamental in Linux, but this is just one driver becoming more complete.

comment 6y ago · link · parent

I, too, would have appreciated slightly more documentation. Here are two questions I had, and what I figured out.

Many RSS readers are stand-alone GUI applications. I would have appreciated an up-front notice that this is a hosted solution. (Which is what I am looking for. I'd like the same view of what's read and unread on my different devices, thank you)

Different RSS readers use different storage backends. I dug through your code, and it seems to use SQLite, which is exactly what I hoped for. It's a huge difference in deployment and system administration headaches whether it uses an embedded or a hosted database.

Looks interesting! I'd also appreciate a prebuilt binary for Linux, but I understand that it's still early days. Paying attention :)

comment 6y ago · link · parent

I haven't had a look at the source code for this, but I expect that it syncs with the screen refresh rate.

comment 6y ago · link · parent

I recently did a write-up of my experience with writing maintainable code with vanilla JS: https://magnushoff.com/blog/dependency-free-javascript/

I am a huge fan of React for the maintainability of the resulting code, and this was my attempt to regain some of that without the dependency.

comment 6y ago · link · parent

>Also encoding ampersands into a URI (URL) using HTML encoding schemes is also common, but that is incorrect.

To encode any string (for example a URL) containing & in HTML, you must HTML-encode that &. Using & in the value of the href attribute for an a-tag must result in a URL containing just & in place of the entire entity. This is a property of HTML that has nothing to do with URLs or URL encodings.

comment 6y ago · link · parent

I have recently experimented with writing dependency-free JS. I ended up using Webpack and Babel, but no frameworks or libraries, and I find it quite nice to work with. These are my tips for making the best of it: https://magnushoff.com/blog/dependency-free-javascript/

comment 6y ago · link · parent

Right, so, in my book, reasoning based on facts such as "these squares are clear" are _considering_ those squares.

This is in contrast to the local rules I first describe that consider only a very limited part of the board, and there is a pre-determined hard limit for how much would ever need to be considered for these rules.

comment 6y ago · link · parent

It's been some years, but I think it boils down to the definition of when you are _considering_ some part of the game state.

Right off the bat, I cannot agree that abc must contain exactly 2 mines. From what we can see, abc contains _at most_ 2 mines. There may or may not be mines in what you have left out, and we cannot know without considering what's there.

I haven't written a formal proof for that statement, but I have been unable to solve it to my own satisfaction by reasoning about a reduced view of the board.

comment 6y ago · link · parent

In complex situations it is easy to come to the conclusion that you have to guess, but sometimes there is an elaborate connection you might have missed. This game is sure to call you out on any mistakes you make of this kind.

That would at least make this game more strict and perhaps even more difficult.

comment 6y ago · link · parent

Great read!

It's in a similar vein as the variant I developed, which makes you declare that you are in a situation that requires a guess. I don't use an SAT solver, and I prepopulate the board.

https://magnushoff.com/articles/minesweeper/

In comparison to the Simon Tatham version mentioned at the end of the article, my game allows all game configurations while Tatham's version guarantees solvability by restricting the possible configurations.

comment 7y ago · link · parent

Similarly, only Rust has "non-standardized, only one meaningful implementation" listed as a con, even if this is true for several of the others as well.

comment 7y ago · link · parent

(2016)

comment 7y ago · link · parent

No, only tried on stable. Looking forward to testing 67 when I get the update.

I should clarify that I am talking about the situation when running Firefox with GDK_BACKEND=wayland.

UPDATE: Ooh! Firefox 67 in my package manager! I am happy to report that I am now able to use Firefox with WebRender on Wayland directly. One glitch so far: It leaves a one-pixel row transparent at the bottom of the screen. Weird :)

12345
12