Skip to content

Instantly share code, notes, and snippets.

View felixjung's full-sized avatar

Felix Jung felixjung

View GitHub Profile
n u *@:call FdmSave()<CR>u:call FdmRestore()<CR>
Last set from ~/.vimviews/~=+Research Projects=+Forward Intensity=+Presentation=+frames.tex=

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@felixjung
felixjung / parallel.jl
Created June 16, 2014 12:37
Parallel for loop in Julia
# Prepare parallel computing
n_cpu_reserve = 4 # Number of CPUs not to use
n_cpu = length(Sys.cpu_info()) # Obtain number of CPUs
n_workers = n_cpu - n_cpu_reserve # Set number of CPUs for computation
addprocs(n_workers - length(workers())) # Add additional CPUs if necessary
# Create a standard array for our task
my_array = dzeros((1000, 1000), workers(), [1, length(workers())])
@parallel for i = 1:size(my_array, 1)
# Load library files
include("lib/parallel.jl")
# Set number of workers
setprocs(2)
# Load remaining source onto all parallel processes
require("lib/DataIO.jl")
require("lib/IntensityFunctions.jl")
@felixjung
felixjung / .ctags
Created September 1, 2014 14:25
Adding languages to crags
# Definitions for R
--langdef=R
--langmap=r:.R.r
--regex-R=/^[ \t]*"?([.A-Za-z][.A-Za-z0-9_]*)"?[ \t]*<-[ \t]function/\1/f,Functions/
--regex-R=/^"?([.A-Za-z][.A-Za-z0-9_]*)"?[ \t]*<-[ \t][^f][^u][^n][^c][^t][^i][^o][^n]/\1/g,GlobalVars/
--regex-R=/[ \t]"?([.A-Za-z][.A-Za-z0-9_]*)"?[ \t]*<-[ \t][^f][^u][^n][^c][^t][^i][^o][^n]/\1/v,FunctionVariables/
# Definitions for UltiSnips
--langdef=snippets
--langmap=snippets:.snippets
@felixjung
felixjung / gist:882cc8cfd1b2d91360f4
Created October 27, 2014 16:33
Database migration error
== 20140907220153 SerializeServiceProperties: migrating =======================
-- add_column(:services, :properties, :text)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Duplicate column name 'properties': ALTER TABLE `services` ADD `properties` text/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `query'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `block in execute'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'

Keybase proof

I hereby claim:

  • I am felixjung on github.
  • I am felixjung (https://keybase.io/felixjung) on keybase.
  • I have a public key whose fingerprint is 8AC5 2600 8E2C CBC3 5775 B7D6 336D FEA2 1F3B 8864

To claim this, I am signing this object:

x = c(2.8, 1.2, 2.1, 1.6, 1.5, 4.6, 3.6, 2.1, 6.5, 4.6, 3.0, 1.3, 4.2)
y = c(9.4, 10.4, 10.8, 10.5, 18.4, 11.1, 2.6, 8.8, 5.0, 21.5, 6.7, 2.5, 5.6)
countries = c("Belgium", "Denmark", "France", "GB", "Ireland", "Italy", "Luxembourg", "Holland", "Portugal", "Spain", "USA", "Japan", "Germany")
@felixjung
felixjung / Test.R
Created July 4, 2012 17:32
R code for Alex
flush.console()
# Set working directory
setwd("/Users/Felix/Documents/University/Maastricht University/Master Thesis/")
# Include spreadPlotter code
source("Code/R/Main/DataPlotting.R")
source("Code/R/Library/additionalFunctions.R")
# Tranche configuration
correlationType <- "Compound"
@felixjung
felixjung / DataPlotting.R
Created July 24, 2012 10:10
Some R Code
# Import necessary packages
library(xts);
library(timeDate);
require(Hmisc);
library(ggplot2);
library(scales);
library(reshape2);
library(gridExtra);
library(grid);