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 javax.swing.JFrame; | |
import javax.swing.JPanel; | |
import javax.swing.WindowConstants; | |
import java.awt.Dimension; | |
import java.awt.Color; | |
import java.awt.Graphics; | |
import java.awt.Graphics2D; | |
import java.awt.Point; | |
import java.awt.event.MouseListener; |
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
String words = "apple bear cat dog"; | |
String[] list = split(words, ' '); | |
// Writes the strings to a file, each on a separate line | |
saveStrings("nouns.txt", list); |
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
BufferedReader reader; | |
String line; | |
void setup() { | |
// Open the file from the createWriter() example | |
reader = createReader("positions.txt"); | |
} | |
void draw() { |
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 javax.swing.JFrame; | |
import javax.swing.JPanel; | |
import javax.swing.WindowConstants; | |
import java.awt.Dimension; | |
import java.awt.Color; | |
import java.awt.Graphics; | |
import java.awt.Graphics2D; | |
import java.awt.Point; | |
import java.awt.event.MouseListener; |
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
public class TwoDArray | |
{ | |
public static void main(String args[]) | |
{ | |
// int[][] sales = new int[4][6];//row column | |
//OR | |
//q1, q2,q3,q4 | |
int[][] sales = { {2,3,4,5},//2014 | |
{7,8,19,10},//2015 |
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.video.*; | |
Capture cam; | |
Capture cam2; | |
int count=0; | |
PImage myImg=null; | |
PImage myImg2=null; | |
void setup() { |
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
public class TwoDArray | |
{ | |
public static void main(String args[]) | |
{ | |
// int[][] sales = new int[4][6];//row column | |
//OR | |
//q1, q2,q3,q4 | |
int[][] sales = { {2,3,4,5},//2014 | |
{7,8,9,10},//2015 |
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
int sideStart =400; | |
int xStart = 50; | |
int yStart = 410; | |
void setup(){ | |
size(600,420); | |
} | |
void draw(){ |
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 java.util.Scanner; | |
/** | |
* A simple class to run the Magpie class. | |
* @author Laurie White | |
* @version April 2012 | |
*/ | |
public class MagpieRunner2 | |
{ |
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
/** | |
* A program to carry on conversations with a human user. | |
* This is the initial version that: | |
* <ul><li> | |
* Uses indexOf to find strings | |
* </li><li> | |
* Handles responding to simple words and phrases | |
* </li></ul> | |
* This version uses a nested if to handle default responses. | |
* @author Laurie White |