Skip to content

Instantly share code, notes, and snippets.

Avatar

Yuri yurivish

View GitHub Profile
@rmitton
rmitton / hipparchus.c
Created Aug 30, 2020
Mandelbrot set rendered from a first-person viewpoint
View hipparchus.c
// I don't know what I'm looking at here.
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#define OUTPUT "hipparchus.pgm"
#define WIDTH 1024
@jiahao
jiahao / naivebayes.jl
Last active Apr 28, 2019
Multinomial naive Bayes in Julia, allowing for generic numeric types for the conditional probabilities. When using rational numbers, you can calculate exact probabilities without roundoff error.
View naivebayes.jl
struct MultinomialNaiveBayes{T, V<:AbstractVector}
feature_ratios::V
prior_ratio::T
end
"""
fit(MultinomialNaiveBayes, [T,] features, labels, α = 1) -> MNB
fits a `MultinomialNaiveBayes` classifier `MNB` using the
`features` matrix and `labels` vector of `Bool`s.
@rntz
rntz / tonetheory.ml
Last active Mar 4, 2018
An introduction to tone theory, and subtyping for a fragment of modal Datafun
View tonetheory.ml
(* A quick note about preorders; skip this if you know about them.
*
* A preorder is a relation (a ≤ b) satisfying two rules:
* 1. Reflexivity: a ≤ a.
* 2. Transitivity: if a ≤ b and b ≤ c then a ≤ c.
*
* A good example of a preorder is "lists under containment":
* let (X ≤ Y) if every element of the list X is also in Y.
*
* Preorders are like partial orders, but without requiring antisymmetry.
View pyfft.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View dispatchingNamedTuples.jl
julia> nt_proto_a_names = (:first, :last)
(:first, :last)
julia> nt_proto_b_names = (:larger, :smaller)
(:larger, :smaller)
julia> nt_proto_a = NamedTuple{nt_proto_a_names}
NamedTuple{(:first, :last),T} where T<:Tuple
julia> nt_proto_b = NamedTuple{nt_proto_b_names}
View noise4.jl
#=
# Perlin noise ported from: https://github.com/caseman/noise
# with the license:
Copyright (c) 2008 Casey Duncan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@AlexanderWillner
AlexanderWillner / things.sh
Last active Nov 8, 2020 — forked from avdgaag/things.sh
Command-line read-only interface to your local Things database of to do items.
View things.sh
Moved to https://github.com/alexanderwillner/things.sh/
@Reedbeta
Reedbeta / cool-game-programming-blogs.opml
Last active Oct 12, 2020
List of cool blogs on game programming, graphics, theoretical physics, and other random stuff
View cool-game-programming-blogs.opml
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Graphics, Games, Programming, and Physics Blogs</title>
</head>
<body>
<outline text="Tech News" title="Tech News">
<outline type="rss" text="Ars Technica" title="Ars Technica" xmlUrl="http://feeds.arstechnica.com/arstechnica/index/" htmlUrl="https://arstechnica.com"/>
<outline type="rss" text="Polygon - Full" title="Polygon - Full" xmlUrl="http://www.polygon.com/rss/index.xml" htmlUrl="https://www.polygon.com/"/>
<outline type="rss" text="Road to VR" title="Road to VR" xmlUrl="http://www.roadtovr.com/feed" htmlUrl="https://www.roadtovr.com"/>
You can’t perform that action at this time.