@kogasa@programming.dev

This profile is from a federated server and may be incomplete. Browse more on the original instance.

kogasa,
@kogasa@programming.dev avatar

Fluent polymorphism via duck typing. It’s useful when you’re treating objects as a collection of properties, and therefore it’s not their type that matters but which properties they have. Types can still be used to label common collections of properties but it’s less painful to talk about objects that are “like an X but with/without certain properties,” or where some properties themselves have a different shape, etc. This is applicable to web APIs, not just because of JSON, but because it allows to define both very rigid and very flexible schemas without much overhead or repetition. See the OpenAPI specification.

kogasa,
@kogasa@programming.dev avatar

Computable. There are countably many computable numbers since there are only countably many possible programs. Non-computable numbers can’t be exactly referred to / described / constructed by a program, so if your point of view is that everything is a program, you would say they don’t exist.

kogasa,
@kogasa@programming.dev avatar

I don’t understand what you think the problem is. What do you mean infinities can’t be differentiated from each other? Infinite cardinals are by definition equivalence classes of sets that can be placed in bijection with one another. You can compare one cardinal to another by showing there exists an injection from a representative set of the first one into a representative for the other. You can show equality by showing there is an injection both ways (Cantor-Schroder-Bernstein theorem) or otherwise producing a bijection explicitly. Infinite ordinals may as well be copies of the natural numbers indexed by infinite cardinals, so of course we can distinguish them too.

kogasa,
@kogasa@programming.dev avatar

Math went on because it doesn’t matter. Nobody cares about incompleteness. If you can prove ZFC is inconsistent, do it and we’ll all move to a new system and most of us wouldn’t even notice (since nobody references the axioms outside of set theorists and logicians anyway). If you can prove it’s incomplete, do it and nobody will care since the culprit will be an arcane theorem far outside the realm of non-logic fields of math.

kogasa,
@kogasa@programming.dev avatar

You wouldn’t even notice if some proof is wrong because it relies on an inconsistency that’s the issue.

You wouldn’t notice because there’s no realistic chance that any meaningful result in the vast majority of math depends strictly on the particular way in which ZFC is hypothetically inconsistent.

And that’s before you didn’t notice because noone builds anything on axioms but instead uses fragile foundations made of intuition, hand-waving, and mass psychology.

This is a ridiculous attitude. Nobody uses the axioms of ZFC directly because that would be stupid. It’s obviously sufficient to know how to do so. There is literally no difference to the vast majority of all math which particular axiomatic formalism you decide to use, because all of those results are trivially translatable between them.

kogasa,
@kogasa@programming.dev avatar

No, that’s definitely not true. As I said, infinite cardinals (like the cardinality of the naturals ℵ₀) are defined to be equivalence classes of sets that can be placed in bijection with one another. Whenever you have infinite sets that can’t be placed in bijection, they represent different cardinals. The set of functions f : X --> X has cardinality 2^X too, so e.g. there are more real-valued functions of real numbers than there are real numbers. You can use this technique to get an infinite sequence of distinct cardinals (via Cantor’s theorem, which has a simple constructive proof). And once you have all of those, you can take their (infinite) union to get yet another greater cardinal, and continue that way. There are in fact more cardinalities that can be obtained in this way than we could fit into a set-- the (infinite) number of infinite cardinals is too big to be an infinite cardinal.

You might be thinking of the generalized continuum hypothesis that says that there are no more cardinal numbers in between the cardinalities of power sets, i.e. that ℵ₁ = 2^(ℵ₀), ℵ₂ = 2^(ℵ₁), and so on.

kogasa,
@kogasa@programming.dev avatar

Cantor’s theorem says the power set of X has a strictly larger cardinality than X.

When |X| is a natural number, the power set of X has cardinality 2^(|X|), since you can think of an element of the power set as a choice, for each element of X, of “in the subset” vs “not in the subset.” Hence the notation 2^X for the power set of X.

Cantor’s theorem applies to all sets, not just finite ones. You can show this with a simple argument. Let X be a set and suppose there is a bijection f : X -> 2^(X). Let D be the set { x in X : x is not in f(x) }. (The fact that this is well defined is given by the comprehension axiom of ZFC, so we aren’t running into a Russell’s paradox issue.) Since f is a bijection, there is an element y of X so that f(y) = D. Now either:

  • y is in D. But then by definition y is not in f(y) = D, a contradiction.
  • y is not in D. But then by definition, since y is not in f(y), y is in D.

Thus, there cannot exist such a bijection f, and |2^(X)| != |X|. It’s easy enough to show that the inequality only goes one way, i.e. |2^(X)| > |X|.

