Skip to content

Instantly share code, notes, and snippets.

View yhuag's full-sized avatar
:octocat:
BUIDL

HU Yao-Chieh yhuag

:octocat:
BUIDL
View GitHub Profile
import torch
import torch.nn as nn
import torchvision.datasets as dsets
import torchvision.transforms as transforms
from torch.autograd import Variable
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)
@yhuag
yhuag / setup.md
Last active December 29, 2018 09:26
The suggestive setup list for Ethereum smart contract development at Taipei Tech 0x1 Blockchain Bootcamp
pragma solidity ^0.4.13;
contract Sample {
uint public a = 0;
function Sample() public {
a = 10;
}
}
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;
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 {
@yhuag
yhuag / hi
Last active April 10, 2018 10:38
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
@yhuag
yhuag / pin_break.py
Created April 23, 2018 09:31
pin demonstration
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 = ""
download: function () {
let csvContent = "data:text/csv;charset=utf-8,";
csvContent += document.getElementById("bulktextarea").value;
var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", "BitcoinKeys.csv");
document.body.appendChild(link);
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