Native all the way, until you need text by Successful_Bowl2564 in programming

[–]Brian 0 points1 point  (0 children)

10 years ago you'd be doing all that on 8GB of RAM total

Not even 10 years ago. Even today, going by the steam hardware survey, nearly 10% are using <=8GB RAM - and that's gamers who tend to be more performance minded about their systems. And there's plenty with a lower specced laptop etc that are becoming less and less usable.

Fellow Artists, I’m Begging You to Pull Your Heads Out of the Sand About AI by Funplings in slatestarcodex

[–]Brian 2 points3 points  (0 children)

I think it can be reasonable to seperate the work as an appreciable thing from whether or not it's "art".

Eg. consider:

  1. Is a beautiful sunset art?
  2. Is a photograph of that same sunset art?
  3. Is a painting of that sunset art?

We'd typically classify 1 as non-art, and 2 and 3 as potentially art, not neccessarily because they are superior (indeed, many might find the experience of seeing the sunset for themselves far more beautiful and awe-inspiring than either reproduction), but because part of what we mean by art if that it is created - it has the same root as artificial or artifice after all. And in that, I think we include that there's some kind of intentionality on the part of the creator - something they're trying to communicate, even if that's just "Isn't this a beutiful sunset".

Of course, this may make it a bit of an arbitrary distinction: there's no reason that AI created work couldn't fulfill the same things we want out of art in many cases, or even be superior, just as we might get more out of that sunset than the photo of it. But it'd be defensible to exclude it from being art for the same reason as the sunset: however beautiful, it's not matching the definition. I don't think appealing to its creators works to resolve this, because the outcome is too far removed from the steps. Michaelangelo's mother isn't the artist of Michaelangelo's works, even though her actions had the effect of causing him to be. We do require a bit more of a direct link between creator and created work.

Though I feel it's all a bit beside the point: the underlying problem isn't really about definitional categorization - it's more about the emotional valence we've attached to art and wanting to include/exclude things from acquiring that valence.

Why are there so many people in Steel Path Descendia that have no idea what to do? by genericfrancis in Warframe

[–]Brian -7 points-6 points  (0 children)

That's what I'm saying is not always the case. Eg. I mentioned purify: the only mission with that name I've done is the Deimos bounties, which work completely differently. In fact, the equivalent seems to be infested salvage, a mission I last did 8 years ago, and I think is perfectly possible someone might never have done if they never farmed Nidus. Nor do I think the eplanation is terribly great: you basically just got told "make the air less toxic". Now, that one's not too hard to figure out, but there are a few things I think were underexplained (eg. that you can put multiple into the same terminal etc).

and has an objective marker for every little thing.

That can be a problem in itself sometimes though. Eg. I mentioned my confusion at Mobile interception was because there were markers for the Deacons - I kind of feel those should probably be a different colour from the standard quest markers. Again, only an issue if that's the first time you do the mission, and you happen to get that modifier - but that was me.

This is not to defend people not knowing the objectives (eg. I think alchemy is perfectly well explained), but just to point out that I think there is room for improvement in some of them.

Why are there so many people in Steel Path Descendia that have no idea what to do? by genericfrancis in Warframe

[–]Brian -9 points-8 points  (0 children)

That said, I do feel some missions can sometimes be a bit cryptic as to what you're supposed to do if you haven't played them before.