kogasa,
@kogasa@programming.dev avatar

I don’t care what you prefer. But:

Dark mode just doesn’t make sense for professionals.

Come on.

I use a dark, low contrast theme and work in a nearly unlit room with my monitors on nearly minimum brightness. It’s comfortable and totally efficient. I understand wanting to switch to bright mode and use higher contrast when reading unfamiliar material, but code is not that. It is highly structured, repetitive (syntactically) and organized. So you can usually have a clear idea of what you’re looking at without relying much on visual details.

you risk blinding yourself with the sudden flash to light

Only if your monitors are way, way too bright for your environment.

kogasa,
@kogasa@programming.dev avatar

SQL Server Management Studio still has no dark mode, although there is a hidden one that Microsoft really doesn’t want you to use (I think you need to change a registry flag, also it sucks). But I think Azure Data Studio might.

kogasa,
@kogasa@programming.dev avatar

Never heard of dbeaver, but I use JetBrains DataGrip 99% of the time, which looks the same as every other JB IDE (not bad). There are some super clunky but occasionally useful SQL Server tools in SSMS but for typical dev work there’s nothing you really need.

kogasa, (edited )
@kogasa@programming.dev avatar

No, he’s right. “For any odd prime” is a not-unheard-of expression. It is usually to rule out 2 as a trivial case which may need to be handled separately.

en.wikipedia.org/…/Fermat's_theorem_on_sums_of_tw…

www.jstor.org/stable/2047029

www.jstor.org/stable/2374361

kogasa,
@kogasa@programming.dev avatar

Okay? Like I said, it’s usually to rule out cases where 2 is a trivial edge case. It’s common enough that “for any odd prime / let p be an odd prime” is a normal expression. That’s all.

kogasa,
@kogasa@programming.dev avatar

TPM is not necessary for Windows 11.

I have a Windows 11 partition and fTPM is disabled in UEFI. Windows complains that “My computer doesn’t meet the requirements to update to Windows 11” on the update menu, but there’s no issue.

kogasa,
@kogasa@programming.dev avatar

They’re backporting to 6.1 but you can always just disable fTPM.

kogasa,
@kogasa@programming.dev avatar

That’s not why at all. This happened because someone published AI art with a wonky limb and people noticed. “Generative art algorithms” are completely capable of producing art that feels new and fresh. The biggest problem with them currently is producing art that is undetectable as AI art.

kogasa,
@kogasa@programming.dev avatar

In C# you can automatically generate (or manually write) binding redirects that let you say “anything using versions between x.y.0 and x.y.9 should use x.y.9”, which helps a lot with transitive dependencies. However, doing this manually is hard, and you can’t really rely on semver to be done “correctly.” This leads to subtle bugs. Occasionally not so subtle, but hard to diagnose.

kogasa,
@kogasa@programming.dev avatar

Immutable in this context usually means the root filesystem is readonly at runtime, and all changes are performed by updating a set of declarative config files that describe the desired state of the system. Changes would be prepared and applied after a reboot. Something like that.

kogasa,
@kogasa@programming.dev avatar

in math, if you have a real and you round it, it’s always a real not an integer.

No, that’s made up. Outside of very specific niche contexts the concept of a number having a single well-defined type isn’t relevant in math like it is in programming. The number 1 is almost always considered both an integer and a real number.

If we follow your mind with abs(-1) of an integer it should return a unsigned and that makes no sense.

How does that not make sense? abs is always a nonnegative integer value, why couldn’t it be an unsigned int?

Which filesystem should I use for stable storage?

Hello everyone. I’m going to build a new PC soon and I’m trying to maximize its reliability all I can. I’m using Debian Bookworm. I have a 1TB M2 SSD to boot on and a 4TB SATA SSD for storage. My goal is for the computer to last at least 10 years. It’s for personal use and work, playing games, making games, programming,...

kogasa,
@kogasa@programming.dev avatar

Distro defaults are chosen for general purpose use and stability. For op’s specific requirement, zfs, xfs, and btrfs are all definitely better. For the boot drive, I can understand going for the default since you just want it to be stable, but having some snapshotting and fault protection isn’t a bad thing.

kogasa,
@kogasa@programming.dev avatar

Dunno what you mean. I’ve been using a Pixel since Pixel 1. The UI has only changed a bit at a time. I’ve used Messages (Google’s SMS app) for as long as I can remember. It’s only ever had one AI assistant, which is the “hey google” one, and it’s always been okay.

I’m guessing some of the issues you’re noticing are specific to some Android distributions from specific brands. Mainline Android is pretty stable.

kogasa,
@kogasa@programming.dev avatar

