自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 收藏
  • 关注

原创 Leetcode - 229. Majority Element II

题目Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times.Note: The algorithm should run in linear time and in O(1) space.示例Input: [1,1,1,3,3,2,2,2]Output: [1,2]解...

2019-04-15 16:07:54 201

原创 Leetcode - 904. Fruit Into Baskets

题目In a row of trees, the i-th tree produces fruit with type tree[i].You start at any tree of your choice, then repeatedly perform the following steps:Add one piece of fruit from this tree to your b...

2019-04-14 19:41:00 191

原创 Leetcode - 957. Prison Cells After N Days

题目There are 8 prison cells in a row, and each cell is either occupied or vacant.Each day, whether the cell is occupied or vacant changes according to the following rules:If a cell has two adjacent ...

2019-04-13 18:54:38 194

原创 【fabric 5】运行你的第一个nodejs应用

本文介绍如何运行fabric-samples中的fabcar示例。安装nodejs和npm application使用nodejs开发,需要安装nodejs.这里我安装的是node v8.9.4,亲测可用。据说fabric node sdk不支持node9.X及以上版本???一开始安装了v6.X版本,是有问题的,不好用。。。wget https://nodejs.org/downlo...

2018-08-09 18:57:14 2399

原创 【fabric 4】chaincode开发 - shim.ChaincodeStubInterface

shim.ChaincodeStubInterface提供了一些API,使chaincode与底层区块链网络进行交互。 在上一篇文章中,我们已经简单的使用了一些shim.ChaincodeStubInterface的接口,完成了一个简单的读写账本的chaincode,本章会继续就shim.ChaincodeStubInterface的一些常用接口进行一些练习。获得调用参数 shim.Ch...

2018-07-31 17:53:12 1136

原创 【fabric 3】开发你的第一个chaincode

参考:http://hyperledger-fabric.readthedocs.io/en/latest/chaincode4ade.html1.编码每一个chaincode都需要实现chaincode interface的Init和Invoke接口 每一个chaincode都应该有一个main函数 代码结构如下所示:package mainimport ( "f...

2018-07-26 17:42:39 1696

原创 【编程语言 go】quick start

1.环境配置//Linux envwget https://studygolang.com/dl/golang/go1.10.3.linux-amd64.tar.gz //下载golang安装包sudo tar -zxvf go1.10.3.linux-amd64.tar.gz -C /optsudo vi /etc/profile //配置如下环境变量...export...

2018-07-20 18:28:04 233

原创 【fabric 2】v1.0环境搭建详细过程

搭建fabric网络的详细步骤大都隐藏在官方的脚本中,本文详细了解下脚本的执行过程1.生成各节点需要的公私钥证书1.1编译生成cryptogencd ~/github.com/hyperledger/fabricmake cryptogen //编译生成cryptogen正常编译通过后会如下图所示并且在build/bin/目录下可以看到cryptogen Tips: ...

2018-07-19 16:37:33 1271

原创 VirtualBox - 常见问题

问题1. 已经安装过的虚拟机再次打开时依然进入安装界面 解决办法:确保下图红色部分没有盘片

2018-07-12 15:31:24 2618

原创 【Fabric 1】v1.0环境搭建

基于Ubuntu 16.041.安装dockersudo apt-get install docker.io //安装dockerdocker --version //查看docker版本,确认是否安装成功sudo usermod -aG docker ${USER} //将当前用户加入docker组,使用docker命令时可以不加sudouser logout...

2018-07-10 18:22:11 631

原创 Linux - 常见错误

Windows下编写的shell脚本在Linux执行出错 原因:windows下文件结尾是”\n\r” ,而Linux文件结尾是”\n” 解决办法:sed -i 's/\r$//' *.sh

2018-07-05 15:20:03 163

原创 【ethereum 4】创建和部署智能合约 - voting

这里使用solidity官方文档中的voting项目作为示例voting源码( http://solidity.readthedocs.io/en/v0.4.24/solidity-by-example.html):pragma solidity ^0.4.22;/// @title Voting with delegation.contract Ballot { // Th...

2018-07-04 18:20:44 441

原创 【ethereum 3】创建和部署智能合约 - 简单示例

安装solcapt-get install solc新建solidity智能合约文件,命名test.sol,内容如下pragma solidity ^0.4.0;contract testContract{ function multiply(uint a) returns(uint d) { d = a*7; }}用solc获取编译后的EV...

2018-07-03 19:23:35 613

原创 【ethereum 2】go-ethereum javascript console 常用命令

创建账户presonal.newAccount() “0x393b0054f9fe5ce92c8d16e0b9ea7bde65148404”即为创建的新账户地址查看余额eth.getBalance("0x393b0054f9fe5ce92c8d16e0b9ea7bde65148404") 初始化账户余额为0.开始/停止挖矿miner.star...

2018-07-03 15:29:51 428

原创 【ethereum 1】go-ethereum搭建私有链

Environment:Ubuntu 16.04geth version 1.8.111. 初始化一个创世区块新建genesis.json配置文件,内容如下:{ "config": { "chainId": 0, "homesteadBlo

2018-07-02 18:30:50 465

原创 docker - 常见错误

docker 1 - 常见错误can’t connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?sudo docker service stopsudo rm -rf /var/lib/dockersudo docker service start

2017-12-05 17:00:59 269

原创 【Apollo 1】编译运行

使用ubuntu 14.04虚拟机,一定要将apollo文件夹拷贝到虚拟机上,不要采用共享文件夹的方式,要不然编译apollo源码过程中会有can't create symbolic link,文件read-only之类的错误。安装虚拟机步骤略过...1.下载源码git clone https://github.com/ApolloAuto/apollo2. 安装docke

2017-12-04 17:31:43 1336

原创 adb常用命令

adb logcatadb logcat --help  查看logcat帮助信息adb logcat -v 设置日志的输出格式,常用adb logcat -v timeadb logcat -c 清空日志信息,常用于开始抓取log前先清空一下adb logcat -s 设置过滤器,例如过滤Tag为"test"的log,输入adb logcat -s testadb logc

2017-07-04 16:31:37 230

原创 Android无线调试

1. 连接USB线2. 输入adb tcpip 55553. 断开USB4. adb connect XXX.XXX.XXX.XXX(你手机的IP地址)如果需要恢复USB调试,输入adb usb

2017-06-29 18:23:18 288

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除