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 RandomScreenPos : MonoBehaviour { | |
void Update() { | |
float x = Random.Range(0f, Screen.width); | |
float y = Random.Range(0f, Screen.height); | |
float z = Random.Range(Camera.main.nearClipPlane, Camera.main.farClipPlane); | |
transform.position = Camera.main.ScreenToWorldPoint(new Vector3(x, y, z)); |
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
# http://effbot.org/imagingbook/introduction.htm | |
# https://en.wikibooks.org/wiki/Python_Imaging_Library/Editing_Pixels | |
import PIL.Image as Image | |
inputFilePath = "test.jpg" | |
outputFilePath = "out.png" | |
img = Image.open(inputFilePath) | |
print (str(img.format) + " " + str(img.size) + " " + str(img.mode)) |
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 uprez() { | |
app.beginUndoGroup("Uprez"); | |
var theComps = getSelectedComps(); | |
if (theComps.length < 1) { | |
alert("No comps selected."); | |
} else { | |
for (var i=0; i<theComps.length; i++) { | |
theComp = theComps[i]; |
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
// updated for Processing 3 | |
import gab.opencv.*; | |
import org.opencv.photo.Photo; | |
import org.opencv.imgproc.Imgproc; | |
import processing.opengl.PGraphics2D; | |
PImage src; | |
PGraphics2D canvas; |
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
"use strict" | |
function setup(classDays) { | |
// var classDays = [ [7, 9, 17], [14, 9, 17], [21, 9, 17], [28, 9, 17], [5, 10, 17], [19, 10, 17], [26, 10, 17], [2, 11, 17], [9, 11, 17], [16, 11, 17], [23, 11, 17], [30, 11, 17] ]; | |
var doCalendar = true; | |
//get the day | |
var myDays = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ]; |
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
// http://www.sebaslab.com/how-to-compress-and-decompress-binary-stream-in-unity/ | |
using ICSharpCode.SharpZipLib.BZip2; | |
using System.Runtime.Serialization.Formatters.Binary; | |
using System.IO; | |
static void Compress (string nameOfTheFileToSave, ISerializable objectToSerialize) | |
{ | |
using (FileStream fs = new FileStream(nameOfTheFileToSave, FileMode.Create)) | |
{ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="refresh" content="0;url=./destination"/> | |
</head> | |
<body> | |
</body> |
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
# https://github.com/jdf/processing.py/issues/280 | |
def setup(): | |
size(300, 300, P3D) | |
def draw(): | |
if frameCount == 1: | |
g.textFont(loadFont("Impact-48.vlw")) | |
g.textMode(SCREEN) | |
g.fill(0) |
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
Neck | |
0 | |
-0.07827437 | |
-0.1752148 | |
0 | |
-90.00001 | |
-90.00001 | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test</title> | |
<style type="text/css"> | |
body, html { | |
margin: 0; padding: 0; height: 100%; overflow: hidden; | |
} |