start with a story
- help people relate
- opportunity for some fun
- make it real and relevant
talk about the numbers
- data on the problem
- data on the solution
| <?php | |
| include_once('plugins/pog/objects/class.trend.php'); | |
| include_once('plugins/pog/objects/class.trendhistory.php'); | |
| include_once('plugins/pog/objects/class.database.php'); | |
| include_once('plugins/pog/configuration.php'); | |
| function get_trend_data($hotness, $direction) | |
| { | |
| $t = new Trend(); |
| # Put your answers here! |
| class NumberNotFoundError < ArgumentError; end | |
| def render(points, length) | |
| puts "_" * length | |
| display = " " * length | |
| markers = %w[\\ | /] | |
| points.each_with_index do |p, idx| | |
| display[p] = markers[idx] | |
| end | |
| puts "%#{length + 5}s %3s : %3s : %3s" % [display, *points] |
| class Window | |
| SCALE = 100 | |
| class Collapsed < ArgumentError; end | |
| attr_reader :low, :mid, :high, :max | |
| def set(window) | |
| # p "setting window to #{window}" | |
| @low, @mid, @high = window |
| // to understand any system we must retain either control or visibility (or both) | |
| // this is how you retain visibility | |
| console.log('hello world') | |
| // so now we can give up our need for control :) | |
| // and along the way you'll see new words and language syntax. share your confusion! | |
| // it's the greatest of gifts from a shameless heart and playfully curious mind. |
| # echo is like puts for bash (bash is the program running in your terminal) | |
| echo "Loading ~/.bash_profile a shell script that runs in every new terminal you open" | |
| # $VARIABLE will render before the rest of the command is executed | |
| echo "Logged in as $USER at $(hostname)" | |
| # Load RVM into a shell session *as a function* | |
| [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" | |
| # Path for RVM | |
| test -d $HOME/.rvm/bin && PATH=$PATH:$HOME/.rvm/bin |
| # this file is NOT MEANT TO BE EXECUTED | |
| #----------------------------------------- | |
| # the following notes are related to a short presentation about how to think about programming basics | |
| # the idea is simple: all programming languages basically have 4 common attributes that you can look for when | |
| # you're trying to learn the new language: data, decisions, loops and flow | |
| # the notes here are specific to Ruby but you can basically produce the same thing for any programming language |
The following links were used as references for this talk: SF RoR Meetup: High Performance Learning
A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.
Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer.
In that case, the programmer isn't allowed to say x = true; that would be an invalid program.
The compiler will refuse to compile it, so we can't even run it.