This file contains hidden or 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
#include <iostream> | |
#include <stdint.h> | |
class Area; | |
class Quest; | |
template <typename T, typename Meaning> | |
struct Explicit | |
{ | |
Explicit() {} |
This file contains hidden or 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
[254, 253, 3].map { |v| v.to_s(16).rjust(2, '0') }.join |
This file contains hidden or 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
defmodule Loop do | |
def each([head|tail], fun) do | |
[fun.(head)|each(tail, fun)] | |
end | |
def each([], _) do | |
[] | |
end | |
end | |
Loop.each [1, 2], fn element -> |
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 34 columns, instead of 1 in line 4.
This file contains hidden or 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
0.02620087336,0,0,0,0,1,0,0,0,0,0,0,0,0.237037037,0.5070422535,0.6,0.6923076923,0,0.1212121212,0.5,0.6367980884,0.5735080058,0.6797752809,0.6111111111,0.7682926829,0.2727272727,0.479638009,0.7974683544,0.7183098592,0.4277777778,0.2958823529,0,0.2083333333,1 | |
0.2358078603,0,0,1,0,0,0,0,0,0,0,0,0,0.6790123457,0.01408450704,0,0.07692307692,0,0,0,0.05256869773,0.03881610869,0.1011235955,0.05555555556,0.0487804878,0,0.01357466063,0.1392405063,0.1549295775,0.6777777778,0.3594117647,0.2173913043,0.5416666667,1 | |
0.2139737991,0,0,0,1,0,0,0,0,0,0,0,0,0.1265432099,1,0.3333333333,0.1538461538,0,1,0.714,0.3261648746,0.3352741388,0.2921348315,0.1111111111,0.2682926829,0.09090909091,0.2805429864,0.2151898734,0.2253521127,0.2916666667,0.2111764706,0,0.375,1 | |
0.05021834061,0,0,0,0,1,0,0,0,0,0,0,0,0.3067901235,0.3943661972,0.06666666667,0.2307692308,0,0.3333333333,0.25,0.146953405,0.1358563804,0.1853932584,0.2222222222,0.1341463415,0,0.09502262443,0.2025316456,0.2253521127,0.4222222222,0.3223529412,0.1739130435,0.4166666667,1 | |
0.0 |
This file contains hidden or 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
library(dplyr) | |
library(ggplot2) | |
extract_input <- function(data) { | |
return(data %>% select(c(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width))) | |
} | |
extract_labels <- function(data) { | |
return(data %$% Species %>% factor) | |
} |
This file contains hidden or 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
library(plyr) | |
num_data <- 100 | |
true_lambda <- 1 | |
sample_from_distribution <- function(candidates, distribution, threshold) { | |
while (TRUE) { | |
x <- sample(candidates, size = 1) | |
dice <- runif(n = 1, min = 0, max = 1) | |
if (dice < distribution(x) / threshold) { |
This file contains hidden or 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
library(magrittr) | |
F <- function(y, theta) { | |
dnorm(y, mean = theta, sd = 1) | |
} | |
G0 <- function(theta) { | |
dnorm(theta, mean = 0, sd = 1) | |
} |
This file contains hidden or 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
def show_mat(mat): | |
fig = plt.figure() | |
ax = fig.add_subplot(111) | |
cax = ax.matshow(mat) | |
fig.colorbar(cax) |
This file contains hidden or 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 scipy.linalg | |
import numpy as np | |
import sys | |
num_samples = 500000 | |
n = 7 | |
def inv(Q, x, num_eqs): |
This file contains hidden or 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
np.set_printoptions(formatter={'float': lambda x: '%+1.1f' % x}, linewidth=50) |