Show newer

@spencer @cartocalypse Oh, that's right -- but you have to declare b to be of type &int instead of int, right?

I have more experience with Java, which uses the word "reference" to mean "non-primitive" (and thus subject to aliasing), but doesn't allow this sort of thing.

Answering the usual beginning-of-semester emails, like "is there room in your class", "can I do an independent study", and "how do I repair my puppyhammer".

@spencer @cartocalypse Is there a language that does it that way? I would find it surprising.

There is the related notion of passing function parameters by reference, which (IIRC) C++ and C# allow. Python and Java pass by value; the passed value is always a reference in Python.

@cartocalypse In Python, everything is an object and variables hold references to objects.

In Java, in contrast, a few things (primitive values like ints and chars) are NOT objects, so variables hold them directly.

The main consequence of a reference is the possibility of aliasing. If you

a = [1, 2, 3]
b = a
a[0] = 10

then b is [10, 2, 3].

The line b = a above makes a second reference to the list rather than copying the list, so modifying the list affects a and b.

Objects like Python ints and strings are immutable (can't be modified), so the programmer can largely ignore whether variables hold them directly or hold references to them. It is possible to tell whether two variables refer to the same object by using the "is" operator.

ChatGPT: Can It Make Huge Corporations Even Wealthier?

arstechnica.com/information-te

'Libin also sees tricky technical challenges ahead. One is that ChatGPT and other generative AI models are currently created by scraping content made by humans from the web, but are increasingly contributing to the text and images found online. “All of these models are about to shit all over their own training data,” he says. “We’re about to be flooded with a tsunami of bullshit.”'

If it is not literally the warmest year ever, someone will complain that global warming has stopped.

Year-to-year fluctuations are a normal part of the ongoing global warming trend. Don't be distracted by the noise.

#GlobalWarming #ClimateChange

Whale: *beaches*

Oregon: *takes stick of dynamite out of pocket* *smiles nostalgically* *shakes head and puts away dynamite*

We kicked off our two weeks of B games with a classic: Battleship. @peterdrake beat me by a ship and change. He had amazing luck. My two-point destroyer was the first boat he found and sank.

This is the copy my brother and I played as kids. Do they still print the rules inside the lid of the box? And do kids still try to cheat by marking the spots their opponent has already called and then moving their ships mid-game to avoid being hit?

#BoardGamesAtoZ #BoardGames

@DrSuzanne Terrified! The steering wheel is on the wrong side, it runs on Nutella, and because of the metric system it has ten tires!

@engelbart Nothing. I didn't know this person terribly well, so it's merely odd to me. I understand that others have been traumatized by automated suggestions to reconnect with dead loved ones, abusive exes, etc.

Facebook just suggested I add someone as a friend. The person in question died six years ago.

Show older
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.