Wait, can we just use HTTP and DNS? I’ll register a domain name and put my HTML or CGI application on a “box” and we’ll all party like it’s 1999. What am I missing?
While I also believe the world would work just fine if we all just followed each other's RSS feeds, people want something more collective, where a thousand or a million people can interact with each other's content.
Centralized bulletin boards are one way, but no one wants to host and moderate a public website anymore, takes work. Web 2.0 was all about platforms taking the hosting and account management off your back so anyone can create a discussion group or simply post into the void without any technical know how
Here’s an out-there take, but one I’ve held loosely for a long time and haven’t shed yet: dicts are not appropriate for what people mostly use them for, which is named access to member attributes.
dict is an implementation of a hash table. Hash table are designed for o(1) lookup of items. As such, they are arrays which are much bigger than the number of items they store, to allow hashing items into integers and sidestep collisions. They’re meant to act like an index that contains many records, not a single record.
A single record is more
like a tuple, except you want named access instead of, title = movie[0], release_year = movie[1], etc. And Python had that, in NamedTuple, but it was kinda magical and no one used it (shoutout Raymond Hettinger).
Granted, this rant is pretty much the meme with the guy explaining something to a brick wall, in that dicts are so firmly entrenched as the "record" type of choice in Python (but not so in other languages: struct, case class, etc. and JSON doesn’t just deserialize to a weak type but I digress).
NamedTuples are great, but they let you do too much with the objects. You probably don't want users of your GitHubRepo class to be able to do things like `repo[1]` or `for foo in repo`. Dataclasses have more constrained semantics, so I reach for them by default. In my ideal world they would default to frozen=True, kw_only=True, slots=True, but even without those they're a big improvement.
Dicts in python are for when you have a thing and you aren't sure what the keys are. Dataclasses are for when you have a thing and you're sure what the keys (attributes are). The trouble is when you have a thing and you're sort of sure, but not entirely sure, and some things are definitely there but not everything you might be thinking of.
I think most modern Python codebases are using dataclasses/ something like Pydantic. I think dicts are mostly seen, like the author suggests, because something which you hacked up to work quickly ends up turning into actual software and it's too much work refactor the types
dicts are used internally in the language to look up class and module attributes. They are optimized for this use case. How can it be wrong to use them that way when the very fabric of the language depends on it?
namedtuple is widely used in Python code, especially before the introduction of dataclasses.
A hash function will always be more expensive than a pointer lookup, specially concidering a pointer lookuo is still needed after the hash function.
No matter what you do, a lookup into an array will always be quicker than a hash lookup if you don't need to do a linear search, even in a lot of cases the linear search will be quicker.
Structs in other languages is a lookup of pointer + and offset. Which to my knowledge is also true in python classes using __slots__. There's no reason to use a dict if you know the contents of the data, use a dataclass with slots=True purely because there's no hash function run on every lookup into the datastructure.
It’s not wrong to use dicts, it’s just bad practice when you could use something like a dataclass or pydantic model instead.
Dicts are useful for looking things up, like if you have a list bunch of objects that you need to access and modify, you should use a dict.
If you are using the dict as a container like car={“make”:”honda”,”color”:”red”}, you should use a proper object like a class, dataclass, or pydantic model based on whether you need validation, type safety, etc. This drastically reduces bugs and code complexity, helps others reason about your code, gives you access to better tooling etc.
Subclassing NamedTuple is very ergonomic, and given they're immutable unlike data classes I often reach for them by default. I still use Pydantic when I want custom validation or when it ties into another lib like FastAPI.
The article title perhaps mischaracterizes the significance of these findings.
The paper finds that Hooded crows—who are not specialized tool users—demonstrate some of the same abilities that have already been observed experimentally in New Caledonian crows—who are specialized tool makers, including:
the ability to manufacture tools from novel materials, select or manufacture a tool depending on the specifics of the task,
…etc.
The authors cite a dozen papers published over the last 20 years that have documented these findings in NC crows, as well as Goffin’s cockatoo (who, like the Hooded crow, are not specialized tool users).
The significance of this paper must be that the abilities are more widespread in crows than previously thought, which is stated in the article, but blotted out by the juicier headline.
What's the difference between CriticGPT and ChatGPT with a prompt that says "You are a software engineer, your job is to review this code and point out bugs, here is what the code is supposed to do: {the original prompt}, here is the code {original response}, review the code," etc.
My takeaway was the exact opposite: in the 1930s, things really were as bad as they seemed, and the U.S. was justified in taking extreme measures to avoid it happening again.
4. Spending the tax money like crazy, to give the poor some money to buy things.
Hoover Dam, Golden Gate Bridge etc are nice takeaway of that generosity frenzy. Too bad during COVID gov just gave cash, not getting any infrastructure in return.
COVID wasn't a lack of employment problem, everyone had jobs, the government decided to pay people to stay home. It was a handout specifically aimed at not building anything at all.
The government persisted with the failed policies, lengthening and deepening the Depression. Central economic planning simply never is able to do better than free market forces.
That's not really true. Just because central planning be done stupidly doesn't mean it never works. Check out the number of countries that don't have something like a central bank stabilizing their currency which is approx zero out of 200 or so countries.
This is so cool! Does anyone know how the data is encoded in the signal? Is it just data for the game that's transmitted (and the logic resides on the ZX Spectrum) or is logic also transmitted?
The format is very simple, basically a square wave with different pulse widths for 1s and 0s [1]. Spectrum software was typically sold on audio cassettes and the radio broadcasts are the exact same format, typically people would record the broadcasts to cassette. The loader program in ROM just copies all the data from tape (or radio) into RAM so yes any game logic would be included in that.
Jury is still out on an astronomical explanation for the apparent 26M year periodicity[0] of mass extinction events. Lisa Randall has an entertaining theory[1] that it’s due to the sun passing through dark matter in its orbit around the galaxy.
It doesn’t even have to be dark matter, most of the (non-dark) galactic mass is in the galactic plane and the sun oscillates up and down passing through the plane as it orbits the centre.
That’s the argument I think. Per that Wikipedia link:
> Randall hypothesizes a plane of dark matter exists roughly on the plane of the Milky Way galaxy. As the Sun oscillates in its orbit around the center of the galaxy, it passes through the dark matter.
If you're not smack bang in the middle of the galactic plane, you're going to be accelerated towards it by gravity, so you'll tend to bob up and down, like a pendulum.
The oscillations are not "around" the plane, they are through the plane.
That is; the plane itself has a local gravitational attraction
which is orthogonal to the galaxy core gravitational attraction.
If a mass is above or below the plane, the "local" gravity will
pull towards the plane.
since nothing stops it at the mid line of the plane it passes through
to the opposite side; rinse and repeat.
This bouncing above and below center line of the disk
is more or less independent of our solar system completing galactic orbits.
Fair; the descriptions I've seen seem to focus on the galactic orbit more than the local neighbourhood as the cause of the oscillation; this makes more sense.
The up down oscillation is completely decoupled from the orbit itself, assuming the orbital potential is uniform. It's like the galaxy wasn't rotating at all. You put something above the disk, and it gets accelerated downwards, but doesn't stop at the disk, it keeps going, until it gets dragged back up. Think of it like a pendulum.
There might be some gas in the way that would slow it down slightly, but I expect that to be a very long time scale compared to other things like interactions with other systems and even the upcoming collision with Andromeda.
I haven't done the math but I would think it's possible due to interactions from other solar systems. Similar to how satellites oscillate around Lagrange points
I don't think that's really an accurate description. There's a discrepancy between observations relating to gravitation and general relativity's predictions. The discrepancy could be accounted for by significant extra mass, but no non-gravitational observations seem to confirm the presence of that extra mass. So "dark matter" is the supposition that there's a significant amount of extra mass that interacts only with gravity but not, for example, light, making it categorically different from ordinary matter. And I don't think there's any evidence that this dark matter follows the same gravitational constant as ordinary matter.
It does not matter whether it "follows the same gravitational constant as ordinary matter" or not.
For any kind of matter, normal or "dark", which is observed only through gravitational effects, you cannot determine separately its mass and the gravitational constant that applies to it. You can determine only the product between mass and gravitational constant (which is the cause of measurable forces).
Therefore for many astronomical objects the product between their mass and the gravitational constant is known with a much greater precision than their mass (because the gravitational constant is known with very poor precision even for ordinary matter).
The same applies for "dark matter". You cannot compute the distribution in space of the mass of the dark matter, but only the distribution in space of the product between its mass and whatever gravitational constant is applicable to it.
So even if a different gravitational constant were applicable to "dark matter" that fact would be irrelevant for any mathematical model that is fitted to the observations.
Nevertheless, mass is a separate quantity, which means that the original claim that orbital speed is determined solely by mass and orbital radius is not supportible in the context of dark matter.
Not quite. Dark matter is the hypothesis that the discrepancy between theory and observation is due to a form of matter that interacts gravitationally but not electromagnetically. So we can't see it, and thus "dark".
There are other competing ideas including a family of modified Newtonian dynamics models, but nothing comes as close as explaining the observations as dark matter does.
There was a paper recently that showed that the discrepancy may be the higher order terms from general relativity that is often neglected because they are believed to be small - but that idea still needs to be proven to work for a large variety of cases.
The observations in question for this Dark matter hypothesis include the rotation velocity of stars in galaxies and a few other things like gravitational lensing.
Dark energy is a different discrepancy with theory. It's a term that we have to add to Einstein's field equations to account for the observation that the universal expansion is accelerating instead of slowing down. Again there are competing hypotheses, like non uniform density on the largest scales, but nothing quite explains everything as dark energy.
That’s just how often the local dark forest reaper aliens fire a relativistic velocity impactor at every biosphere they can detect within range. Keep resetting to make sure nothing too complex evolves.
How much longer do we have to bug out before the next one?
I had free petunia plants last year in the pots the previous years petunias grew. No, these were not the same plants as they are annuals that got pulled in the fall. Never thought about them seeding themselves like that. Maybe that $53 plant can do the same thing so you get a second year out of it essentially halving the cost???
Isn't that the very definition of propagating the line which is protected via patent? I too doubt these would grow from a seed, but at least growing a plant from a seed is not patentable regardless of what Monsanto thinks.
It's really only enforceable if you attempt to make money from it or even just distribute it as your own to the point they find out about you. If you do anything to share the new plants that prevents them from making money, you'll be "guilty". If you do it just to fill in your backyard, they'll never find out about you.
reply