I agree with this comment.

kogasa,
@kogasa@programming.dev avatar

Most code isn’t really that good, it’s just good enough. If you think your code isn’t good enough, you should just read the codebase you’re thinking about contributing to. It’s probably full of stuff you would have been embarrassed about.

kogasa,
@kogasa@programming.dev avatar

I haven’t used autocorrect since I turned it off on my iPhone 3GS. It’s not that hard to not type like a lunatic.

kogasa,
@kogasa@programming.dev avatar

No, you’re wrong. All interesting behavior of ML models is emergent. It is learned, not programmed. The fact that it can perform what we consider an abstract task with success clearly distinguishable from random chance is irrefutable proof that some model of the task has been learned.

kogasa,
@kogasa@programming.dev avatar

A computer program is just a series of single bits activating and deactivating. That’s what you’re saying when you say a LLM is simply predicting words. You’re not thinking at the appropriate level of abstraction. The whole point is the mechanism by which words are produced and the information encoded.

kogasa,
@kogasa@programming.dev avatar

What do you think “it’s an algorithm” is supposed to imply? Can nothing deterministic be considered intelligent?

Also, “designed in a black box” is misleading. It’s opaque because it’s emergent behavior, not because it was obfuscated or designed in secrecy or something. The algorithm itself is simple. All the interesting data is encoded in the billions to trillions of input parameters. These parameters aren’t designed at all, they are learned.

kogasa,
@kogasa@programming.dev avatar

There is no agent on the planet who is intentionally choosing to make their models harder to analyze. This is a ridiculous idea that you could only believe if you didn’t understand where the complexity comes from in the first place. Creating ML models that can be efficiently and effectively trained and interpreted is an extremely hard and unsolved problem, and whomever could solve it would be rolling in cash.

kogasa,
@kogasa@programming.dev avatar

OP is saying it’s impossible for a LLM to have “figured out” how something it works, and that if it understood anything it would be able to perform related tasks perfectly reliably. They didn’t use the words, but that’s what they meant. Sorry for your reading comprehension.

kogasa,
@kogasa@programming.dev avatar

“op” you are referring to is… well… myself, Since you didn’t comprehend that from the posts above, my reading comprehension might not be the issue here.

I don’t care. It doesn’t matter, so I didn’t check. Your reading comprehension is still, in fact, the issue, since you didn’t understand that the “learned” vs “programmed” distinction I had referred to is completely relevant to your post.

It’s wether it can grasp concepts from the content of the words it absorbs as it it’s learning data.

That’s what learning is. The fact that it can construct syntactically and semantically correct, relevant responses in perfect English means that it has a highly developed inner model of many things we would consider to be abstract concepts (like the syntax of the English language).

If it would grasp concepts (like rules in algebra), it could reproduce them everytime it gets confronted with a similar problem

This is wrong. It is obvious and irrefutable that it models sophisticated approximations of abstract concepts. Humans are literally no different. Humans who consider themselves to understand a concept can obviously misunderstand some aspect of the concept in some contexts. The fact that these models are not as robust as that of a human’s doesn’t mean what you’re saying it means.

the only thing it does is chain words together by stochastic calculation.

This is a meaningless point, you’re thinking at the wrong level of abstraction. This argument is equivalent to “a computer cannot convey meaningful information to a human because it simply activates and deactivates bits according to simple rules.” Your statement about an implementation detail says literally nothing about the emergent behavior we’re talking about.

kogasa,
@kogasa@programming.dev avatar

What does “uselessness” mean to you? Arch and other minimal distros are completely functional. If anything, they require less work to set up than a typical distro if you are a competent user who intends to customize the hell out of their system. It’s not for “old and embedded computers”… there are distros for that. Arch has an explicit philosophy and target audience, and it has nothing to do with low hardware power.

kogasa,
@kogasa@programming.dev avatar

By design it supports a highly minimalistic installation via the PKGBUILD system and AUR. If you stick to the official repos only, you’ll naturally have some decisions made for you by package maintainers, which may include bundling and preconfiguration. It’s still minimal by conventional standards, but maybe not if you’re an RMS type.

kogasa,
@kogasa@programming.dev avatar

The DSM 5 was out when I was taking this class years ago. Don’t think that’s the problem…

kogasa,
@kogasa@programming.dev avatar

Only thing that breaks me now and then (still very rarely) is wlroots-git and sway-git. Once or twice there has been a bug that needed me to downgrade, wait for a fix, or fix myself.

kogasa,
@kogasa@programming.dev avatar

Yeah, those are AUR packages, and not even supposed to be stable. The fact that I’ve only run into major issues a couple times is impressive.

