Skip to content

Instantly share code, notes, and snippets.

let getProb nums =
let p = List.fold (fun acc n -> (1.0 - n) * acc) 1.0 nums in (1.0 - p) * 100.0
getProb [0.5; 0.5] |> Dump
getProb [0.05; 0.05; 0.05; 0.07; 0.07] |> Dump
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script>
function transformData(data) {
return data.results;
}
@dotsonjb14
dotsonjb14 / readingList.js
Last active December 20, 2015 21:20
novel updates scripts
// ==UserScript==
// @name Novel Updates Reading List Scripts
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the world!
// @author Joseph Dotson
// @match http://www.novelupdates.com/reading-list/
// @grant none
// @run-at document-end
// ==/UserScript==
@dotsonjb14
dotsonjb14 / es6urtil.js
Created February 5, 2016 18:19
adding map to Map and Set
(function () {
if (Map !== void 0 && Map.prototype.map === void 0) {
Map.prototype.map = function (func) {
return [...this].map(x => func(...x));
};
}
if(Set !== void 0 && Set.prototype.map === void 0) {
Set.prototype.map = function (func) {
return [...this].map(x => func(x));
}
this.punchesService.getEmployees()
.then(function (emps) {
// emps will contain your employees from the api
});
interface ICar {
name: string,
wheels: number
}
var car1: ICar = {
name: "my name",
wheels: 4
}
Position Title Kind Start End
1 Death Note TV (37 eps) Oct 2006 Jun 2007
2 Shingeki no Kyojin TV (25 eps) Apr 2013 Sep 2013
3 Sword Art Online TV (25 eps) Jul 2012 Dec 2012
4 Fullmetal Alchemist: Brotherhood TV (64 eps) Apr 2009 Jul 2010
5 Angel Beats! TV (13 eps) Apr 2010 Jun 2010
6 Code Geass: Hangyaku no Lelouch TV (25 eps) Oct 2006 Jul 2007
7 Steins;Gate TV (24 eps) Apr 2011 Sep 2011
8 Naruto TV (220 eps) Oct 2002 Feb 2007
9 Mirai Nikki (TV) TV (26 eps) Oct 2011 Apr 2012
Position Title Kind Start End
1 Kimi no Na wa. Movie (1 eps) Aug 2016 Aug 2016
2 Fullmetal Alchemist: Brotherhood TV (64 eps) Apr 2009 Jul 2010
3 Gintama° TV (51 eps) Apr 2015 Mar 2016
4 Steins;Gate TV (24 eps) Apr 2011 Sep 2011
5 Gintama' TV (51 eps) Apr 2011 Mar 2012
6 Koe no Katachi Movie (1 eps) Sep 2016 Sep 2016
7 Hunter x Hunter (2011) TV (148 eps) Oct 2011 Sep 2014
8 Ginga Eiyuu Densetsu OVA (110 eps) Jan 1988 Mar 1997
9 Gintama': Enchousen TV (13 eps) Oct 2012 Mar 2013
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
#include <iostream>
int main()
{
srand(time(NULL) + 729 + 985);
std::cout << "Rolled number here -> " << (rand() % 6 + 1) << "\n" << std::flush;
system("pause");
return 0;
@dotsonjb14
dotsonjb14 / rules.md
Last active August 21, 2018 00:12
Home of Time Rules (WIP)

Home of time rules (WIP)

New people

Anyone on the server can invite new people to the server. However new people will join without any permissions to talk in the lobby, and several other channels. They can become a Member by completing the following steps.

  1. Be a guest on the server for at least 1 month.
  2. Be nominated by an existing Member or Admin
  3. A vote will be held in which all existing Members and Admins will get a vote.