This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function svd_solve(A,b){ | |
var A_svd,r,s,ut,d,x; | |
A_svd = numeric.svd(A); | |
s = numeric.transpose( [ A_svd.S ] ); | |
r = 1; | |
while( r < numeric.dim(A)[1] & s[r] >= Math.max.apply( Math, numeric.dim(A) )*numeric.epsilon*s[0] ) r++; | |
d = numeric.dot( numeric.transpose( A_svd.U ), b); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NUM_BANKS=E | |
while [[ "$input" != "\e" ]] ; do | |
networks=$(iwlist wlan0 scanning | awk 'BEGIN{ FS="[:=]"; OFS = " " } | |
/ESSID/{ | |
#gsub(/ /,"\\ ",$2) | |
#gsub(/\"/,"",$2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
[SelectionBase] | |
public class Character : MonoBehaviour | |
{ | |
[Header("Info")] | |
public string name; | |
[Space(10)] | |
[TextArea(3,8)] // or the more basic alternative [Multiline(3)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
static class RandArrayExt | |
{ | |
public static System.Random random = new System.Random(); | |
public static T[] Shuffle<T> (this T[] array) | |
{ | |
if (array == null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RandomShuffleSequence | |
{ | |
public static int Shuffled(int cycleLength, int seed, int index) | |
{ | |
int shuffleRange = cycleLength; | |
int output = index % shuffleRange; | |
int cycleIndex = index / cycleLength; | |
while (output < shuffleRange) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class SimpleFramePlayer : MonoBehaviour { | |
public float fps; | |
public Texture[] frames; | |
private float spf; | |
private float timeElapsed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.Events; | |
public class CheatCode : MonoBehaviour | |
{ | |
public string code; | |
public UnityEvent onCodeEntered; | |
protected int current; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
colorToIChing = function(value){ | |
r=function(n,r,i){for(;3-i++;r=r*2|n&1,n>>=1);return r;}; | |
var s=''; | |
for(var i=0;i<8;i++){ | |
s=String.fromCharCode(9776+r(7&(value>>(i*3)),0,0))+s; | |
} | |
return s; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH="$PATH:~/bin:/Users/$USER/adt-bundle-mac-x86_64/sdk/tools:/Users/$USER/adt-bundle-mac-x86_64/sdk/platform-tools:/Applications/TEE-CLC-10.0.0:/usr/textbin" | |
export PYTHONPATH=/usr/local/lib/python2.7/site-packages | |
export EDITOR="subl -w" | |
alias pull="git pull origin" | |
alias push="git push origin" | |
function title () { echo -ne "\033]0;$@\007"; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <CapacitiveSensor.h> | |
CapacitiveSensor cs = CapacitiveSensor(9,2); // 10M resistor between pins 4 & 2, pin 2 is sensor pin, add a wire and or foil if desired | |
int minValue = 32767; | |
int maxValue = 0; | |
void setup(){ | |
cs.set_CS_AutocaL_Millis(0xFFFFFFFF); // turn off autocalibrate on channel 1 - just as an example | |
Serial.begin(9600); | |
} |
OlderNewer