Skip to content

Instantly share code, notes, and snippets.

Avatar

++ATH0 dapperfu

View GitHub Profile
View Optimize.m
%%
n=1e4;
tic
x=rand(n,n);
y=rand(n,n);
toc
tic
for i=1:n
for j=1:n
z3(i,j)=sqrt(x(i,j)^2+y(i,j)^2);
View algorithm1.m
function [ vortices ] = algorithm1( wavefunction)
% Returns the position and charge of vortices found in a 2D wavefunction.
% Uses Plaquette algorithm (1) to detect vortices in a wavefuntion.
% The format of the result is rows of:
% [vortex charge, x-position, y-position] for each vortex.
% Note that the position given is the top left point of the square of
% four points that bounds the vortex.
[x_size, y_size] = size(wavefunction);
centre_x = x_size/2;
View gist:9599672
function EA_loop
% Peruvian_Lumberjack Valence Processing v.01
%
% The script is intended to expedite the valence scoring of the EA_EEG
% experiments for both targets and perceivers. It requires a computer with
% MATLAB 7 installed.
clc; % Clear command window
clear all; % Clear other variables
View Reddit
% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode
% This is a simple template for a LaTeX document using the "article" class.
% See "book", "report", "letter" for other types of document.
\documentclass[11pt]{article} % use larger type; default would be 10pt
\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)
View gist:4610306
alpha=1/sqrt(2);
% Joint 2
i=1;
A(i,2)=1;
A(i,6)=-1;
b(i)=0;
i=i+1;
A(i,3)=1;
b(i)=10;
% Joint 3
@dapperfu
dapperfu / logging.py
Created Dec 31, 2015
Quick and Dirty logger setup.
View logging.py
"""
Logging
"""
import logging
# Setup logging.
log=logging.getLogger(__name__)
critical = log.critical
error = log.error
@dapperfu
dapperfu / logging.py
Created Jan 5, 2016
Logging copy paste
View logging.py
## Setup Logging.
# Import logging
import logging
# Get generic logger
logger=logging.getLogger()
# Set logging level to debug for now.
logger.setLevel(logging.DEBUG)
# Assign aliases to use instead of print()
debug=logger.debug
info =logger.info
View LICENSE
Copyright (c) 2016, Jed Frey
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
View autocommit.sh
while [ 1 ];
do
git add *.slx
git add *.mdl
git add *.ipynb
git add *.m
git commit -a -m "Git Auto Commit: `date`"
#git push
sleep 300
done
View avahi-daemon.conf
[server]
domain-name=local
use-ipv4=yes
use-ipv6=yes
allow-interfaces=
check-response-ttl=yes
use-iff-running=no
enable-dbus=yes
disallow-other-stacks=no