Skip to content

Instantly share code, notes, and snippets.

View rolandkofler's full-sized avatar

Ro rolandkofler

View GitHub Profile
@rolandkofler
rolandkofler / average-bitcoin-prices.R
Last active August 29, 2015 14:00
Regression of weekly average bitcoin prices since 2010
a=read.csv('http://www.quandl.com/api/v1/datasets/BAVERAGE/USD.csv?&trim_start=2010-07-17&trim_end=2018-05-02&collapse=weekly&sort_order=desc', colClasses=c('Date'='Date'))
names(a)[2] <- "Weighted.Price"
fit=lm(formula=Weighted.Price~Date, data=a)
#abline(fit$coefficients)
summary(fit)
library(ggplot2)
library(scales)
m = lm(log10(Weighted.Price) ~ Date, a);
@rolandkofler
rolandkofler / ElasticsearchSinkConnector.java
Created January 7, 2016 12:23
The Connector class configures the tasks and provides a template how to start the tasks.
public class ElasticsearchSinkConnector extends SinkConnector {
public static final String ES_HOST = "es.host";
public static final String INDEX_PREFIX = "index.prefix";
private String esHost;
private String indexPrefix;
@Override
public String version() {
<rezeptur>
<verbal>40 % Rinderschulter, 40 % magerer Schweinebauch</verbal>
<zutaten>
<zutat>
<id>27</id>
<bez>Rinderschulter</bez>
<proz>40</proz>
</zutat>
<zutat>
<id>05</id>
<html><head>
<meta charset="utf-8">
<title>MetaMask Notification</title>
<style>
body {
overflow: hidden;
}
</style>
<style type="text/css">/*========== fonts.css ==========*/

Keybase proof

I hereby claim:

  • I am rolandkofler on github.
  • I am rolandk (https://keybase.io/rolandk) on keybase.
  • I have a public key ASAae7CdH-SiEXEA21KS94sRMdxQr-5FgJIBIck0L8LMNgo

To claim this, I am signing this object:

0x9b231950070308a3930a08020316DBB6999924C2
the thes that nobondy can
@rolandkofler
rolandkofler / DecimalTest.sol
Last active June 13, 2018 08:40
Shows that a single computation preserves the decimals while a multistep computation not
pragma solidity 0.4.24;
import 'https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/math/SafeMath.sol';
contract TestDecimals{
uint public singleComputation;
uint public multiStepComputation;
uint public safeMath;
using SafeMath for uint;
constructor(){
Method Result
multiStepComputation 123500 
singleComputation 123556 
safeMath 123500
pragma solidity 0.4.24;
contract TestMath {
uint public constant MAX_INT = uint(-1);
uint public constant TRILLION_18_DECIMALS = 1000000000000 * 10**18;
uint public constant TRILLION_SQUARED_18_DECIMALS = TRILLION_18_DECIMALS * TRILLION_18_DECIMALS;
uint public constant BILLION_18_DECIMALS = 1000000000 * 10**18;