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
| //FightCode can only understand your robot | |
| //if its class is called Robot | |
| var Robot = function(robot) { | |
| this.enemyPos = null; | |
| }; | |
| Robot.prototype.onIdle = function(ev) { | |
| var robot = ev.robot; | |
| robot.ahead(50); |
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
| #!/bin/bash | |
| # config | |
| with_timeout=1 | |
| time_limit="2s" # (float) | |
| memory_limit=128 # (int) megs | |
| if [ -z "$1" ]; then |
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
| webapp: python webapp_frog_config.py $PORT |
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 python | |
| # -*- coding: utf-8 -*- | |
| from __future__ import with_statement | |
| import collections, operator, math, random, pprint | |
| class Classifier(object): | |
| AttrsToDump = ["value_counts", "class_counts", "features", "feature_counts"] | |
| def __init__(self, features={}, verbose=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
| # -*- coding: utf-8 -*- | |
| # client.py | |
| from common import FooClient, LockedError, UnauthorizedError | |
| from jsonrpclib import Server, ProtocolError as JsonProtocolError | |
| if __name__ == "__main__": | |
| # using remote | |
| client = FooClient() # in fact FooClient can be also an instance of |
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 "rubygems" | |
| require "Node" | |
| require "Configuration" | |
| require "CoreService" | |
| require "MonitoringObjectsAttributes" | |
| require "sga" | |
| require "SimpleAgents" | |
| require "actions" # FIXME: duza litera | |
| require "example-services" |
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 "rubygems" | |
| require "Node" | |
| require "Configuration" | |
| require "CoreService" | |
| require "MonitoringObjectsAttributes" | |
| require "sga" | |
| require "SimpleAgents" | |
| require "actions" | |
| require "example-services" |
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 "rubygems" | |
| require "Node" | |
| require "Configuration" | |
| require "CoreService" | |
| require "MonitoringObjectsAttributes" | |
| require "sga" | |
| require "example-services" | |
| require "mocha" |
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 "rubygems" | |
| require "Node" | |
| require "Configuration" | |
| require "CoreService" | |
| require "MonitoringObjectsAttributes" | |
| require "example-services" | |
| require "mocha" | |
| class NameService | |
| def initialize(bus) |
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 "rubygems" | |
| require "Node" | |
| require "CoreService" | |
| require "Configuration" | |
| require "example-services" | |
| require "mocha" | |
| class NameService | |
| def initialize(bus) | |
| (@mock = Mocha::Mock.new).stubs(:register_address).returns("Agent1", "Agent2") |
NewerOlder