This file contains 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
from django.contrib.auth.models import User | |
from tastypie.resources import ModelResource | |
from tastypie import fields | |
from employee.models import Employee, Message | |
from tastypie.authentication import OAuthAuthentication | |
from extendedmodelresource import ExtendedModelResource | |
from django.conf.urls import patterns, url, include | |
from tastypie.utils import trailing_slash | |
class UserResource(ModelResource): |
This file contains 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
from decimal import * | |
getcontext().prec = 15 | |
t=[] | |
for i in range(int(raw_input())): | |
t.append(raw_input()) | |
for i in range(len(t)): | |
o=t[i] | |
l=[] | |
for j in range(int(o)): | |
p=Decimal((2*j) + 1) |
This file contains 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 Info: | |
def __init__(self, index, name): | |
self.name = name | |
self.index = index | |
def __repr__(self): | |
return repr((self.name, self.index)) | |
inf1 = Info(2, "two") | |
inf2 = Info(1, "one") | |
inf3 = Info(-1, "Minus-one") |
This file contains 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 is_valid(grid): | |
if len(grid)!=81: | |
return False | |
for a in grid: | |
val = int(a) | |
if type(val)!= int or val == 0: | |
return False | |
k = 0 | |
puzzle = [[0 for x in xrange(9)] for x in xrange(9)] |
This file contains 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 reverse(_string): | |
return ''.join(reversed(_string)) |
This file contains 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
""" | |
Buckets Robo problem | |
Attempt #1 | |
""" | |
begin = -1; | |
end = len(no_of_buckets); | |
loc = 0; | |
while (loc<end) { | |
switch (color) { |
This file contains 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
'use strict'; | |
module.exports = function mochacli(grunt) { | |
// Load task | |
grunt.loadNpmTasks('grunt-mocha-cli'); | |
// Options | |
return { | |
src: ['test/unit/**/*.js'], |
This file contains 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
timeline = { | |
'1': set([0,1,2,3,4]), | |
'2': set([3,4,5,6,7]), | |
'3': set([2,3,4])} | |
def get_meeting_time(timeline): | |
""" | |
get intersection of all the person | |
""" |
This file contains 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 Event { | |
int start; | |
int end; | |
} | |
class myE { | |
int isStart; | |
int time; | |
} | |
void maxparticipants(event[] events){ |
This file contains 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
To Watch | |
- The Room | |
- Brooklyn | |
- There's no tomorrow | |
- True Cost | |
- Ghetto Physics | |
- Garbage warriors | |
- P Sainath Corporate hijack of Indian agriculture | |
Watched |
OlderNewer