View allAll Photos Tagged debuging
The other day I laid my hands on this so called "lord of the canon 35mm slrs" Canon EOS-1D at office. Bharat lost in his world of bugging and debugging.
A peek inside a malfunctioning benchtop power supply. Problem never found, but after reassembly it worked fine. Go figure, eh?
Computerdesaster, Lüftungskanäle von Grafikkarte und CPU-Kühler waren stark angestaubt. Mit geputztem Lüfter ist die CPU 20°C kühler
An easy to solder PCB made to give access to the NEXUS debug port on the AVR32 (CN1 in the image).
Based on the same schematic as the isostick, it's functionally identical. The NEXUS port will really help in debugging, as it enables realtime streaming trace data. In retrospect I probably should have broken out more of the pins for other random hackery, ah well.
Since I only need a few, fabrication is being done through Laen / DorkbotPDX: dorkbotpdx.org/wiki/pcb_order
chipKIT WF32: WiFi Enabled Microntroller Board with Uno R3 Headers
The chipKIT™ WF32 is a prototyping platform that adds the performance of the Microchip® PIC32 microcontroller. The WF32 is the first board from Digilent to have a WiFi MRF24 and SD card on the board both with dedicated signals. The WF32 board takes advantage of the powerful PIC32MX695F512L microcontroller, which features a 32-bit MIPS processor core running at 80 MHz, 512K of flash program memory, and 128K of SRAM data memory. The WF32 can be programmed using the Multi-Platform Integrated Development Environment (MPIDE). It contains everything needed to start developing embedded applications. The WF32 features a USB serial port interface for connection to the MPIDE and can be powered via USB or by an external power supply. In addition, the WF32 is fully compatible with the advanced Microchip MPLAB® IDE and works with all MPLAB compatible in-system programmer/debuggers, such as the Microchip PICkit™3 or the Digilent chipKIT PGM.
store.digilentinc.com/chipkit-wf32-wifi-enabled-microntro...
chipKIT PGM Programmer/Debugger for use with Digilent chipKIT Platforms
The chipKIT PGM is designed to work with the MPLAB® and MPLAB X development environments available from Microchip. This allows the chipKIT boards, for example, to be used as a more traditional microcontroller development platform using the professional tools available from Microchip. While the PICkit™3 programmer can generate programming voltages needed to program all Microchip PIC devices, the chipKIT PGM can only program devices that are programmable with 3.3V programming voltage. Further, the PICkit3 can source a small amount of current to provide power to some boards being programmed. The chipKIT PGM does not provide power to the board being programmed.
store.digilentinc.com/chipkit-pgm-programmer-debugger-for...
Debug sequence in enterprise cms workflow. Sense/Net 6.0 is an enterprise grade open source cms software for the .Net framework.
The chipKIT™ Uno32 is a prototyping platform that adds the performance of the Microchip® PIC32 microcontroller. It features a USB serial port interface for connection to the IDE and can be powered via USB or an external power supply. To download the IDE, please visit www.chipkit.net/started
The Uno32 board takes advantage of the powerful PIC32MX320F128 microcontroller. This microcontroller features a 32-bit MIPS processor core running at 80 MHz, 128K of flash program memory, and 16K of SRAM data memory.
The Uno32 can be programmed using the Multi-Platform Development Environment (MPIDE). In addition, the Uno32 is fully compatible with the advanced Microchip MPLAB® IDE and the PICKit3 in-system programmer/debugger.
store.digilentinc.com/chipkit-uno32-basic-microcontroller...
Using Processing.org
import processing.pdf.*;
boolean debug = false;
boolean randomized = false;
boolean randomNumberNodes = false;
boolean randomRadius = false;
// Variables for how complex a drawing
int numberBranches = 5;
int minNodes = 3; //this will always set an odd number
int maxNodes = 10; //this will always set an odd number
// Declarations
int pagePixels;
int arrayLength = 1000000;
int i;
int j;
String filename;
// randomizing limits
float randLow = .95;
float randHigh = 1.05;
float randRadiusLow = .80;
float randRadiusHigh = 1.25;
// node array variables
String branchAction;
boolean maxLevelFlag = false;
boolean maxNodeFlag = false;
boolean reuseFlag = false;
// node calculation variables
int nodes;
int parentNode;
float x;
float y;
float radius; //4 for 5 branches
float angle = 0.0;
// drawing varables
float drawMod;
PGraphics pg;
// Declare and construct objects
//---------------Branch-----------------
// Creates the array
Branch branch[] = new Branch[numberBranches] ;
//---------------Node-----------------
// Creates the array
Node node[] = new Node[arrayLength] ;
// Setup
// -----
void setup() {
size(9000, 9000, PDF, "Snowflake01.pdf");
pagePixels = numberBranches * 1800;
radius = pagePixels / 4;
filename = year()+"-"+month()+"-"+day()+" "+hour()+"-"+minute()+"-"+second()+" Snowflake.pdf";
// size(pagePixels, pagePixels);
// pg = createGraphics(pagePixels, pagePixels);
pg = createGraphics(pagePixels, pagePixels, PDF, filename);
pg.beginDraw();
smooth();
background(255,255,255,0);
pg.endDraw();
}
// Draw
void draw() {
// All of these funtions are quite extensive, read them below.
buildArray();
drawAllChildToChild();
drawChildInRing();
drawNodeOrbits();
drawParentToChild();
drawNodeEllipse();
println("DONE");
exit();
} // ************** Draw END **************
void keyPressed() {
if (key == 'q') {
exit();
}
if (key == 's') {
saveDrawing();
}
}
// KeyPressed END
void saveDrawing() {
println("Saving...");
filename = year()+"-"+month()+"-"+day()+" "+hour()+"-"+minute()+"-"+second()+"- Snowflake.pdf";
println("Saved.");
}
//-------------------
// Building the Array
//-------------------
void buildArray() {
println("Branches " + numberBranches);
//---------------Branch-----------------
// Creates the objects and assigns them to the array
for (i = 0; i < numberBranches; i++) {
branch[i] = new Branch();
}
// Sets the first node as branch[0]
branch[0].Branch(int((2*round(random(minNodes,maxNodes)/2))+1), radius); //int NodeNum; float radius;
if(debug == true){
println("Branch 0 Node #: " + branch[0].getNodeNum() );
println("Branch 0 radius: " + branch[0].getRadius() );
}
// Reset arrayLength to the first node
arrayLength = 1;
// Sets the values for the array
for (i = 1; i < numberBranches; i++) {
// designed to always produce an odd number
// branch[i].Branch(int((2*round(random(minNodes,maxNodes)/2))+1), branch[i-1].getRadius()/2); //int NodeNum; float radius;
branch[i].Branch(int((2*round(random(minNodes,maxNodes)/2))+1), branch[i-1].getRadius()/2.075); //int NodeNum; float radius;
if(debug == true){
println("Branch " + i + " Node #: " + branch[i].getNodeNum() );
println("Branch " + i + " radius: " + branch[i].getRadius() );
}
}
arrayLength = node.length;
if(debug == true){
println("arrayLength #: " + arrayLength);
}
//---------------Node-----------------
// Creates the objects and assigns them to the array
for (i = 0; i < arrayLength; i++) {
node[i] = new Node();
}
if(debug == true){
println("Node Array Length #: " + node.length);
println("");
}
// Clear out array
for (i = 0; i < arrayLength; i++) {
//int int branchPosition, int nodePosition, int parentReference, int nodeNumber, float nodeRadius, float theta, float x, float y, String action
node[i].Node(0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, "empty");
}
if (debug == true) {
println("START");
println("");
println("node, int branchPosition, int nodePosition, int parentReference, int nodeNumber, float nodeRadius, float theta, float x, float y, String action");
}
if (randomNumberNodes == false) {
// First Node
//int int branchPosition, int nodePosition, int parentReference, int nodeNumber, float nodeRadius, float theta, float x, float y, String action
node[0].Node(0, 0, 0, branch[0].getNodeNum(), radius, 0.0, pagePixels/2, pagePixels/2, "up");
} else {
// First Node
//int int branchPosition, int nodePosition, int parentReference, int nodeNumber, float nodeRadius, float theta, float x, float y, String action
node[0].Node(0, 0, 0, int((2*round(random(minNodes,maxNodes)/2))+1), radius, 0.0, pagePixels/2, pagePixels/2, "up");
}
node[0].setNodePosition(node[0].getNodeNumber());
if(debug == true){
print("0, ");
node[0].printNode();
}
// DETERMINE WHAT ACTIONS TO TAKE: add, up, down, reuse
//---------------------------------------
for (i = 1; i < arrayLength; i++) {
// set boolean conditions ...this was for legability...
// maxLevelFlag = was the last node at the highest branch level?
// maxNodeFlag = was the last node at the highest node number (the last node)?
// reuseFlag = was the last node a reuse. Or, was it a node that exists already as we move back down the tree?
if (node[i-1].getBranchPosition() == numberBranches - 1) { // If max level
maxLevelFlag = true;
} else {
maxLevelFlag = false;
}
if (node[i-1].getNodePosition() == node[node[i-1].getParentReference()].getNodeNumber() ) { // If max node from parent node
maxNodeFlag = true;
} else {
maxNodeFlag = false;
}
if (node[i-1].getAction() == "reuse") { // If reuse
reuseFlag = true;
} else {
reuseFlag = false;
}
// Set actions based on boolean conditions
if (maxLevelFlag == false && maxNodeFlag == false && reuseFlag == false) {
parentNode = i - 1;
branchAction = "up";
}
if (maxLevelFlag == false && maxNodeFlag == true && reuseFlag == false) {
parentNode = i - 1;
branchAction = "up";
}
if (maxLevelFlag == false && maxNodeFlag == true && reuseFlag == true) {
if (node[node[i-1].getParentReference()].getNodePosition() < node[node[node[i-1].getParentReference()].getParentReference()].getNodeNumber()) { // if parent is not max node
parentNode = node[node[i-1].getParentReference()].getParentReference();
branchAction = "down";
} else {
if (node[i-1].getBranchPosition() == 0) { // if back to the start
arrayLength = i - 1;
println("arrayLength = " + arrayLength);
i = node.length - 1;
branchAction = "reuse";
} else {
parentNode = node[node[i-1].getParentReference()].getParentReference();
branchAction = "reuse";
}
}
}
if (maxLevelFlag == true && maxNodeFlag == false && reuseFlag == false) {
parentNode = node[i-1].getParentReference();
branchAction = "add";
}
if (maxLevelFlag == true && maxNodeFlag == true) {
if (node[node[i-1].getParentReference()].getNodePosition() == node[node[node[i-1].getParentReference()].getParentReference()].getNodeNumber()) { // if parent is max node
parentNode = node[node[i-1].getParentReference()].getParentReference();
branchAction = "reuse";
} else {
parentNode = node[node[i-1].getParentReference()].getParentReference();
branchAction = "down";
}
}
// ACTIONS: add, up, down, reuse
//---------------------------------------
// Add node at same branch level
if (branchAction == "add") {
// Set Parent Reference.
node[i].setParentReference(parentNode);
// Keep the parent node's branch level.
node[i].setBranchPosition(node[i-1].getBranchPosition());
// Add 1 to the node position of the previous node.
node[i].setNodePosition(node[i-1].getNodePosition() + 1);
//if Adding a node, NodeNumber is zero
node[i].setNodeNumber(0);
if (randomRadius == false) {
node[i].setNodeRadius(branch[node[i].getBranchPosition()].getRadius());
} else {
node[i].setNodeRadius(random(randRadiusLow,randRadiusHigh)*branch[node[i].getBranchPosition()].getRadius());
}
// Set the angle by adding the Node's branch angle (2 PI / Number of nodes) to the previous node's angle.
if (randomized == true) {
node[i].setAngle(random(randLow,randHigh)*(node[node[i].getParentReference()].getAngle() + (node[i].getNodePosition()*(TWO_PI / node[node[i].getParentReference()].getNodeNumber() ))));
}
if (randomized == false) {
node[i].setAngle((node[node[i].getParentReference()].getAngle() + (node[i].getNodePosition()*(TWO_PI / node[node[i].getParentReference()].getNodeNumber()) )));
}
// Calculate and set the x, y position of the node
if (randomized == true) {
x = node[node[i].getParentReference()].getX() + sin(node[i].getAngle()) * random(randLow,randHigh)*node[node[i].getParentReference()].getNodeRadius();
y = node[node[i].getParentReference()].getY() + cos(node[i].getAngle()) * random(randLow,randHigh)*node[node[i].getParentReference()].getNodeRadius();
}
if (randomized == false) {
x = node[node[i].getParentReference()].getX() + sin(node[i].getAngle()) * node[node[i].getParentReference()].getNodeRadius();
y = node[node[i].getParentReference()].getY() + cos(node[i].getAngle()) * node[node[i].getParentReference()].getNodeRadius();
}
node[i].setPosition(x, y);
// Set action
node[i].setAction("add");
}
// Go up one branch level, add node to upper branch level
if (branchAction == "up") {
// Set Parent Reference.
node[i].setParentReference(parentNode);
// Go up one branch level. Add 1 to the former node's branch level.
node[i].setBranchPosition(node[i-1].getBranchPosition() + 1);
// When you go up a branch the node is always 1, the starting position.
node[i].setNodePosition(1);
//if Maximum branch level, NodeNumber is zero
if(node[i].getBranchPosition() == numberBranches - 1) {
node[i].setNodeNumber(0);
} else {
if (randomNumberNodes == false) {
node[i].setNodeNumber(branch[node[i].getBranchPosition()].getNodeNum() );
} else {
node[i].setNodeNumber(int((2*round(random(minNodes,maxNodes)/2))+1) );
}
}
if (randomRadius == false) {
node[i].setNodeRadius(branch[node[i].getBranchPosition()].getRadius());
} else {
node[i].setNodeRadius(random(randRadiusLow,randRadiusHigh)*branch[node[i].getBranchPosition()].getRadius());
}
// Set the angle by adding the Node's branch angle (2 PI / Number of nodes) to the previous node's angle.
if (randomized == true) {
node[i].setAngle(random(randLow,1.01)*(node[i-1].getAngle() + (TWO_PI / node[node[i].getParentReference()].getNodeNumber() )));
}
if (randomized == false) {
node[i].setAngle((node[i-1].getAngle() + (TWO_PI / node[node[i].getParentReference()].getNodeNumber() )));
}
// Calculate and set the x, y position of the node
if (randomized == true) {
x = node[i-1].getX() + sin(node[i].getAngle()) * random(randLow,randHigh)*node[node[i].getParentReference()].getNodeRadius();
y = node[i-1].getY() + cos(node[i].getAngle()) * random(randLow,randHigh)*node[node[i].getParentReference()].getNodeRadius();
}
if (randomized == false) {
x = node[i-1].getX() + sin(node[i].getAngle()) * node[node[i].getParentReference()].getNodeRadius();
y = node[i-1].getY() + cos(node[i].getAngle()) * node[node[i].getParentReference()].getNodeRadius();
}
node[i].setPosition(x, y);
// Set action
node[i].setAction("up");
// Set parentNode to this node
parentNode = i;
}
// Go down one branch level, add node from parent at lower branch level
if (branchAction == "down") {
// Set Parent Reference.
node[i].setParentReference(parentNode);
// Keep the parent node's branch level.
node[i].setBranchPosition(node[node[i-1].getParentReference()].getBranchPosition());
// Add 1 to the parent node's position.
node[i].setNodePosition(node[node[i-1].getParentReference()].getNodePosition() + 1);
if (randomNumberNodes == false) {
node[i].setNodeNumber(branch[node[i].getBranchPosition()].getNodeNum() );
} else {
node[i].setNodeNumber(int((2*round(random(minNodes,maxNodes)/2))+1) );
}
if (randomRadius == false) {
node[i].setNodeRadius(branch[node[i].getBranchPosition()].getRadius());
} else {
node[i].setNodeRadius(random(randRadiusLow,randRadiusHigh)*branch[node[i].getBranchPosition()].getRadius());
}
// Set the angle by adding the node's branch angle (2 PI / Number of nodes) to the parent's angle.
if (randomized == true) {
node[i].setAngle(random(.99,1.01)*(node[node[i-1].getParentReference()].getAngle() + (TWO_PI / node[node[i].getParentReference()].getNodeNumber() )));
}
if (randomized == false) {
node[i].setAngle((node[node[i-1].getParentReference()].getAngle() + (TWO_PI / node[node[i].getParentReference()].getNodeNumber() )));
}
// Calculate and set the x, y position of the node
if (randomized == true) {
x = node[parentNode].getX() + sin(node[i].getAngle()) * random(randLow,randHigh)*node[node[i].getParentReference()].getNodeRadius();
y = node[parentNode].getY() + cos(node[i].getAngle()) * random(randLow,randHigh)*node[node[i].getParentReference()].getNodeRadius();
}
if (randomized == false) {
x = node[parentNode].getX() + sin(node[i].getAngle()) * node[node[i].getParentReference()].getNodeRadius();
y = node[parentNode].getY() + cos(node[i].getAngle()) * node[node[i].getParentReference()].getNodeRadius();
}
node[i].setPosition(x, y);
// Set action
node[i].setAction("down");
}
// Go down one branch level, reuse parent at lower branch level
if (branchAction == "reuse") {
// Set Parent Reference.
node[i].setParentReference(parentNode);
// Keep the parent node's branch level.
node[i].setBranchPosition(node[node[i-1].getParentReference()].getBranchPosition());
// Keep the parent node position.
node[i].setNodePosition(node[node[i-1].getParentReference()].getNodePosition());
// Keep the parent node number.
node[i].setNodeNumber(node[node[i-1].getParentReference()].getNodeNumber());
// Keep the parent node radius.
node[i].setNodeRadius(node[node[i-1].getParentReference()].getNodeRadius());
// Keep the parent angle.
node[i].setAngle(node[node[i-1].getParentReference()].getAngle());
// Keep the parent x.
x = node[node[i-1].getParentReference()].getX();
// Keep the parent y.
y = node[node[i-1].getParentReference()].getY();
// Keep the parent postition.
node[i].setPosition(x, y);
// Set action
node[i].setAction("reuse");
// set parentNode to the reused node's parent to keep it moving down
parentNode = node[i].getParentReference();
}
if (debug == true) {
// print node information
print(i + ", ");
node[i].printNode();
}
}
// buildArray END
}
//-------------------
// Drawing Functions
//-------------------
void drawAllChildToChild() {
println("START: Draw line connecting all children together...");
// Draw line connecting all children together
for (i = 1; i < arrayLength; i++) {
for (j = 2; j < arrayLength; j++) {
if(node[i].getParentReference() == node[j].getParentReference() && i!= j) {
drawMod = numberBranches-node[i].getBranchPosition()+1;
if (randomized == true) {
stroke(random(randLow,randHigh)*round(random(100,150)),
random(randLow,randHigh)*round(random(100,150)),
random(randLow,randHigh)*round(random(100,150)),
random(randLow,randHigh)*round(random(200,255))*drawMod/numberBranches);
strokeWeight(random(.75,1.5)*drawMod*.03);
}
if (randomized == false) {
stroke(10 * drawMod/numberBranches,
200 * drawMod/numberBranches,
200 * drawMod/numberBranches,
255 * drawMod/numberBranches);
strokeWeight(drawMod*.05);
}
pg.beginDraw();
line (node[i].getX(), node[i].getY(), node[j].getX(), node[j].getY());
pg.endDraw();
}
}
}
println("END: Draw line connecting all children together.");
}
void drawChildInRing() {
println("START: Draw line connecting all children together in a ring...");
// Draw line connecting all children together in a ring
for (i = 1; i < arrayLength; i++) {
for (j = 2; j < arrayLength; j++) {
if( (node[i].getParentReference() == node[j].getParentReference() && node[i].getNodePosition() + 1 == node[j].getNodePosition())
||
(node[i].getParentReference() == node[j].getParentReference() && (node[i].getNodePosition() == 1
&& node[j].getNodePosition() == node[node[j].getParentReference()].getNodeNumber()))
)
{
drawMod = numberBranches-node[i].getBranchPosition()+1;
if (randomized == true) {
stroke(random(randLow,randHigh)*round(random(215,255))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(125,150))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(25,75))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(200,255))*drawMod/numberBranches);
strokeWeight(random(.75,1.25)*drawMod*.0625);
}
if (randomized == false) {
stroke(250 * drawMod/numberBranches,
166 * drawMod/numberBranches,
52 * drawMod/numberBranches,
255 * drawMod/numberBranches);
strokeWeight(drawMod*.0625);
}
pg.beginDraw();
line (node[i].getX(), node[i].getY(), node[j].getX(), node[j].getY());
pg.endDraw();
}
}
}
println("END: Draw line connecting all children together in a ring.");
}
void drawParentToChild() {
println("START: Draw line connecting parent node to child node...");
// Draw line connecting parent node to child node
for (i = 1; i < arrayLength; i++) {
if(node[i].getAction() != "reuse") {
drawMod = numberBranches-node[i].getBranchPosition()+1;
if (randomized == true) {
stroke(random(randLow,randHigh)*round(random(0,50)),
random(randLow,randHigh)*round(random(0,150)),
random(randLow,randHigh)*round(random(200,255)),
random(randLow,randHigh)*round(random(200,255))*drawMod/numberBranches); //blue
strokeWeight(random(.75,1.5)*drawMod*.125);
}
if (randomized == false) {
stroke(0,
127 * drawMod/numberBranches,
195 * drawMod/numberBranches,
255 * drawMod/numberBranches); //blue
strokeWeight(drawMod*.125);
}
pg.beginDraw();
line (node[i].getX(), node[i].getY(), node[node[i].getParentReference()].getX(), node[node[i].getParentReference()].getY());
pg.endDraw();
}
}
println("END: Draw line connecting parent node to child node.");
}
void drawNodeOrbits() {
println("START: Draw ellipse at each node with radius...");
// Draw ellipse at each node
for (i = 0; i < arrayLength; i++) {
if(node[i].getAction() != "reuse") {
drawMod = (numberBranches - node[i].getBranchPosition())*1.5;
// Fill
if (randomized == true) {
fill(random(randLow,randHigh)*round(random(5,125)),
random(randLow,randHigh)*round(random(175,255)),
random(randLow,randHigh)*round(random(5,125)),
random(randLow,randHigh)*round(random(30,50))*drawMod/numberBranches); //green
}
if (randomized == false) {
fill(127 * drawMod/numberBranches,
255 * drawMod/numberBranches,
50 * drawMod/numberBranches,
40 * drawMod/numberBranches);
}
// Stroke
if (randomized == true) {
stroke(random(randLow,randHigh)*round(random(0,125)),
random(randLow,randHigh)*round(random(200,255)),
random(randLow,randHigh)*round(random(0,125)),
random(randLow,randHigh)*round(random(225,255))*drawMod/numberBranches); //green
strokeWeight(random(.75,1.5)*drawMod*.0625);
}
if (randomized == false) {
stroke(63 * drawMod/numberBranches,
127 * drawMod/numberBranches,
25 * drawMod/numberBranches,
255 * drawMod/numberBranches);
strokeWeight(drawMod*.0625);
}
pg.beginDraw();
ellipse(node[i].getX(), node[i].getY(), node[i].getNodeRadius(), node[i].getNodeRadius());
pg.endDraw();
}
}
println("END: Draw ellipse at each node with radius.");
}
void drawNodeEllipse() {
println("START: Draw ellipse at each node...");
// Draw ellipse at each node
for (i = 0; i < arrayLength; i++) {
for (j = 0; j < numberBranches; j++) {
if (node[i].getBranchPosition()==j){
if(node[i].getAction() != "reuse") {
drawMod = (numberBranches - node[i].getBranchPosition());
// Fill
if (randomized == true) {
fill(random(randLow,randHigh)*round(random(100,150))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(200,255))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(25,75))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(200,255))*drawMod/numberBranches); //green
}
if (randomized == false) {
fill(127 * drawMod/numberBranches,
255 * drawMod/numberBranches,
50 * drawMod/numberBranches,
250 * drawMod/numberBranches);
}
// Stroke
if (randomized == true) {
stroke(random(randLow,randHigh)*round(random(0,50))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(100,150))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(0,50))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(200,255))*drawMod/numberBranches); //green
strokeWeight(random(.75,1.5)*drawMod*.0625);
}
if (randomized == false) {
stroke(63 * drawMod/numberBranches,
127 * drawMod/numberBranches,
25 * drawMod/numberBranches,
250 * drawMod/numberBranches);
strokeWeight(drawMod*.0625);
}
pg.beginDraw();
ellipse(node[i].getX(), node[i].getY(),pow(drawMod,1.5),pow(drawMod,1.5));
pg.endDraw();
}
}
}
}
println("END: Draw ellipse at each node.");
}
// ---------------
// HERE BE CLASSES
// ---------------
public class Node{
// the first letter of a class name should be capitalized
// the class has fields
// for fields, spell the first word lowercase, capitalize the first letter of each subsequent word
// --------------------------
// these are private and you use the get Methods to return the public values
// private float radius, theta, x, y, action;
int branchPosition, nodePosition, parentReference, nodeNumber;
float theta, x, y, nodeRadius;
String action;
// the class has constructors
// --------------------------
public void Node(int startBranchPosition, int startNodePosition, int startParentReference, int startNodeNumber, float startNodeRadius, float startAngle, float startX, float startY, String startAction) {
branchPosition = startBranchPosition;
nodePosition = startNodePosition;
parentReference = startParentReference;
nodeNumber = startNodeNumber;
nodeRadius = startNodeRadius;
theta = startAngle;
x = startX;
y = startY;
action = startAction;
}
// the class has methods
// the first (or only) word in a method name should be a verb
// --------------------------
// ---------SET and GET------------
public int getBranchPosition() {
return branchPosition;
}
public void setBranchPosition(int newValue) {
branchPosition = newValue;
}
public int getNodePosition() {
return nodePosition;
}
public void setNodePosition(int newValue) {
nodePosition = newValue;
}
public int getParentReference() {
return parentReference;
}
public void setParentReference(int newValue) {
parentReference = newValue;
}
public int getNodeNumber() {
return nodeNumber;
}
public void setNodeNumber(int newValue) {
nodeNumber = newValue;
}
public float getNodeRadius() {
return nodeRadius;
}
public void setNodeRadius(float newValue) {
nodeRadius = newValue;
}
public float getAngle() {
return theta;
}
public void setAngle(float newValue) {
theta = newValue;
}
public float getX() {
return (x);
}
public float getY() {
return (y);
}
public void setPosition(float newX, float newY) {
x = newX;
y = newY;
}
public String getAction() {
return action;
}
public void setAction(String newValue) {
action = newValue;
}
public void printNode() {
println(branchPosition + ", " + nodePosition + ", " + parentReference + ", " + nodeNumber + ", " + nodeRadius + ", " + theta + ", " + x + ", " + y + ", " + action);
}
}
public class Branch{
// the first letter of a class name should be capitalized
// the class has fields
// for fields, spell the first word lowercase, capitalize the first letter of each subsequent word
// --------------------------
// these are private and you use the get Methods to return the public values
// private float radius, theta, x, y;
int NodeNum;
float radius;
// the class has constructors
// --------------------------
public void Branch(int startNodeNum, float startRadius) {
NodeNum = startNodeNum;
radius = startRadius;
}
// the class has methods
// the first (or only) word in a method name should be a verb
// --------------------------
// ---------SET and GET------------
public int getNodeNum() {
return NodeNum;
}
public void setNodeNum(int newValue) {
NodeNum = newValue;
}
public float getRadius() {
return radius;
}
public void setRadius(float newValue) {
radius = newValue;
}
}
In software engineering, rubber duck debugging is a method of debugging code by articulating a problem in spoken or written natural language en.wikipedia.org/wiki/Rubber_duck_debugging
Rubber duck picture by Tom Morris on Wikimedia Commons w.wiki/4QHW
Using Processing.org
import processing.pdf.*;
boolean debug = false;
boolean randomized = false;
boolean randomNumberNodes = false;
boolean randomRadius = false;
// Variables for how complex a drawing
int numberBranches = 5;
int minNodes = 3; //this will always set an odd number
int maxNodes = 10; //this will always set an odd number
// Declarations
int pagePixels;
int arrayLength = 1000000;
int i;
int j;
String filename;
// randomizing limits
float randLow = .95;
float randHigh = 1.05;
float randRadiusLow = .80;
float randRadiusHigh = 1.25;
// node array variables
String branchAction;
boolean maxLevelFlag = false;
boolean maxNodeFlag = false;
boolean reuseFlag = false;
// node calculation variables
int nodes;
int parentNode;
float x;
float y;
float radius; //4 for 5 branches
float angle = 0.0;
// drawing varables
float drawMod;
PGraphics pg;
// Declare and construct objects
//---------------Branch-----------------
// Creates the array
Branch branch[] = new Branch[numberBranches] ;
//---------------Node-----------------
// Creates the array
Node node[] = new Node[arrayLength] ;
// Setup
// -----
void setup() {
size(9000, 9000, PDF, "Snowflake01.pdf");
pagePixels = numberBranches * 1800;
radius = pagePixels / 4;
filename = year()+"-"+month()+"-"+day()+" "+hour()+"-"+minute()+"-"+second()+" Snowflake.pdf";
// size(pagePixels, pagePixels);
// pg = createGraphics(pagePixels, pagePixels);
pg = createGraphics(pagePixels, pagePixels, PDF, filename);
pg.beginDraw();
smooth();
background(255,255,255,0);
pg.endDraw();
}
// Draw
void draw() {
// All of these funtions are quite extensive, read them below.
buildArray();
drawAllChildToChild();
drawChildInRing();
drawNodeOrbits();
drawParentToChild();
drawNodeEllipse();
println("DONE");
exit();
} // ************** Draw END **************
void keyPressed() {
if (key == 'q') {
exit();
}
if (key == 's') {
saveDrawing();
}
}
// KeyPressed END
void saveDrawing() {
println("Saving...");
filename = year()+"-"+month()+"-"+day()+" "+hour()+"-"+minute()+"-"+second()+"- Snowflake.pdf";
println("Saved.");
}
//-------------------
// Building the Array
//-------------------
void buildArray() {
println("Branches " + numberBranches);
//---------------Branch-----------------
// Creates the objects and assigns them to the array
for (i = 0; i < numberBranches; i++) {
branch[i] = new Branch();
}
// Sets the first node as branch[0]
branch[0].Branch(int((2*round(random(minNodes,maxNodes)/2))+1), radius); //int NodeNum; float radius;
if(debug == true){
println("Branch 0 Node #: " + branch[0].getNodeNum() );
println("Branch 0 radius: " + branch[0].getRadius() );
}
// Reset arrayLength to the first node
arrayLength = 1;
// Sets the values for the array
for (i = 1; i < numberBranches; i++) {
// designed to always produce an odd number
// branch[i].Branch(int((2*round(random(minNodes,maxNodes)/2))+1), branch[i-1].getRadius()/2); //int NodeNum; float radius;
branch[i].Branch(int((2*round(random(minNodes,maxNodes)/2))+1), branch[i-1].getRadius()/2.075); //int NodeNum; float radius;
if(debug == true){
println("Branch " + i + " Node #: " + branch[i].getNodeNum() );
println("Branch " + i + " radius: " + branch[i].getRadius() );
}
}
arrayLength = node.length;
if(debug == true){
println("arrayLength #: " + arrayLength);
}
//---------------Node-----------------
// Creates the objects and assigns them to the array
for (i = 0; i < arrayLength; i++) {
node[i] = new Node();
}
if(debug == true){
println("Node Array Length #: " + node.length);
println("");
}
// Clear out array
for (i = 0; i < arrayLength; i++) {
//int int branchPosition, int nodePosition, int parentReference, int nodeNumber, float nodeRadius, float theta, float x, float y, String action
node[i].Node(0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, "empty");
}
if (debug == true) {
println("START");
println("");
println("node, int branchPosition, int nodePosition, int parentReference, int nodeNumber, float nodeRadius, float theta, float x, float y, String action");
}
if (randomNumberNodes == false) {
// First Node
//int int branchPosition, int nodePosition, int parentReference, int nodeNumber, float nodeRadius, float theta, float x, float y, String action
node[0].Node(0, 0, 0, branch[0].getNodeNum(), radius, 0.0, pagePixels/2, pagePixels/2, "up");
} else {
// First Node
//int int branchPosition, int nodePosition, int parentReference, int nodeNumber, float nodeRadius, float theta, float x, float y, String action
node[0].Node(0, 0, 0, int((2*round(random(minNodes,maxNodes)/2))+1), radius, 0.0, pagePixels/2, pagePixels/2, "up");
}
node[0].setNodePosition(node[0].getNodeNumber());
if(debug == true){
print("0, ");
node[0].printNode();
}
// DETERMINE WHAT ACTIONS TO TAKE: add, up, down, reuse
//---------------------------------------
for (i = 1; i < arrayLength; i++) {
// set boolean conditions ...this was for legability...
// maxLevelFlag = was the last node at the highest branch level?
// maxNodeFlag = was the last node at the highest node number (the last node)?
// reuseFlag = was the last node a reuse. Or, was it a node that exists already as we move back down the tree?
if (node[i-1].getBranchPosition() == numberBranches - 1) { // If max level
maxLevelFlag = true;
} else {
maxLevelFlag = false;
}
if (node[i-1].getNodePosition() == node[node[i-1].getParentReference()].getNodeNumber() ) { // If max node from parent node
maxNodeFlag = true;
} else {
maxNodeFlag = false;
}
if (node[i-1].getAction() == "reuse") { // If reuse
reuseFlag = true;
} else {
reuseFlag = false;
}
// Set actions based on boolean conditions
if (maxLevelFlag == false && maxNodeFlag == false && reuseFlag == false) {
parentNode = i - 1;
branchAction = "up";
}
if (maxLevelFlag == false && maxNodeFlag == true && reuseFlag == false) {
parentNode = i - 1;
branchAction = "up";
}
if (maxLevelFlag == false && maxNodeFlag == true && reuseFlag == true) {
if (node[node[i-1].getParentReference()].getNodePosition() < node[node[node[i-1].getParentReference()].getParentReference()].getNodeNumber()) { // if parent is not max node
parentNode = node[node[i-1].getParentReference()].getParentReference();
branchAction = "down";
} else {
if (node[i-1].getBranchPosition() == 0) { // if back to the start
arrayLength = i - 1;
println("arrayLength = " + arrayLength);
i = node.length - 1;
branchAction = "reuse";
} else {
parentNode = node[node[i-1].getParentReference()].getParentReference();
branchAction = "reuse";
}
}
}
if (maxLevelFlag == true && maxNodeFlag == false && reuseFlag == false) {
parentNode = node[i-1].getParentReference();
branchAction = "add";
}
if (maxLevelFlag == true && maxNodeFlag == true) {
if (node[node[i-1].getParentReference()].getNodePosition() == node[node[node[i-1].getParentReference()].getParentReference()].getNodeNumber()) { // if parent is max node
parentNode = node[node[i-1].getParentReference()].getParentReference();
branchAction = "reuse";
} else {
parentNode = node[node[i-1].getParentReference()].getParentReference();
branchAction = "down";
}
}
// ACTIONS: add, up, down, reuse
//---------------------------------------
// Add node at same branch level
if (branchAction == "add") {
// Set Parent Reference.
node[i].setParentReference(parentNode);
// Keep the parent node's branch level.
node[i].setBranchPosition(node[i-1].getBranchPosition());
// Add 1 to the node position of the previous node.
node[i].setNodePosition(node[i-1].getNodePosition() + 1);
//if Adding a node, NodeNumber is zero
node[i].setNodeNumber(0);
if (randomRadius == false) {
node[i].setNodeRadius(branch[node[i].getBranchPosition()].getRadius());
} else {
node[i].setNodeRadius(random(randRadiusLow,randRadiusHigh)*branch[node[i].getBranchPosition()].getRadius());
}
// Set the angle by adding the Node's branch angle (2 PI / Number of nodes) to the previous node's angle.
if (randomized == true) {
node[i].setAngle(random(randLow,randHigh)*(node[node[i].getParentReference()].getAngle() + (node[i].getNodePosition()*(TWO_PI / node[node[i].getParentReference()].getNodeNumber() ))));
}
if (randomized == false) {
node[i].setAngle((node[node[i].getParentReference()].getAngle() + (node[i].getNodePosition()*(TWO_PI / node[node[i].getParentReference()].getNodeNumber()) )));
}
// Calculate and set the x, y position of the node
if (randomized == true) {
x = node[node[i].getParentReference()].getX() + sin(node[i].getAngle()) * random(randLow,randHigh)*node[node[i].getParentReference()].getNodeRadius();
y = node[node[i].getParentReference()].getY() + cos(node[i].getAngle()) * random(randLow,randHigh)*node[node[i].getParentReference()].getNodeRadius();
}
if (randomized == false) {
x = node[node[i].getParentReference()].getX() + sin(node[i].getAngle()) * node[node[i].getParentReference()].getNodeRadius();
y = node[node[i].getParentReference()].getY() + cos(node[i].getAngle()) * node[node[i].getParentReference()].getNodeRadius();
}
node[i].setPosition(x, y);
// Set action
node[i].setAction("add");
}
// Go up one branch level, add node to upper branch level
if (branchAction == "up") {
// Set Parent Reference.
node[i].setParentReference(parentNode);
// Go up one branch level. Add 1 to the former node's branch level.
node[i].setBranchPosition(node[i-1].getBranchPosition() + 1);
// When you go up a branch the node is always 1, the starting position.
node[i].setNodePosition(1);
//if Maximum branch level, NodeNumber is zero
if(node[i].getBranchPosition() == numberBranches - 1) {
node[i].setNodeNumber(0);
} else {
if (randomNumberNodes == false) {
node[i].setNodeNumber(branch[node[i].getBranchPosition()].getNodeNum() );
} else {
node[i].setNodeNumber(int((2*round(random(minNodes,maxNodes)/2))+1) );
}
}
if (randomRadius == false) {
node[i].setNodeRadius(branch[node[i].getBranchPosition()].getRadius());
} else {
node[i].setNodeRadius(random(randRadiusLow,randRadiusHigh)*branch[node[i].getBranchPosition()].getRadius());
}
// Set the angle by adding the Node's branch angle (2 PI / Number of nodes) to the previous node's angle.
if (randomized == true) {
node[i].setAngle(random(randLow,1.01)*(node[i-1].getAngle() + (TWO_PI / node[node[i].getParentReference()].getNodeNumber() )));
}
if (randomized == false) {
node[i].setAngle((node[i-1].getAngle() + (TWO_PI / node[node[i].getParentReference()].getNodeNumber() )));
}
// Calculate and set the x, y position of the node
if (randomized == true) {
x = node[i-1].getX() + sin(node[i].getAngle()) * random(randLow,randHigh)*node[node[i].getParentReference()].getNodeRadius();
y = node[i-1].getY() + cos(node[i].getAngle()) * random(randLow,randHigh)*node[node[i].getParentReference()].getNodeRadius();
}
if (randomized == false) {
x = node[i-1].getX() + sin(node[i].getAngle()) * node[node[i].getParentReference()].getNodeRadius();
y = node[i-1].getY() + cos(node[i].getAngle()) * node[node[i].getParentReference()].getNodeRadius();
}
node[i].setPosition(x, y);
// Set action
node[i].setAction("up");
// Set parentNode to this node
parentNode = i;
}
// Go down one branch level, add node from parent at lower branch level
if (branchAction == "down") {
// Set Parent Reference.
node[i].setParentReference(parentNode);
// Keep the parent node's branch level.
node[i].setBranchPosition(node[node[i-1].getParentReference()].getBranchPosition());
// Add 1 to the parent node's position.
node[i].setNodePosition(node[node[i-1].getParentReference()].getNodePosition() + 1);
if (randomNumberNodes == false) {
node[i].setNodeNumber(branch[node[i].getBranchPosition()].getNodeNum() );
} else {
node[i].setNodeNumber(int((2*round(random(minNodes,maxNodes)/2))+1) );
}
if (randomRadius == false) {
node[i].setNodeRadius(branch[node[i].getBranchPosition()].getRadius());
} else {
node[i].setNodeRadius(random(randRadiusLow,randRadiusHigh)*branch[node[i].getBranchPosition()].getRadius());
}
// Set the angle by adding the node's branch angle (2 PI / Number of nodes) to the parent's angle.
if (randomized == true) {
node[i].setAngle(random(.99,1.01)*(node[node[i-1].getParentReference()].getAngle() + (TWO_PI / node[node[i].getParentReference()].getNodeNumber() )));
}
if (randomized == false) {
node[i].setAngle((node[node[i-1].getParentReference()].getAngle() + (TWO_PI / node[node[i].getParentReference()].getNodeNumber() )));
}
// Calculate and set the x, y position of the node
if (randomized == true) {
x = node[parentNode].getX() + sin(node[i].getAngle()) * random(randLow,randHigh)*node[node[i].getParentReference()].getNodeRadius();
y = node[parentNode].getY() + cos(node[i].getAngle()) * random(randLow,randHigh)*node[node[i].getParentReference()].getNodeRadius();
}
if (randomized == false) {
x = node[parentNode].getX() + sin(node[i].getAngle()) * node[node[i].getParentReference()].getNodeRadius();
y = node[parentNode].getY() + cos(node[i].getAngle()) * node[node[i].getParentReference()].getNodeRadius();
}
node[i].setPosition(x, y);
// Set action
node[i].setAction("down");
}
// Go down one branch level, reuse parent at lower branch level
if (branchAction == "reuse") {
// Set Parent Reference.
node[i].setParentReference(parentNode);
// Keep the parent node's branch level.
node[i].setBranchPosition(node[node[i-1].getParentReference()].getBranchPosition());
// Keep the parent node position.
node[i].setNodePosition(node[node[i-1].getParentReference()].getNodePosition());
// Keep the parent node number.
node[i].setNodeNumber(node[node[i-1].getParentReference()].getNodeNumber());
// Keep the parent node radius.
node[i].setNodeRadius(node[node[i-1].getParentReference()].getNodeRadius());
// Keep the parent angle.
node[i].setAngle(node[node[i-1].getParentReference()].getAngle());
// Keep the parent x.
x = node[node[i-1].getParentReference()].getX();
// Keep the parent y.
y = node[node[i-1].getParentReference()].getY();
// Keep the parent postition.
node[i].setPosition(x, y);
// Set action
node[i].setAction("reuse");
// set parentNode to the reused node's parent to keep it moving down
parentNode = node[i].getParentReference();
}
if (debug == true) {
// print node information
print(i + ", ");
node[i].printNode();
}
}
// buildArray END
}
//-------------------
// Drawing Functions
//-------------------
void drawAllChildToChild() {
println("START: Draw line connecting all children together...");
// Draw line connecting all children together
for (i = 1; i < arrayLength; i++) {
for (j = 2; j < arrayLength; j++) {
if(node[i].getParentReference() == node[j].getParentReference() && i!= j) {
drawMod = numberBranches-node[i].getBranchPosition()+1;
if (randomized == true) {
stroke(random(randLow,randHigh)*round(random(100,150)),
random(randLow,randHigh)*round(random(100,150)),
random(randLow,randHigh)*round(random(100,150)),
random(randLow,randHigh)*round(random(200,255))*drawMod/numberBranches);
strokeWeight(random(.75,1.5)*drawMod*.03);
}
if (randomized == false) {
stroke(10 * drawMod/numberBranches,
200 * drawMod/numberBranches,
200 * drawMod/numberBranches,
255 * drawMod/numberBranches);
strokeWeight(drawMod*.05);
}
pg.beginDraw();
line (node[i].getX(), node[i].getY(), node[j].getX(), node[j].getY());
pg.endDraw();
}
}
}
println("END: Draw line connecting all children together.");
}
void drawChildInRing() {
println("START: Draw line connecting all children together in a ring...");
// Draw line connecting all children together in a ring
for (i = 1; i < arrayLength; i++) {
for (j = 2; j < arrayLength; j++) {
if( (node[i].getParentReference() == node[j].getParentReference() && node[i].getNodePosition() + 1 == node[j].getNodePosition())
||
(node[i].getParentReference() == node[j].getParentReference() && (node[i].getNodePosition() == 1
&& node[j].getNodePosition() == node[node[j].getParentReference()].getNodeNumber()))
)
{
drawMod = numberBranches-node[i].getBranchPosition()+1;
if (randomized == true) {
stroke(random(randLow,randHigh)*round(random(215,255))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(125,150))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(25,75))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(200,255))*drawMod/numberBranches);
strokeWeight(random(.75,1.25)*drawMod*.0625);
}
if (randomized == false) {
stroke(250 * drawMod/numberBranches,
166 * drawMod/numberBranches,
52 * drawMod/numberBranches,
255 * drawMod/numberBranches);
strokeWeight(drawMod*.0625);
}
pg.beginDraw();
line (node[i].getX(), node[i].getY(), node[j].getX(), node[j].getY());
pg.endDraw();
}
}
}
println("END: Draw line connecting all children together in a ring.");
}
void drawParentToChild() {
println("START: Draw line connecting parent node to child node...");
// Draw line connecting parent node to child node
for (i = 1; i < arrayLength; i++) {
if(node[i].getAction() != "reuse") {
drawMod = numberBranches-node[i].getBranchPosition()+1;
if (randomized == true) {
stroke(random(randLow,randHigh)*round(random(0,50)),
random(randLow,randHigh)*round(random(0,150)),
random(randLow,randHigh)*round(random(200,255)),
random(randLow,randHigh)*round(random(200,255))*drawMod/numberBranches); //blue
strokeWeight(random(.75,1.5)*drawMod*.125);
}
if (randomized == false) {
stroke(0,
127 * drawMod/numberBranches,
195 * drawMod/numberBranches,
255 * drawMod/numberBranches); //blue
strokeWeight(drawMod*.125);
}
pg.beginDraw();
line (node[i].getX(), node[i].getY(), node[node[i].getParentReference()].getX(), node[node[i].getParentReference()].getY());
pg.endDraw();
}
}
println("END: Draw line connecting parent node to child node.");
}
void drawNodeOrbits() {
println("START: Draw ellipse at each node with radius...");
// Draw ellipse at each node
for (i = 0; i < arrayLength; i++) {
if(node[i].getAction() != "reuse") {
drawMod = (numberBranches - node[i].getBranchPosition())*1.5;
// Fill
if (randomized == true) {
fill(random(randLow,randHigh)*round(random(5,125)),
random(randLow,randHigh)*round(random(175,255)),
random(randLow,randHigh)*round(random(5,125)),
random(randLow,randHigh)*round(random(30,50))*drawMod/numberBranches); //green
}
if (randomized == false) {
fill(127 * drawMod/numberBranches,
255 * drawMod/numberBranches,
50 * drawMod/numberBranches,
40 * drawMod/numberBranches);
}
// Stroke
if (randomized == true) {
stroke(random(randLow,randHigh)*round(random(0,125)),
random(randLow,randHigh)*round(random(200,255)),
random(randLow,randHigh)*round(random(0,125)),
random(randLow,randHigh)*round(random(225,255))*drawMod/numberBranches); //green
strokeWeight(random(.75,1.5)*drawMod*.0625);
}
if (randomized == false) {
stroke(63 * drawMod/numberBranches,
127 * drawMod/numberBranches,
25 * drawMod/numberBranches,
255 * drawMod/numberBranches);
strokeWeight(drawMod*.0625);
}
pg.beginDraw();
ellipse(node[i].getX(), node[i].getY(), node[i].getNodeRadius(), node[i].getNodeRadius());
pg.endDraw();
}
}
println("END: Draw ellipse at each node with radius.");
}
void drawNodeEllipse() {
println("START: Draw ellipse at each node...");
// Draw ellipse at each node
for (i = 0; i < arrayLength; i++) {
for (j = 0; j < numberBranches; j++) {
if (node[i].getBranchPosition()==j){
if(node[i].getAction() != "reuse") {
drawMod = (numberBranches - node[i].getBranchPosition());
// Fill
if (randomized == true) {
fill(random(randLow,randHigh)*round(random(100,150))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(200,255))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(25,75))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(200,255))*drawMod/numberBranches); //green
}
if (randomized == false) {
fill(127 * drawMod/numberBranches,
255 * drawMod/numberBranches,
50 * drawMod/numberBranches,
250 * drawMod/numberBranches);
}
// Stroke
if (randomized == true) {
stroke(random(randLow,randHigh)*round(random(0,50))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(100,150))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(0,50))*drawMod/numberBranches,
random(randLow,randHigh)*round(random(200,255))*drawMod/numberBranches); //green
strokeWeight(random(.75,1.5)*drawMod*.0625);
}
if (randomized == false) {
stroke(63 * drawMod/numberBranches,
127 * drawMod/numberBranches,
25 * drawMod/numberBranches,
250 * drawMod/numberBranches);
strokeWeight(drawMod*.0625);
}
pg.beginDraw();
ellipse(node[i].getX(), node[i].getY(),pow(drawMod,1.5),pow(drawMod,1.5));
pg.endDraw();
}
}
}
}
println("END: Draw ellipse at each node.");
}
// ---------------
// HERE BE CLASSES
// ---------------
public class Node{
// the first letter of a class name should be capitalized
// the class has fields
// for fields, spell the first word lowercase, capitalize the first letter of each subsequent word
// --------------------------
// these are private and you use the get Methods to return the public values
// private float radius, theta, x, y, action;
int branchPosition, nodePosition, parentReference, nodeNumber;
float theta, x, y, nodeRadius;
String action;
// the class has constructors
// --------------------------
public void Node(int startBranchPosition, int startNodePosition, int startParentReference, int startNodeNumber, float startNodeRadius, float startAngle, float startX, float startY, String startAction) {
branchPosition = startBranchPosition;
nodePosition = startNodePosition;
parentReference = startParentReference;
nodeNumber = startNodeNumber;
nodeRadius = startNodeRadius;
theta = startAngle;
x = startX;
y = startY;
action = startAction;
}
// the class has methods
// the first (or only) word in a method name should be a verb
// --------------------------
// ---------SET and GET------------
public int getBranchPosition() {
return branchPosition;
}
public void setBranchPosition(int newValue) {
branchPosition = newValue;
}
public int getNodePosition() {
return nodePosition;
}
public void setNodePosition(int newValue) {
nodePosition = newValue;
}
public int getParentReference() {
return parentReference;
}
public void setParentReference(int newValue) {
parentReference = newValue;
}
public int getNodeNumber() {
return nodeNumber;
}
public void setNodeNumber(int newValue) {
nodeNumber = newValue;
}
public float getNodeRadius() {
return nodeRadius;
}
public void setNodeRadius(float newValue) {
nodeRadius = newValue;
}
public float getAngle() {
return theta;
}
public void setAngle(float newValue) {
theta = newValue;
}
public float getX() {
return (x);
}
public float getY() {
return (y);
}
public void setPosition(float newX, float newY) {
x = newX;
y = newY;
}
public String getAction() {
return action;
}
public void setAction(String newValue) {
action = newValue;
}
public void printNode() {
println(branchPosition + ", " + nodePosition + ", " + parentReference + ", " + nodeNumber + ", " + nodeRadius + ", " + theta + ", " + x + ", " + y + ", " + action);
}
}
public class Branch{
// the first letter of a class name should be capitalized
// the class has fields
// for fields, spell the first word lowercase, capitalize the first letter of each subsequent word
// --------------------------
// these are private and you use the get Methods to return the public values
// private float radius, theta, x, y;
int NodeNum;
float radius;
// the class has constructors
// --------------------------
public void Branch(int startNodeNum, float startRadius) {
NodeNum = startNodeNum;
radius = startRadius;
}
// the class has methods
// the first (or only) word in a method name should be a verb
// --------------------------
// ---------SET and GET------------
public int getNodeNum() {
return NodeNum;
}
public void setNodeNum(int newValue) {
NodeNum = newValue;
}
public float getRadius() {
return radius;
}
public void setRadius(float newValue) {
radius = newValue;
}
}
729 N. Carson St
Carson City, NV 89701
775.883.3630
DeBug was founded in January of 2000 by Keith and Debbie Barham. Keith saw a tremendous need for good quality honest computer help for small businesses and home users. He started out of an extra bedroom of their house, with a computer and answering machine. Within three months, Keith hired an answering service to help with the abundance of phone calls. Not too long after this, Keith and Debbie moved DeBug to the historic V&T Train Depot to handle the increasing calls and drop-offs.
Visit us on the web www.debugcomputer.net
Right extruder prints fine. Left extruder (the Inverted stepper one) prints too little plastic at the bottom and too much plastic on top of my Aztec Pyramid test.
Feels like a firmware bug.
Update: Turns out this was caused by a sticky filament spool.
laptop repairing institute in delhi,
laptop repairing institute in noida,
laptop repairing institute in faridabad,
laptop repairing institute in jalandhar,
laptop repairing institute in chadigarah,
laptop repairing institute in indore,
laptop repairing institute in bhopal,
laptop repairing institute in asam
Update:
Next www.flickr.com/photos/bootload/151687217/... installed svn, apache2 reconfigured, webpy works again
www.flickr.com/photos/bootload/115246692/ ... raising my blood pressure
www.flickr.com/photos/bootload/102536597/ ... Rudimentary forms working.
Next >>> .... Templates working.
Next >>> ... Bugs in using Cheetah templates
form.py works
Finally got the form code to work. It turns out the style sheet was altering the examples so they rendered but not in any visible way.
The only way I could get to here through experimenting:
*Comment out the style sheet one by one.
*I deduced it was the style sheet by view source of the previous example & hand modifying the html
*Saving as html & testing if it would render.
*The code still needs tidy
-use a python module that calls tidy on Form.Render() method
*Examples with styles should at least work
-style sheet supplied didn't work
-have to try my own.
The full source code is here. The next challenge is databases & redirects so I can build an application :)
My maternal grandfather was a service engineer for Allis-Chalmers from approximately WW2 until the early 1970s, and this involved flying to various customer sites to debug A-C machinery.
Various customer sites everywhere except maybe the poles, and this included at least one trip to Peru, where he got a rug that we assumed was made of pieced together furs. I don't know exactly when he make the peruvian trip, but I remember this rug sitting in the basement den of their West Allis house from as early as I can remember things.
Well, eventually my grandparents all died, and this rug ended up in my mother's hands, where it hung on the wall for many years until it got (what we thought was) a little moth-eaten and was taken down for repairs, only to be forgotten until today when I cleaned out the closet it was stored in.
When I saw it, it was covered with dust, so I picked up and gave it a vigorous shake only to discover that it was NOT pieced together furs, but hides that had appropriately dyed fur glued to it. Glued to it over 50 years ago, so it wasn't so much /glue/ anymore as powder, so the shake resulted in an explosion of fur all over the room it was in.
I can't fix this (well, I *could* fix this in a perfect world where I wasn't constantly fighting depression or wasn't 60+ years old, but this ain't that world) so I'm afraid we're going to have to toss it in the bin.
This is as annoying to find out as it was to discover that 578 was scrapped after the enthusiast who bought it from the Brillion & Forest Junction lost interest.
Damnit.
How to debug a C/C++ program with Nemiver debugger
If you would like to use this photo, be sure to place a proper attribution linking to xmodulo.com