Notes from RubyConf2020 Day 2
Keynote: Kerri Miller
“If you can move it, it isn’t broken”
New item for the bucket list: “The 1000 mile stomachache” roadtrip
Learnings from a cross-country motorcycle trip:
- Ambition
- Failure
- Resilience
- Storytelling
When something bad happens, “at least you get a story out of it”
- True for motorcycle accidents and code
- Be resilient
- Opportunity to learn and help others
- The story you tell yourself about failures is important
Ambitious systems:
- Multidisciplinary
- Large and complicated
- Too large for one team to fully understand
- Success breeds essentiality
- Undefinable end state
- How do you know when you’re done?
- What does success look like?
- Ignore complexity for speed
- All systems without a well-defined end state will bend towards complexity and chaos
Dwarf Fortress example:
- Dev ships new “tavern” feature
- Then bug report comes in: “There’s cat vomit all over my tavern” (??)
- Design bugs can be subtle, easy to miss and make mistakes
Good quotes:
- “Software is the resolution of the argument between the proactive and the pragmatic”
- “The most dangerous thought you can have as a creative person is to think you know what you’re doing” (Bret Victor)
- “Code is inherently incorrect. It’s always in a state of undiscovered failure”
Why are we so resistent to change?
- We want to be right
- Risk being vulnerable
- Damage our professional reputation
- Damage our self-image (“Do I know what I’m doing?”)
Ractor Demonstration (Koichi Sasada)
Ractor is an experimental feature in Ruby 3.0
Ractor is designed to provide a parallel execution feature of Ruby without thread-safety concerns.
Performance:
- Object creation on ractors is slower, needs improvement before GA.
Limited object sharing:
- Most objects are not shared among multiple Ractors
- Avoid synchronization bugs
- However there are immutable objects and “special shared objects”
Communication types:
- In general, message passing on incoming- and outgoing- ports
- Supports push / Actor style communication
- Supports pull / rendezvous style communication
- Send objects via message passing by copy or move
Demos:
- Ractor-based “load balancer”
- Ractor-based worker pool
- Pipeline
Summary:
- Ractor provides parallel execution without thread-safety headaches
- Part of Ruby 3.0
- Ractor API and implementation is not mature
- Ruby 3.0 is the preview release
- Feedback welcome
The Bug That Forced Me to Understand Memory Compaction (Emily Giurleo)
Note: I dropped in late because I already caught an early version of this talk at nyc.rb
Great talk, highly recommend checking out the slides.
This bug hunt story is specific to Ruby gem with C extension.
Takeaways:
- Knowledge sharing is crucial
- You never know when the knowledge you put in the world will help someone out of a huge jam like this one, so just put it out there!
Summary:
- Ruby 2.7 includes manual memory compaction
- When maintaining an existing gem with C extension, maually mark long-lived objects and refs
- Newer C extensions can use new convenience methods for pinning and marking objects
Storytelling and Talent Show
Theme: “A time when technology wasn’t the answer”
“Unexpected side effects of medical advances”
- How 23andMe found his half sister!
- Got pregnant, so they did 23andMe
- Months later, 23andMe emailed him “Hey you have a half sibling” (!!)
- Turns out his dad was a sperm donor back in medical school, but donation bank didn’t track anything. So this was a happy surprise!
- Everyone was understanding and now they’re one bigger happy family
“The Time I Robbed a Bank”
- Takes money out of an ATM, notices account has a lot more money than expected
- Checks again, now account has even more money in it (thousands more!!)
- So they take out a bunch just to see what happens
- Spends all of it on fun night out with friends, buying rounds for the whole bar, etc
- Over the next few months, kept checking, and the money was always in there (didn’t spend much more though)
- Then one day sees account drops to -$25,000 😱
- CitiBank is unresponsive, wants him to pay the money back
- Finally get someone on the phone, no surprise, it was an accident
- CitiBank resolved everything and sent him a check for 1 cent, which is now framed in his living room
“Names are Hard”
- Back in 2015, wants to set up a feminist tech conference
- Recruited some friends, got lots set up, but still didn’t have a name
- Stumped. Couldn’t pick a name, ended up picking the one they disliked the least: “&:conf”
- Problems started immediately
- Google doesn’t recognize ampersands, so unsearchable, zero SEO
- Lots of other sites mishandled the special characters
- No one knew how to pronounce it out loud
- Renamed to “AndConf”
- Then they decided to start a SF Ruby Meetup
- Named it “SF.rb”, which shouldn’t have caused any problems
- EXCEPT they wanted to include the dot in everything, so used “#SFdotRB”, etc. It didn’t go over well
- Renamed to “Fog City Ruby”
- Lesson learned: keep technology out of naming things
“The Hunt for Lean Manufacturing Kanban”
- Yeast rancher!
- Wanted to use kanban board for tracking physical inventory
- Read some LEAN manufacturing books, but hard to find implementation details
- Found a video detailing how a hospital successfully implemented a kanban tracking system, decided to use this as their model
- Couple years later, needed to iterate on kanban system
- Found a bakery example that looked useful, switched to that
- Now EVERYTHING at the facility is kanbaned: coffee, toilet paper, etc
- And life is good! Yay kanban!
“The Magic of Coins”
- Needed to choose college major
- Loved computer science, thinking minor in Education
- But school forced everyone to do broad liberal arts courses first year
- Twist! Fell in love with chemistry
- Now very conflicted, avoided decision til the last minute
- Chemistry professor flipped a coin to decide back in the day, so they recommend to do the same
- Flips coin, it’s computer science 4 times in a row
- Keeps using this technique to the day! Used to choose between industry vs graduate school, let friends borrow it, too
- Chance > technology
Plus original song and poetry performances!
The Minaswan::Interview (Jesse Spevak)
Tech interviewing is broken for candidates:
- Gives example of his interview process at Ibotta
- Cursory HR phone screen
- No salary transparency
- HR has more knowledge than the candidate
- Perpetuates pay disparity
- Takehome project
- Unrelated to actual work
- Many hours of unpaid labor
- Excludes candidates who don’t have or can’t afford the time (for any myriad of completely valid reasons, including childcare)
- On-site whiteboarding challenges
- Often just a trick
- Often relies on familiarity with niche subject matter (CS topics, chess, etc)
- Homogenous interviewers (all white dudes)
- Overall: process is not nice
- Cursory HR phone screen
Tech interviewing is broken for interviewers:
- Purpose is to collect data and make a guess
- If the process works, then you should be able to make a confident recommendation
- Reality: Low data quality + low confidence outcome
- Overall: experience is not nice
But we’re Rubyists. We live by “Matz is nice and so we are nice” (MINISWAN). Why not with our interviews?
The MINISWAN interview:
- Shorter
- Phone screen
- Manager screen
- No take home project
- Presume success
- Use phrases like “when you join our team…”
- Challenges are representative of actual work
- Put interviewee at ease
- Give them signs that you’ve respected them and their time (tell them you’ve read their resume, etc)
- Allow them to use Google and ask questions to panel
- Be intentional about giving positive feedback
- Exploratory challenges
- Designed to allow candidate to demonstrate their thought process and opinions
- Doesn’t presuppose expertise or niche knowledge
Automation Engineering with Serverless Compute (Kevin Lesht)
A masterwork in food puns
What are we solving for?
- Take a photo
- Auto-add it to Tumblr blog ONLY if it’s an omlette
Requirements:
- On photo taken, kick off process to parse image and post if omlette
- Make sure only authorized users can parse + post
“Brick walls are there for a reason. They let us prove how bady we want things” - Randy Pausch
Exploration:
- Google Photos has a REST API available
- Let’s also use a serverless Lambda function
- Google API endpoint requires authentication. How do we OAuth without a browser?
- First request to get token
- Second request to Lambda function
- How to parse? Pre-trained image recognition model vs custom model?
- In this case, we’re going custom
- Construct a solid dataset with lots of variability and robust labeling
- Then train it
- How to patch? Where are we sending these images?
- Lambda function uploads to S3 bucket
Basic flow we have so far:
- Auth with Google
- Fetch photo from phone
- Parse for omlette
- If omlette, post to S3 bucket
- Rebuild site HTML
New plan: reconfigure for batches for photos
- Run Lambda function at regular intervals
- Only pull in photos since last update timestamp
- Use DynamoDB to store last updated timestamp
- Read whenever we kick off job
- Update at end of job
- Collect photo keys from S3
- Break keys into batches for pagination
- Step over each item, update HTML accordingly
Next iteration: can we process photos concurrently?
- At this point, we’re chasing the brick wall :)
- Use event streaming!
- On new photo event, fire off Lambda
- Does this bork HTML rebuilds?
- No! Add another Lambda for the rebuilds
Snack break with Amy Kritzer
https://whatjewwannaeat.com/cardamom-tahini-brownie-in-a-mug/
Ingredients:
- ¼ Cup all-purpose flour (can substitute with gluten-free flour)
- ¼ Cup granulated sugar
- 3 tablespoons cocoa powder
- ⅛ teaspoons Cardamom (can substitute with cinnamon)
- Pinch of salt
- 3 tablespoons milk (can substitute with water)
- 2 tablespoons melted butter (can substitute with any neutral oil (ex. coconut oil))
- 3 teaspoons tahini (can substitute with peanut butter, nut butter, etc.)
- 12 oz microwavable mug
- Optional garnish: ice cream, nuts, powdered sugar, whipped cream, sprinkles
Instructions:
- Mix all ingredients together in mug
- (Optional) Add a swirl of tahini/substitute on top
- Pop in microwave for 30 second intervals
- Your brownie will be firm to the touch on top when it’s done
- Should take 60-90 seconds total
- Let cool, then add garnish of your choice and dig in!
I substituted cinammon and peanut butter and it turned out GREAT. 10/10 would snack again.