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
REMIX EXAMPLE PROJECT | |
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer. | |
It contains 3 directories: | |
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name. | |
2. 'scripts': Holds two scripts to deploy a contract. It is explained below. | |
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity. | |
SCRIPTS |
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 math | |
DEBUG = False | |
def generate_input_sample(params): | |
population = COVIDPopulation(params["N"], params["K"]) | |
return population |
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
from bisect import bisect_left, bisect_right | |
class COVIDPopulation: | |
def __init__(self, N, K): | |
""" | |
K is the number of infected persons in N number of people. | |
It's not a percentage. | |
""" | |
self.N = N |
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 time | |
import sys | |
print "Maximizer is X and Minimizer O" | |
class Position: | |
def __init__(self, parent_): | |
self.parent = parent_ | |
self.children = [] | |
self.best_eval = [] |
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 | |
adj = {} | |
m = """012 | |
345 | |
678 | |
""" | |
# Contruct adj list |
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/python | |
X = "X" | |
O = "O" | |
T = "T" | |
cases = ["", | |
"X won", | |
"Draw", | |
"Game has not completed", | |
"O won"] |
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
# This is a program trying to implement Verbal Expressions | |
# See this for more info - http://verbalexpressions.github.io/ | |
def VerEx | |
return VerExClass.new | |
end | |
class VerExClass | |
@regex = "" # The main regex variable |
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 main(): | |
print "Calculating pi. Calm down,bro!" | |
acc = 0.0 | |
for i in range(1,1000001,4): | |
acc += 4/float(i) | |
acc -= 4/float(i+2) | |
print i | |
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 requests | |
import BeautifulSoup | |
def main(): | |
print "Hey! Let's start Doing things" | |
done=False; i = 0 ; acc = "<html><body>" | |
while (i<=50): | |
i = i + 2 | |
print "Getting {0}".format(i) | |
r = requests.get( |
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 requests | |
uri = "http://www.sofworld.org/imo-second-level-result/JH02800800" | |
for i in range(1,10): | |
print i | |
r = requests.get( uri+str(i) ) | |
if "KINSHUK" in r.content: | |
print "Found it! I'm opening it in the browser now" | |
import webbrowser |
NewerOlder