Skip to content

Instantly share code, notes, and snippets.

View gragusa's full-sized avatar

Giuseppe Ragusa gragusa

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Utilities needed in rand()
# (exp(x) - 1) / x
function d2(z::Real)
const p1 = 0.840066852536483239e3
const p2 = 0.200011141589964569e2
const q1 = 0.168013370507926648e4
const q2 = 0.18013370407390023e3
const q3 = 1.0
(quail-define-package
"symbol-input" "unicode" "unicode-sym" t
"Easier input for unicode technical symbols"
nil t nil nil nil nil nil nil nil nil t)
(quail-define-rules
("\\alpha" ?α)
("\\beta" ?β)
("\\gamma" ?γ)
("\\delta" ?δ)
using MinimumDivergence
using ModelsGenerators
using Ipopt
using Divergences
HellingerDistance() = CressieRead(0.5)
ContinuousUpdating() = CressieRead(2.0)
ModifiedHellingerDistance(ϑ::Real) = ModifiedCressieRead(0.5, ϑ)
n = 31
ttt()=(randn(100,1), randn(100,1), randn(100,5))
function rvproducer()
for i = 1:n
produce(ttt())
end
end
@gragusa
gragusa / ForwardDiffArgs.jl
Created February 27, 2015 16:54
Modifies ForwardDiff to allow parameters in function definition
using ForwardDiff
import ForwardDiff: Dual, epsilon
function my_dual_fad{T<:Real}(f!::Function, x::Vector{T}, jac_out::Matrix{T}, dual_in, dual_out, args...)
for i in 1:length(x)
dual_in[i] = Dual(x[i], zero(T))
end
@gragusa
gragusa / sqlite2pg.sh
Last active August 29, 2015 14:23 — forked from eclubb/sqlite2pg.sh
#!/bin/sh
# This script will migrate schema and data from a SQLite3 database to PostgreSQL.
# Schema translation based on http://stackoverflow.com/a/4581921/1303625.
# Some column types are not handled (e.g blobs).
SQLITE_DB_PATH=$1
PG_DB_NAME=$2
PG_USER_NAME=$3
@gragusa
gragusa / mydiss.cls
Created October 8, 2012 14:44 — forked from ummels/mydiss.cls
Class file for my PhD thesis
\ProvidesClass{mydiss}[2012/08/22 v1.3 mydiss class (Michael Ummels)]
\NeedsTeXFormat{LaTeX2e}[1996/06/01]
% Options
\newif\if@iso
\@isofalse
\newif\if@crop
\@cropfalse
@gragusa
gragusa / mydiss.cls
Created October 8, 2012 14:46 — forked from ummels/mydiss.cls
Class file for my PhD thesis
\ProvidesClass{mydiss}[2012/08/22 v1.3 mydiss class (Michael Ummels)]
\NeedsTeXFormat{LaTeX2e}[1996/06/01]
% Options
\newif\if@iso
\@isofalse
\newif\if@crop
\@cropfalse
\documentclass[10pt, aspectratio=169]{beamer}
\usetheme{metropolis}
\usepackage{booktabs}
\usepackage[scale=2]{ccicons}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}