Skip to content

Instantly share code, notes, and snippets.

View idlecool's full-sized avatar

Shiv Deepak idlecool

  • Aeroh, Inc.
  • Mountain View, CA
View GitHub Profile
{
"callback_url": "http://railsserver:3000/codechecker/testcallback/9e5f82910de261445c2fda38662a748f",
"code": [
"puts \"DOWN\"",
"#include<iostream>\n#include<vector>\n#include<stdlib.h>\nusing namespace std;\nint main() {\n vector<string> board;\n string s;\n srand(time(NULL));\n vector<string> moves;\n moves.push_back(\"UP\");\n moves.push_back(\"DOWN\");\n moves.push_back(\"LEFT\");\n moves.push_back(\"RIGHT\");\n vector<int> valid_moves;\n char player;\n int x,y;\n cin>>player>>x>>y;\n for( int i = 0; i < 32; i++ ) cin>>s, board.push_back(s);\n for ( int i = -1; i < 2; i++ ) {\n for ( int j = -1; j < 2; j++) {\n if ((i == 0 && j !=0) || ( i != 0 && j == 0 ) ) {\n if(board[x+i][y+j] == '-') {\n if( i == -1 ) valid_moves.push_back(0);\n if( i == 1 ) valid_moves.push_back(1);\n if( j == -1 ) valid_moves.push_back(2);\n if( j == 1 ) val
CALL mysql.rds_rotate_slow_log;
sudo launchctl limit maxfiles 1000000
HR.appController.getTemplate @template, ((template) ->
$(@el).html template()
//rest of the view code
), @
$(@el).html HR.appController.getTemplate(@template)()
//rest of the view code
import urllib
from BeautifulSoup import BeautifulSoup
gradedict = {
"A+": 10,
"A": 9.5,
"A-": 9,
"B+": 8.5,
"B": 8,
"B-": 7.5,
file = open("city_grid.txt", "r")
text_grid = file.read()
horizontal_grid = text_grid.split("\n")[:-1]
grid = []
for i in xrange(len(horizontal_grid)):
grid.append(horizontal_grid[i].split(" ")[:-1])
max_grid_size = 0
cords = 0
class DiscreteBidding : public Game {
public:
int BOARD_LEN; //Arbitrary Board Length and must be even and the position starts from 0.
int coins; //coins to be equally distributed among the 1st and the 2nd player preferably (BOARD_LEN-1)*constant
int token_pos; //0<=token_pos<=BOARD_LEN indicating the position of the token.
int current_player;
int dL,dR; //tokens left during the game initially coins/2 each.
int bid_1,bid_2; //first player bids first and then the second. If the first_bid>second, first wins else second.
int draw_advantage; //Initially the first player will have the draw advantage. And it alternates henceforth.
idlecool@chunkybacon:/Users/idlecool/Workspace/Projects/hackerrank git:(master) ✗ 0:% rails s
=> Booting Thin
=> Rails 3.2.6 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/idlecool/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError)
from /Users/idlecool/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `open'
from /Users/idlecool/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
from /Users/idlecool/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
1. Create a HackerRank account from our campaign page
url: https://www.hackerrank.com/campaign/pandodaily
2. After account creation you can login with following url
login url: https://www.hackerrank.com/login
3. (Optional) Once you login, there will be a modal dialog box which will
ask you to fill your school, company and country; as well as you can find
player = input()
line = raw_input()
if player == 1:
print 10
else:
[L,R,pos,end,bid] = [int(x) for x in line.split(' ')]
if pos == 1:
print bid + 1
else:
print 0 if bid > 10 else bid + 1