20-01-2022
Kitty Config Additions
I need to save time cd through directories, so use this instead
lines 207 and 208
map ctrl+shift+alt+enter new_window_with_cwd
map ctrl+shift+super+enter new_tab_with_cwd
nice :smile:
Vim NERDTree tabs
-
t from the tree opens a tab
-
command mode: gt moves forward a tab
-
command mode: gT moves back a tab
Today's Focus / Goal
- Give positive critical feedback in the pairing
- Be honest, considerate, and gentle
- How are they feeling in general?
- How do you feel that went?
- Is it okay if I give you some feedback?
- Be honest - be considerate - put myself in their shoes
Focus 2 RSpec expect().to
- Understand RSpecs expect{}.to syntax
- Read the documentation/blogs/posts, understand it; Use it in a test.
- Make the test pass. I feel uncomfortable with it - I will feel comfortable with it.
Focus 3 navigate vim NERDTree
- navigate vim NERDTree better
- multiple tabs please!
- I will be navigating through multiple NERDTree tabs, instead of closing, navigating, and opening
Focus 4 remember and understand PRNG
- Focus/How: Recall PRNG acronym, understand how it works
- Measure: Write at the bottom of the sheet
Formalise
-
To improve giving feedback to others
-
Give positive critical feedback to my pair; do they want feedback? Be considerate and kind - put myself in their shoes.
-
Ask my pair how they felt about the feedback - how might I have better approached giving you positive critical feedback?
Organise Bookmarks and Declutter the insanity
- Bookmarks by subject
done! :smile:
Learning Objectives for Debugging
https://github.com/makersacademy/skills-workshops/tree/main/test_driven_development/debugging_card_game#readme
- Explain what a bug is
- Unintentional or unexpected behaviour
- Explain a good approach to debugging
- What is the error message?
- Have you followed through the directly related methods and variables within their scope(s), that you can follow the objects and messages explicitly and with absolute certainty?
-
Follow an effective debugging process to identify a bug
-
Follow an effective debugging process to fix the bug
Debugging
RSpec message
Error 1 expected 4 clubs, got king clubs used deck.draw to assert this
- honestly, I'm confused.
- the deck.pop method returns from an array the last item.
- the last item in the array is 'king clubs'.
- why isnt it doing this?
- ...
- It's p time.
Useful Tactics
Recreating Constant instance variables
&:symbol
words = ['would', 'you', 'like', 'to', 'play', 'a', 'game']
# this...
words.map &:length
# ...is equivalent to this
words.map { |w| w.length }
when & is added to the beginning of a method argument in Ruby, it calls to_proc on its operand and passes it in as a block.
a to_proc method can be added to any object, including a Symbol. hence the shortcut, &:symbol
Methods I learned today
Object.freeze
This method "freezes" an object any attempt to modify this object will throw a runtime error, "FrozenError" There is no way to "unfreeze" a frozen object
Array.shuffle (returns a new array object)
Array.shuffle! (returns the original array object)
OptionalArg (random: Random)
Array.shuffle(random: Random.new(1))
Array.shuffle returns a new array, with element locations randomized
If a 'random' argument is given, it will be used as the RNG
Array.shuffle! will return the original array, with element locations randomized
Ruby, Random
An interface for the psuedo random-number generator (PRNG)
PRNG represents a deterministic sequence of bits which approximate true randomness. Can be represented as (integers, floats, or binary strings)
Random PRNG can be initialised with a system-generated value ( so, just calling Random? ) or a used-supplied seed value using ::srand
The class method #rand provides the base funcionality of Kernel#rand, AND better handles floating point values. These are both interfaces to the Ruby PRNG. ( So it calls a method in the OS Kernel? where can I find this? )