True or false: "parameter names and argument names must be the same"?
Play with the following examples: changing the names of the parameters and the arguments.
As always, try to have a hypothesis for what will happen before you make a change.
| /notes.txt | |
| # DevOps Notes – if you find this, I've gone feral | |
| --- | |
| 🟢 **Day 1: Vision** | |
| Clean setup. One instance. Node backend. | |
| "Firehose" service captures ride events and pushes them to Postgres. | |
| Event types: 'pickup', 'dropoff', 'cancelled', 'requested', maybe more. |
| ```python annotate | |
| # Import the PyTorch neural network module, which provides base classes and building blocks for neural network architectures. | |
| import torch.nn as nn | |
| # `torch` is needed for tensor operations, such as matmul and tensor reshaping, used later in the code. | |
| import torch | |
| # `F` is used for functional operations like softmax. | |
| import torch.nn.functional as F |
| "[{\"id\":\"f2722cbf-c819-4844-81ee-1cc9816d89a2\",\"type\":\"heading\",\"props\":{\"textColor\":\"default\",\"backgroundColor\":\"default\",\"textAlignment\":\"left\",\"level\":1},\"content\":[{\"type\":\"text\",\"text\":\"Event-Driven Systems\",\"styles\":{}}],\"children\":[]},{\"id\":\"c8f5a658-5e3a-42dc-8d41-6efcc3794909\",\"type\":\"paragraph\",\"props\":{\"textColor\":\"default\",\"backgroundColor\":\"default\",\"textAlignment\":\"left\"},\"content\":[{\"type\":\"text\",\"text\":\"The most advanced scaled systems in the world are \",\"styles\":{}},{\"type\":\"text\",\"text\":\"Event-Driven systems\",\"styles\":{\"bold\":true}},{\"type\":\"text\",\"text\":\".\",\"styles\":{}}],\"children\":[]},{\"id\":\"1fe99a7c-966f-4c32-ab0d-f1e8795eece5\",\"type\":\"paragraph\",\"props\":{\"textColor\":\"default\",\"backgroundColor\":\"default\",\"textAlignment\":\"left\"},\"content\":[{\"type\":\"text\",\"text\":\"In this article, we'll explore:\",\"styles\":{}}],\"children\":[]},{\"id\":\"092a9214-936a-459f-aa5b-7f7 |
| // An implementation of https://css-tricks.com/the-cleanest-trick-for-autogrowing-textareas/ in React | |
| import React, { useRef } from 'react' | |
| const AutoGrowingTextArea = props => { | |
| const grower = useRef(null); | |
| return( | |
| <div className="AutoGrowingTextArea" ref={grower}> | |
| <textarea |
True or false: "parameter names and argument names must be the same"?
Play with the following examples: changing the names of the parameters and the arguments.
As always, try to have a hypothesis for what will happen before you make a change.
| class Todo | |
| def initialize(items) | |
| @items = items | |
| end | |
| def print | |
| print @items.join("\n") | |
| end | |
| def print_selected(index) |
| # why do we do this? | |
| # (demonstrate working with the object and how nice it is) | |
| # (then talk about the idea of different "layers" in software and how we want each "layer" to be self-contained: Ruby in the MVC!) | |
| def self.create(url:, title:) | |
| return false unless is_url?(url) | |
| if ENV['ENVIRONMENT'] == 'test' | |
| connection = PG.connect(dbname: 'bookmark_manager_test') | |
| else | |
| connection = PG.connect(dbname: 'bookmark_manager') |
| This is a test Gist. |
Link in
Explanation
New terminology
| def thing | |
| p "I am great" | |
| end |