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
| def show | |
| puts Benchmark.measure { | |
| method_1() | |
| } | |
| puts Benchmark.measure { | |
| method_2() | |
| } | |
| puts Benchmark.measure { | |
| method_3() | |
| } |
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 'net/http' | |
| class Bot | |
| def post(data, speech) | |
| data['STIMULUS'] = speech | |
| data['sub'] = 'Say' | |
| response = Net::HTTP.post_form( | |
| URI.parse('http://jabberwacky.icogno.com/webserviceform-joan'), |
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
| def get_response(html) | |
| html.chomp! | |
| start_index = html.index('Begin Response !-->') + | |
| 'Begin Response !-->'.length | |
| end_index = html.index('<!-- End Response') | |
| result = html[start_index, end_index - start_index] | |
| while (result.index('}')) | |
| result = result[result.index('}') + 1, |
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 Bot | |
| def start_conversation | |
| def post(data, speech) | |
| 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
| var U='whbshrvpchfkrm'; | |
| var U = U.replace(/h/g,'e').replace('k','o').replace('p','i'); | |
| //whbshrvpchfkrm => webserviceform | |
| if('joan' != '') U+='-'+'joan'; |
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
| def post() | |
| response = Net::HTTP.post_form( | |
| URI.parse('http://jabberwacky.icogno.com/webserviceform-joan'), | |
| this_was_my_response_to_Joan | |
| ) | |
| return response.body | |
| 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
| var U = 'whbshrvpchfkrm'; | |
| var U = U.replace(/h/g,'e').replace('k','o').replace('p','i'); |
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
| sT(f,m) => window.setTimeout(f,m) | |
| gE(e) => document.getElementById(e) | |
| iH(e,h) => document.getElementById(e).innerHTML = h |
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
| T=true; | |
| F=false; |
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
| def GetSource | |
| url = URI.parse('http://www.icogno.com/') | |
| request = Net::HTTP::Get.new(url.path) | |
| response = Net::HTTP.start(url.host, url.port) {|http| | |
| http.request(request) | |
| } | |
| return response.body | |
| end |
NewerOlder