Author Archive

Processing Map

Processing Map

So I am unsure if we have a class drop box or if its just the moodle, which there isn’t a space for it here so i’ll add my code on here as well.

//import your data
//declaring a table object
Table table;

//data variables
float latm, latp;
float lonm, lonp;
float prevX, prevY;
//counter going through rows
int row=0;
//arrays for x coordinates and y coordinates
float[] locationsX;
float[] locationsY;

//import libraries
import de.fhpotsdam.unfolding.*;
import de.fhpotsdam.unfolding.geo.*;
import de.fhpotsdam.unfolding.utils.*;
import de.fhpotsdam.unfolding.providers.*;

//for map styles
import de.fhpotsdam.unfolding.providers.*;

UnfoldingMap map;

void setup() {
size(800, 600);
map = new UnfoldingMap(this);
MapUtils.createDefaultEventDispatcher(this, map);
map = new UnfoldingMap(this, new Google.GoogleTerrainProvider());
Location nyLocation = new Location (41.1500, -73.7667);
map.zoomAndPanTo(nyLocation,9);
float maxPanningDistance = 30;
map.setPanningRestriction(nyLocation, maxPanningDistance);

//load your data file. Check if you have a header.
// header tells processing to ignore the first line of data
table = loadTable(“openpaths_miscione9.csv”, “header”);

//get row count- returns the total number of rows in your table – the first tow
println(table.getRowCount() + ” total rows in table”);

//make arrays as long as our table length. table.getRowCount() evaluates to the length of your table
locationsX = new float[table.getRowCount()];
locationsY = new float[table.getRowCount()];

}

void draw(){
if(rowtable.getRowCount()-1){
row=0;
}
}
}

http://www.timesleader.com/news/home_top-local-news-news/152490094/

Kids play game to learn coding

This article discuses how kids around the country are now pushed to learn computer coding as it will open up various new oppuritunies for them and it will help teach them logic. These children have been learning coding through a game that was described as very similar to the one that we had played for our homework.

Writing code is like solving a Rubik’s cube… Do you agree?

I believe that writing code is like solving a Rubik’s cube.They both require a great amount of logic and problem solving to solve. Both have to be done on a step by step basis, and if one choses to ignore a problem, it can transform into a huge problem later in the process only furthering your completion. Sometimes you would even have to remove some complete parts, in order to further your progress. It could feel like a one step forward and two steps back process at times. However, if you continue to think logically, and troubleshoot problems when they first arise rather than ignoring them, then you will do fine.

Movement in faces

Screen Shot 2015-02-17 at 12.43.31 AM

Screen Shot 2015-02-17 at 12.43.41 AM

Screen Shot 2015-02-17 at 12.43.54 AM

Screen Shot 2015-02-17 at 12.44.04 AM

Screen Shot 2015-02-17 at 12.44.13 AM

Screen Shot 2015-02-17 at 12.44.26 AM

Screen Shot 2015-02-17 at 12.44.53 AM

Screen Shot 2015-02-17 at 12.45.04 AM

Screen Shot 2015-02-17 at 12.45.12 AM

float hr=100;
float hg=25;
float hb=5;
float eyex; // left eye
float eyey; // right eye
float mouthx; // for eyex
float mouthy; //for eyey

void setup() {
size(500,500);
smooth();
eyex= width/2-50;
eyey= width/2+20;
mouthx=50;
mouthy=0;

}

void draw() {
if (mousePressed) {
println(mouseX);
}
background(150,14,205);

println(mouseY);
fill(224,195,229);
rect(215,210,40,50); //neck
// move with mouse rect(mouseX,mouseY,40,50);
ellipseMode(CENTER);
fill(224,195,229);
ellipse(235,137,165,190); //head

stroke(100,25,5);
fill(100,25,5); //bangs
arc(235, 63, 105, 45, -PI,0);
arc(235, 70, 115, 45, -PI,0);
arc(235, 80, 130, 45, -PI,0);
arc(235,90,145,45,-PI,0);

fill(25);
stroke(0);
rect(115,250,250,400); //body
//random function
//random(0,100)
//random(low range, high range);
//rapidly changing eye color
hg = random(0,255);
hr= random(0,255);
hb= random(0, 255);
fill(hr,hg,hb);
ellipse(eyex,112,8,8); //left eye
ellipse(eyey,112,8,8); //right eye
fill(230,180,225);
stroke(0);
ellipse(227,145,15,30); //squidward like nose

stroke(0);
fill(250,100,250);
arc(229, 185, mouthx, mouthy, 0, PI /1.0); //mouth

if (mousePressed) {
eyex=width/2-random(20, 80);
eyey=width/2+random(0, 30);
mouthx= random(50,100);
mouthy=random(0,100);
}
}

Homework week 1 Self Portrait

void setup() {
  size(500,500);
  background(150,14,205);
  smooth();
}

void draw() {
  if (mousePressed) {
  println(mouseX);
  }
  
  println(mouseY);
  fill(224,195,229);
  rect(215,210,40,50); //neck
  ellipseMode(CENTER);
  fill(224,195,229);
  ellipse(235,137,165,190); //head
  
  stroke(0);
  fill(0); //bangs
 arc(235, 63, 105, 45, -PI,0);
 arc(235, 70, 115, 45, -PI,0);
 arc(235, 80, 130, 45, -PI,0);
 arc(235,90,145,45,-PI,0);
 
  fill(25);
 rect(115,250,250,400); //body
 ellipse(198,112,8,8); //left eye
 ellipse(263,112,8,8); //right eye
 fill(230,180,225);
 ellipse(227,145,15,30); //squidward like nose
 
 stroke(0);
 fill(250,100,250);
 arc(229, 185, 50, 50, 0, PI /1.0); //mouth
 
}