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
| #[derive(Debug, Copy, Clone, PartialEq)] | |
| pub struct Point<T> { | |
| pub a : T, | |
| pub b : T, | |
| pub x : Option<T>, | |
| pub y : Option<T> | |
| } | |
| impl<T> Point<T> { | |
| pub fn infinity(a: T, b: T) -> Self { |
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 <iostream> | |
| #include <string> | |
| #include <vector> | |
| class RPCArgument { | |
| public: | |
| RPCArgument(const std::string& name, | |
| const std::string& type, | |
| const std::string& description, | |
| bool required=false, |
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
| #!/usr/bin/env ksh | |
| # | |
| # Benchmark Project Euler 1 programs by running them through same datsets | |
| # several times and computing the average. | |
| # | |
| Values=(1000 10000 100000 1000000 10000000) | |
| echo "${Values[@]}" | |
| Programs=("./c_euler_1" "./haskell_euler_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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| #include "result.h" | |
| #include "number_list.h" | |
| #include "population_statistics.h" | |
| eResult read_numbers(NumberList *number_list) |
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 Parent | |
| def try_me(confirmed_only: true) | |
| confirmed_only | |
| end | |
| end | |
| class Child < Parent | |
| def try_me(confirmed_only: true) | |
| # Ruby will proxy the value of `confirmed_only` up to the super method invocation for you. | |
| super |
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
| package main | |
| import ( | |
| "bytes" | |
| "crypto/sha256" | |
| "golang.org/x/crypto/ripemd160" | |
| "fmt" | |
| "math/big" | |
| ) | |
| const Base58Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" |
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
| require 'csv' | |
| def percent_support_tickets(time) | |
| 1.0 - ((time + 5) / 200.0) | |
| end | |
| seed = Random.new_seed | |
| prng = Random.new(seed) | |
| puts "Seed: #{seed}" |
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
| pragma solidity ^0.4.2; | |
| contract EIP150ReplaySafeSplit { | |
| // Fork oracle for EIP-150 fork | |
| AmIOnEIP150Fork amIOnEIP150Fork = AmIOnEIP150Fork(/* To be deployed */); | |
| // Fork oracle for ETH/ETC fork | |
| AmIOnTheFork amIOnDAOFork = AmIOnTheFork(0x2bd2326c993dfaef84f696526064ff22eba5b362); | |
| // This routine provides a way to route funds across Ethereum chain forks. It preserves | |
| // the signature of split method from DAO hard-fork replay split contract. If the current |
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
| pragma solidity ^0.4.2; | |
| contract AmIOnEIP150Fork { | |
| // Tracks whether or not hard fork is effective on this chain. | |
| bool public forked = false; | |
| // Event emitted on updates during fork window to indicate status. | |
| event ForkedStatus(bool forked); | |
| // This function should be called between block X and Y. | |
| function update() { |
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
| pragma solidity ^0.4.2; | |
| contract EIP150ForkConstant { | |
| // Used to determine gas constant | |
| event GasConstant(uint first, uint second, uint third); | |
| event OnFork(bool forked); | |
| // This function should be called between block X and Y. | |
| function run() { | |
| uint beforeGas = 0; |