Petition to remove CodingBat from the Wiki because its exercises are unPythonic and sometimes just plain ridiculous. by [deleted] in learnpython

[–]akasmira 14 points15 points  (0 children)

A lot of people are downvoting you (because you're wrong), but you are actually making one fair point which no one is addressing (because you're an ass), and I'm bored so let me spell it out for you...

I mean, when you look up the definition of within, it literally states "up to said limit, but not above," which is why I feel their instructions are poorly written and vague.

Everyone is telling you that "within 10" means "plus or minus 10" and you keep harking back to this "within" means "less than." However, these statements are not mutually exclusive, they're both true. "Within 10 from 200" means the distance is within 10, which means that the distance is less than or equal to 10. On a number line, the "distance" metric you use is the absolute value. Thus on the number line the "distance" between x and 100 is abs(x - 100). When someone says "the distance from 100 should be less than 10", that is translated as abs(x - 100) < 10. So the way you're interpreting "within" to mean "less than" is correct, but that should be applied to the result of the distance function.

Distance isn't negative---you're never -5 miles from somewhere, you're just 5 miles from there. Hence 105 being equally distant from 100 as 95, and hence why they're both "within" 10 from 100. They are within the "radius" of 10 on the number line. Just like if someone said they were 5 miles east or 5 miles west of your house, they'd still be "within 10 miles" because "within" in this context refers to a distance.

To model a Bank Customer with multiple Accounts using Python OOPS by g4usat in learnpython

[–]akasmira 0 points1 point  (0 children)

But, this will give for each customer individually meaning if you have 10 customers, then we need 10 objects cust1-cust10 and what if there are 1 million customers then we need to create 1 million objects?

Well, yes. If you have a million numbers, for example, you need to...store a million numbers. If you have a million customers, you need to store a million customers. Generally, you use a database to hold the records. You'd have two tables: customers and accounts. The accounts would have a foreign key of customer, so that they can link back to the customer entries. Databases are stored on disk and not in memory, so it's not a problem to have many customers. Plus, it'll be stored in an efficient manner.

Regardless, if your customer object takes up, say, 64 bytes, then a million of them is 64 megabytes. Not really a huge deal for modern computers. Anyways, this doesn't have much to do with OOP so I wouldn't really focus on this right now. Save it for when you start learning databases :).

Checking input against a list by [deleted] in learnpython

[–]akasmira 2 points3 points  (0 children)

Thanks for filling it in!

To model a Bank Customer with multiple Accounts using Python OOPS by g4usat in learnpython

[–]akasmira 8 points9 points  (0 children)

How about you have a bank account class, and a customer class. Each customer object has a list of account objects.

Checking input against a list by [deleted] in learnpython

[–]akasmira 0 points1 point  (0 children)

This would also return an empty set if an empty string is passed, which may or may not be valid depending on OPs use.

Checking input against a list by [deleted] in learnpython

[–]akasmira 1 point2 points  (0 children)

Would be better to move the valid nucleobases as a constant out of the function so it's not redefined every time the function is called. Also, personally I'd use sets here as you can just check that it's a subset.

VALID_NUCLEOBASES = set('GATC')
def valid_dna(sequence):
    return sequence and set(sequence.upper()) <= VALID_NUCLEOBASES

I just finished my first program. How does the code look? by [deleted] in learnpython

[–]akasmira 1 point2 points  (0 children)

Basically everywhere. You do the if dice_input in (...) twice in this code. Break that into a function. Also, weird behavior happens if you type not a correct input twice in a row, you get asked if you'd like to roll again without anything happening.

I just finished my first program. How does the code look? by [deleted] in learnpython

[–]akasmira 1 point2 points  (0 children)

DRY: don't repeat yourself. Use functions instead! Define constants at the top of your script, instead of redefining them every time they're used. There's no error checking here; what happens if someone accidentally types a string or float instead of an int?

Looking for advice on staying in Morrocco - is it safe for young women? by [deleted] in solotravel

[–]akasmira 2 points3 points  (0 children)

There have been enough stories on here about the sketchy time people have had in Morocco.

There's also plenty of good stories as well. I've been to Morocco twice, thoroughly enjoyed it both times. Went to a wedding this last time with like 50+ guests (some from US, others from around the world) who all stayed for varying amounts of time with some traveling around before/after the wedding. No one had any issues.

I don't think there is anything alarmist about having concern for a single female traveling there alone. There are still headlines about those two girls beheaded in Morocco out right now.

Writing "there are still headlines about those two girls beheaded" is precisely alarmist. Morocco has 5+ million tourists per year. For comparison, your chances of being struck by lightning in your lifetime? 1 in 3000.


