kogasa

joined 2 years ago
[–] kogasa@programming.dev 14 points 7 months ago* (last edited 7 months ago) (3 children)

Let f(x) = 1/((x-1)^(2)). Given an integer n, compute the nth derivative of f as f^((n))(x) = (-1)^(n)(n+1)!/((x-1)^(n+2)), which lets us write f as the Taylor series about x=0 whose nth coefficient is f^((n))(0)/n! = (-1)^(-2)(n+1)!/n! = n+1. We now compute the nth coefficient with a simple recursion. To show this process works, we make an inductive argument: the 0th coefficient is f(0) = 1, and the nth coefficient is (f(x) - (1 + 2x + 3x^(2) + ... + nx^(n-1)))/x^(n) evaluated at x=0. Note that each coefficient appearing in the previous expression is an integer between 0 and n, so by inductive hypothesis we can represent it by incrementing 0 repeatedly. Unfortunately, the expression we've written isn't well-defined at x=0 since we can't divide by 0, but as we'd expect, the limit as x->0 is defined and equal to n+1 (exercise: prove this). To compute the limit, we can evaluate at a sufficiently small value of x and argue by monotonicity or squeezing that n+1 is the nearest integer. (exercise: determine an upper bound for |x| that makes this argument work and fill in the details). Finally, evaluate our expression at the appropriate value of x for each k from 1 to n, using each result to compute the next, until we are able to write each coefficient. Evaluate one more time and conclude by rounding to the value of n+1. This increments n.

[–] kogasa@programming.dev 1 points 7 months ago* (last edited 7 months ago) (3 children)

Rant incoming, because I just happened to be dealing with this today.

I tried the push to talk binding method in sway, and found it was extremely fragile because if you press any modifier keys before releasing the button, the release binding won't trigger and your mic will stay open. This is especially problematic for my use case as I use both my push to talk hotkey and my modifier buttons while gaming.

I just use a toggle mute hotkey instead of push-to-talk though. Just gotta remember to re-mute, and have a visual indicator for your mic status so you don't accidentally leave it in the wrong state.

Another workaround is binding all possible combinations of modifier keys explicitly, and passing in --device-id so that the binding doesn't consume the keypress and instead forwards it on to the application. This should perfectly emulate the behavior of an X-style global hotkey. With 4 mods (super, ctrl, shift, alt) and 2 bindings per combination there are 2^5 = 32 total bindings for each such hotkey. However there's still no telling if the key-release event could be missed somehow and leave your mic open. I don't know how reliable this method is.

[–] kogasa@programming.dev 5 points 7 months ago

Start with the goal to create something, be it a console app, website, web api, or game. It's hard to just study a language abstractly and learn it. Use the Microsoft Learn documentation as reference, and look for open source .NET projects on GitHub to get different perspectives on how to build things with .NET. There is a free course on freecodecamp that will get you started by building an app, and I believe it was done in partnership with Microsoft

[–] kogasa@programming.dev 7 points 7 months ago

SQLite is one of the best tested codebases in existence. Having only so many variables per line means nothing

[–] kogasa@programming.dev 10 points 7 months ago

Don't think you can stack 2.4 million bananas on top of each other. By volume you'd need like 10^16 bananas to form everest

[–] kogasa@programming.dev 1 points 7 months ago

I'm a big fan of stuff like this. Not this specifically though.

[–] kogasa@programming.dev 2 points 7 months ago

You can also get a bluetooth amp/dac and plug your wired headphones into there. I use a Qudelix 5k for my IEMs at home and I can just put it in my pocket if I want to take them out.

[–] kogasa@programming.dev 2 points 8 months ago (1 children)

Impossible to say how the screenshot came about. At some point, the semantics of someone's data was misinterpreted. Something was called a hard drive when it isn't, something was treated as a capacity when it isn't

[–] kogasa@programming.dev 2 points 8 months ago (3 children)

Everyone has their own way of doing things. In order to integrate them, you have to create your own way of doing things. Later, other people have to integrate your new schema with their own. It's just the nature of working with many different companies

[–] kogasa@programming.dev 2 points 8 months ago
[–] kogasa@programming.dev 6 points 8 months ago

Played for the first time a couple weeks ago. No significant bugs. Just a really excellent game, easily 9/10. Phantom Liberty might be a 10.

[–] kogasa@programming.dev 3 points 8 months ago

This has gotta be responsible for some awful mistreatment of alien gut fauna

view more: ‹ prev next ›