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
| { | |
| identity: <serviceaddr>, // multikey | |
| api: { | |
| location: [ | |
| /ip4/123.234.123.234/tcp/80/, | |
| /ipfs/<identity>/tcp/80/ | |
| ], | |
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 web3.RequestManager | |
| import web3.IBAN | |
| import web3.methods.Eth | |
| import web3.methods.Db | |
| import web3.methods.Shh | |
| import web3.methods.Net | |
| import web3.Personal | |
| import web3.Settings | |
| import version | |
| import utils.utils |
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
| # Object which is true once after <interval> seconds | |
| # For Python2, use the __nonzero__ method | |
| class Every: | |
| def __init__(self, interval): | |
| self.interval = interval | |
| self.lasttime = time() | |
| def __bool__(self): | |
| current = time() | |
| if current-self.lasttime>=self.interval: |
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
| /*To control the rover, copy and paste the code below into the Arduino software*/ | |
| int E1 = 6; //M1 Speed Control | |
| int E2 = 5; //M2 Speed Control | |
| int M1 = 8; //M1 Direction Control | |
| int M2 = 7; //M2 Direction Control | |
| void setup(void) | |
| { | |
| int i; | |
| for(i=5;i<=8;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
| ``` | |
| { | |
| "image": {}, | |
| "moderates_for": [], | |
| "moderators": [], | |
| "new_robot_id": "67146952", | |
| "robots": [ | |
| { | |
| "__v": 9, | |
| "_id": "595b611e9a42c53364befa89", |
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 json | |
| import requests | |
| username = "" | |
| password = "" | |
| customui = """ | |
| [ | |
| { | |
| "button_panels": [ |
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 collections import OrderedDict | |
| # Allows for dot dict access, but is also ordered (but not nested yet) | |
| # Evil hack 1 from | |
| #https://stackoverflow.com/questions/2352181/how-to-use-a-dot-to-access-members-of-dictionary | |
| class OrderedAttributeDict(OrderedDict): | |
| __getattr__ = dict.__getitem__ | |
| __setattr__ = dict.__setitem__ | |
| __delattr__ = dict.__delitem__ |
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
| primitives = { | |
| "+" : sum | |
| } | |
| def step(program): | |
| # For convenience, not necessity | |
| program[0][1] = dict(program[0][1]) |
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 X: | |
| def __init__(self, l=[]): | |
| self.l = l | |
| a,b = X(), X() | |
| print(id(a.l), id(b.l)) | |
| a.l.append(1) | |
| print(b.l) |
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 step(processbinary): | |
| process = decode(processbinary) | |
| if process.instruction == RUN: | |
| if childStillHasResources(): | |
| child = process.memory[process.currentsandbox] | |
| child = step(child) | |
| else: | |
| child.state = OUTOFRESOURCES | |
| else: |
OlderNewer