Skip to content

Instantly share code, notes, and snippets.

View dapperfu's full-sized avatar

dapperfu (+++ATH0) dapperfu

View GitHub Profile
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
%%
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);
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
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;
% !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)
#!/bin/tcsh
# Grab user information.
echo "PrivateInternetAccess OpenVPN Setup:"
echo " https://www.privateinternetaccess.com/pages/client-control-panel"
echo " -> PPTP/L2TP/SOCKS Username and Password"
echo -n "User: "
set user = $<
echo -n "Pass: "
set pass = $<
@dapperfu
dapperfu / logging.py
Created December 31, 2015 18:12
Quick and Dirty logger setup.
"""
Logging
"""
import logging
# Setup logging.
log=logging.getLogger(__name__)
critical = log.critical
error = log.error
@dapperfu
dapperfu / logging.py
Created January 5, 2016 17:05
Logging copy paste
## 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
@dapperfu
dapperfu / LICENSE
Created August 31, 2016 14:50
BSD 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
@dapperfu
dapperfu / autocommit.sh
Created September 4, 2016 00:01
5 minute commits.
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