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
#include <iostream> | |
//#include <cctype> | |
#include <string> | |
using std::cout; | |
using std::cin; | |
using std::string; | |
using std::endl; | |
class Soldier; |
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
.DS_Store |
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
/* | |
Some simple Github-like styles, with syntax highlighting CSS via Pygments. | |
*/ | |
body{ | |
font-family: helvetica, arial, freesans, clean, sans-serif; | |
color: #333; | |
background-color: #fff; | |
border: none; | |
line-height: 1.5; | |
margin: 2em 3em; |
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
Consumption affecting the environment | |
Today, overpopulation is a serious issue in the world. To feed everyone, we need to make enough food. To make food, we have to cut down forests to make space for cattle and crops. This causes some species like tigers to become extinct because their habitat has been used by us humans. | |
Also, many people drive cars, which release carbon dioxide. This is a chemical which influences the environment, causing global warming. | |
People use a lot of water; more than they actually need. This means that the groundwater levels are sinking and people are having trouble accessing water. |
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
#!/bin/bash | |
# dotfiles.sh - a tiny script to keep your dotfiles in | |
# sync by using dropbox | |
# this should be the name of the folder where you keep | |
# your dotfiles. | |
dotfiles_folder="$HOME/Dropbox/Dotfiles" | |
# these are the dotfiles to be kept in sync | |
dotfiles="bashrc concyrc hnbrc screenrc gitconfig vimrc ssh/config irssi/config" |
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
# not the most efficient way, | |
# but you get the idea. | |
str = "meow" | |
# convert string to binary | |
bin = str.bytes.map{|d| d.to_s(2)}.map{|b| b.rjust(8, '0')}.join | |
puts bin | |
# and convert it back to a string |
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
1. Can you execute Ruby in the Chrome console? Why / why not? | |
Ruby cannot be executed in the chrome console. I am not exectly sure the technical reasons, but I would guess is that chrome does not have an inheret Ruby envirement to execute the code. This is why we had to create the envirement on our local computers. | |
2. Write some Ruby code that includes a method that fails to work solely because of a scope issue. Think about how Ruby scope differs from Javascript scope. | |
array = [1,2] | |
def add | |
array[0]+array[1] |
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
\begin{tikzpicture}[shorten >=1pt,auto] | |
%\node[state,initial,accepting] (0_A) {$\{0,A\}$}; | |
%\node[state] (1_B) at (2,2) {$\{1,B\}$}; | |
%\node[state,accepting] (4_A) [right of=1_B] {$\{4,A\}$}; | |
%\node[state] (1_C) [below of=0_A] {$\{1,C\}$}; | |
%\node[state,accepting] (2_A) [below of=1_B] {$\{2,A\}$}; | |
%\node[state] (4_B) [below of=4_A] {$\{4,B\}$}; | |
%\node[state] (2_C) [below of=1_C] {$\{2,C\}$}; | |
%\node[state,accepting] (3_C) [below of=2_A] {$\{3,C\}$}; |
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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: GnuPG v1 | |
mI0EVS40twEEAKZa444dPqVWtEEm7rXoYil+E2epwsHJFH21TEUh+EfWD1JWKdhs | |
rJn9+83n+CeSKu+fRAVaR/66CpqQ0SmkUew4tBTXZsm3zZNgxgMVDwzBHzup1ow1 | |
umOIL7oWc4Aw+F5fPaAqHTw3+IBpavc+8wmdmV94nz3mLh5904pKMj67ABEBAAG0 | |
Dmtra2trIDxrQGsua2s+iLgEEwECACIFAlUuNLcCGwMGCwkIBwMCBhUIAgkKCwQW | |
AgMBAh4BAheAAAoJEBreQ20puKF6AdMD/2mAaJJYBRdyZ6eDpldsAenkwVQoxDz8 | |
a68auy9jLEA+jZH/y5pdlNGJ2uTUUdM00rYaV/oIzuxWLF1x7J8/qLD8rZQRKe3d | |
iKY6vq1L44cfmeSo5tN88h050fZCvqY+9sx3s1ubLztX5W8GzeDV0GBaORUulgwk |
OlderNewer