Grapher

This program reads in a file. The program sorts through all the data in setup and finds the extremes for each field. Depending on where you scroll right to left, it will show that part of the data.

First change the variable “filename” to the name of your file. Usually you have to put the file . . . → Read More: Grapher

Mobile Processing Set Up

Download Mpowerplayer wireless toolkit and emulator
Download Mobile Processing
Configure Mobile Processing (preferences) to point at Mpowerplayer (/Applications/mpp-sdk) and use MIDP 2.0 and CLDC 1.1.
Write your mobile processing code.
Try to run it in the emulator (not so good for things that require phone hardware bluetooth, video etc).
Use Export
Send just xxxx.jar file to the phone (via usb or bluetooth).  . . . → Read More: Mobile Processing Set Up

Get Data BT to Mobile Processing and Save

This mobile processing code connects to a bluetooth device (arduino code below) and records the incoming data.  There is a variable that you will have to change for the address of your bluetooth dongle.  Hard coding this saves writing code for discovering that address.  Instead discover it using the bluetooth preferences on your computer.  Unfortunately the . . . → Read More: Get Data BT to Mobile Processing and Save

Getting Data from the Phone

Ways to get stuff from your phone to your computer. Here are the ways to do it in order of difficulty.

Physically pull out the SD card and transfer the java database (needs cleaning).
Physically pull out the SD card and transfer files (requires an extra java library that is not present on all phones or wireless toolkits.)
Send . . . → Read More: Getting Data from the Phone

BT Log and Send

This mobile processing app opens up and tries to connect to your bluetooth device (eg. on your arduino). It uses call and response method to get readings from the arduino. Then if you press the “WaitNSend” button, it will stop logging and wait for a connect TO the phone FROM your laptop. You would have to . . . → Read More: BT Log and Send

Keystroke Logging and Word Counting

Install a keystroke logging program.

Logging keystrokes would be an easy application for you to write yourself but for security reasons it is not permitted to trap keystrokes in the background in java (processing). First find keylogging software that writes a file full of all your keystrokes. I did not write these and so am a little . . . → Read More: Keystroke Logging and Word Counting

Track Mouse in Background

import java.awt.*;

public class MouseLocation
{

private MouseInfo mInfo;
private PointerInfo pInfo;
private Point point = new Point();
private int buttons = 0;
private double pointX = 0;
private double pointY = 0;

private Robot robot;

public MouseLocation()
{
try
{ robot = new Robot(); }

catch(Exception e) { }

hasMouse();
pointerLocation();

}//ends constr.

private void hasMouse()
{
buttons = mInfo.getNumberOfButtons();
if(buttons == -1)
{
System.out.println(“No mouse detected. Program terminated.”);
System.exit(0);
}

}//ends hasMouse()

private void pointerLocation()
{
try
{
pInfo = mInfo.getPointerInfo();
point = pInfo.getLocation();

pointX = point.getX();
pointY . . . → Read More: Track Mouse in Background

Look for Shapes

Look for Circles in processing

ArrayList positionsInThisStroke = new ArrayList();
Rectangle currentRect = new Rectangle();
String[] circleFeedBack = {
“Zen Like Circling”,”Circular”,”Little Flabby”,”Square!” };

int previousX;
int previousY;

void setup(){
size(320,240);
}

void draw(){
if (mousePressed){
fill(0,0,0);
ellipse(mouseX-2, mouseY-2,4,4);
}
}

void analyzeStrokes(){

int totalX = 0;
int totalY = 0;
int totalDiff = 0;
int radius = (currentRect.width + currentRect.height)/4;
int midx = currentRect.width/2 + currentRect.x;
int midy = currentRect.height/2 + currentRect.y;
for (int j =0; j < . . . → Read More: Look for Shapes

Sniffing Gets

// A Less Simple Carnivore Client
//
// Note: requires Carnivore Library for Processing v2.2 (http://r-s-g.org/carnivore)
//
// + Windows people: first install winpcap (http://winpcap.org)
// + Mac people: first open a Terminal and execute this commmand: sudo chmod 777 /dev/bpf*
// (must be done each time you reboot your mac)

import java.util.Iterator;
import org.rsg.carnivore.*;
import org.rsg.carnivore.net.*;
import java.net.*;

HashMap nodes = new HashMap();
float startDiameter = 100.0;
float . . . → Read More: Sniffing Gets

Word of the Month

This code looks through your keylogging for the year and finds the most interesting words for each month. It collects all the words for the year and ranks them for each month. Then it hilite the words that rank high for the month and below average for the year. This code is a little further along . . . → Read More: Word of the Month