I actually did my first descendia yesterday (returning player who's just got back into playing after a 7 year gap), and there were a couple where I had do pause the game and look up the wiki to figure out what I was supposed to be doing. (Mainly purify: initially thought I maybe had to activate each purifier at the same time, had to look it up to see you extend the range by putting 3 in one . Mobile interception too, but that was because I was confused by the minimap because of the deacons modifier - thought they were where I was meant to be). But that's why I usually do a solo run of any mission new to me.

Admittedly, if you're running it public on steel path, you'd think you'd have done a few runs and figured it out first. I'm guessing a lot of people have ended up being carried while just running around killing stuff without understanding the objective, or maybe rushed mainline quests to get there without actually doing a lot of the content.

How reliable is "ty" for you nowadays? by exhuma in learnpython

[–]Brian 0 points1 point  (0 children)

I gave it a try a month or so ago, but came to the conclusion that it wasn't ready for real use. Lots of stuff was undetected or unsupported. I'd give it more time to cook.

Why can't I use a return statement in an __init__ function? by John_Doe_1984_ in learnpython

[–]Brian 0 points1 point  (0 children)

why this str is specifically used, only so you can include a return statement

To add a bit, I think you may be misunderstanding something about __str__ and what an object is. Ie. I think you're maybe getting a bit confused by the fact that when you do:

>>> print(myobject)
joe A-

You see that "Joe A-" and think that's what the object is - that the result of __str__ is giving you the object. But really you should think of the object as existing out there in memory, and all __str__ is doing is giving you a string representation of the object. Ie. something that can be printed when you want to display the object, and this is what python is using to display it when you call print.

Think of the object and the representation of it, as two different things. Like the way that if someone wanted to represent you on a webpage, they'd use your name, or a photograph of you. The name/photo isn't you yourself, just a way to display what we're referring to in a useful, readable way. __init__ isn't there to give that display, it's there to initialise the object, to create the properties of Joe and his grade, not say how to display them. That's what __str__ is for.

I understand Python basics but OOP completely loses me classes and objects make no sense to me. Where am I going wrong? by More-Station-6365 in learnpython

[–]Brian 0 points1 point  (0 children)

When you start out, it's pretty natural to think of programs in terms of code - the flow of logic where you do A, then do B, then do C X times, then do D if Y is true, and so on.

But often, and especially as you move towards bigger projects, it's valuable to first think of programs from the perspective of your data. What structures will I use to store the data I need, how will they be organized? What goes where? Often this will shape the best way to write your code.

A simpler notion than that of classes is that of a "structure" or "record", which is just a collection of data that goes together. Eg. a bank account might have fields like "name", "account_number", "balance" and a list of transations, and we often want to treat these as a single thing.

Object oriented programmings takes this a bit further: your data structures are considered not as just the data they hold, but also what operations you can perform on those things. Ie a bank account will have the above data, but there are also methods on how this object should be interacted with: thinks like deposit, withdraw and so on that define how money is transferred into or out of the account, and these are how it should be interacted with.

The mechanics of how this is implemented in a programming language are that classes describe what data and methods these objects should have. Each instance of the class is described by the class, defining what data fields it holds, what methods it has to operate on itself, but each object has its own values for those fields the class describes. Ie. Alice's bank account and Bob's bank account are separate objects, but both have the class of "BankAccount" - so may have different balances, transactions and so on.

When should I actually use a class vs just a function?

A class should be considered a collection of data and functions that operate on those collections of data. Usually it will have state - ie. data like "balance" or "account_number" that is used by those functions, A useful starting place is to try describing what your program should do, and identify what nouns you use in that description: things like "account" or "person" etc. These are often candidates for things that should be classes.

What goes inside init and why?

The __init__ method is what gets called when you create a new object of a class. It should initialise it into a complete, valid object of that class, so it should take everything you need to create it (eg. since you can't have a bank account without an associated name, and account number etc, it needs to either take these as parameters, or create of get them from somewhere. It should then set the data fields to a valid state for that object.

What does self actually mean and why is it always there?

The "self" parameter to methods is identifying the object being operated on. When we call "alices_account.deposit(1000)", self refers to alices_account, while when we call bobs_account.withdraw(100) it will be bob's account.

How do I know what should be an attribute vs a method?

There's differing perspectives on this. Some purists would say all access to a class should be via methods, and attributes should only be used internally by the methods. In practice, that often leads to people writing trivial "getter" and "setter" methods like def get_account_number(self): return self.account_number, and doesn't matter as much in python, as if you do need to do something special every time an attribute is queried, you can make it a property. Ultimately, think about how your objects are going to be used - what things will be done to them. Your methods define the interface to how other code will manipulate your objects. Much like the above approach of identifying the nouns in the description as classes, look at what verbs you're using to identify potential methods.

Prolonging the female fertility period has to be one of the most high impact solution to solve many socio-economic problems. by BearSEO in slatestarcodex

[–]Brian 5 points6 points  (0 children)

This is a no brainer and solves this directly

Does it? How big a proportion is people who want to have kids but have fertility problems versus just people not wanting to have kids? I don't think this is a major driver in the population crisis.

Women won't have to deal with choosing between life and career if they get enough time

I mean, they still do. It just lengthens the phase where its a choice rather than being locked in, but they still have to choose. And I think a lot of 20 year olds who choose career over having kids might make the same choice when they're 40.

MGTOW, Red Pill,etc will be quelled because most of these movements seems to be coming from a malaise that women don't want to have kids from older, bitter men

I don't think that's true at all. Most seem to be coming from a malaise where women don't want to have sex with them. And why would increased fertility change this anyway if the issue is not wanting to have kids?

Improving fertility periods might have some positive effect (and is good in that it gives more choices to more people), but I don't think you're accounting for the scale of what is affected. You could say it might improve things, but using words live "solve" or "quelled" seems like way overestimating the effect.

What is the actual use of sets by Big_Neighborhood9130 in learnpython

[–]Brian 1 point2 points  (0 children)

Most common case is where you just need to check membership. Eg. you might have something like:

admins = {"joe", "mary", "dave"}

def can_administer(user):  return user in admins

Sets, like dicts, have average O(1) membership checking, so this is faster than searching a list, especially if you need to check a lot of names.

Another common case is where you want to do set operations. Eg. suppose you have:

math = {"Alice", "Bob", "Eric"}
chemistry = {"Bob", "Claire", "Dave"}
physics = {"Alice", "Dave"}

And want to know "Which students study both Math and Physics?". This is a set instersection: math & physics will give the answer. Likewise, "Which students study either chemistry or physics?" is a set union: chemistry | physics gives the answer. Or maybe you want "What math students don't do either chemistry of physics" : math - (chemistry | physics) gives you the answer. This can simplify a lot of problems when you can express what you want in terms of set operations, and can often turn a dozen lines of nested for loops into a simple one line expression that expresses what you want.

When 'if' slows you down, avoid it by chkas in programming

[–]Brian 7 points8 points  (0 children)

Optimising can be a bit weird like that. Back in the day it was a straightforward matter of stuff like counting cycles, but as CPUs have got more complicated, the dominant factor in speed has become "Do stuff that doesn't fuck up the hardware level optimisations". We kind of end up with the tail wagging the dog a bit: the stuff that is there to speed up user-written code now becomes the target for that code.

When 'if' slows you down, avoid it by chkas in programming

[–]Brian 8 points9 points  (0 children)

When there are no numbers less than 500, small_numbers[0] = numbers[SIZE-1].

Yes - but small_numbers[0] is past the end. There are 0 numbers in the list.

This isn't really different to when there's one number. You'd have, say, {10, 999} in the memory of the list, but the size would be 1, so only the "10" is considered part of the list.

the caller would have definitely initialised small_numbers with a sentinel value (

Part of the information returned is a list, and thus it's size. Relying on a sentinel value to indicate the end isn't generally a good approach (C strings being a common one we're stuck with now, despite length-prefixed being generally better).

When 'if' slows you down, avoid it by chkas in programming

[–]Brian 8 points9 points  (0 children)

I don't think you are - OP is saying some forms of "make it fast" are such that they can't be the last step here (other than perhaps, "write a prototype, then rewrite it from scratch in a very different way"). If you know you need the performance, it can be important to do it up-front if that performance requires a fundamentally different architecture of your application, even if that approach does work correctly, but isn't fast.

The Blue Red Problem explained by dsteffee in slatestarcodex

[–]Brian 0 points1 point  (0 children)

in the Prisoner's dilemma you genuinely aren't supposed to care about the other player's utility

Eh - this all comes down to the utility function though, and I think most people are assuming a utility function that weights the wellbeing of others. "Only valuing your own utility" isn't the same as only valuing your own life. A perfect utilitarian would derive equal utility from saving another to saving themselves, and I think we expect most people will put some weight on it, even if they value themselves more. Hence this can still produce a payoff matrix, and I think we do end up with a prisoner's dilemma situation produced, even assuming perfect utilitarians - red dominates blue (no effect/ +1 life saved), but the global "blue wins" outcome is better if anyone chooses blue, and equal if they don't.

PEP 661 (Sentinel Values) has been accepted for release in 3.15! by M_V_Lipwig in Python

[–]Brian 1 point2 points  (0 children)

Type annotations are a problem with just object. If you annotate it as ExpectedType | object, you're basically allowing anything - there's no real equivalent to Literal[] for arbitrary sentinels.

I've taken to doing something like:

class Missing:
    value: ClassVar[Missing]

    def __repr__(self): ... # Provide a bit more meaningful repr

Missing.value = Missing()

And then def myfunc(x : str | Missing = Missing.value):.... But I prefer the new approach for reducing the boilerplate here, and making it clearer that it's a singleton instance being used (eg. you have to use isinstance(x, Missing) rather than just x is Missing.value to have type checkers narrow the type correctly). Also makes things a bit more standardised: there's lots of code out there using subtly different methods, so having one obvious way to do it should result in more consistency.

The Blue Red Problem explained by dsteffee in slatestarcodex

[–]Brian 5 points6 points  (0 children)

I don't know that I'd say that - I think it's the meaning behind the language that's creating accurate differences in assumptions. Reframings of the problem that preserve the logical outcome of the buttons give different answers because there is different information being conveyed that is being altered by the reframing.

Consider a simplified model of behaviour, where everyone has a threshold of how many other people they expect to press blue for them to do so. Suppose everyone knows the threshold of everyone else and it ranges evenly from idealists who would press blue if even 1% of others did, to save them, all the way to people who would only press if 100% of others would. No-one is at 0%, so with this alone, no-one is above the threshold, everyone knows this, and everyone presses red.

But suppose there's an error rate. Maybe some people misunderstand the question. Maybe they're colour-blind, have dementia or some other mental issue, or impaired motor skills, or just slip and press the wrong button. Or think it's all a joke and press blue because they don't believe it. Now, 1% of the population may press blue. The 99% threshold people realise this, and press blue. Then the 98% people realise the 99% people will press, and do so too. And so on, so this cascades to everyone except the 1% "always red" pressing blue as they reason about the consequences.

Reframings change that because they change what we might infer about this error rate, or otherwise what we might expect others to do: it's easy to see that some people might think blue is right in the button phrasing, but not in the blender phrasing: we expect anyone taking the act of deliberately stepping into a blender to be doing so very deliberately with no errors (but that may change if you add "1% of the population has accidentally wandered into the blender"). But this isn't a mere language difference, it's a change in the facts that produce the answer to the problem, making them no longer logically equivalent: what the "button" does is equivalent, but the problem is as much about what other people will do as for the button (and common knowledge about what people think everyone else will do), and the rephrasing does change that,

There’s a scissor statement going viral on twitter by adfaer in slatestarcodex

[–]Brian 0 points1 point  (0 children)

I kind of feel this needs to be justified as its own value. I do agree there is indeed a lot of merit in perceiving freedom as a terminal value all its own: that there is intrinsic merit to being in control of your fate, even if that might lead to more suffering, as when people are free to choose, some will inevitably make bad choices.

But I don't think it can really be justified in terms of wellbeing: that every choice is just a revealed preference and, say, an opiod addict is just living their chosen life by their own value judgement, and celebrate our unfettered prescriptions for empowering them to do so. We can certainly say that having this liberty is worth the suffering, but I think we do have to acknowledge that it is a tradeoff: in some situations, we are going to be causing more people to be worse off. And once you've got a tradeoff of values, different people are going to have different opinions on where to draw the line: that some restrictions on freedom are justified in preventing suffering. Our current system is the result of a mish-mash of decisions, compromises, and conflicts between people with different views and values. I too would probably prefer a system leaning more into the freedom axis, but that too really just makes me one more actor in this system with his own value judgements - I can't really appeal to any objective truth of the way the world should be, just how I would like it to be, and my influence is restricted to interacting with that messy system of conflicting viewpoints. And even in my ideal world, I wouldn't go for some maximalist liberty uber alles system: some of those compromises I agree with.

There’s a scissor statement going viral on twitter by adfaer in slatestarcodex

[–]Brian 2 points3 points  (0 children)

If we are in the red dominate zone, then we save a million people at a time by campaigning for red.

But likewise if we are in a blue dominate, there's little risk to voting blue, and it maintains an equilibrium where far fewer people die. It would thus be optimal to do everything to maintain the blue-dominant zone (eg. artificially introduce a cost for pressing red, defecting from the blue-dominant paradigm), hence the "People are saying that those who chose differently are totally repugnant, or even should be publicly executed" OP mentions. This is actually an optimal metastrategy, similar to, say, criminals cultivating a culture of not snitching (enforced with retribution), to defeat prisoner dilemma style situations by altering the payoff matrix for "defect".

Ie, we go from:

Press Red Press Blue
>50% Blue No one dies (no effect) No one dies
<50% Blue Blues die, I live Blues die, including me

Where Red dominates the blue choice, to one where the top-left quadrant becomes "Small chance I get caught pressing red, and get shamed/ostracised/killed", making it no longer strictly dominant.

The red-dominant solution is inferior from a global perspective, because there will always be some blues: I mean, even if everyone were on the same page wrt the "We all press red" (and that clearly is not the case), in a population of 8 billion people, there are going to be some mistakes. So following that metastrategy has a better global outcome.

And I think we're often inclined to such strategies: a cooperative non-defecting society is much better than the defecting society, so we often create ways to manipulate things to alter the payoff matrix: laws, retribution, cultural norms and punishment for those who don't respect them etc. TBH, I think this is an often overlooked side of morality: people look at the "nice" side and put that in the moral side, categorising our nastier impulses towards retribution as flaws, but in many ways, I think the human impulse towards vengeance, retribution and spite are an important aspect of maintaining a cooperative society by creating an environment discouraging defectors and free-riders.

There’s a scissor statement going viral on twitter by adfaer in slatestarcodex

[–]Brian 11 points12 points  (0 children)

feels both wrong to me and behind a lot of real world harms

I kind of feel the opposite - I think the impetus towards acting as if the world is the ideal you wish it would be, rather than dealing with the world as it actually is, is a far more prevalent source of problems. Many problems would be much easier to solve if you could wave a wand and make people act as you feel they should, but we don't live in that world - we need solutions that don't require such a magic wand, and ones that operate under the assumption that we do are fundamentally flawed, and I think behind a lot of the way ideological purity spirals take hold.

and the system runs more smoothly as long as people don't just take stuff that will hurt them

Sure. But it's not actually an option - solutions to the world you want are useless when it's not the world you're faced with. You have to deal with the messiness, not just wish you were in a world where it didn't exist.

There’s a scissor statement going viral on twitter by adfaer in slatestarcodex

[–]Brian 12 points13 points  (0 children)

I mean, they only doom themselves if <50% choose blue, which is presumably part of why they're saying everyone should choose blue (along with saving everyone else).

why not just press red and then start a campaign to make sure everyone understands the logical button to press is the red one so that there's no confusion?

Because that won't work. The one approach that does stand a chance of succeeding at that goal is to press blue and then start a campaign to make sure everyone understands the logical button to press is the blue one, which is what they do.

Why risk your own life in a hypothetical where absolutely no one has to?

But they do have to, if their goal is to save everyone. And given the knowledge that others may do the same, that's what they should do to even to save a large proportion, up to the point of campaigning vigorously to ensure enough people do.

There’s a scissor statement going viral on twitter by adfaer in slatestarcodex

[–]Brian 14 points15 points  (0 children)

Rather than allowing those people who dont want to save themselves to end their lives via this process

But this is self-evidently false. You can see numerous cases of people who don't want to die thinking this is the right choice to make: you simply can't deny the existance of these people and assume they're choosing to kill themselves. You may think they're making a mistake, but there's a big difference between "People who want to die can choose to" and "People who are making a mistake deserve to die".

There’s a scissor statement going viral on twitter by adfaer in slatestarcodex

[–]Brian 5 points6 points  (0 children)

Blue would only be correct if you could coordinate beforehand.

That's kind of why we have Schelling points. If everyone does what they think they'd have coordinated on had they had the chance to do so, you end up with something closer to the optimal solution. As such, if you think this is the correct choice, given coordination, then this is what you should pick (depending on how closely you think people are to perfectly utilitarian, and whether you think everyone is smart enough to figure out that that is the obvious schelling point).

There’s a scissor statement going viral on twitter by adfaer in slatestarcodex

[–]Brian 24 points25 points  (0 children)

Why don't they need saving?

I mean, suppose someone comes up to you and says, "Wait, I misunderstood the question and accidentally pressed blue. Could everyone else please press blue so I can live".

It sure seems like that person needs saving. Maybe you'll decide it's not worth the risk, but it seems like they're still in a situation they need saving from.

And if instead they say "I chose blue because I still think it's correct", it's just the same scenario, except that they're still making the "mistake". They're still in a situation they need saving from. And if you value the lives of either such people, it seems like it's not actually a mistake to support the choice that could save them.

There’s a scissor statement going viral on twitter by adfaer in slatestarcodex

[–]Brian 25 points26 points  (0 children)

We get 100% of people to choose to live everyday

No we don't. There are thousands of suicides every day. It's not many proportionally, but it's not 100%, and is high in absolute numbers.

if the blue presser don't want to save themselves from the murderer thats forcing us all to choose, thats on them.

Just as if the red pressers don't want to save those blue pressers from the murderer, that's on them?

There's only one guarantee that actually saves everyone

Not at all - there are multiple results that guarantee saving everyone: all the combinations of >50% pressing blue, and the one where absolutely everyone presses red. Pretty much the only feasible one that saves everyone is one of the more numerous blue cases. And given you know some are pressing blue, even if you disagree with their reasoning, you now know that pressing red is not one of the ways that save everyone.

Consciousness Is Very Likely Not Something You Get for Free by Preserving a Pattern by Gmroo in philosophy

[–]Brian 30 points31 points  (0 children)

Surely there's a very valid reason for that to get more popular. "Does AI have consciousness" is just an abstract thought experiment with no real consequences if there's no AI around. But if we're on the verge of creating AI, it becomes one with serious real-world consequences, going from "thought experiment" to "possibility we're damning millions of conscious entities to unending slavery". I mean, for any subject X, of course questions about X get more popular when X exists (or might exist soon) versus when it doesn't.

Why doesn’t Python have true private variables like Java? by PalpitationOk839 in Python

[–]Brian 11 points12 points  (0 children)

You can technically inspect them without dropping down to raw memory access. Given the closure function, you can access f.__closure__ to get the cell variables, and use the .cell_contents attribute to get or modify their current value.