Skip to content

Instantly share code, notes, and snippets.

View kovek's full-sized avatar

Kevin Galkov kovek

  • Montreal, Quebec, Canada
View GitHub Profile
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUI.DrawTextureWithTexCoords (Rect position, UnityEngine.Texture image, Rect texCoords, Boolean alphaBlend) (at C:/BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/GUI.cs:215)
Character.Start () (at Assets/Character.cs:13)
@kovek
kovek / webkitGetUserMedia.js
Created February 1, 2013 18:41
webkitGetUserMedia isn't working right... When you use audio:true, the browser is supposed to use the microphone. But still, it has an undefined kind... PS: The browser is actually asking me to get access to my microphone, and I grant it.
navigator.webkitGetUserMedia({audio: true, video: false}, function(LocalMediaStream){
audio = document.querySelector('video');
if(typeof window.URL.createObjectURL(LocalMediaStream) != "undefined"){
var file = window.URL.createObjectURL(LocalMediaStream);
audio.src = file;
audio.play();
}
console.log(file);
console.log('>>'+LocalMediaStream.kind); // THIS WILL RETURN UNDEFINED
n=[]
n['M'] = 1000
n['CM'] = 900
n['D'] = 500
n['CD'] = 400
n['C'] = 100
n['XC'] = 90
n['L'] = 50
n['XL'] = 40
n['X'] = 10
part1 = 'abcdefghijklm '
part2 = 'nopqrstuvwxyz.'
convert = (text) ->
output = ""
for i in [0...text.length]
index = part1.indexOf text.charAt(i)
if index isnt -1 then output += part2.charAt index else
index = part2.indexOf(text.charAt(i))
output += part1.charAt index
murder = (howMany, bounce) ->
people = [0..howMany] # people from 0 to 40
for i in people
people[i] = 1
killed = Array()
count=0
for i in [1..howMany]
whichOne = i*bounce - howMany*count
count++ if whichOne> (howMany-bounce)
if people[whichOne] is 1