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
| HTTPDPlat_IP=10.69.9.10 | |
| OAM_MASK=28 | |
| HCLBRG_IP=10.69.9.18 | |
| CP_MASK=29 | |
| TW_IP=10.56.127.245 | |
| CP_GW_IP=10.69.9.17 | |
| #fsclish -c "add networking address dedicated /HTTPDPlat iface eth4 ip-address $HTTPDPlat_IP/$OAM_MASK" | |
| fsclish -c "add networking address dedicated /MGW_HCLBRG-0 iface eth2 ip-address $HCLBRG_IP/$CP_MASK" | |
| fsclish -c "set routing node CLA-0 static-route $TW_IP/32 nexthop gateway address $CP_GW_IP on" |
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 RubyWarrior::Space | |
| def <=>(other) | |
| if self.ticking? && !other.ticking? | |
| return -1 | |
| elsif !self.ticking? && other.ticking? | |
| return 1 | |
| else | |
| return self.to_s <=> other.to_s | |
| 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
| TW_IP=10.56.127.245 | |
| OAM_MASK=28 | |
| CP_MASK=29 | |
| UP_MASK=29 | |
| HTTPDPlat_IP=10.69.9.10 | |
| HCLBRG_IP=10.69.9.18 | |
| MGW_IPNIURG0=10.69.9.28 | |
| CP_GW_IP=10.69.9.17 | |
| UP_GW_IP=10.69.9.25 |
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
| START = 30 | |
| SIZE = 50 | |
| WHITE_PIECE = 1 | |
| BLACK_PIECE = 2 | |
| DEAD_TEST = 3 | |
| COUNTED = 4 | |
| WHITE_DEAD = 6 | |
| BLACK_DEAD = 7 #these are what will go on the board for "temporarily" dead groups |
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
| # Ruby 1.9.2 | |
| # Home: https://gist.github.com/856219 | |
| # My CPP template: template_cpp.rb | |
| # OJ Support: | |
| # Online Judge of Zhejiang University | |
| # Author: [email protected] | |
| require 'uri' | |
| require 'net/http' | |
| #require 'hpricot' |
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 "readline" | |
| class Player | |
| def play_turn(w) | |
| # add your code here | |
| buf = Readline.readline("> ", true ) | |
| action=buf[0] | |
| direction=buf[1] | |
| abilities = {'w' => 'w.walk!', 'a' => 'w.attack!', 'r' => 'w.rest!', 'c' => 'w.rescue!', 's' => 'w.shoot!', 'b' => 'w.bind!', 'd' => 'w.detonate!'} | |
| directions = {'l' => ':forward', 'h' => ':backward', 'j' => ':right', 'k' => ':left'} |
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 Proxy | |
| def initialize(target_object) | |
| @object = target_object | |
| # ADD MORE CODE HERE | |
| @call_count = {} | |
| end | |
| attr_accessor :channel | |
| def proxy_call(m, *args) |
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 "fiber" | |
| f1 = Fiber.new { |f2| f2.resume Fiber.current;loop{puts "A"; f2.transfer} } | |
| f2 = Fiber.new { |f1| f1.transfer; loop{puts "B"; f1.transfer} } | |
| f1.resume f2 |
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
| package main | |
| import ( | |
| "github.com/bmizerany/pat" | |
| "io" | |
| "log" | |
| "net/http" | |
| ) | |
| // hello world, the web server |
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
| onLocalSearchResult: function(items, q){ | |
| var newItems = new Array(); | |
| $.each(items, function(index, item){ | |
| names = item.Name.split(" "); | |
| $.each(names, function(i, name){ | |
| if(name.toLowerCase().slice(0,q.length) == q){ | |
| newItems.push(item); | |
| return false | |
| } | |
| }) |
OlderNewer