# Eternity Async Tutoring

**URL:** <https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932>\
**Category:** Tutoring\
**Created:** [April 17, 2024, 11:22pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932 "2024-04-17T23:22:52Z")\
**Posts on this page:** 20\
**Page:** 39

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [January 22, 2025, 3:45pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/762 "2025-01-22T15:45:37Z")

</div>

OK let’s try something else first.

Can you make a loop which just prints out the 4 suits?

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [January 22, 2025, 3:57pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/763 "2025-01-22T15:57:30Z")

</div>

Reminder to do some writing on most days and share something at least every 2 weeks.

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [January 22, 2025, 8:20pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/764 "2025-01-22T20:20:14Z")

</div>

> [@Elliot](#):
>
> Can you make a loop which just prints out the 4 suits?

Like this?:

```auto
0.upto(4) do |i|
    puts "S"
    puts "H"
    puts "C"
    puts "D"
end

```

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [January 22, 2025, 8:26pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/765 "2025-01-22T20:26:29Z")

</div>

> [@Elliot](#):
>
> Reminder to do some writing on most days and share something at least every 2 weeks.

I forget if I shared for last month: I did 23 out of 31 days in December. I’ve journaled and done around ~15 minutes of writing every day so far in January. I will share something soon.

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [January 22, 2025, 8:27pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/766 "2025-01-22T20:27:36Z")

</div>

each time it goes through the loop, it should print one suit, until all 4 are printed.

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [January 29, 2025, 4:29am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/767 "2025-01-29T04:29:11Z")

</div>

> [@Elliot](#):
>
> each time it goes through the loop, it should print one suit, until all 4 are printed.

```auto
suits = ["S","H","C","D"]

0.upto(4) do |n|
	puts suits[n]
end

```

* * *

When trying to look up stuff I keep going to this guys videos on ruby:

> **[Giraffe Academy](https://www.youtube.com/@GiraffeAcademy)**
>
> Giraffe Academy is a cool place to learn and hang out!

He has a ruby playlist:  
https://www.youtube.com/embed/CIe1DxrSrhs?feature=oembed&wmode=opaque&list=PLLAZ4kZ9dFpO90iMas70Tt4_wYjhLGkya

I’m thinking of going through the videos in between my answers and sharing my notes and thoughts on the stuff. Sound fine?

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [January 29, 2025, 4:49am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/768 "2025-01-29T04:49:51Z")

</div>

Some writing:

I’ve thought about this before but I don’t know if I’ve shared it here before.

I think companies are a bit misguided when it comes to offering better benefits or pay to increase employee satisfaction. From my experience I think people would rather have a better working environment in a trade off for less pay. They would never openly say that and I don’t think anyone would admit it (hmm. admits a strong word. idk.), but I think they would be happier with less pay. I say this because after talking to friends with other jobs (and family) and looking at Starbucks own benefits policy. I do think Starbucks is quite a generous employer for the level of work I’m doing. Free college, lots of leave opportunities for issues in someones life, sick time, vacation time, abortion help (I forget details but if you can’t legally abort in your area they will help pay you for to travel somewhere for an abortion, idk if they help pay for the abortion too), etc. Starbucks is quite generous with its benefits and they keep expanding it. Yet people want more. Starbucks are unionizing because they believe they aren’t getting what they deserve. I don’t know how to comment on the economics of the issue but I think most of those workers think that because for most Starbucks _it sucks working there_. I think the thought process goes: working is shit, so I deserve enough pay until working no longer feels like shit.

Yeah I think thats a good way of putting it: people think with enough money, a crappy working situation can be made tolerable. I disagree. As an example: doctors. Doctors, generally, make six figures. Thats the kind of money a lot of people say they would do anything for. I’ve seen jokes online where people will see a clearly bad job that pays well and they say stuff like, “for that kind of pay you’ll see me there 4 hours early, worshipping the boss”. Yet the doctors who are making that kind of money are burning out at a high number. An article: [https://www.ama-assn.org/practice-management/physician-health/measuring-and-addressing-physician-burnout](https://www.ama-assn.org/practice-management/physician-health/measuring-and-addressing-physician-burnout) . I haven’t looked through the article fully but one of the headlines read “Physician burnout rates drop below 50% for first time in 4 years”. So for the past four years, people making six figures have been burning out at a rate higher than 50%. Thats bad.

Now I do think people who really need the money can tolerate bad working conditions. However, I think for people who are in ok financial situations/perceive themselves in an ok situation (even if they are not) can’t be made to tolerate a job with better pay. They don’t necessarily need the money, so more money doesn’t make their crappy day-to-day tolerable. I think Starbucks and other companies would be better off treating their workers better and making the day to day job much better in order to keep happy employees.

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [January 29, 2025, 5:45am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/769 "2025-01-29T05:45:06Z")

</div>

> [@Eternity](#):
>
> I’m thinking of going through the videos in between my answers and sharing my notes and thoughts on the stuff. Sound fine?

yes

> [@Eternity](#):
>
> ```auto
> suits = ["S","H","C","D"]
> 
> 0.upto(4) do |n|
> puts suits[n]
> end
> 
> ```

That works (although you looped 5 times not 4). There are nicer ways to do it. One of the most common loops in Ruby loops through an array. Can you find that in the array documentation?

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [January 29, 2025, 3:39pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/770 "2025-01-29T15:39:38Z")

</div>

I haven’t tried it myself but I’ve heard a couple positive things about The Odin Project, so FYI:

> **[Ruby | The Odin Project](https://www.theodinproject.com/paths/full-stack-ruby-on-rails/courses/ruby)**
>
> The Odin Project empowers aspiring web developers to learn together for free

There also exist books like:

> **[Programming Ruby 3.3 (5th Edition)](https://pragprog.com/titles/ruby5/programming-ruby-3-3-5th-edition/)**
>
> Programming Ruby is the most complete book on Ruby, covering both the language itself and the standard library as well as commonly used third-party tools.

(Long ago, I used a much older version of that book. It was fine. Nothing exceptional, but totally decent.)

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [January 29, 2025, 4:04pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/771 "2025-01-29T16:04:22Z")

</div>

> [@Eternity](#):
>
> I think companies are a bit misguided when it comes to offering better benefits or pay to increase employee satisfaction. From my experience I think people would rather have a better working environment in a trade off for less pay. They would never openly say that and I don’t think anyone would admit it (hmm. admits a strong word. idk.), but I think they would be happier with less pay.

People admit this on programming forums like [https://www.reddit.com/r/cscareerquestions/](https://www.reddit.com/r/cscareerquestions/)

People will ask which job to take between multiple options and be told that remote work (and some other things, such as getting away from an awful manager) is worth it for less pay. These are jobs where the lower paying option still pays well, so it’s an easier tradeoff to accept.

One of the reasons employers don’t try to offer a better working environment instead of less pay is that they don’t know how to reliably offer reasonable managers, coworkers and company policies. They’re bad at that.

> [@Eternity](#):
>
> Yet people want more. Starbucks are unionizing because they believe they aren’t getting what they deserve.

My first guess is that’s because they want more cash pay because a few specific things are now way too expensive in the US, particularly rent or buying a house.

> [@Eternity](#):
>
> I think most of those workers think that because for most Starbucks _it sucks working there_. I think the thought process goes: working is shit, so I deserve enough pay until working no longer feels like shit.

I suspect that rent and house prices (and a few other things) feel really bad to them even though they have a job, and that feels unfair and makes their life hard. Even if work was nicer, they’d still have big problems with their finances.

> [@Eternity](#):
>
> Yeah I think thats a good way of putting it: people think with enough money, a crappy working situation can be made tolerable. I disagree. As an example: doctors.

Working conditions in the medical system can be pretty bad yeah, but I think it may often be better for doctors than working for Amazon for much lower pay… And people do manage to have all kinds of problems even if they have plenty of money for housing, but I do think that overall the people struggling to pay rent despite working a job are significantly more sympathetic than the people making $100k+.

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [February 2, 2025, 7:23pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/772 "2025-02-02T19:23:11Z")

</div>

> [@Elliot](#):
>
> That works (although you looped 5 times not 4). There are nicer ways to do it. One of the most common loops in Ruby loops through an array. Can you find that in the array documentation?

This?:

```auto
suits = ["S","C","D","H"]

suits.each do |a| puts a
end

```

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [February 2, 2025, 7:24pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/773 "2025-02-02T19:24:38Z")

</div>

yes

so with one loop for the suits, and one for the numbers, can you use both to make all the cards?

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [February 2, 2025, 7:35pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/774 "2025-02-02T19:35:24Z")

</div>

> [@Elliot](#):
>
> One of the reasons employers don’t try to offer a better working environment instead of less pay is that they don’t know how to reliably offer reasonable managers, coworkers and company policies. They’re bad at that.

Thats true. I’ve started thinking, partially inspired by your [Capitalism Means Policing Big Companies · Elliot Temple](https://www.elliottemple.com/essays/capitalism-means-policing-big-companies) essay, that its also kind of impossible for a big company to be good all the time. Their just aren’t enough good people you can reasonably find and hire at such a massive scale.

> [@Elliot](#):
>
> My first guess is that’s because they want more cash pay because a few specific things are now way too expensive in the US, particularly rent or buying a house.

> [@Elliot](#):
>
> I suspect that rent and house prices (and a few other things) feel really bad to them even though they have a job, and that feels unfair and makes their life hard. Even if work was nicer, they’d still have big problems with their finances.

I think thats partially true. I do think peoples money issues play a big part in it. All I can go off of is anecdotal stuff. To me it just seems like the same coworkers who have money issues but are ok with their jobs (usually at the slower Starbucks with a chill manager) don’t really hate their jobs and don’t get frustrated at Starbucks for not paying them more. They would like more pay because it would help them more and because they feel Starbucks can afford to pay them more (maybe they can. maybe they can’t idk).

> [@Elliot](#):
>
> Working conditions in the medical system can be pretty bad yeah, but I think it may often be better for doctors than working for Amazon for much lower pay… And people do manage to have all kinds of problems even if they have plenty of money for housing, but I do think that overall the people struggling to pay rent despite working a job are significantly more sympathetic than the people making $100k+.

Mmm. Yeah I do think overall it probably is better for doctors working in the medical industry then at Amazon or something. I do think the people struggling to pay rent are more sympathetic. My point with the doctors was just to show that their are people who make a lot of money who are quitting at record rates due to the working conditions. I think most people would say they could handle the working environment of medicine for that pay. I think thats true until someone feels like their finances feel better sorted out.

I do think more people would quit Amazon then medicine if they could afford to.

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [February 3, 2025, 12:41am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/775 "2025-02-03T00:41:04Z")

</div>

Do you see how the `each` loop is better? It’s a little shorter and more importantly you don’t have to deal with managing numbers. Unless you actually need loop numbers and math for some reason, it’s better to avoid them, because they’re a source of potential bugs and extra complexity. (btw there is an `each_with_index` version of `each` that provides loop numbers)

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [February 7, 2025, 3:44am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/776 "2025-02-07T03:44:24Z")

</div>

> [@Elliot](#):
>
> so with one loop for the suits, and one for the numbers, can you use both to make all the cards?

I did it with 52 cards in mind. I forgot that we switched to focusing on just the 32(?) cards or so. Here:

```auto

cards = 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

```

> [@Elliot](#):
>
> Do you see how the `each` loop is better? It’s a little shorter and more importantly you don’t have to deal with managing numbers. Unless you actually need loop numbers and math for some reason, it’s better to avoid them, because they’re a source of potential bugs and extra complexity.

I think so? I do see how using numbers when I don’t need to is adding complexity. I did like how I could go through a set of values in an array instead of having to do stuff like converting from numbers to strings.

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [February 7, 2025, 3:50am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/777 "2025-02-07T03:50:54Z")

</div>

Great.

FYI, here is a way you could get all the card ranks into one array instead of using two separate loops:

`ranks = ["A"] + (2..9).to_a + ["T","J","Q","K"]`

So next, shuffle the deck and deal 5 cards, then print out your hand of 5 cards on one line.

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [February 7, 2025, 3:52am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/778 "2025-02-07T03:52:23Z")

</div>

For January I wrote 29 out of 31 days.

I have a journal entry for every day of January but for some of those days I journaled after the day (or even a few days later).

A common theme I noticed from looking at some random journal entires was getting up late and taking long to start my day. I would wake up what I felt like was kind of late. Feel “off” as I was getting up late (though even when I’m not getting up late, I feel off if I just “naturally” wake up) and take a while to start doing stuff even though I am more rested.

Actually is this normal? Specifically, feeling “off” when sleeping in? I don’t know how to describe it but if I sleep in even a little bit it is harder for me to follow up with certain goals and stuff. For example, I’ve been trying to eat at home more and out less. However, if I sleep in and start getting ready the temptation to just order food is much harder to control. On the other hand, if I force myself up on an alarm. While I may be tired, I find it easier to follow through with stuff.

Hmm. Maybe having a consistent sleep routine would help? Probably. Just some thoughts.

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [February 7, 2025, 3:56am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/779 "2025-02-07T03:56:26Z")

</div>

Oh yeah. Some notes I took yesterday and today from Giraffe Academy:

video 6:  
https://www.youtube.com/embed/4mWc6Q9shcQ?feature=oembed&wmode=opaque&list=PLLAZ4kZ9dFpO90iMas70Tt4_wYjhLGkya

video 6 was on variables:

- In ruby, and assuming programming in general, you will be dealing with a lot of data.
  - Variables are containers for data.
  - You use variables to access a piece of data and you can do stuff to that piece of data by doing stuff to that variable.
  - Whenever we create a variable we need to give ruby some information:
    - the container (variable) needs a name, you should give it a name that helps you in using it
    - separate stuff with an underscore \_\_

  - so you can do `puts "some string" + a_variable_that_contains_a_string` for example:
    - `character_name = "Luffy" character_age = "20" puts character_name + " is " + character_age`

  - he says i need a parentheses to do this but it works without

- you can update the values of a variable as it goes through a program

In the video he mentions to do the above with puts I need to do it with parentheses. It seems to work without. Is that an old thing for Ruby?

video 7:  
https://www.youtube.com/embed/rjLB_bD3SLU?feature=oembed&wmode=opaque&list=PLLAZ4kZ9dFpO90iMas70Tt4_wYjhLGkya  
video 7 was on data types:

- strings = plain text
  - integers = whole numbers
  - floating point number = decimals
  - boolean = true, false, seems like you would just write the words “true” or “false” to establish this data type
  - nil = no value
  - the above are the primary types of data that a beginner will use but their are other types

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [February 7, 2025, 4:27am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/780 "2025-02-07T04:27:40Z")

</div>

> [@Elliot](#):
>
> So next, shuffle the deck and deal 5 cards, then print out your hand of 5 cards on one line.

This fine?:

```auto
cards = Array.new
hand = 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[0..4]

deck.slice!(0..4)

print hand

```

Hmm. The array doesn’t look as nice. I’m also unsure if I should’ve made the hand an array.

![image](https://discuss.criticalfallibilism.com/uploads/default/original/2X/b/b175dfb32a84345014bcffec42eec46663b30ee7.png)

Oh yeah. I started using [RubyMine](https://www.jetbrains.com/ruby/). Giraffe academy recommended to use an IDE. I googled some and saw that recommended quite a bit. I get it for free due to my college email and it seemed neat. Is that fine?

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [February 7, 2025, 4:18pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/781 "2025-02-07T16:18:39Z")

</div>

> [@Eternity](#):
>
> `deck.slice!(0..4)`

What’s the return value for this?

> [@Eternity](#):
>
> Oh yeah. I started using [RubyMine](https://www.jetbrains.com/ruby/). Giraffe academy recommended to use an IDE. I googled some and saw that recommended quite a bit. I get it for free due to my college email and it seemed neat. Is that fine?

Yes but I don’t think one should be too reliant on it.

It’s fine to use the IDE to do something you don’t fully understand, just like you might copy/paste some code and get it working while only understanding parts of it. But you should pay some attention to what things keep coming up repeatedly and learn how they work at some point, not keep using them without understanding indefinitely. This generally isn’t a big concern for beginners but becomes a larger concern as you try to advance further.

[Previous page](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932.md?page=38)

[Next page](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932.md?page=40)
