All content herein Copyright © Dev Bootcamp. All rights reservered. Don't repurpose any of this without permission from Dev Bootcamp. Yadda yadda.
class GuessingGame | |
def initialize(answer) | |
@answer = answer | |
end | |
def guess(g) | |
if @answer < g | |
return :high |
I'm Jesse, one of the co-founders of Dev Bootcamp, and the acting curricular editor-in-chief. We get lots of questions about how Dev Bootcamp approaches teaching, what our curriculum is like, and how it differs from other schools and competitors. I thought I'd share some of that with you, starting with a brief overview of our theory of learning and then sharing our introduction to ActiveRecord.
This will be light on theory and heavy on ActiveRecord, so if you're not familiar with SQL or Ruby it might be hard to follow. Mea culpa.
At Dev Bootcamp, we believe that "modeling" is central to learning. The most effective students have a clear model of how the world works and are able to quickly integrate new information int
+----+------------+-----------+--------+------------+---------------------------------+-----------------------+ | |
| id | first_name | last_name | gender | birthday | email | phone | | |
+----+------------+-----------+--------+------------+---------------------------------+-----------------------+ | |
| 1 | Nikolas | Friesen | female | 1998-12-24 | [email protected] | 449.897.7415 | | |
| 2 | Randi | Halvorson | male | 1997-01-29 | [email protected] | (697)436-2633 | | |
| 3 | Sally | Buckridge | male | 1997-10-30 | [email protected] | 1-351-672-6358 x02502 | | |
| 4 | Morris | Swift | male | 1995-06-27 | [email protected] | (600)142-5639 x9380 | | |
| 5 | Sidney | Ortiz | male | 1997-04-04 | [email protected] | 554.170.3265 | | |
| 6 | Reid | Skiles | male | 1994-10-13 | [email protected] | (543)511-2123 | | |
| 7 | Violet |
(2012-05-01 15:43) [ ] This is a todo item created on May 1st, 2012 at 3:43PM | |
(2012-05-02 09:10) [X] This is a completed todo item created on May 2nd, 2012 at 9:10AM | |
(2012-05-03 10:00) [X] Buy groceries | |
(2012-01-01 00:01) [ ] Make better New Years' resolutions |
Many programming languages, including Ruby, have native boolean (true and false) data types. In Ruby they're called true
and false
. In Python, for example, they're written as True
and False
. But oftentimes we want to use a non-boolean value (integers, strings, arrays, etc.) in a boolean context (if statement, &&, ||, etc.).
This outlines how this works in Ruby, with some basic examples from Python and JavaScript, too. The idea is much more general than any of these specific languages, though. It's really a question of how the people designing a programming language wants booleans and conditionals to work.
If you want to use or share this material, please see the license file, below.
# In Ruby everything is an object, including classes. | |
# That means class methods are instance methods of some object. | |
# But what object? | |
class Object | |
def eigenclass | |
class << self | |
self | |
end | |
end |
ioreg -n "BNBMouseDevice" | grep -i "batterypercent" | sed 's/[^0-9]//g' |
# Get rid of /private ugh | |
if [[ $PWD =~ ^/private ]];then | |
cd ${PWD#*/private} | |
fi |