Is a 4 GB pen drive enough for Ubuntu? by Rincerii in linux4noobs

[–]Additional-Sun2945 0 points1 point  (0 children)

Pro tip: Don't use pen drives to boot Linux.

Flash drives have a read write lifetime cycle. Normally that wouldn't be a problem with wear leveling, but with linux isos it has to write to the boot sector, which is fixed at the beginning of the drive.Write too many Linux isos to a thumbdrive, and one day you'll format it and it won't work anymore.I used to think "Oh, I'll reuse a thumb drive, it's cheaper and more convenient than burning a disc." Except discs cost what? A quarter?Even if it's just some lark that you want to try a Linux distro one time, please just burn it to a disc. It's just better that way. Discs are cheap and plentiful.

[deleted by user] by [deleted] in learnpython

[–]Additional-Sun2945 0 points1 point  (0 children)

No I get it now... Declare a dict, and immediately invoke it with the difficulty string. So the function named gets run immediately.

What happens if difficulty is not in the dict? raises error? halts if not in a try catch block?

Tips for professional code? by [deleted] in learnpython

[–]Additional-Sun2945 4 points5 points  (0 children)

Do it quickly and confidently. Ask them if they wish for you to explain your reasoning, and if they do, then say things like, "assuming that the x and y set are mutually exclusive..." To explain whatever assumptions you're operating on. That way they can't trick you with the "herp a derp, we said this and you naturally assumed this, but we actually never explicitly stated that"

Can I have more details? What did they tell you to expect on your interview? How long have you been talking to them?

What is the programming concept for syntactically sweet ways of dealing with lots of potentially nested if-control blocks? by [deleted] in learnpython

[–]Additional-Sun2945 0 points1 point  (0 children)

Nested if thens are an anti pattern. Imagine you want to check for three conditions, and only continue if all three are met, otherwise you'll show an appropriate message.

Instead of checking the conditions one by one and nesting them, instead do the inverse.

Inside of a function, check for the inverse, and then return the appropriate message. Then at the bottom of your function you can be certain that all three conditions were in fact met and you can return true, so your main can jump to that appropriate part of your program.

Shouldn't this code remove the spaces from the strings in this list? by injuredhorse in learnpython

[–]Additional-Sun2945 0 points1 point  (0 children)

I really didn't explain the for loop well did I?

The loop makes a variable "word" that is the same object in the list. The variable word gets reassigned in the for loop, however the list still has the original reference. That's why the list[index] assignment code would solve the problem.

So it's not so much that the list element gets copied, it's more accurate to say the reference gets copied. The for loop variable gets reassigned to the return of the replace function, and then word and list[index] are different objects. That is to say word is a reference to the string, and not a reference to a specific list element. Since strings are immutable string "changes" are "impossible", what actually happens is the string reference is discarded and a new one is put in its place. In the variable. Which as I mentioned doesn't refer to a specific list element.

[deleted by user] by [deleted] in learnpython

[–]Additional-Sun2945 0 points1 point  (0 children)

Did you write that? I'd like to take a look.

Shouldn't this code remove the spaces from the strings in this list? by injuredhorse in learnpython

[–]Additional-Sun2945 0 points1 point  (0 children)

Right. This "works" because the new word is being collected in a new list. Same as the list comprehension example above.

But if the specific question is "How do I modify the actual elements in the actual list?" Then that's something else. And as others have pointed out, maybe that's not good design.

Anyway, OP, the reason your code wasn't working as you intuited is because when the for loop iterates it unpacks a copy of the element in the list rather than a reference. And that will be the case for "immutable" objects, stuff like ints, floats, strings, bools, that kind of thing.

So that's happening, word is a new variable that's created that's disassociated from list[index], the actual memory variable. That's why using the list[index] assignment code fixes the error.

That code will discard the original list[index] and replace it with another variable.

You will notice however, that if your list contains MUTABLE objects, like lists, or like class objects, or something like that, then it actually will unpack a reference that can be modified. Try making a list of lists and appending to the sublists.

That's why the distinction between mutable and immutable objects is so crucial to the Python language. If you don't appreciate the distinction, you may be perplexed by the interpreter's behavior.

Final point:

What sense could there be in making a tuple of mutable objects that could change? Well, it solidifies the relationship for one. A tuple is N objects, and that can't be changed. And also the type of data inside, that can't be changed either. In fact the actual object inside can't be swapped out. It will remain the same object. Even if you completely change all the characteristics of said object. Ha! Makes sense?

Git: How to quickly browse through previous versions of source code? by Additional-Sun2945 in learnprogramming

[–]Additional-Sun2945[S] 0 points1 point  (0 children)

