Skip to content

Instantly share code, notes, and snippets.

<div id="google_search_box_15151244">
<div>
<label for="searchText15151244">
<img src="//s3.amazonaws.com/libapps/apps/libguides/images/google_scholar.png" alt="Google Scholar Search" style="width:125px;">
</label>
</div>
<form id="form_google_15151244" target="_blank" action="http://scholar.google.com/scholar" class="form-horizontal">
<input name="q" id="searchText15151244" class="form-control s-lg-google-search-field" type="text" value="">
<input id="btn_patent_search15151244" class="btn btn-default btn-sm" type="submit" value="Search">
</form>
@KarlHerler
KarlHerler / tmux.conf
Created May 27, 2015 16:14
my tmux.conf
##
# STATUS BAR CUSTOMIZATION
##
set -g status-utf8 on
set -g status-keys vi
set -g status-interval 1
set -g status-attr bright
set -g status-fg white
set -g status-bg black
set -g status-left-length 20
@KarlHerler
KarlHerler / megamalloc.c
Last active December 31, 2015 11:59
compile using: gcc -ansi megamalloc.c -o megamalloc
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
int main(void) {
int i,size;
int cumulative_mem=0;
int iter=0;
int *base;
clock_t start,end;
#include <stdio.h>
#include <time.h>
void main() {
while (1) {
clock_t start, end;
double runTime;
start = clock();
int i, num = 1, primes = 0;
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main () {
while (1) {fork (); }
return EXIT_FAILURE;
}
@KarlHerler
KarlHerler / dsimpletest.F
Last active December 17, 2015 14:09
The double real matrix test for MUMPS
C
C This file is part of MUMPS 4.10.0, built on Tue May 10 12:56:32 UTC 2011
C
PROGRAM MUMPS_TEST
IMPLICIT NONE
INCLUDE 'mpif.h'
INCLUDE 'dmumps_struc.h'
TYPE (DMUMPS_STRUC) mumps_par
INTEGER IERR, I
CALL MPI_INIT(IERR)
@KarlHerler
KarlHerler / .vimrc
Created May 1, 2013 11:59
My .vimrc
call pathogen#infect()
set noswapfile
syntax on
syntax enable
set background=dark
colorscheme solarized
" ---------------------------------
" Added because the internet told me to:
@KarlHerler
KarlHerler / gist:5056076
Last active December 14, 2015 08:09
N-back test in javascript with some beautiful swedish comments.
n = 2 // hur långt det är mellan repetitionerna, n värdet
nbackArr = []; // slutlliga arrayn som vi vill ha
sampleArr = []; // Arrayn som vi "väljer från"
noElements = 24; // Denna borde sättas som längden på sampleArray men efter som vi inte har den
// så lägger vi den som 24, cause...24 e fint.
// Generera sample array, om du har den innan, t.ex. bilderna, så behöver du inte göra den
for (i=0;i<noElements;i++) {
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
/* Private; Implements the sieve of Erathostenes algorithm
function [X_norm, mu, sigma] = featureNormalize(X)
%FEATURENORMALIZE Normalizes the features in X
% FEATURENORMALIZE(X) returns a normalized version of X where
% the mean value of each feature is 0 and the standard deviation
% is 1. This is often a good preprocessing step to do when
% working with learning algorithms.
mu = mean(X);
X_norm = bsxfun(@minus, X, mu);