Skip to content

Instantly share code, notes, and snippets.

var primes = new Array();
var factor = function(n){
for (var i = 2; i === n-1; i++)
{
if (n%i !== 0 || n !== i){
primes.push(i);
}else{n = n-1;}
}
};
#!/usr/bin/env node
var fs = require('fs');
var outfile = "primes.txt";
var primes = new Array();
var i = 2;
var factor = function(n){
while (primes.length<100)
{
if (n%i !== 0 && i === n-1 ||n===2){
principal = float(input("Enter the lump sum investment: "))
apr = float(input("Enter the perodic interest rate: "))
years = int(input("Enter the number of periods: "))
x = years
for i in range(years):
principal = principal * (1+apr)
print('The value in %s periods is: %s' % (years,principal))
margin = float(input("Enter the gross margin per customer: "))
churn = float(input("Enter the percentage of customers who end their relationship with a company in a given period: "))
discount = float(input("Enter the cost of capital used to discount future revenue from a customer(discount rate): "))
gc = float(input("Enter the yearly gross contribution per customer: "))
clv = (gc * margin) * ((1 - churn) / (1 + discount - (1 - churn)))
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bgits
bgits / UsernameRegistry_flat.sol
Created September 11, 2018 14:15
UsernameRegistry + related contracts
pragma solidity ^0.4.24;
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 _amount, address _token, bytes _data) public;
}
interface ENS {
// Logged when the owner of a node assigns a new owner to a subnode.
@bgits
bgits / status-build-log.txt
Created January 9, 2019 16:38
build failure - status-react
/Applications/Xcode.app/Contents/Developer/usr/bin/make prepare-ios
scripts/prepare-for-platform.sh ios
+ node version v10.12.0 is installed. node version v10.14.0 is recommended.
Finished!
Creating link: package.json -> mobile_files/package.json.orig
Creating link: yarn.lock -> mobile_files/yarn.lock
Creating link: VERSION -> mobile_files/VERSION
Finished!
yarn install --frozen-lockfile
yarn install v1.12.3
/Applications/Xcode.app/Contents/Developer/usr/bin/make prepare-ios
scripts/prepare-for-platform.sh ios
+ node version v10.12.0 is installed. node version v10.14.0 is recommended.
Finished!
Creating link: package.json -> mobile_files/package.json.orig
Creating link: yarn.lock -> mobile_files/yarn.lock
Creating link: VERSION -> mobile_files/VERSION
Finished!
yarn install --frozen-lockfile
yarn install v1.12.3
{
"args": [
"$TestToken",
"$ENSRegistry",
"$PublicResolver",
"0x5f7791d31ca0493e9ca7c9ca16695ecd9d5044768674d14d31ab5d8277518fff",
3,
"0xb46e19581b371ab0856ee8ffd05b33cbfd264755e18f2d004780bb929970a53e",
"0x9e183BC54Bb4f3cCa1A478CA6f2c3EdC37B60478"
],
@bgits
bgits / whisper.csv
Created March 20, 2019 15:40
Whisper messages 12/15/2018 - 03/20/2018
We can make this file beautiful and searchable if this error is corrected: Any value after quoted field isn't allowed in line 1.
"Time";"mail-01.ac-cn-hongkong-c.eth.beta(statusd-mail)";"mail-02.ac-cn-hongkong-c.eth.beta(statusd-mail)";"mail-03.ac-cn-hongkong-c.eth.beta(statusd-mail)";"mail-01.do-ams3.eth.beta(statusd-mail)";"mail-02.do-ams3.eth.beta(statusd-mail)";"mail-03.do-ams3.eth.beta(statusd-mail)";"mail-01.gc-us-central1-a.eth.beta(statusd-mail)";"mail-02.gc-us-central1-a.eth.beta(statusd-mail)";"mail-03.gc-us-central1-a.eth.beta(statusd-mail)";"mail-01.ac-cn-hongkong-c.eth.beta(statusd-mail-1)";"mail-02.ac-cn-hongkong-c.eth.beta(statusd-mail-1)";"mail-03.ac-cn-hongkong-c.eth.beta(statusd-mail-1)";"mail-01.do-ams3.eth.beta(statusd-mail-1)";"mail-02.do-ams3.eth.beta(statusd-mail-1)";"mail-03.do-ams3.eth.beta(statusd-mail-1)";"mail-01.gc-us-central1-a.eth.beta(statusd-mail-1)";"mail-02.gc-us-central1-a.eth.beta(statusd-mail-1)";"mail-03.gc-us-central1-a.eth.beta(statusd-mail-1)"
"2018-12-31";null;null;null;null;null;null;null;null;null;37,059.868;37,058.868;37,059.868;37,057.867;37,058.867;37,063.872;37,059.868;37,056.867;37,059.