/* interfaces for generic */
int Del(const std::string &strKey, long *pnVal = nullptr, Pipeline ppLine = nullptr)
int Dump(const std::string &strKey, std::string *pstrVal, Pipeline ppLine = nullptr)
int Exists(const std::string &strKey, long *pnVal, Pipeline ppLine = nullptr)
int Expire(const std::string &strKey, long nSec, long *pnVal = nullptr, Pipeline ppLine = nullptr)
int Expireat(const std::string &strKey, long nTime, long *pnVal = nullptr, Pipeline ppLine = nullptr)
int Keys(const std::string &strPattern, std::vectorstd::string *pvecVal)
int Persist(const std::string &strKey, long *pnVal = nullptr, Pipeline ppLine = nullptr)
int Pexpire(const
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
| var readline = require('readline'); | |
| var fs = require('fs'); | |
| var os = require('os'); | |
| var fReadName = './data.cpp'; | |
| var fWriteName = './data.deal.cpp'; | |
| var fRead = fs.createReadStream(fReadName); | |
| var fWrite = fs.createWriteStream(fWriteName); | |
| var objReadline = readline.createInterface({ |
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 Redis | |
| { | |
| public: | |
| redisContext* context; | |
| Redis(const char * ip="127.0.0.1",int port=6379){ | |
| this->context = redisConnect(ip,port); | |
| if(this->context == NULL || context->err){ | |
| if(context){ | |
| printf("Error: %s\n",context->errstr); | |
| exit(-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
| // ==UserScript== | |
| // @name csdn | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author You | |
| // @match http://*/* | |
| // @grant none | |
| // ==/UserScript== |
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
| #include <string> | |
| #include <thread> | |
| #include "RedisClient.h" | |
| void f(int index){ | |
| std::string strKey = "name"; | |
| std::string strVal; | |
| CRedisClient* r = CRedisClient::Instance(); | |
| int ret = r->Get(strKey, &strVal); | |
| std::cout << index << ":" << std::this_thread::get_id() << " request ret = " << ret << ", val = " << strVal << std::endl; |
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
| var readline = require('readline'); | |
| var fs = require('fs'); | |
| var os = require('os'); | |
| var fReadName = './test.cpp'; | |
| var fWriteName = './test.deal.cpp'; | |
| var fRead = fs.createReadStream(fReadName); | |
| var fWrite = fs.createWriteStream(fWriteName); | |
| var objReadline = readline.createInterface({ |
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 { app, BrowserWindow } from 'electron' | |
| import { autoUpdater } from "electron-updater" | |
| import log from "electron-log" | |
| autoUpdater.logger = log; | |
| autoUpdater.logger.transports.file.level = "info"; | |
| log.info("App starting..."); | |
| /** |
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
| var keythereum = require("keythereum"); | |
| var path = require("path"); | |
| var fs = require("fs-extra"); | |
| var createKeccakHash = require("keccak/js"); | |
| var os = require('os'); | |
| var secp256k1 = require("secp256k1/elliptic"); | |
| var ffi = require('ffi'); | |
| var ref = require('ref'); | |
| var sha3 = require('crypto-js/sha3'); |
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
| Json::Value Eth::eth_getTransactionByHash(string const& _transactionHash) | |
| { | |
| static int count = 0; | |
| static int totalSpend = 0; | |
| try | |
| { | |
| h256 h = jsToFixed<32>(_transactionHash); | |
| std::chrono:: steady_clock :: time_point t1 = std::chrono:: steady_clock ::now(); | |
| bool ret = client()->isKnownTransaction(h); | |
| std::chrono:: steady_clock :: time_point t2 = std::chrono:: steady_clock ::now(); |