Eternity Async Tutoring

Some quick writing to share:

I just realized how much my family has gotten used to our abusive fathers anger. For various health reasons he’s no longer able to be physically abusive for the past ~2 years, due to that me, my brother, and my mom have been able to somewhat live comfortably and just ignore all his yelling and stuff.

I mentioned previously we got in a new family member and it made me realize how comfortable we’ve gotten with a bad situation. He was confused by our capacity to ignore all the stuff and we just told him, “If he isn’t calling for anyone in particular, just ignore him.” I guess its not normal to be able to ignore stuff like this.

He reminds me of this from Atlas Shrugged (his being Mouch a scene around directive 10-289):

His head drawn into his shoulders, he was looking at them with the anger of a man declaring that the country’s troubles were a personal affront to him. So many men seeking favors had been afraid of him that he now acted as if his anger were a solution to everything, as if his anger were omnipotent, as if all he had to do was to get angry. Yet, facing him, the men who sat in a silent semicircle before his desk were uncertain whether the presence of fear in the room was their own emotion or whether the hunched figure behind the desk generated the panic of a cornered rat.

Hmm. I guess the process is something like this: I have power. I get angry and can use that power against you. Appease my anger and I won’t use that power against you. I may even use it for you That sounds about accurate for my father. That sounds about accurate for the stuff I read about abusive men.

Ok. I just looked at the string documentation and just looked for stuff that could work:

these two seem simple:

“5H”.chr and “5H” .chop

Yes. Also "5H"[0]

1 Like

huh. neat. I tried seeing what you’re doing in the documentation, couldn’t find it. I assumed it had something to do with the position of something in a string. Seems I was right?:

so thats neat.

https://ruby-doc.org/3.4.1/String.html#method-i-5B-5D

it might not automatically scroll down but you can find it in the sidebar and click on #[]

1 Like

I made a post about issues related to quoting like @ActiveMind had here:
Curiosity – Specialist Creators with Small Audiences - #13 by ActiveMind.

I and others have made mistakes about this before, so I asked about it on the discourse meta forum: Issues quoting quotes - Support - Discourse Meta

Nothing really helpful tho. Sadge. I don’t know how these forums work maybe someone will see it later and has something, but yeah.

1 Like

I think you’re supposed to put it in the bugs or feature requests section if you want something changed.

1 Like

Yeah I figured. It feels odd to request things. Especially when I’m unsure if its just a me issue here. Seeing how the person who responded seems to be a big discourse user though I guess I should be fine.

So this is what I’ve come up with so far:

def hand_to_ranks(hand)
  ranks=Array.new
  hand[0].each do |n|
    ranks<<n[0]
  end
  puts ranks
end

well the puts part wasn’t necessary i was just checking if i got the right values.

Have you run this code and checked the results? Once you think you’ve got it working, share an example of running it and the output.

I changed it to print instead of puts so its all on one line and I got this:

Run it in IRB using manual input.

Like this?:

or put the whole code in irb ?:

Run it with your own test data in IRB, e.g.:

hand_to_ranks(%w[AH AD 5H 3S 2C])

%w is a shortcut for making arrays of strings with less typing. you can run that part by itself to see what it does.

also, your function is currently outputting nil

I may be doing something wrong, but I just replaced the (hands) part with the the stuff you provided. I got this:


i assume that has something to do with my code mentions the hand array while (%w[AH AD 5H 3S 2C]) does not. . hmm I don’t know what the stuff in the parentheses is for. I know that you can def a function by something like this:

def name
some code
end

#put the name here and it will run the code

hmm i see that. i think thats because i have the print part in my code? i did that to check if the right values got put in rank. lets see.

this seems to work:

def hand_to_ranks(hand)
  ranks=Array.new
  hand[0].each do |n|
    ranks<<n[0]
  end
  ranks
end

image

if I don’t put that ranks at the end the return value i get is just the hand array:


def hand_to_ranks(hand)
  ranks=Array.new
  hand[0].each do |n|
    ranks<<n[0]
  end

end

Your code has a bug and also whatever data you have saved in the hand variable appears to be wrong.

You should test individual parts. Like print out what’s in hand or run these in irb:

testhand = %w[AH AD 5H 3S 2C]
testhand[0]

since the first thing your code does to the hand input is call the [] method with 0 as input.

Before I try anything this is whats in my hand variable:
image
its an array in an array. instead of addressing that i’ve been just calling on hand[0] to get access to the array inside. i assume thats probably causing some of my problems

1 Like

Still haven’t done the stuff you mentioned but this fixed it:

cards = Array.new

deck = Array.new
suits = ["S","C","D","H"]

letters = ["A","T","J","Q","K"]

suits.each do |a|

  2.upto(9) do |n|
  cards << "#{n}#{a}"
  end

  letters.each do |l|
  cards << "#{l}#{a}"
  end

end

deck = cards.shuffle

hand = deck.slice!(0..4)

I had hand originally defined hand as an Array. So at the beginning was hand=Array.new and then I shoved/<< the slice of the deck into the hand array. Seems like the return value of slice of multiple things is an array (from the documentation):


So I was putting an array into an array.

It seems fine now. This is what I get for hand now:

Something I thought of today while at work:

Hmm. I forgot what lead me to think of this at work so I don’t have that to share.

I’ve heard before stuff like “ends justify the means”. I don’t know. I think the means determine the end. I’m not great at coming with examples (Is that a skill that can be worked on? probably) but here’s one:

Lets say you have a murderer on the loose. There’s a house where he locked himself up in. An ends justify the means kind of person could say something like,“Blow up the house.” Or. more absurdly, “Blow up the city.” The reasoning goes: getting rid of a murder justifies whatever we do. It usually feels like people are context-dropping when using this. They just blew up a city and just focus on the fact that a murderer is gone. They ignore all the stuff around that situation. From costs of the explosives, to the other deaths they caused, or, if not deaths, the property damage caused.

Hmm. A similar kind of thing: a cause can have multiple effects. I think this is obvious but I don’t know. Going off of killing some bad guy again. Going through a scenario:
You shoot him in public. Bullet kills him, but the bullet can hit other things. Also people will get scared by hearing/seeing the bullet/shooter. You can think of other methods to kill him or whatever to solve the issue and need to keep him in mind all the effects your cause can have besides the effect you care about.

Some work related stuff:

Apparently when I got hired at Starbucks, I got hired at every Starbucks in the area. This wasn’t’ disclosed to me. The reasoning kinda makes sense? You aren’t hired by “some_location_name” Starbucks. You were hired by corporate Starbucks. You just work at “some_location_name” for convenience.

This issue came up because some coworkers were told to go to another store, in the middle of their shift, to another store to cover a call out. The coworker refused because they didn’t want to drive there and because the store they were going to was known to be quite toxic. The DM “politely” informed them that they are employees of Starbucks and that unless they had a car safety issues they would have to go.

I don’t know if this kind of thing is normal for big corporations. If I get hired by Walmart am I a employee of every corporate Walmart in the US? Idk. I guess so.