Skip to content

Instantly share code, notes, and snippets.

View mim-Armand's full-sized avatar
🔦
Kugelblitz!

Armand mim-Armand

🔦
Kugelblitz!
View GitHub Profile
@mim-Armand
mim-Armand / cover_generator_01.pde
Last active August 29, 2015 14:02
a processing sketch to auto generate cover photos I used for the first version of one of my university projects
Points mover;
int docWidth, docHeight;
int dpi = 300; //TODO!
float scaleFactor = 1;
int arrayLength = 300;
float minDistance, maxDistance, lineWeightMin, lineWeightMax, circleSizeMin, circleSizeMax;
Points[] myArray = new Points[(arrayLength + 3)];
PGraphics imageHolder;
void setup() {
docWidth = 1300;
@mim-Armand
mim-Armand / processing_array_length_change.pde
Last active August 29, 2015 14:02
Changing Array length in processing works in contrary to Java that changin an Arrays length is impossible after it's creation (Although I assume in Processing it's returning a new array under the hood but it says something else though in the documentations!)
String[] sa1 = { "OH ", "NY ", "CA "};
println(sa1); // --> OH, NY, CA
println(sa1.length); // --> 3
sa1 = shorten(sa1);
println(sa1); // --> OH, NY
println(sa1.length); // --> 2
@mim-Armand
mim-Armand / Points.pde
Created June 23, 2014 11:59
A simple class to populate bunch of random points on the stage.
int pointsNumber = 300;
Points[] pointsArray = new Points[pointsNumber];
class Points {
PVector location;
float circleSize;
float gravity;
float lineWeight;
color strokeColor;
int docHeight = height;
public class HashGrid {
float bucketSize;
int gridWidth, gridHeight, bucketLength, numberOfRows, numberOfCols;
Buckets[] buckets;
HashGrid(float bucketSize_, int gridWidth_, int gridHeight_, int bucketLength_) {
bucketSize = bucketSize_;
gridWidth = gridWidth_;
gridHeight = gridHeight_;
bucketLength = bucketLength_; // bucketLength = ceil(10 * (numOfElements / ((gridWidth * gridHeight)/ bucketSize)));
public class HashGrid {
float bucketSize;
int gridWidth, gridHeight, bucketLength, numberOfRows, numberOfCols;
HashGrid(float bucketSize_, int gridWidth_, int gridHeight_, int bucketLength_) {
}
void set(Points point_) { //TODO: it is better probably to use an interface instead of hardcoding it but for now! ...
}
Points[] get(PVector location_) {
Points[] answer = new Points[answerLength];
HashGrid test;
float scaleFactor = 1;
void setup(){
size(500, 500);
test = new HashGrid(50, width, height, 30);
test.drawGrid();
for(int i = 0; i < pointsNumber; i++){
pointsArray[i] = new Points();
test.set(pointsArray[i]);
var myPath = app.activeDocument.filePath;
alert(myPath);
var myPath = (app.activeDocument.fullName.parent.fsName).toString().replace(/\\/g, '/');
alert(myPath);
void setup(){
ImageIcon titlebaricon = new ImageIcon(loadBytes("myicon.png"));
frame.setIconImage(titlebaricon.getImage());
}
@mim-Armand
mim-Armand / jsx_reflection.jsx
Created July 13, 2014 20:22
using this methode you can get all the related attributes , contents, etc. of any ExtensScript object! very helpful in writing ES codes!
var f = this;
var t = '';
var props = f.reflect.properties;
for (var i = 0; i < props.length; i++) {
t += ('this property ' + props[i].name + ' is ' + f[props[i].name] + "\n");
}
alert(t);