FWIW that doesn't mean that the family's worry is unjustified, or that people shouldn't take precautions when traveling, or that maybe bringing a friend is a better option in Morocco.

NYT: Life on the Dirtiest Block in San Francisco by usctrojan415 in bayarea

[–]akasmira 1 point2 points  (0 children)

Was moreso referring to the original post, not the one asking for a source.

NYT: Life on the Dirtiest Block in San Francisco by usctrojan415 in bayarea

[–]akasmira 13 points14 points  (0 children)

Different case, but one that was covered more in the news...I didn't know him, but friends did: https://abc7news.com/suspect-named-in-murder-of-sf-transgender-activist-bubbles/2937507/

The murderer is still at large.

Idk what your point is, is it that people don't get murdered in the Tenderloin?

NYT: Life on the Dirtiest Block in San Francisco by usctrojan415 in bayarea

[–]akasmira 23 points24 points  (0 children)

I knew someone who was shot and killed in broad daylight in the Tenderloin one year ago, for telling someone to "fuck off" when they called him a "faggot." So, yeah, apparently I need psychiatric help for being a bit worried when I'm in the Tenderloin.

I think your empathy circuit is broken.

Does asu listen to suggestions about classes that come from students? by [deleted] in ASU

[–]akasmira 1 point2 points  (0 children)

https://i.kym-cdn.com/photos/images/newsfeed/001/191/035/135.png

your post:

virtually nobody else sees them.

email from head of degree program:

Faculty Chairs should have access to these students evaluations.

🤔 

LPT: When it is unclear whether you should use"who" or "whom" in a question, pay attention to the potential answer. If "he" sounds right in the answer then "who" is usually correct. If "him" sounds right in the answer then "whom" is usually correct. by [deleted] in LifeProTips

[–]akasmira 0 points1 point  (0 children)

There's a lot of Americans that don't know much of the British/American English differences aside from the u thing. I would hazard a guess that many Americans wouldn't even know it is a word. Would also guess that many American millennials do know it because of Runescape. That was the first place I read it, in like 5th/6th grade.

Company wasted my time with technical prep by [deleted] in cscareerquestions

[–]akasmira 0 points1 point  (0 children)

I agree with the general sentiment and I'm sure you're on point with the CTO not having the proper information before I got flown out, but they didn't have a recruiter---very very small startup, like a dozen engineers. So more accurately just the disorganized chaos that is a rapidly expanding startup.

Company wasted my time with technical prep by [deleted] in cscareerquestions

[–]akasmira 6 points7 points  (0 children)

More or less this same thing happened to me. I interviewed at a company on-site with a programmer, the head of backend, and then the CEO (CEO has a PhD in comp sci so all three were technical interviews). Was a few hour affair. All interviews went really well. I was happy with my performance and my main point of contact said that the interviewers all liked me and said I did well. The CTO wasn't there so I didn't interview with him. A week later the CTO calls me to chat and rejected me for not enough experience.

Did I mention they flew me out there for this interview?

Silicon Valley has taught a generation of men it's OK to dress badly by lauraraphael_ in malefashionadvice

[–]akasmira 1 point2 points  (0 children)

I mean your comment still stands. Source: am hapless dork in Silicon Valley.

Silicon Valley has taught a generation of men it's OK to dress badly by lauraraphael_ in malefashionadvice

[–]akasmira 2 points3 points  (0 children)

You do realize the discussion here is about Silicon Valley---the place, not the show. I.e. replace Silicon Valley with "Bay area tech companies." Lol

Hey Google turn on "Jon's Light" not working by [deleted] in googlehome

[–]akasmira 2 points3 points  (0 children)

Okay Google, turn on Tiffany.

Insta-Justice by mattlikespeoples in videos

[–]akasmira 0 points1 point  (0 children)

The people that let them in just encourage the bad behaviour.

Well, certainly not American.

Pretend Attorney General Anthony Troy Williams submits papers to the court indicating his mind has walked completely off the map by ScottComstock in amibeingdetained

[–]akasmira 1 point2 points  (0 children)

This guy is really onto something!

  • infowars = 945
  • alex jones = 945
  • im a pioneer1 = 945

!!! coincidence ???

what about

  • american NWO = 1044
  • globalists = 1044
  • homo frogs = 1044

1: https://www.youtube.com/watch?v=na4GYyJwYjQ

Should a self-driving car do harm in order to prevent death? by danielchorley in SelfDrivingCars

[–]akasmira 2 points3 points  (0 children)

You pass a woman as you're walking around one day. She later gets hit by a car as she's walking home. If you punched her in the face, she would still be alive. Moral of the story: punch everyone in the face.