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
| <properties> | |
| <hadoop.directory>your/path/here</hadoop.directory> | |
| </properties> | |
| <dependencies> | |
| <dependency> | |
| <groupId>org.apache.hadoop</groupId> | |
| <artifactId>hadoop-main</artifactId> | |
| <version>9.9.9</version> |
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
| public class Main { | |
| interface Foo { | |
| public String x(); | |
| public String y(); | |
| } | |
| interface Bar { | |
| public Integer w(); |
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
| ╭─whaley at perfectdrug in ~ | |
| ╰─○ cat .ackrc | |
| -type-set=puppet=.pp |
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
| >>> import boto | |
| >>> s3 = boto.connect_s3() | |
| >>> bucket = s3.get_bucket("basementcoders.logging") | |
| >>> result = bucket.delete_keys([key.name for key in bucket if key.name[-1] == '6']) | |
| >>> result.deleted | |
| [<Deleted: basementcoders.downloads2011-01-30-21-37-29-09929716CC5526B6>, <Deleted: basementcoders.downloads2011-01-16-17-19-55- | |
| E50B56C60B99F316>] |
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
| > python ec2_hole_poker.py -g jasonwhaley.com -p 22 -p 33333 | |
| Port 46667 opened for 99.98.113.100 in group jasonwhaley.com | |
| Port 22 opened for 99.98.113.100 in group jasonwhaley.com |
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 start() { | |
| val finalBoard = processMoves(new TicTacToeBoard()) | |
| outputState(finalBoard) | |
| } | |
| private def processMoves (board : TicTacToeBoard) : TicTacToeBoard = { | |
| outputState(board) | |
| val updatedBoard = board.updated(getSelectionFromUser(board), board.gameState.nextTurn) | |
| if (!updatedBoard.gameState.isGameFinished) processMoves(updatedBoard) else updatedBoard | |
| } |
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 board: TicTacToeBoard = new TicTacToeBoard | |
| def start() { | |
| var gameState: GameState = new XMovesNext | |
| outputState(gameState) | |
| while (!gameState.isGameFinished) { | |
| val position: Int = getSelectionFromUser | |
| board = board.updated(position, gameState.nextTurn) | |
| gameState = getGameState(board) | |
| outputState(gameState) | |
| } |
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 updated(position: Int, entity: TicTacToeSpace) : TicTacToeBoard = { | |
| def updatedGrid(row: Int, column: Int, entity : TicTacToeSpace) { | |
| grid.updated(row, grid(row).updated(column,entity)) | |
| } | |
| position match { | |
| case 1 => new TicTacToeBoard updatedGrid(0,0,entity) | |
| case 2 => new TicTacToeBoard updatedGrid(0,1,entity) | |
| case 3 => new TicTacToeBoard updatedGrid(0,2,entity) | |
| case 4 => new TicTacToeBoard updatedGrid(1,0,entity) | |
| case 5 => new TicTacToeBoard updatedGrid(1,1,entity) |
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 update(position: Int, entity: TicTacToeSpace): Unit = { | |
| position match { | |
| case 1 => grid(0)(0) = entity | |
| case 2 => grid(0)(1) = entity | |
| case 3 => grid(0)(2) = entity | |
| case 4 => grid(1)(0) = entity | |
| case 5 => grid(1)(1) = entity | |
| case 6 => grid(1)(2) = entity | |
| case 7 => grid(2)(0) = entity | |
| case 8 => grid(2)(1) = entity |
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
| val spacesUsed = grid flatten filterNot { space => space == new Empty()} size |