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 requests | |
API_KEY = 'YOUR_API_KEY' | |
BASE_URL = 'http://social.repustate.com/%(api_key)s/%(call)s.json' | |
# Create a new data source. | |
kwargs = {'api_key':API_KEY, 'call':'add-datasource'} | |
response = requests.post(BASE_URL % kwargs, {'name':'Rob Ford', 'language':'en', 'niche':'general'}) | |
datasource_id = response.json()['datasource_id'] |
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
// Galaxy collisions | |
Star[] Stars; | |
PVector[] galp; | |
PVector[] galv; | |
color[] galcol, galcol2; | |
boolean paused = false; | |
int side = 100; // border around Stars' initial positions | |
int Startot = 300; // number of Stars | |
int obsize = 10; // size of Stars |
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 Foundation | |
public protocol AlmostEquatable { | |
@warn_unused_result | |
func ==~(lhs: Self, rhs: Self) -> Bool | |
} | |
public protocol EquatableWithinEpsilon: Strideable { | |
static var Epsilon: Self.Stride { get } | |
} |
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
// Model to represent an account in the distributed database | |
// Accounts are mainly a place users can store information like their private keys, in a password protected | |
// vault, so they can login conveniently from other devices and keep hold of their private keys and record | |
// what blogs they are authors of. It's also a way for other users to lookup an authors public keys to validate | |
// their other objects when determining if a new version of some data really belongs to the blog it claims to be | |
// related to. | |
const nacl = require('tweetnacl') | |
const cbor = require('borc') | |
class HSAccount { |
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
const { Transform } = require('stream'); | |
class AppendInitVect extends Transform { | |
constructor(initVect, opts) { | |
super(opts); | |
this.initVect = initVect; | |
this.appended = false; | |
} | |
_transform(chunk, encoding, cb) { |
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
// Open-ended range operators | |
// | |
// 100... is equivalent to 100...Int.max | |
// ...-100 is equivalent to Int.min...-100 | |
// ..<3 is equivalent to Int.min..<3 | |
import Swift | |
/// Conforming types provide static `max` and `min` constants. | |
protocol MinMaxType { |
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
/* | |
* NAME | |
* | |
* statistics-distributions.js - JavaScript library for calculating | |
* critical values and upper probabilities of common statistical | |
* distributions | |
* | |
* SYNOPSIS | |
* | |
* |
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
// Simple example of how to display an image from IPFS on your html web page | |
// Using ipfs/js-ipfs : https://github.com/ipfs/js-ipfs#use-in-the-browser | |
// Don't forget to include the scripts into your html page: | |
// <script src="https://unpkg.com/ipfs/dist/index.min.js"></script> | |
// <script src="https://cdn.jsdelivr.net/npm/ipfs/dist/index.min.js"></script> | |
function showIPFSImage () { | |
// Create the IPFS node instance | |
const node = new Ipfs() |
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
# -*- coding: utf-8 -*- | |
u""" | |
Beta regression for modeling rates and proportions. | |
References | |
---------- | |
Grün, Bettina, Ioannis Kosmidis, and Achim Zeileis. Extended beta regression | |
in R: Shaken, stirred, mixed, and partitioned. No. 2011-22. Working Papers in | |
Economics and Statistics, 2011. |
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
// Part of https://github.com/chris-rock/node-crypto-examples | |
// Nodejs encryption of buffers | |
var crypto = require('crypto'), | |
algorithm = 'aes-256-ctr', | |
password = 'd6F3Efeq'; | |
var fs = require('fs'); | |
var zlib = require('zlib'); |
OlderNewer