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 break_words(stuff): | |
"""This function will break up words for us.""" | |
words = stuff.split(' ') | |
return words | |
def sort_words(words): | |
"""Sort the words.""" | |
return sorted(words) | |
def print_first_word(words): |
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
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) | |
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import ex25 | |
>>> sentence = "All good things come to those who wait." | |
>>> words = ex25.break_words(sentence) | |
>>> words | |
['All', 'good', 'things', 'come', 'to', 'those', 'who', 'wait.'] | |
>>> sorted_words = ex25.sort_words(words) | |
>>> sorted_words |
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.9.3p125 :001 > require './main' | |
LoadError: cannot load such file -- sinatra | |
from /Users/aosteraa/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' | |
from /Users/aosteraa/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' | |
from /Users/aosteraa/development/sinatra2/main.rb:1:in `<top (required)>' | |
from /Users/aosteraa/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' | |
from /Users/aosteraa/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' | |
from (irb):1 | |
from /Users/aosteraa/.rvm/rubies/ruby-1.9.3-p125/bin/irb:16:in `<main>' |
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
# I don't understand this at all | |
def test_slash_w_is_a_shortcut_for_a_word_character_class | |
# NOTE: This is more like how a programmer might define a word. | |
assert_equal "variable_1", "variable_1 = 42"[/[a-zA-Z0-9_]+/] | |
assert_equal "variable_1", "variable_1 = 42"[/\w+/] | |
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
html { | |
height:100%; | |
} | |
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td,iframe { | |
margin:0; | |
padding:0; | |
} | |
table { border-collapse:collapse; } | |
fieldset,img { border:0; } | |
address,caption,cite,code,dfn,em,strong,th,var { font-style:normal; font-weight:normal; } |
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
function localStorageSupported() { | |
try { | |
return "localStorage" in window && window["localStorage"] !== null; | |
} catch (e) { | |
return false; | |
} | |
} |
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
<?php | |
$name = $_GET['name']; | |
echo 'Welcome to our website, ' . | |
htmlspecialchars($name, ENT_QUOTES, 'UTF-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
require 'spec_helper' | |
describe "Static pages" do | |
let(:base_title) { "Ruby on Rails Tutorial Sample App" } | |
describe "Home page" do | |
it "should have the h1 'Sample App'" do | |
visit '/static_pages/home' |
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
You may have found a problem in PHP. | |
This report can be automatically sent to the PHP QA team at | |
http://qa.php.net/reports and http://news.php.net/php.qa.reports | |
This gives us a better understanding of PHP's behavior. | |
If you don't want to send the report immediately you can choose | |
option "s" to save it. You can then email it to [email protected] later. | |
Do you want to send this report now? [Yns]: Y |
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
Interval Since Last Panic Report: 345546 sec | |
Panics Since Last Report: 1 | |
Anonymous UUID: 7F8B9B54-B6CF-4EAF-9EAE-3722ABBE1022 | |
Sat Jun 23 18:16:15 2012 | |
panic(cpu 0 caller 0xffffff80002c4794): Kernel trap at 0xffffff7f816a7d22, type 14=page fault, registers: | |
CR0: 0x0000000080010033, CR2: 0x000000000000008c, CR3: 0x0000000161d18049, CR4: 0x00000000001606e0 | |
RAX: 0x000000000000007c, RBX: 0xffffff806a5f2000, RCX: 0x00000000ffffffff, RDX: 0xffffff800bddea00 | |
RSP: 0xffffff809296b970, RBP: 0xffffff809296b9b0, RSI: 0xffffff800c997200, RDI: 0xffffff800a3e7a50 | |
R8: 0x000000004f800000, R9: 0xffffff800640fca8, R10: 0xffffff8016aaee50, R11: 0x0008000000137b5f |
OlderNewer