Skip to content

Instantly share code, notes, and snippets.

View tina1998612's full-sized avatar
:octocat:
DigitalNomad

李婷婷 Lee Ting Ting tina1998612

:octocat:
DigitalNomad
View GitHub Profile
#include "bigDecimal.h"
#include <iostream>
#include <sstream>
#include <stack>
#include <math.h>
using namespace std;
// helper functions
bool isPositive(Node* b){
if(b->data == '-') return false;
#include "bigDecimal.h"
#include <iostream>
#include <sstream>
#include <stack>
#include <math.h>
#include <cstring>
using namespace std;
// helper functions
bool isPositive(Node* b) {
#include <iostream>
using namespace std;
#include "TreeNode.h"
void insertNodeHelper( TreeNode< int > **ptr, int arr[], int len)
{
cout<<len<<endl;
if (len == 1) {*ptr = new TreeNode< int >( arr[0] ); cout<<"len 0"<<endl;}
// FILE: table2.h
// TEMPLATE CLASS PROVIDED: Table<RecordType>
// This class is a container template class for a Table of records.
// The template parameter, RecordType, is the data type of the records in the
// Table. It may any type with a default constructor, a copy constructor,
// an assignment operator, and an integer member variable called key.
#ifndef TABLE1_H
#define TABLE1_H
// FILE: link2.h
// PROVIDES: A toolkit of ten template functions for manipulating linked lists.
// Each node of the list contains a piece of data and a pointer to the next
// node, as shown in this template struct:
//
// template <class Item> Item may be any of the C++ built-in types
// struct Node (int, char, etc.), or a class with a default
// { constructor, an assignment operator,
// Item data; and a test for equality (x == y).
// Node *link;
pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
function functionSignatureFromAbi(abiArray) {
let functionSignatures = [];
for (i in abiArray) {
let abi = abiArray[i];
let functionSignature = abi.name + '(' + abi.inputs.map((input) => input.type + ' ' + input.name).join(', ') + ')';
functionSignatures.push(functionSignature);
// console.log(functionSignature);
}
return functionSignatures;
}
@tina1998612
tina1998612 / C.sol
Created July 12, 2018 04:27
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.24;
// @title MAR mode: Module-Agnostic Rendering Mode (Core)
// @author Jeff Hu
// @dev This smart contract is modularized via a module agnostic execution scheme
pragma solidity ^0.4.24;
contract Math {
uint public ans;
function add(uint a,uint b) public {
ans = a + b;
}
}
pragma solidity ^0.4.24;
//// All Modules ////
contract Math {
// Module #0
function plus(uint _n1, uint _n2) public pure returns (uint) { return _n1 + _n2; }
// Module #1
function minus(uint _n1, uint _n2) public pure returns (uint ans) { return _n1 - _n2; }
// Module #2