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
const IOTA = require('iota.lib.js'); | |
const iota = new IOTA({ provider: 'https://nodes.testnet.iota.org:443' }); | |
const remoteCurl = require('@iota/curl-remote'); | |
remoteCurl(iota, `https://powbox.testnet.iota.org`, 500); | |
// cat /dev/urandom | LC_ALL=C tr -dc 'A-Z9' | fold -w 81 | head -n 1 | |
const seed = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; | |
let newaddr = () => { |
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
// Generate contract instance. Pass contract address as 2nd parameter. | |
Contract contract(&web3, CONTRACT_ADDRESS); | |
// Set your secret to contract. | |
// This secret will not send to server (of course!) but use in local to sign. | |
contract.SetPrivateKey((uint8_t*)PRIVATE_KEY); | |
// set required data to execute sendTransaction | |
// nonce can be get with web3.EthGetTransactionCount() API | |
uint32_t nonceVal = (uint32_t)web3.EthGetTransactionCount((char *)MY_ADDRESS); |
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
web3.Web3ClientVersion(result); | |
USE_SERIAL.println(result); // Geth/v1.7.3-stable-4bb3c89d/linux-amd64/go1.9 |
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
#define INFURA_HOST "rinkeby.infura.io" | |
#define INFURA_PATH "/<YOUR_INFURA_ID>" | |
Web3 web3(INFURA_HOST, INFURA_PATH); |
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; | |
contract Sample { | |
uint data; | |
function set(uint d) public{ | |
data = d; | |
} | |
function get() public constant returns (uint retVal) { |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<kml xmlns="http://www.opengis.net/kml/2.2"> | |
<Document> | |
<name>計算用</name> | |
<description/> | |
<Style id="icon-1899-FF5252-nodesc-normal"> | |
<IconStyle> | |
<color>ff5252ff</color> | |
<scale>1</scale> | |
<Icon> |
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
#include <SPI.h> | |
#define PROMINI | |
#ifdef PROMINI | |
// pin number | |
#define VCC 8 | |
#define GND 9 | |
#define SLAVE 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
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <execinfo.h> | |
#include <signal.h> | |
void test() { | |
void *trace[128]; | |
int n = backtrace(trace, sizeof(trace) / sizeof(trace[0])); | |
backtrace_symbols_fd(trace, n, 1); |
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
unsigned char slave_addr= 0x4c; | |
unsigned char MMA7660_MODE = 0x07; | |
unsigned char MMA7660_STAND_BY = 0x00; | |
unsigned char MMA7660_ACTIVE = 0x01; | |
unsigned char MMA7660_SR = 0x08; | |
unsigned char AUTO_SLEEP_1 = 0X07; | |
- (void)init { |
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
/* | |
* (C) Copyright 2014 | |
* okada.takahiro111@gmail.com | |
* | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License as | |
* published by the Free Software Foundation; either version 2 of | |
* the License, or (at your option) any later version. | |
* | |
* Sample to read/write "mbed Geta SPI PRAM 128Mbit" from Iteaduino A20. |
NewerOlder