Skip to content

Instantly share code, notes, and snippets.

View felixlindemann's full-sized avatar

Felix Lindemann felixlindemann

  • Lime-Tree
  • Wuppertal, Germany
View GitHub Profile
@felixlindemann
felixlindemann / Lottozahlen.r
Last active February 28, 2021 16:07
Lottozahlen mit R
#####################################################
################## Project R ##################
################## Lottozahlen ##################
################## Copyright ##################
################## Felix LIndemann ##################
#####################################################
#####################################################
# #
# Parameters: #
# n: Anzahl Lotto-Reihen #
@felixlindemann
felixlindemann / c#-vsto-writecustomproperties.cs
Created August 11, 2013 15:35
C# - VSTO - WriteCustomDocumentProperties
private void WriteDocumentProperty(string propertyName, string value)
{
Microsoft.Office.Core.DocumentProperties properties;
Document doc = this.getDoc();
properties = (Microsoft.Office.Core.DocumentProperties)
doc.CustomDocumentProperties;
if (properties.Cast<DocumentProperty>().Where(c => c.Name == propertyName).Count() == 0)
properties.Add(propertyName, false, MsoDocProperties.msoPropertyTypeString, Guid.NewGuid().ToString());
properties[propertyName].Value = value;
@felixlindemann
felixlindemann / c#-vsto-readcsutomproperties.cs
Created August 11, 2013 15:36
c# vsto word read customproperty
private string ReadDocumentProperty(string propertyName)
{
Microsoft.Office.Core.DocumentProperties properties;
Document doc = this.getDoc();
properties = (Microsoft.Office.Core.DocumentProperties)
doc.CustomDocumentProperties;
if (properties.Cast<DocumentProperty>().Where(c => c.Name == propertyName).Count() > 0)
return properties[propertyName].Value.ToString();
@felixlindemann
felixlindemann / c#-vsto-getWordDoc.cs
Created August 11, 2013 15:37
c# vsto getWordDoc
private Document getDoc()
{
if (this.doc == null) { this.doc = Globals.ThisAddIn.Application.ActiveDocument; }
return doc;
}
@felixlindemann
felixlindemann / c#-vsto-saveFileAs.cs
Last active December 20, 2015 22:29
c# vsto savefileas
public void Save()
{
Saving = true;
try
{
writeProperties();
Document doc = getDoc();
FileInfo f = new FileInfo(doc.FullName);
String strFileName = String.Format(@"{0}\{1} - v.{2}.{3}.{4}.docx", f.Directory.FullName, DocTitle, Revision, Version, Build);
@felixlindemann
felixlindemann / RandomNorm.r
Last active December 21, 2015 00:29
Transformation Rechteckverteilter Zufallszahlen in standardnormalverteilte
# define function
# found in:
# Wilmott, Paul (2007):
# Paul Wilmott introduces quantitative finance.
# 2. Edition. Chichester: Wiley.
# r: number of random numbers to be calculated
StandNorm<-function(r=30){
# how many iterations should be calculated?
# 50 proofed to be a good number to get robust
@felixlindemann
felixlindemann / gaussianRandomNumbersFromUniform.html
Created August 13, 2013 12:08
Formula presented in HTML5 for transforming Gaussian Random Numbers from Uniform distributed
<math display="block">
<mrow>
<mi>r</mi>
<mo>=</mo>
<msqrt>
<mfrac>
<mrow>
12
</mrow>
<mrow>
@felixlindemann
felixlindemann / randomnumberormula.tex
Created August 14, 2013 08:08
Latex Formula: Create Random Gaussian Random Numbers from uniform distributed
r = \sqrt{\frac{12}{n}}\cdot (\sum_{i=1}^n(RAND())-\frac{n}{2})
@felixlindemann
felixlindemann / latex-beamer-andler-optimal-lotsize.tex
Created August 14, 2013 08:34
Latex-Beamer: animated Optimal Lotsize
% Optimal Lot-Size with the Andler Formula
% Author: Felix Lindemann
% Source: Beamer by Till Tantau <--- Great!
% GNUPLOT required
\RequirePackage{atbegshi}
\documentclass{beamer}
\usepackage{verbatim}
\usepackage{animate}
\usepackage{calc}
@felixlindemann
felixlindemann / rooty-helix.tex
Created August 14, 2013 08:39
Latex-Beamer: Create Rooty Helix
% Rooty helix
% Author: Felix Lindemann
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\pagestyle{empty}
\pgfdeclarelayer{background}