This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tic_tac_toe | |
b=[] | |
a=["x", "o", "x", "o", "x", "x", "o", "x", "o"] | |
1.upto(10) do | |
tic_tac_toe = a.sample(9) | |
p board_grid = Array.new(3) { tic_tac_toe.shift(3) } | |
end | |
end | |
p tic_tac_toe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css"> | |
<link rel="stylesheet" href="main.css"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900"> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css"> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Last login: Mon Jul 8 14:09:11 on ttys000 | |
apprentice@dbc07 ~ $ cat << EOF > ~/.sqliterc | |
> .headers on | |
> .mode column | |
> EOF | |
apprentice@dbc07 ~ $ sqlite3 dummy.rb | |
-- Loading resources from /Users/apprentice/.sqliterc | |
SQLite version 3.7.15.1 2012-12-19 20:39:10 | |
Enter ".help" for instructions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://min.us/lbuwvg67CwwHkU | |
<?xml version="1.0" encoding="utf-8" ?> | |
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ --> | |
<!-- Active URL: http://socrates.devbootcamp.com/sql.html --> | |
<sql> | |
<datatypes db="mysql"> | |
<group label="Numeric" color="rgb(238,238,170)"> | |
<type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/> | |
<type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Functions | |
def drive | |
@status = :driving | |
end | |
def needs_gas? | |
return [true,true,false].sample | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lanny Bassham, a World Champion and Olympic Gold Medalist rifleman, wrote a pretty good book on performing at a high level, called With Winning in Mind. | |
In it, he recommends keeping a performance journal for each of your practice sessions. | |
A perforamnce journal is: | |
A way to measure and record your progress | |
First, because you cannot manage what you do not measure. | |
Second, because without one you are wasting a lot of time because without if you dont know what is going onw ith your performance. | |
I believe that the primary benefit of a performance journal is to build Self-Image. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flow control# uncomment each of the following comments individually | |
# to see how break, next, and return affect loop control flow. | |
def looper | |
i = 0 | |
while i < 20 | |
i += 1 | |
break if i == 9 #"Print out to the screen 1..8 than done with loop followed by HA" | |
# next if i.even? # "Prints out to the screen odd number between 1..19 than HA! then prints DONE!" | |
# return if i == 9 # "Print out to the screen 1..8 than done with loop followed by HA" The same as line 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tic_tac_toe | |
a=["x", "o", "x", "o", "x", "x", "o", "x", "o"] | |
1.upto(10) do | |
tic_tac_toe = a.sample(9) | |
p board_grid = Array.new(3) { tic_tac_toe.shift(3) } | |
end | |
end | |
p tic_tac_toe | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Car | |
@@WHEELS = 4 | |
def initialize(args) | |
@color = args[:color] | |
@wheels = @@WHEELS | |
end | |
def drive | |
@status = :driving | |
end | |
def brake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def to_roman(num) | |
words='' | |
romans = { | |
1000=>'M', | |
900=>'CM', | |
500=>'D', | |
400=>'CD', | |
100=>'C', | |
90=>'XC', | |
50=>'L', |