kogasa, (edited )
@kogasa@programming.dev avatar

If you think of complex numbers in their polar form, everything is much simpler. If you know basic calculus, it can be intuitive.

Instead of z = + iy, write z = (r, t) where r is the distance from the origin and t is the angle from the positive x-axis. Now addition is trickier to write, but multiplication is simple: (a,b) * (c,d) = (ab, b + d). That is, the lengths multiply and the angles add. Multiplication by a number (1, t) simply adds t to the angle. That is, multiplying a point by (1, t) is the same as rotating it counterclockwise about the origin by an angle t.

The function f(t) = (1, t) then parameterizes a circular motion with a constant radial velocity t. The tangential velocity of a circular motion is perpendicular to the current position, and so the derivative of our function is a constant 90 degree multiple of itself. In radians, that means f’(t) = (1, pi/2)f(t). And now we have one of the simplest differential equations whose solution can only be f(t) = k * e^(t* (1, pi/2)) = ke^(it) for some k. Given f(0) = 1, we have k = 1.

All that said, we now know that f(t) = e^(it) is a circular motion passing through f(0) = 1 with a rate of 1 radian per unit time, and e^(i pi) is halfway through a full rotation, which is -1.


If you don’t know calculus, then consider the relationship between exponentiation and multiplication. We learn that when you take an interest rate of a fixed annual percent r and compound it n times a year, as you compound more and more frequently (i.e. as n gets larger and larger), the formula turns from multiplication (P(1+r/n)^(nt)) to exponentiation (Pe^(rt)). Thus, exponentiation is like a continuous series of tiny multiplications. Since, geometrically speaking, multiplying by a complex number (z, z^(2), z^(3), …) causes us to rotate by a fixed amount each time, then complex exponentiation by a continuous real variable (z^t for t in [0,1]) causes us to rotate continuously over time. Now the precise nature of the numbers e and pi here might not be apparent, but that is the intuition behind why I say e^(it) draws a circular motion, and hopefully it’s believable that e^(i pi) = -1.


All explanations will tend to have an algebraic component (the exponential and the number e arise from an algebraic relationship in a fundamental geometric equation) and a geometric component (the number pi and its relationship to circles). The previous explanations are somewhat more geometric in nature. Here is a more algebraic one.

The real-valued function e^(x) arises naturally in many contexts. It’s natural to wonder if it can be extended to the complex plane, and how. To tackle this, we can fall back on a tool we often use to calculate values of smooth functions, which is the Taylor series. Knowing that the derivative of e^(x) is itself immediately tells us that e^(x) = 1 + x + x^(2)/2! + x^(3)/3! + …, and now can simply plug in a complex value for x and see what happens (although we don’t yet know if the result is even well-defined.)

Let x = iy be a purely imaginary number, where y is a real number. Then substitution gives e^x = e^(iy) = 1 + iy + i^(2)y^(2)/2! + i^(3)y^(3)/3! + …, and of course since i^(2) = -1, this can be simplified:

e^(iy) = 1 + iy - y^(2)/2! - iy^(3)/3! + y^(4)/4! + iy^(5)/5! - y^(6)/6! + …

So we’re alternating between real/imaginary and positive/negative. Let’s factor it into a real and imaginary component: e^(iy) = a + bi, where

a = 1 - y^(2)/2! + y^(4)/4! - y^(6)/6! + …

b = y - y^(3)/3! + y^(5)/5! - y^(7)/7! + …

And here’s the kicker: from our prolific experience with calculus of the real numbers, we instantly recognize these as the Taylor series a = cos(y) and b = sin(y), and thus conclude that if anything, e^(iy) = a + bi = cos(y) + i sin(y). Finally, we have e^(i pi) = cos(pi) + i sin(pi) = -1.

kogasa,
@kogasa@programming.dev avatar

There are some rules about the kind of map this applies to. One of them is “no countries inside other countries.”

kogasa,
@kogasa@programming.dev avatar

A sphere is a perfect model of spherical geometry. It’s just a 2-dimensional one, the spherical equivalent of a plane we might stand on as opposed to the space we live in. A sphere is locally flat (locally Euclidean/plane-like) but intrinsically curved, and indeed can have triangles with 3 right angles (with endpoints on a pole and the equator.)

kogasa, (edited )
@kogasa@programming.dev avatar

Let’s name the goats Alice and Bob. You pick at random between Alice, Bob, and the Car, each with 1/3 chance. Let’s examine each case.

  • Case 1: You picked Alice. Monty eliminates Bob. Switching wins. (1/3)
  • Case 2: You picked Bob. Monty eliminates Alice. Switching wins. (1/3)
  • Case 3: You picked the Car. Monty eliminates either Alice or Bob. You don’t know which, but it doesn’t matter-- switching loses. (1/3)

