You’d think the Unicode consortium would know better. Dinosaurs are also miscategorized as reptilian but I can understand the mistake, because dinosaurs are extinct.
4,384 karma · joined October 29, 2012
You’d think the Unicode consortium would know better. Dinosaurs are also miscategorized as reptilian but I can understand the mistake, because dinosaurs are extinct.
const goog = { define(name, value) { return value; } };
That was it. I used it to select between development and release versions of the project, because the release version had to fit in 13 KB (compressed).In some ways the console is really modern (perspective-correct texture interpolation, z-buffering, subpixel positioning). On paper, it seems a lot like a more modern system. But the hardware complexity is a beast. and the design is permeated with bottlenecks. Half of the graphics pipeline is taken up by the RSP, which is a fully programmable vector processor--sounds cool, but in practice it is unapproachable. 4 KiB of texture memory (and if you use a palette, half of it is the palette). RAM bandwidth is barely fast enough to handle 3D scenes.
https://www.copetti.org/writings/consoles/nintendo-64/
The folks working on LibDragon have done a lot of work to make homebrew a better experience, but you’ll note that support for 3D graphics is still only in a preview branch.
My own experience is that it’s so difficult to make homebrew games not just because of the technical challenges you have to solve making the game, but also because of the poor experience with tools and debugging. Pretty soon, you find your project taking up more time than you can reasonably spare. I think it’s impressive when people manage to get something interactive working on these old consoles, anything at all beyond a “hello world” template.
Ah! That makes sense. But for N=2^32-1, there are also checks for N/3, N/5, N/17, N/257, and N/65537.
I’m missing something here… what do you mean by “advance both sides?”
> an informative period failure is 15 = 6 + 6 + 3. Doesn't this conflict with something in the article?
You’re talking about, say, P(x) = x^4 + x^2 + 1, for a four-bit LFSR? This will have three nontrivial cycles, with length 6, 6, and 3. Rather than talk about this specific polynomial / specific set of taps, we can consider that the initial (non-zero) state is in one of those three cycles. There are three possibilities for the length of a cycle:
1. Maximum period 2^k-1. In this case, 15.
2. Period which is a factor of 2^k-1, such as 3.
3. Period which is not a factor of 2^k-1, such as 6.
We can distinguish these case by picking an initial state and then doing a series of checks, where we advance the LFSR by N steps, and then see if it is in the initial state again.
For exactly the LFSRs with maximum period, the LFSR will be in the initial state after advancing 2^k-1 steps, but it will not be in the initial state after advancing (2^k-1)/p steps for prime factors p of 2^k-1. In the case of a 4-bit LFSR, we check N=15, N=5, and N=3. The cycles of length 6 will fail the test because they will be in a different state after advancing 15 steps. The cycles of length 3 will fail because they will be in the same state after advancing 3 steps. The end result is that the LFSR with cycles of length 6, 6, and 3 will be rejected, no matter which cycle the initial state is in.
> tradition makes people produce LFSRs with very few taps but if you're doing it in software there's no real reason you have to do anything other than keep them even and use the end bits.
The reason I was looking at this in the first place was out of a kind of retrocomputing interest, and using something like 0x100001b as your polynomial for a 24-bit LFSR can make the implementation slightly shorter / faster, on some older CPUs and with memory constraints.
It was easy to find a lot of handwaving and code / numbers copied from place to place, and I wanted to know how to generate the polynomials / pick the taps in the first place. The program I wrote just goes through the polynomials in lexicographic order, so it’s not actually trying to pick the fewest number of taps, but it will prefer sets of taps where the taps are all clustered on one side.
Magnetic hard drives are sensitive to vibration. You can shout at hard drives and measure the effects (video: https://www.youtube.com/watch?v=tDacjrSCeq4).
One of the worst-case scenarios is a head crash. A head crash will damage the media and may result in data loss. https://en.wikipedia.org/wiki/Head_crash
My guess is that earthquakes powerful enough to cause a head crash are powerful enough for widespread destruction anyway, but I’m no expert. I did some quick searches for hard drives damaged by earthquake, and the only results I got were scenarios where the hard drives or the whole rack got knocked over by the earthquake and hit the floor.
It has that “wow” factor, but as I kid I think I moved on to breadboards pretty quickly. That, and we had a bunch of Engineer’s Mini-Notebook by Forrest Mims III. These kits are very cool but I remember that it felt a little more like paint-by-numbers.
I have a lot of fond memories of, like, going to OMSI and doing the experiments in the chemlab.
Which is what I did: https://github.com/depp/elf2dos.git
This is not really a polished, supported product, just a program I wrote to make DOS programs on Linux or Mac.
You can use X as an index when you are looping through an array of pointers.
You can use Y as an index when you are looping through an array, where you have a pointer to the beginning of that array.
There are also a couple operations that always use X as a source or destination. There’s TXS/TSX, but no TYS/TSY.
> In effect the 6502’s ‘page zero’ in memory provides a large number of ‘pseudo’ 8 and 16-bit registers, slower than real registers, but still faster and more versatile than having to use other parts of memory. A skilled programmer making effective use of ‘page zero’ could write code that was fast when compared to other 8-bit designs.
I haven’t done a lot of 6502, though. I learned Basic on the Apple II when I was young but moved to Think Pascal, HyperCard, and CodeWarrior on the Mac.
It is equally true that 1*0=0 is the same as false|true=true, and 0+1=1 is the same as true&false=false.
But it is also not true that 1+1=1, so it is probably wrong to equate 'or' with '+'. The operation has the wrong properties.
As someone who sometimes dabbles in electronics, 0 = true makes a lot of intuitive sense to me. You have your pin with an open collector, your pull-up resistor, and “true” (as in, it is true that the transistor is conducting) pulls the voltage to ground, which is 0.
As someone who uses a Unix shell, 0 = true makes a lot of intuitive sense to me.
$ true; echo $?
0
$ false; echo $?
1 a * (x + y) = (a * x) + (a * y)
However, the reverse doesn’t work… a + (x * y) =? (a + x) * (a + y)
Why is this a problem? a ∧ (x ∨ y) = (a ∧ x) ∨ (a ∧ y)
a ∨ (x ∧ y) = (a ∨ x) ∧ (a ∨ y)
Both are true. So, who are we to say that one corresponds to multiplication, and the other corresponds to addition? The two operations are too similar to each other.I’ll pretend that this isn’t pedantry. I can understand why you’d say this, but I think you just haven’t explored the way that git diff works, including the configuration options it takes.
$ git diff 'HEAD^'
diff --git a/file b/file
index efb8e76..ca03496 100644
--- a/file
+++ b/file
@@ -1,3 +1,3 @@
This is context.
-I am studying tonight.
+I am not studying tonight.
This is also context.
Try it with --word-diff… $ git diff 'HEAD^' --word-diff
diff --git a/file b/file
index efb8e76..ca03496 100644
--- a/file
+++ b/file
@@ -1,3 +1,3 @@
This is context.
I am {+not+} studying tonight.
This is also context.I think I may have used a pirated Escape Velocity key.
I know it’s not gonna happen industry-wide. But this is how we do things everywhere I’ve worked for the past many years.
You can use a field extension here, ℚ(√5), to represent your numbers. The numbers would be represented as pairs, (a,b), which represents the number a+b√5. You can see for yourself that this set is closed under addition and multiplication.
But when you try to implement code that computes exponents with this representation, you’re probably going to fall back to the old “repeated squaring” trick. But that’s how you calculate exponents with your matrix representation anyway—and you can note that the matrix powers (for this matrix) always take the form
| a b |
| 0 a |
So you can represent these matrixes as (a,b) pairs anyway. We are right back where we started—our state is represented as a pair of numbers, and we use repeated squaring to calculate an exponent.Sometimes these different ideas for representing the problem give us new insight or new algorithms, and sometimes it turns out to be a new perspective on the same piece of code.
Finding an explanation of a linear algebra concept that strikes the right balance can be time-consuming or difficult. This is why you see, for example, a hojillion different articles explaining what quaternions are. Everybody is most comfortable at a different place on the complexity spectrum—from “a vector is (x,y,z), here are rules for how that works” to “a vector space is an abelian group V, field F, and a map in Hom(F,End(V))”.
M = P Δ P^-1
Here, P is some invertible matrix and Δ is a diagonal matrix. The powers of M reveal how useful this is: M^N = (P Δ P^-1) * … * (P Δ P^-1)
If you adjust the parentheses, you’ll see N-1 terms of (P^-1 P), which can be removed, giving: M^N = P Δ^N P^-1
The powers of a diagonal matrix is done by taking powers of the entries on the diagonal.You see the φ values (1±√5)/2 in the matrix Δ.
Diagonalization of a 2x2 matrix is simple to do on paper. The diagonal of Δ contains the eigenvalues of M, which can be found using the quadratic formula. Proving that this is a correct way to diagonalize any diagonalizable matrix is more of a chore, but for this specific 2x2 matrix, you can just show that that you’ve found the values for P and Δ.
This is very elegant mathematically, but I would not use the closed-form solution if I wanted the exact answer, because you’d need a lot of precision, and that’s inconvenient.
I had the same feeling when Apple came out with launchd in 2005. It felt like such a massive improvement over the existing state of things. Systemd also feels like a massive improvement.
Systemd is incredibly controversial among a niche group of people who have strong opinions about how init & core system functionality should work, and then there’s an outer ring of people who focus on one or two problems with some relatively minor problems that Systemd caused for which there are viable workarounds. Like how Systemd terminates processes that belong to your session when you log out.
I remember writing SysV style init scripts or rc.d / BSD style init scripts. It was awful. You had all these copy-pasted shell scripts with various gaps in functionality depending on who wrote them. Getting a service to run in Systemd feels like heaven by comparison. I don’t even care about, like, Docker.
I think the reports of problems (like background processes getting termed on logout, how any security problems in Systemd tends to be severe by nature) were just so numerous compared to the reports of the benefits (like the boot time improvements and the massive improvements running daemons). It was some bad decisions and a lot of bad PR, but the overall impact IMO is very positive.
There are some specific complaints I have about technical choices for Debian, like the way daemons autostart post install. But these complaints are outweighed by the benefits of using a distro with coherence across packages and upgrades.
Apt is also just such a phenomenal package manager. It is fast out of the box, and supports some relatively tricky scenarios—like using stable for your system, but a newer Nginx from backports. Feels like I can get the newer features for the one or two packages that I really care about, and then use something stable and boring for everything else.