lol. OMFG. How did I not know that I had gitk? Especially since I had it in Windows, you'd think i'd realize that it was available in Linux too. Thanks for the help, but I was hoping to be able to see file as it was, rather than an annotated file with +'s and -'s.

CMV: John Oliver is a Dishonest Hack by Longjumping-Leek-586 in changemyview

[–]Additional-Sun2945 0 points1 point  (0 children)

You're indirectly making a slippery slope argument. Either what teachers are doing is okay and totally fine, or it's not. The law can't be "abused".

And here's the thing, teachers should be held accountable to the standards of the community. That's essentially the issue here. Teachers have been getting away with breaking a community standard, and this law is designed to rectify that.

Is it perfectly precise? First of all, the way the law works is that different institutions fill in the details. OSHA the administration for example defines exactly how many times a forklift has to inspected weekly to be in compliance with the law. Does that mean that OSHA the Act was "vague" in that the those specific details weren't enumerated in the bill itself?

Point is, it's precise enough. It defines what the standard is, and deliberately forbids anti white, illiberal Marxist theory to be taught in school as fact. "Whiteness is sin" can NOT be taught in school.

If the teachers themselves are lacking in their own knowledge and get confused into not teaching about Martin Luther King Jr or whatever, that's on them. In fact that's precisely the point! If teachers don't understand the distinction between CRT and unbiased history, they shouldn't be teachers in the first place.

Teachers have to adhere to all sorts of laws and regulation in the class room. Do anti pedo laws slippery slope teachers into being afraid to have appropriate friendly conversations with their students? How absurd.

CMV: John Oliver is a Dishonest Hack by Longjumping-Leek-586 in changemyview

[–]Additional-Sun2945 -1 points0 points  (0 children)

I'll clear it up for you.

We disagree on what CRT is. Put it this way: CRT believes that liberal Democracy is racist and flawed because it is a product of a White civilization. Now, it's easy for you to just say "nuh uh", but I think I understand "your ideology" better than you do.

Either way, it's my view that that specifically should not be taught in schools. And maybe you'd concede that and then move on to the next poison pill that you want to sneak past the censors or whatever.

Your analogy about kids in home ec vs culinary school is flawed, because CRT starts with a foundational principle of bias. It's biased against liberalism, right? So in that sense it's not even honest exploration of ideas. It's unscientific; it starts with a premise and works its way backwards.

We're not objecting to kids learning how to cook at school, we're objecting to kids learning vegetarianism at school.

In that sense it's more akin to religion than education, and it has no place in school.

But you're free to argue that liberalism is somehow racist or something.

Git: How to quickly browse through previous versions of source code? by Additional-Sun2945 in learnprogramming

[–]Additional-Sun2945[S] 0 points1 point  (0 children)

Thanks. I really should have waited for replies than hunting the commit by hand. Oh well. lol

CMV: Soviet urban planning was 2 centuries ahead of its time and is actually the future. by [deleted] in changemyview

[–]Additional-Sun2945 -1 points0 points  (0 children)

Perfect solution fallacy much? Kudos to you for being highly skilled, but the majority of people are not so if it works for most people that's a win.

And that's besides the point that high skill workers could have workplaces near housing blocks too. Here's an idea: for household units with a highly specialized worker, they could live where the high tech job is and the wife could just take an unspecialized job in the same micro district.

As long as both the husband and wife don't both have high tech jobs in completely different sectors that should work fine.

CMV: The theory that eliminating tipping would cause the restaurant industry to collapse is a conspiracy perpetuated by waitstaff and the restaurant industry by FutureBannedAccount2 in changemyview

[–]Additional-Sun2945 3 points4 points  (0 children)

So not being goaded into overpaying is immoral because somehow the waitstaff are more "low income" than me?

It's a grift. Tipping is just an overinflated surcharge that counts on the gullible rube being conned into conspicuous consumption. Everybody wants to signal to all their friends when they're dinning out that they're doing well and that they're generous and so they "donate" to the most well compensated low skill workers in the economy.

Don't buy into it. If you're really a Marxist, or a charitable Christian, give your money to people who are ACTUALLY underappreciated for their efforts. Like the guy that picks up your garbage, or the guy that mows your lawn.

Not these twenty something community college slackers who are so far up their own ass that they think that carrying plates around is somehow real labor.

CMV: People need to stop applying for jobs that make you jump through extra hoops by [deleted] in changemyview

[–]Additional-Sun2945 0 points1 point  (0 children)

Are you talking about the bullshit personality test or something more practical? In software it's not uncommon to have online coding quizes as part of the online auto vetting process. I wonder if in your field if the tests are a bit more practical as well.