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
import torch | |
import torch.nn as nn | |
import torchvision.datasets as dsets | |
import torchvision.transforms as transforms | |
from torch.autograd import Variable |
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
import sys, codecs | |
if sys.version_info[0] < 3: | |
import got | |
else: | |
import got3 as got | |
def main(): | |
try: | |
tweetCriteria = got.manager.TweetCriteria().setQuerySearch('bitcoin').setSince("2015-01-01").setUntil("2015-12-31").setTopTweets(True) |
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
pragma solidity ^0.4.13; | |
contract Sample { | |
uint public a = 0; | |
function Sample() public { | |
a = 10; | |
} | |
} |
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
pragma solidity ^0.4.18; | |
// import "./EIP20Interface.sol"; | |
import "github.com/ConsenSys/Tokens/contracts/eip20/EIP20Interface.sol"; | |
contract EIP20 is EIP20Interface { | |
uint256 constant private MAX_UINT256 = 2**256 - 1; | |
mapping (address => uint256) public balances; |
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
pragma solidity ^0.4.8; | |
// ---------------------------------------------------------------------------------------------- | |
// Sample fixed supply token contract | |
// Enjoy. (c) BokkyPooBah 2017. The MIT Licence. | |
// ---------------------------------------------------------------------------------------------- | |
// ERC Token Standard #20 Interface | |
// https://github.com/ethereum/EIPs/issues/20 | |
contract ERC20Interface { |
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
input: 1.2, 3.4, 2.1, 5 | |
a: 1 2 3 4 5 | |
1 1 1 1 | |
1 2 3 4 5 | |
sum: 4 3 2 1 1 | |
max: 4 |
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
import os | |
def testChar(_char): | |
os.system("echo '"+_char+"' | ../../../pin -t obj-intel64/inscount0.so -- ~/Downloads/break") | |
def getInstr(): | |
return os.popen("cat inscount.out").read() | |
ascii_list = [chr(x) for x in range(48,127)] | |
ans = "" |
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
pragma solidity ^0.4.21; | |
// @title MAR mode: Module-Agnostic Rendering Mode (Core) | |
// @author Jeff Hu | |
// @dev This smart contract is modularized via a module agnostic execution scheme | |
contract C { | |
address public M_addr; // The deployed address of the module M | |
string public M_func; // The target function signature of module M | |
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
pragma solidity ^0.4.21; | |
// @title MAR mode: Module-Agnostic Rendering Mode (Module) | |
// @author Jeff Hu | |
// @dev This smart contract is an atomic callable stub | |
contract M { | |
bool public value = false; | |
function setTrue() public { | |
value = true; |
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
pragma solidity ^0.4.24; | |
// @title Modularized smart contract: Gating | |
// @author Hu Yao-Chieh (yhuag@ust.hk) | |
// @dev This smart contract is modularized by switching on/off a specific module via modifier access control mapping. | |
contract Gating { | |
address owner; | |
mapping (uint => bool) public enabled; | |
// Constructor |
OlderNewer