Skip to content

Instantly share code, notes, and snippets.

View Krewn's full-sized avatar

Kevin Nelson Krewn

View GitHub Profile
@Krewn
Krewn / kmesh.cs
Last active December 30, 2015 22:49
If I knew how to use codeDOM!!!!
using System;
using System.Collections;
using System.Collections.Generic;
public class KmathMeshMaker : MonoBehaviour {
void OnNetworkInstantiate(NetworkMessageInfo info) {
if (!networkView.isMine)
Debug.Log("Kmath.Meshmaker" + networkView.owner);
}
@Krewn
Krewn / leapbasics.cs
Last active January 3, 2016 09:49
How to get started with the leap motion controller and Unity3D with c#
using UnityEngine;
using System.Collections;
using Leap;
public class GetFrame : MonoBehaviour {
private LeapManager manager; //This provides access to leap data
public Leap.Frame frame; //this is a home for leap frame
private Leap.Controller controller; //This interprites the data stream
private Leap.Listener listener; //This is the data stream
// Use this for initialization
@Krewn
Krewn / doodle.py
Last active August 29, 2015 13:57
Just a little drawing, Enjoy!
import sys
import os
#import and init pygame
import pygame
import numpy
def colPong(n,c):
n = int(int(n)/c)
n = n % 510
n = 510 - n if(n > 255) else n
return(int(n))
@Krewn
Krewn / PrefixNotation.java
Last active August 29, 2015 14:06
Polish notation JavaStackImpl
package prefixNotation;
public class prefix {
/**
* @param args
*/
public static String reverse(String input){
if(input.length()==1){
return(input);
@Krewn
Krewn / tree.java
Created September 25, 2014 14:15
Bare Bones tree w/ search. -needs to implement generics < T >-
package Trees;
import Trees.treeNode;
public class tree{
public treeNode root;
public treeNode current;
int size;
boolean first;
public tree(){
super();
root = new treeNode(0);
@Krewn
Krewn / GeneFields.py
Last active August 29, 2015 14:07
A visualization of the RNA frequency in principal component space, the "clip" function is specific to fluidigm's BioMark platform. This code outputs a .m file containing matrices to be plotted in mat-lab with mesh(mat).
########################################################### ____ ______ _ _ _
## Author : Kevin Nelson #### / ____| | ____(_) | | | |
# ### | | __ ___ _ __ ___ | |__ _ ___| | __| |___
##Projecting gene Fields into principal Component space#### | | |_ |/ _ \ '_ \ / _ \ | __| | |/ _ \ |/ _` / __|
########################################################### | |__| | __/ | | | __/ | | | | __/ | (_| \__ \
########################################################### \_____|\___|_| |_|\___| |_| |_|\___|_|\__,_|___/
import os
import numpy as np
import sys
(1)01000010 66 B
(2)01110010 114 r
(3)01100001 97 a
(4)01101001 105 i
(5)01101110 110 n
(6)01000110 70 F
(7)01110101 117 u
(8)01100011 99 c
(9)01101011 107 k
>++++++++++[
@Krewn
Krewn / Comps.py
Last active August 29, 2015 14:07
Euclidean distance, correlation, and cos between sets of vectors with varying dimension.
#########################################################
## Author : Kevin Nelson ##
# #
## Mapping MicroArrayData back to AS ##
#########################################################
import sys
import csv
import pylab as pl
import matplotlib.pyplot as plt
import numpy
@Krewn
Krewn / Tutorial.py
Last active August 29, 2015 14:07
A breif introduction to python for the newbies
#
#
# ___ ,---, ___ ___ ,--,
#,-.----. ,--.'|_ ,--.' | ,--.'|_ ,--.'|_ ,--, ,--.'|
#\ / \ | | :,' | | : ,---. ,---, | | :,' ,--, | | :,' ,---. __ ,-.,--.'| | | :
#| : | : : ' : : : : ' ,'\ ,-+-. / | : : ' : ,'_ /| : : ' : ' ,'\ ,' ,'/ /|| |, : : '
#| | .\ : .--,.;__,' / : | |,--. / / | ,--.'|' | .;__,' / .--
@Krewn
Krewn / GeneticAlgDemo.py
Created October 29, 2014 22:42
A basic paradigm for genetic algorithms.
# ___ ____ _ _ ____ ____ ____ ___ __ __ ___
# / __)( ___)( \( )( ___)(_ _)(_ _)/ __) /__\ ( ) / __)
#( (_-. )__) ) ( )__) )( _)(_( (__ /(__)\ )(__( (_-.
# \___/(____)(_)\_)(____) (__) (____)\___) (__)(__)(____)\___/
#
from pylab import *
def QuickerPlot(x):
close()
y=[]
for k in range(1,len(x)+1):