Skip to content

Instantly share code, notes, and snippets.

View krtk6160's full-sized avatar

Kartik Shah krtk6160

View GitHub Profile
@krtk6160
krtk6160 / P5.py
Created August 1, 2017 14:30 — forked from sharanya0513/P5.py
max.val
def max_val(t):
""" t, tuple or list
Each element of t is either an int, a tuple, or a list
No tuple or list is empty
Returns the maximum int in t or (recursively) in an element of t """
max_v=0
def test(t,max_v):
pragma solidity^0.4.21;
contract Test {
mapping(address => patientStruct) public map;
struct patientStruct{
address[] deptArray;
mapping(string => string);
}
constructor() {
// Establish a Socket.io connection
const socket = io();
// Initialize our Feathers client application through Socket.io
// with hooks and authentication.
const client = feathers();
client.configure(feathers.socketio(socket));
// Use localStorage to store our login token
client.configure(feathers.authentication({
storage: window.localStorage
{
"validationCode": 0,
"transactionEnvelope": {
"signature": {
"type": "Buffer",
"data": [
48,
68,
2,
32,
613c8f75a87118da7e5091dc5ecac4ec96733c5e6f486be74dcca8acd7427befc286a968f2b79d266a41e3ba09434cfd232e407fd21988a52fef0e5f2cfac57c
import LinkdropSDK from '@linkdrop/sdk'
import 'babel-polyfill';
var linkdropMasterAddress="0x7068f16f66bCdAA7FCF575De47d094765772977A";
var factoryAddress="0xBa051891B752ecE3670671812486fe8dd34CC1c8";
const linkdropSDK = new LinkdropSDK({
linkdropMasterAddress,
factoryAddress,
сhain : 'kovan',
var linkdropMasterAddress = "0x7068f16f66bCdAA7FCF575De47d094765772977A";
var factoryAddress = "0xBa051891B752ecE3670671812486fe8dd34CC1c8";
var linkdropSigningKey = 'A663EC3E46FD14E52B145EE5B58F356246723FF1EA95E3D5E51358B66AE9DA39'
const uuidv4 = require('uuid/v4')
const linkdropSDK = new LinkdropSDK({
linkdropMasterAddress,
factoryAddress,
сhain: 'kovan',
jsonRpcUrl: `https://kovan.infura.io`,
const kafka = require('kafka-node')
const Producer = kafka.Producer;
const client = new kafka.KafkaClient('http://localhost:9092');
const producer = new Producer(client);
const kafka_topic = 'contract-events';
console.log(kafka_topic);
let struct = {
"details":{
"name":"Opened",
var linkdropMasterAddress = "0x7068f16f66bCdAA7FCF575De47d094765772977A";
var factoryAddress = "0xBa051891B752ecE3670671812486fe8dd34CC1c8";
var linkdropSigningKey = 'A663EC3E46FD14E52B145EE5B58F356246723FF1EA95E3D5E51358B66AE9DA39'
const campaignId = uuidv4();
let proxyAddress = linkdropSDK.getProxyAddress(
new web3.utils.BN(uuidv4().replace(/-/g, "")).toString()
)
console.log(proxyAddress)
const ethers = require('ethers')
var addr = '0xF2B971B7509DBE603e5a2204d799E73Be9DF35D6' // receiver addr
var w = new ethers.Wallet('A663EC3E46FD14E52B145EE5B58F356246723FF1EA95E3D5E51358B66AE9DA39', ethers.getDefaultProvider('rinkeby'))
w.signMessage(addr)