Skip to content

Instantly share code, notes, and snippets.

View frhack's full-sized avatar

Francesco Pasqualini frhack

View GitHub Profile
#!/bin/bash
# Brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
# oh my ZSH
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
@elizarov
elizarov / AD.kt
Last active February 26, 2023 15:18
Automatic Differentiation with Kotlin
/*
* Implementation of backward-mode automatic differentiation.
*/
/**
* Differentiable variable with value and derivative of differentiation ([grad]) result
* with respect to this variable.
*/
data class D(var x: Double, var d: Double = 0.0) {
constructor(x: Int): this(x.toDouble())
@Alger23
Alger23 / gist:acf9043c36f6bbaaa12c9f1ebd1e43e5
Created July 1, 2017 08:26
Generate C# POCOs from SQL statement in LINQPad
public static class LINQPadExtensions
{
private static readonly Dictionary<Type, string> TypeAliases = new Dictionary<Type, string> {
{ typeof(int), "int" },
{ typeof(short), "short" },
{ typeof(byte), "byte" },
{ typeof(byte[]), "byte[]" },
{ typeof(long), "long" },
{ typeof(double), "double" },
{ typeof(decimal), "decimal" },
@franktoffel
franktoffel / complex_step_derivative.py
Last active July 18, 2022 02:33
Complex-step derivative approximation (implemented in Python, NumPy, matplotlib)
# coding: utf-8
'''The following code reproduces an example of the paper:
'The Complex-Step Derivative Approximation'
by Joaquim R. R. A. MARTINS, Peter STURDZA and Juan J. Alonso published in 2003.
License: MIT
Author: FJ Navarro Brull
'''
@gtallen1187
gtallen1187 / slope_vs_starting.md
Created November 2, 2015 00:02
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]