- 0 Posts
- 19 Comments
AckPhttt@beehaw.orgto
U.S. News@beehaw.org•Plans for gaudy Trump presidential library in Miami spark ridicule
5·8 days agoIt will also have a public bathroom chock-full of our nation’s most valuable classified documents.
AckPhttt@beehaw.orgto
Technology@lemmy.ml•Meta shuts down Metaverse after $80 billion loss, ends Horizon Worlds era
1·20 days agoThose are still rookie numbers. Pete Hegseth just spent more than that on ribeye steaks and lobster tails.
AckPhttt@beehaw.orgto
Chat@beehaw.org•Please stop speaking favorably of Tucker Carlson, I am beggingEnglish
7·20 days agoIt was surprisingly hard to find, but if you put “Tucker Carlson Blake Neff fishing” into a search engine, you can find Tucker’s non-apology and non-explanation for having a Neo-Nazi “top writer” on his staff (up to 2020).
AckPhttt@beehaw.orgto
Programmer Humor@programming.dev•What are some of the worst code you have seen in a production environment?
3·4 months agolot of copied variables, because of c I suppose? Things like var = self.var
If we’re very charitable, there’s a micro-optimization w/ Python (or at least, older Python) where assigning to a local variable like this inside a method is faster than the full
self.varlookup, so you’ll see it in Python’s library code while setting up some loops, etc. as a small speedup. “lots of copied variables”, though, is likely an anti-pattern if not in a heavily used piece of library code, imo.What’s really crazy is when people write modified Python language pre-processors where:
var = varis a necessary thing (to bring thevarinto the right context for the pre-processor to recognize it; yes, I’ve seen this…)
How about another law: No state shall receive more in federal spending than that state contributes in federal taxes.
AckPhttt@beehaw.orgto
General Memes & Private Chuckle@lemmy.dbzer0.com•For the love of society
8·5 months agohttps://www.scientificamerican.com/article/is-the-alpha-wolf-idea-a-myth/
Research that led to “Alpha wolf” theories were shown to be flawed, or at best, representative of captive wolves, and not wild wolf behavior.
The reference to saving society is that there are now “influencers” and other BS commentators using the debunked “Alpha wolf” concepts as also being how “real men” should act, and making many young men (especially) act like total assholes.
AckPhttt@beehaw.orgto
General Memes & Private Chuckle@lemmy.dbzer0.com•Fuckin' Americans
12·5 months agoFirst rename “Platinum”. Then we’ll talk.
AckPhttt@beehaw.orgto
Politics@beehaw.org•Republicans file lawsuit challenging California’s redistricting measure
8·5 months agoThe proposition that led to California’s enacting of the “fair” redistricting was originally funded by conservatives who wanted to improve their chances, and came somewhat as a response to discussion around Texas’ 2003 redistricting: https://en.wikipedia.org/wiki/2003_Texas_redistricting
At the time that California’s redistricting amendment was being discussed, as the obvious Republican “trick” to benefit them in California, many called out the hypocrisy of only advocating for it where it’d help, and explicitly fighting where it’d hurt them. (Hilariously, after the California amendment drew up new “fair” districts, in the next election that used them the Republicans still lost seats in California, just due to them being so generally hated at the time).
So yeah, their hypocrisy on this matter has been called out many times. But they are shameless, and frankly cannot win long-term with a “fair” electoral system.
Possibly many polled Sliwa supporters actually voted for Cuomo instead, to try to prevent a Mamdani win.
AckPhttt@beehaw.orgto
Technology@beehaw.org•Donors for Trump’s $300m White House ballroom include Google, Apple and Palantir
12·6 months agoWait, do you mean that ballroom that is $500m?
AckPhttt@beehaw.orgto
Politics@beehaw.org•AOC's 2028 decision: Run for president or Senate
1·7 months agoOnly the proper candidates win, as a rule
Was Trump winning an example of that rule, or a counterexample?
AckPhttt@beehaw.orgto
/r/50501 Mirror@50501.chat•We should be pushing for legislation for Ranked Choice VotingEnglish
1·1 year agoIt’s worth remembering that the majority of votes cast for President in 2024 were for a candidate other than Donald Trump; he got less than 50% of the votes that were cast for President. Making it so that those majority of votes aren’t automatically split (and thus diminished) can be impactful, imo.
AckPhttt@beehaw.orgto
Politics@beehaw.org•Hopes of US golden age fade as investors start to worry about ‘Trumpcession’ risk
2·1 year agodeleted by creator
AckPhttt@beehaw.orgto
World News@beehaw.org•Musk's embrace of right-wing politics risks turning off car buyers and sinking Tesla's stock
9·1 year agoI’m on the DOGE team, and those values seem completely accurate and verified to me. /s
Edit: And if they are wrong, by our accounting that means that you just saved the government $399.6 Billion dollars.
Try compression socks as the innermost-layer, which are long enough to run up the calf. With these on, I use one more layer of regular cotton sock and generally feel pretty warm (compared to just thick wool socks, or multiple other layers).
And since it’s mentioned in the article, there is a proposed path to having the popular vote decide the presidency that doesn’t require a constitutional amendment, and IMO it’s surprisingly further along than one might guess: https://en.wikipedia.org/wiki/National_Popular_Vote_Interstate_Compact
AckPhttt@beehaw.orgto
Free and Open Source Software@beehaw.org•NetBSD: the portable, lightweight, and robust UNIX-like operating system
3·1 year agoDo I count MacOS users in that search?



IMO, using id() as a key would never be a good idea under any circumstance.
Two different (and even unequal) objects can have the same id():
>>> x = [1] >>> id(x) 4527263424 >>> del x >>> x = [2] >>> id(x) 4527263424 >>> del x >>> y = [3] >>> id(y) 4527263424Note - a dictionary lookup already looks up the key by id() first as a shortcut (under-the-hood), so there’s no need to try doing this as an optimization.
Edit: in case it wasn’t clear above, the object with the same id()s don’t all exist at the same time; but if you store their ids as a key, you’d have to ensure the object lifetimes are identical to be sure the ids could identify the same stored value. The dictionary does this for you when you use the key object, but it’s not automatic when using the id of the key.
Other Note - Since you phrased it as “all ints below a fixed limit share the same id() result”, I’d suggest a better way to semantically think of it is that certain constant objects are pre-allocated, and thus are kinda like singletons. There is usually only one
int(1)object, and the language keeps a pre-allocated pool of these common small ints (since they are used so often for indexing anyway).Similarly, many short string constants are ‘interned’ in a similar way; they aren’t pre-created at startup, but once they are created by the user declaring a string constant when the code is run, it saves memory to check and only keep one copy of those string objects, as the string constants can be checked at byte-compile time. But if you construct the string with code, it doesn’t bother to check all the strings to see if there exists an identical one. So for example:
>>> x = 'ab' >>> y = 'ab' >>> id(x) == id(y) True >>> s = 'a' >>> s = s + 'b' >>> id(s) == id(x) False >>> s == x == y TrueBut you can force it to make this check; it’s something they made more tedious to do in Python3 since it’s really an implementation detail:
>>> import sys >>> s = sys.intern(s) >>> id(s) == id(x) TrueSorry for the verbose reply; hope it helped.