Skip to content

Instantly share code, notes, and snippets.

Avatar

张卓 lispc

View GitHub Profile
@lispc
lispc / multi_sig.sh
Last active Jan 16, 2020
IOST multiple signature
View multi_sig.sh
set -eu
TEST_USER_ID="testname"
GROUP="group"
IWALLET_CMD='iwallet --chain_id 1020 -s 127.0.0.1:30002' # single node dev chain
seckey1=3MWryACc5nSxRDJCJLe9Xq2spR1j7d5wYbZ4pZN4SvfgUxhG497DQxo5ahENoCnDkLsc7haSveP1q1zkt26JWhog
pubkey1=2ott3o9CZcaoZCe4nGYo1azEfEpY4W771GBFe133WW1p
function clean_account() {
$IWALLET_CMD account del $TEST_USER_ID
View map_fail.sh
function init() {
iwallet --account admin account create lispc --initial_balance 100
iwallet --account admin account create lispcc --initial_balance 100
iwallet --account lispc sys pledge 10 --gas_user lispcc
iwallet --account lispc sys pledge 10 --gas_user lispc
iwallet --account lispc sys unpledge 10 --gas_user lispc
iwallet --account lispc sys pledge 10 --gas_user lispc
}
init
curl -s -X POST --data '{"id":"gas.iost","key":"lispcgp"}' http://127.0.0.1:30001/getContractStorageFields
@lispc
lispc / multisig.sh
Last active Apr 3, 2019
multi sig demo for IOST
View multisig.sh
set -eu
pubkey1=2ott3o9CZcaoZCe4nGYo1azEfEpY4W771GBFe133WW1p
seckey1=3MWryACc5nSxRDJCJLe9Xq2spR1j7d5wYbZ4pZN4SvfgUxhG497DQxo5ahENoCnDkLsc7haSveP1q1zkt26JWhog
pubkey2=G7Zy3ctcByrWfzCzkijnmPXm2rxjQruttFg9FH3hJSMw
seckey2=3NdYa9gCfsRpJMzQZWXfLhKegA4kpyKjYpDLxSCv3hnSX4homFS5T91guU6TGasmrU4Cei9WsNn3hA1cFHZnxKtm
pubkey3=D4WgA3Q9EV18S78haqYpdBqJZT3TNCgkraczi8PK4TVE
seckey3=4RQrGu6ZdKdNP21jQpbMjLMRGdhSemZf1xQXVsm6wJztmWXAm828qhmae6SoQjTU1H64box1Ha2cJgTDntj7Ud2
pubkey4=HiE2gyeFeSoWzurFTWdFnNLizuigh93Jh97HisnQ2see
seckey4=3zXxqsvNTfcB3Ah9JCyX2mqYxRmMoGGu7i1jEnykkoc58ikGo6eoDXJTqpn8Yabt5mGkGd51atkzVafFyeTgwp6i
@lispc
lispc / speed_test.py
Created Sep 21, 2017
python list of lists speed
View speed_test.py
import random
import time
batch_size = 256
def merge1(l):
l = l / batch_size * batch_size
manifest = range(0, l)
batch_manifest = zip(*[iter(manifest)] * batch_size)
start_time = time.time()
@lispc
lispc / queue.py
Last active Apr 29, 2017
Tensorflow FIFOQueue bug
View queue.py
from __future__ import print_function
import os
os.environ["CUDA_VISIBLE_DEVICES"]=''
import time
import threading
import numpy as np
import tensorflow as tf
queue_size = 10
queue_shape = [6, 200, 200, 3]
cluster_spec_config = {'train': ['localhost:22222', 'localhost:23333']}
@lispc
lispc / py
Created Nov 28, 2016
Tensorflow FIFOQueue speed
View py
import tensorflow as tf
import time
from datetime import datetime
import numpy as np
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_bool('cluster', False, '')
def log(obj):
print datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3], obj
@lispc
lispc / gist:924eb2514d1caa39ab36
Last active Aug 29, 2015
Gas Station Leetcode
View gist:924eb2514d1caa39ab36
class Solution {
public:
int pw(int a,int b){
if(b==0){
return 1;
}
int half = pw(a,b/2);
return half*half*(b%2?a:1);
}
int canCompleteCircuit(vector<int> &gas, vector<int> &cost) {
View gist:13993fd7d1211bee5627
#include<iostream>
#include<string>
#include<fstream>
#include<cstdlib>
#include<cstring>
#include<vector>
#include<utility>
#include<unistd.h>
#include<algorithm>
using namespace std;
@lispc
lispc / Right
Created Apr 20, 2014
The Js bug
View Right
var descriptionDisplayLimit = 200;
var ids = [];
var simly = Simly.getInstance();
templateFunc = swig.compile($("#src_item_template").html());
function load_log(){
$.ajax({
url: "/simly/api/get_feedback_log",
dataType: "json",
data: {uname:getLoginInfo().username},
success:function(res){
You can’t perform that action at this time.