This file contains hidden or 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 WordLookup | |
| def run() | |
| lines = File.readlines('words.txt') | |
| File.open('words-with-definitions.txt', 'w') do |output_file| | |
| # assume the only thing on the line is the word | |
| lines.each do |word| |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8" ?> | |
| <!DOCTYPE Foo SYSTEM "sample.dtd"> | |
| <Foo/> |
This file contains hidden or 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
| <?xml version="1.0" encoding="us-ascii"?> | |
| <!ELEMENT Foo ()> |
This file contains hidden or 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
| ree-1.8.7-2011.01 :003 > doc = Nokogiri::XML::Document.parse(File.read('sample.xml')) | |
| => #<Nokogiri::XML::Document:0x80899448 name="document" children=[#<Nokogiri::XML::DTD:0x80898e44 name="Foo">, #<Nokogiri::XML::Element:0x80898d40 name="Foo">]> | |
| ree-1.8.7-2011.01 :004 > puts doc.validate | |
| No declaration for element Foo | |
| => nil |
This file contains hidden or 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
| { % }: ls -lRh 5.Apr.11 16.46 | |
| total 0 | |
| drwxr-xr-x 5 kbennett staff 170B Apr 5 14:44 candidate_summary | |
| drwxr-xr-x 5 kbennett staff 170B Apr 5 15:39 committee_summary | |
| drwxr-xr-x 3 kbennett staff 102B Apr 5 15:40 fda-drug-labels | |
| drwxr-xr-x 4 kbennett staff 136B Apr 5 15:40 fdic-failed-institutions | |
| drwxr-xr-x 5 kbennett staff 170B Apr 5 15:41 fdic-insured-institutions | |
| drwxr-xr-x 3 kbennett staff 102B Apr 5 15:42 foreign_labor_statistics | |
| drwxr-xr-x 4 kbennett staff 136B Apr 5 15:38 mining |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # Script that illustrates that when an RObject is created, saved, | |
| # created, deleted, then created, saved again, it is not | |
| # successfully saved to the riak data store. | |
| require 'rubygems' | |
| require 'riak' | |
| CLIENT = Riak::Client.new |
This file contains hidden or 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
| fatal: Not a git repository (or any of the parent directories): .git | |
| ./rebar get-deps | |
| fatal: Not a git repository (or any of the parent directories): .git | |
| fatal: Not a git repository (or any of the parent directories): .git | |
| fatal: Not a git repository (or any of the parent directories): .git | |
| ==> cluster_info (get-deps) | |
| ==> skerl (get-deps) | |
| ==> protobuffs (get-deps) | |
| ==> basho_stats (get-deps) | |
| ==> mochiweb (get-deps) |
This file contains hidden or 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
| # Shows a crude way to enforce that a class implements | |
| # required methods. Use it like this: | |
| # | |
| # class OkClass | |
| # def foo; end | |
| # def bar; end | |
| # def baz; end | |
| # end | |
| # | |
| # |
This file contains hidden or 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 'instance_method_validator' | |
| module EncryptionContract | |
| def required_function_names | |
| [ | |
| # The purpose of this function is self-evident, but in other | |
| # cases the methods would benefit from some explanation | |
| # that would be helpful to authors of new implementations, | |
| # such as defining correct behavior, format and data type |
This file contains hidden or 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 'rspec' | |
| require 'reverse_encrypter' | |
| describe ReverseEncrypter do | |
| it "should implement required methods" do | |
| lambda { subject.validate_contract }.should_not raise_error | |
| end | |
| end |