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
var n1; | |
var n2; | |
var n3; | |
var n4; | |
var n5; | |
//The product of the first two digits is 24. | |
function rule1(){ | |
return (n1 * n2) == 24; | |
} |
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
PVector v1; | |
PVector v2; | |
void setup() { | |
size(500, 500); | |
ellipseMode(CENTER); | |
textSize(12); | |
v1 = new PVector(random(width), random(height)); | |
v2 = new PVector(random(width), random(height)); | |
} |
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
package{ | |
public function merge(object1:Object, object2:Object):Object { | |
var result:Object = {}; | |
var i:String; | |
for (i in object1) { | |
result[i] = object1[i]; | |
} | |
for (i in object2) { | |
if (result[i] == undefined) result[i] = object2[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
/** | |
* Возвращает индекс ячейки | |
* @param index порядковый индекс | |
* @param length длина строки | |
* @return | |
* | |
*/ | |
public function cellIndex(index:uint, length:uint):Object { | |
var r:uint = Math.floor(index / length); | |
var c:uint = index - (r * length); |
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
package ru.gotoandstop.display { | |
import flash.display.DisplayObject; | |
import flash.display.Sprite; | |
public function createSpriteWithCentredContent(content:DisplayObject):Sprite { | |
var s:Sprite = new Sprite(); | |
content.x = -int(content.width / 2); | |
content.y = -int(content.height / 2); | |
s.addChild(content); | |
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
# x is input value with list type | |
import rhinoscriptsyntax as rs | |
import scriptcontext as sc | |
import Rhino | |
sc.doc = Rhino.RhinoDoc.ActiveDoc | |
lastValue = rs.GetDocumentData('hello', 'lastState') | |
currentValue = ','.join(map(str, x)) |
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
import processing.sound.*; | |
class Sound { | |
SoundFile file; | |
boolean playing; | |
Sound(PApplet app, String path){ | |
file = new SoundFile(app, path); | |
playing = true; | |
} |
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
import socks | |
import socket | |
from stem import Signal | |
from stem.control import Controller | |
control_port = 9051 | |
proxy_port = 9050 | |
proxy_host = 'localhost' | |
tor = Controller.from_port(port=control_port) |
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
import processing.serial.*; | |
import processing.video.*; | |
Serial port; | |
String portName; | |
Movie actionMovie; | |
Movie defaultMovie; | |
Movie movie; |
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
package ru.gotoandstop.bytes{ | |
import flash.utils.ByteArray; | |
/** | |
* @author: Roman Timashev (roman@tmshv.ru) | |
**/ | |
public class ByteArrayUtil{ | |
private static var __bitPosition:uint; | |
public function ByteArrayUtil(){ |