It comes down to the fact that Monty always eliminates a goat, which is why there is only one possibility in each of these (equally probable) cases.

From another point of view: Monty revealing a goat does not provide us any new information, because we know in advance that he must always do so. Hence our original odds of picking correctly (p=1/3) cannot change.


In the variant “Monty Fall” problem, where Monty opens a random door, we perform the same analysis:

  • Case 1: You picked Alice. (1/3)
    • Case 1a: Monty eliminates Bob. Switching wins. (1/2 of case 1, 1/6 overall)
    • Case 1b: Monty eliminates the Car. Game over. (1/2 of case 1, 1/6 overall)
  • Case 2: You picked Bob. (1/3)
    • Case 2a: Monty eliminates Alice. Switching wins. (1/2 of case 2, 1/6 overall)
    • Case 2b: Monty eliminates the Car. Game over. (1/2 of case 2, 1/6 overall)
  • Case 3: You picked the Car. (1/3)
    • Case 3a: Monty eliminates Alice. Switching loses. (1/2 of case 3, 1/6 overall)
    • Case 3b: Monty eliminates Bob. Switching loses. (1/2 of case 3, 1/6 overall)

As you can see, there is now a chance that Monty reveals the car resulting in an instant game over-- a 1/3 chance, to be exact. If Monty just so happens to reveal a goat, we instantly know that cases 1b and 2b are impossible. (In this variant, Monty revealing a goat reveals new information!) Of the remaining (still equally probable!) cases, switching wins half the time.

kogasa,
@kogasa@programming.dev avatar

Your original odds were 1/3, and this never changes since you don’t get any new information.

The key is that Monty always reveals a goat. No matter what you choose, even before you make your choice, you know Monty will reveal a goat. Therefore, when he does so, you learn nothing you didn’t already know.

kogasa,
@kogasa@programming.dev avatar

The best part of this is that it is possible to construct a set that has the same cardinality as the real numbers but is not dense, such as the Cantor set.

Well that’s not as hard as it sounds, [0,1] isn’t dense in the reals either. It is however dense with respect to itself, in the sense that the closure of [0,1] in the reals is [0,1]. The Cantor set has the special property of being nowhere dense, which is to say that it contains no intervals (taking for granted that it is closed). It’s like a bunch of disjointed, sparse dots that has no length or substance, yet there are uncountably many points.

kogasa, (edited )
@kogasa@programming.dev avatar

The fact that complex numbers allow you to get a much more accurate approximation of the derivative than classical finite difference at almost no extra cost under suitable conditions while also suffering way less from roundoff errors when implemented in finite precision:

What?

The formula you linked is wrong, it should be O(epsilon). It’s the same as for real numbers, f(x+h) = f(x) + hf’(x) + O(h^(2)). If we assume f(x) is real for real x, then taking imaginary parts, im(f(x+ih)) = 0 + im(ihf’(x)) + O(h^(2)) = hf’(x)) + O(h^(2)).

kogasa,
@kogasa@programming.dev avatar

Oh, okay.

kogasa,
@kogasa@programming.dev avatar

The regions need to be contiguous and intersect at a nontrivial boundary curve. This type of map can be identified uniquely with a planar graph by placing a vertex inside each region and drawing an edge from one point to another in each adjacent region through the bounding curve.

kogasa,
@kogasa@programming.dev avatar

I’m not calling OP entitled here. Regional pricing is good and they seem to be adding it now. I’m talking about some of the more vocal opponents of the app’s pricing.

kogasa,
@kogasa@programming.dev avatar

I had no preconceived notions, never used Sync for Reddit. Just thought it was a nice app and a good experience. I was happy to throw the guy $16 for a year of premium, and if I’m still using it in a year I’ll buy the life pass. It’s not because there are no alternatives, it’s because it’s worth the money when it’s going to a small dev team.

kogasa,
@kogasa@programming.dev avatar

What a genuinely unhinged take.

kogasa,
@kogasa@programming.dev avatar

People can complain about Sync if they have something to complain about.

Okay. I have something to complain about, too. It’s people complaining too much about Sync.

kogasa,
@kogasa@programming.dev avatar

I haven’t had any issues with pCloud’s linux client either, although it is definitely not as quick to sync as Dropbox. It might take 30 seconds to pick up changes instead of 3. Something about block-level change tracking I think.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • KamenRider
  • TheResearchGuardian
  • KbinCafe
  • Socialism
  • oklahoma
  • SuperSentai
  • feritale
  • All magazines