Skip to content

Instantly share code, notes, and snippets.

@aussetg
aussetg / buildapcmice.md
Created August 6, 2012 16:57
/r/buildapc, let's talk gaming mice.

/r/buildapc, let's talk gaming mice.

Original post by h7u9i on reddit.com

I've been on this subreddit for a while, but I haven't seen any good guides to getting a gaming mouse. So here we go.

There's a lot that goes into making a good mouse, and some things may get confusing. Here's list of some terms that you might come across:

  • DPI - Dots per inch - Basically, this describes the sensitivity of your mouse. When you move your mouse, it detects how much you've moved it, and moves the cursor accordingly. The more DPI you have, the less movement is required to move the cursor the same amount.
  • Acceleration - If a mouse has acceleration, it means that as you move the mouse faster, it will move your cursor faster. For example, let's say if I move my move one inch in one second, the cursor will move 500 pixels. With acceleration, if I move my mouse one inch in half a second, the cursor may move 750 pixels. Some people like acceleration, others don't. If your mouse comes with this feature, there is usua
library(compiler)
enableJIT(3)
pimc = function(n) {
v1 <- runif(n)
v2 <- runif(n)
vc <- v1^2 + v2^2
vc[vc<=1] <- 1
vc[vc>1] <- 0
\documentclass{article}\usepackage{graphicx, color}
%% maxwidth is the original width if it is less than linewidth
%% otherwise use linewidth (to make sure the graphics do not exceed the margin)
\makeatletter
\def\maxwidth{ %
\ifdim\Gin@nat@width>\linewidth
\linewidth
\else
\Gin@nat@width
\fi
f <- function(s) {
exp_barre <- mean(exp(-vector_clean/s))
x_barre <- mean(vector_clean)
resul = 1 + log(1/exp_barre) - x_barre/s + 1/exp_barre*mean(exp(-vector_clean/s)*(vector_clean/s-log(1/exp_barre)))
return(resul)
}
uniroot(f,interval=c(10^3, 10^4))
@aussetg
aussetg / g.r
Created December 23, 2013 11:38
g <- function(Z) {
prix <- apply(grid,2,cumsum)
prix <- grid
for (i in 1:n) {
prix[i,] <- S0*exp(sigma*prix[i,]+(r-sigma^2/2)*i/n*Time)
}
prix <- colMeans(prix) - K
prix[prix<0] <- 0
return(prix)
}
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
NumericVector g(NumericMatrix x) {
double sigma = 0.25;
double S0 = 1;
double Time = 1;
double r = 0;
double K = 1;
*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#839496}::-moz-selection{background:#FF5E99;color:#fff;text-shadow:none}::selection{background:#FF5E99;color:#fff;text-shadow:none}a, a:active, a:visited{color:#b58900}a:link{-webkit-tap-highlight-color:#FF5E99}body{line-height:1.5;font-size:22px;background:#fdf6e3;color:#839496 font-family:"Gentium",Georgia,"Times New Roman",Times,serif}strong{font-weight:bold}dt{font-weight:bold}h1{font-size:1.6em}h1 a:hover{-webkit-text-stroke:3px #073642}h2{font-size:1.3em}h3{font-size:1em}h1, h2, h3, h4, h5, h6{color:#657b83;border-color:#839496;font-weight:normal;font-family:"Open Sans", sans-serif}td{padding:8px}blockquote{font-style:italic;background:#eee8d5;padding:5px 20px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px}.title{text-align:center}.large{font-size:5em}.container{margin:10px;padding-bottom:50px;color:#657b83}.header{margin:auto;font-size:16px;display:block;text-align:left}.content{width:60%;margin:0
@aussetg
aussetg / bsc.cpp
Created February 11, 2015 13:17
bsc.cpp
double bsc(double x, double T, double K,double L, double r,double sigma) {
double lambda = (r+sigma*sigma*0.5)/(sigma*sigma) ;
double x1 = log(x/L)/(sigma*sqrt(T)) + lambda * sigma * sqrt(T) ;
double y1 = log(L/x)/(sigma*sqrt(T)) + lambda * sigma * sqrt(T) ;
double d1 = ( log(x/K) + (r+sigma*sigma*0.5)*T ) / (sigma * sqrt(T)) ;
double d2 = d1 - sigma * sqrt(T) ;
double y = log(L*L/(x*K)) / (sigma * sqrt(T)) + lambda * sigma * sqrt(T) ;
double cui = x * N(x1) - K * exp(-r*T) * N(x1 - sigma * sqrt(T)) - x * pow(L/x,2*lambda) * ( N(-y) - N(-y1) ) + K * exp(-r*T) * pow(L/x,2*lambda-2) * ( N(-y+sigma*sqrt(T)) - N(-y1 + sigma*sqrt(T)) ) ;
double c = x * N(d1) - K* exp(-r*T) * N(d2) ;
return(c - cui );
@aussetg
aussetg / test.tex
Last active November 13, 2015 12:47
Test
\section{Théorie}
\subsection{L'apprentissage machine}
Initialement une branche des statistiques, l'apprentissage statistique s'est rapidement transformé en une discipline à part entière mêlant plusieurs domaines des mathématiques et de l'informatique: l'apprentissage machine.
Le terme \emph{apprentissage statistique} en lui-même est vague et regroupe plusieurs sous-domaines. De façon générale on dispose d'un échantillon $\mathcal{L}$ d'individus possédant des caractéristiques $X_i \in \mathcal{X}$ propres considérées comme déterministes appelées variables et un attribut aléatoire $Y \in \mathcal{Y}$. Si $\mathcal{Y}$ est un ensemble discret on parle de problème de \emph{classification}, s’il est continu on parle alors de problème de \emph{régression}. Il existe un grand nombre d'autres objectifs comme le \emph{clustering}, la \emph{détection de structures} et autres, mais nous ne nous intéresserons ici qu'à ces deux grandes familles en choisissant à chaque fois la tache qui facilite les explications ou es
@aussetg
aussetg / log
Created November 24, 2015 20:04
mxnet ) R CMD INSTALL mxnet_0.5.tar.gz
* installing to library ‘/home/guillaume/R/x86_64-pc-linux-gnu-library/3.2’
* installing *source* package ‘mxnet’ ...
** libs
g++-4.9 -I/usr/share/R/include -DNDEBUG -I../inst/include -I"/home/guillaume/R/x86_64-pc-linux-gnu-library/3.2/Rcpp/include" -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c executor.cc -o executor.o
g++-4.9 -I/usr/share/R/include -DNDEBUG -I../inst/include -I"/home/guillaume/R/x86_64-pc-linux-gnu-library/3.2/Rcpp/include" -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c export.cc -o export.o
g++-4.9 -I/usr/share/R/include -DNDEBUG -I../inst/include -I"/home/guillaume/R/x86_64-pc-linux-gnu-library/3.2/Rcpp/include" -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c io.cc -o io.o
g++-4.9 -I/usr/share/R/include -DNDEBUG -I../inst/include -I"/home/guillaume/R/x86_64-pc-linux-gnu-library/3.2/Rcpp