paymentModelFunction = function(gbHours, telemReports, downloadedBytes) {
gbHoursScaled = (gbHours - mean(gbHours)) / sd(gbHours)
telemReportsScaled = (telemReports - mean(telemReports)) / sd(telemReports)
downloadedBytesScaled = (downloadedBytes - mean(downloadedBytes)) / sd(downloadedBytes)
basePayout = 10
ghHourPayout = 12.2221 * gbHoursScaled
telemReportsPayout = 0.1452 * telemReportsScaled
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
// Create a private scope. | |
(function( $, on ){ | |
// I proxy the given function and return the resultant GUID | |
// value that jQuery has attached to the function. | |
var createAndReturnProxyID = function( target ){ | |
// When generating the proxy, it doesn't matter what the | |
// "context" is (window in this case); we never actually |
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
#!/bin/bash -e | |
# Run a program requiring xserver as another user by passing on the xauth cookie | |
# s. http://askubuntu.com/questions/871092/failed-to-connect-to-mir-failed-to-connect-to-server-socket-no-such-file-or-di?newreg=811c7a1d637341c5b294d8b515e8b6e7 | |
# s. http://serverfault.com/questions/51005/how-to-use-xauth-to-run-graphical-application-via-other-user-on-linux | |
# AUTHOR: Florian Lentsch <office@florian-lentsch.at> | |
# TESTED: on Ubuntu 16.04 only | |
# | |
# USAGE: xsudo <username> <command> |
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
TEST_ONE=common-env-file | |
TEST_TWO=common-env-file | |
TEST_TREE=common-env-file | |
TEST_FOUR=common-env-file |
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
import pandas as pd | |
from io import StringIO | |
from openpyxl.formatting.rule import ColorScaleRule | |
from openpyxl.styles import Alignment, Font, NamedStyle | |
from openpyxl.utils import get_column_letter | |
df = pd.read_csv(StringIO("""\ | |
alpha beta gamma | |
2000-01-01 -0.173215 0.119209 -1.044236 | |
2000-01-02 -0.861849 -2.104569 -0.494929 |
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
#! /usr/bin/env python | |
class Point(object): | |
def __init__(self, _x, _y, _order = None): self.x, self.y, self.order = _x, _y, _order | |
def calc(self, top, bottom, other_x): | |
l = (top * inverse_mod(bottom)) % p | |
x3 = (l * l - self.x - other_x) % p | |
return Point(x3, (l * (self.x - x3) - self.y) % p) |
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
import tensorflow as tf | |
import numpy as np | |
import time | |
N=10000 | |
K=4 | |
MAX_ITERS = 1000 | |
start = time.time() |
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
#!/bin/bash | |
HOST=foo.example.com | |
USER= | |
PASS= | |
IPADDR=$(wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//') | |
RESULT=$(wget -q -O- "https://$USER:$PASS@members.dyndns.org/nic/update?hostname=$HOST&myip=$IPADDR&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG") |
OlderNewer