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 RingBuffer: | |
| def __init__(self, size): | |
| self.data = [None for i in xrange(size)] | |
| def append(self, x): | |
| self.data.pop(0) | |
| self.data.append(x) | |
| def get(self): | |
| return self.data |
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
| targets = ['serverA', 'serverB', 'serverC', 'serverD', 'serverE', 'serverF'] | |
| index = 0 | |
| while True: | |
| print targets[index] | |
| index = (index + 1) % len(targets) |
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
| # Installs bootstrap gem | |
| Step:1 (Install bootstrap on your machine) | |
| $ sudo gem install twitter-bootstrap-rails | |
| Successfully installed twitter-bootstrap-rails-2.1.3 | |
| 1 gem installed | |
| Installing ri documentation for twitter-bootstrap-rails-2.1.3... | |
| Installing RDoc documentation for twitter-bootstrap-rails-2.1.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
| # Installs bootstrap gem | |
| Step:1 (Install bootstrap on your machine) | |
| $ sudo gem install twitter-bootstrap-rails | |
| Successfully installed twitter-bootstrap-rails-2.1.3 | |
| 1 gem installed | |
| Installing ri documentation for twitter-bootstrap-rails-2.1.3... | |
| Installing RDoc documentation for twitter-bootstrap-rails-2.1.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
| # Installs bootstrap gem | |
| Step:1 (Install bootstrap on your machine) | |
| $ sudo gem install twitter-bootstrap-rails | |
| Successfully installed twitter-bootstrap-rails-2.1.3 | |
| 1 gem installed | |
| Installing ri documentation for twitter-bootstrap-rails-2.1.3... | |
| Installing RDoc documentation for twitter-bootstrap-rails-2.1.3... |
NewerOlder