background preloader


Facebook Twitter

Issue with Processing + Ubuntu 10.10 + OpenJDK Plugin. Threading. From Processing This tutorial is based on my (somewhat outdated) Java tutorial about threads: The source code below from the examples below can be downloaded from here: Other Resources: You are likely familiar with the idea of writing a program that follows a specific sequence of steps -- setup() first then draw() over and over and over again!


A Thread is also a series of steps with a beginning, a middle, and an end. Processing does this all the time, whenever you write an event callback, such as serialEvent(), or captureEvent(), etc. these functions are triggered by a different thread running behind the scenes, and they alert Processing whenever they have something to report. Void setup() { size(200,200); thread("someFunction");} void draw() { } void someFunction() { // This function will run as a thread when called via // thread("someFunction") as it was in setup!} The thread() function receives a String as an argument.

Boolean running; // Is the thread running? Threads at daniel shiffman. If you are looking for a tutorial about using threads in Processing, I’ve adapted this page on the Processing wiki: Examples: Related: Java Threads tutorial Exercises (optional): Rewrite the spider so that each URL request is its own thread.Recreate one of your previous exercises as a Processing library.

Threads at daniel shiffman

Threading We’re quite familiar with the idea of writing a program that follows a specific sequence of steps as outlined in, say, a main() function. This is incredibly useful when it comes to data mining, as we can have separate threads retrieving different pieces of information from the network. Inside the Hotspot VM: Clocks, Timers and Scheduling Events - Part I - Windows : David Holmes' Weblog. Clocks and Timers - General Overview There are two kinds of time related devices in a system: a means to read a time value; anda means to schedule/trigger a time related event The term "clock" is often used to refer to both of these because you read the time from a clock, and you can (often) set an alarm to have something happen when the clock reaches a certain time.

Inside the Hotspot VM: Clocks, Timers and Scheduling Events - Part I - Windows : David Holmes' Weblog

Sometimes the term "passive clock" is used for a time source that can only be read, while "active clock" is used for one that can also trigger an event/interrupt/alarm. For the sake of discussion (and because they are different hardware devices) I will use the term "clock" to refer to the means by which a time value can be read, and the term "timer" for something that can trigger a time-related event. To further complicate things both clocks and timers can be defined in absolute or relative terms. The resolution of clocks and timers in modern computers is typically very different. Java Programming API's for Clocks and Timers.

Floating Processing clouds with minim. I made a simple example to test the sound input features of minim, an audio library for processing.

Floating Processing clouds with minim

I took one of the cloudes i wrote for my ical-flowers and wrote a simple sketch that makes it float to the right whenever someone blows into the microphone. I didn't export it as an applet this time, but here is the code, in case you want to try it. Read/Write HTML field values from Java - Real's Java How-to. Read/Write HTML field values from JAVATag(s): Javascript interaction [Netscape AND IE4 compatible] The netscape.javascript.* (LiveConnect) package provides facilities to directly manipulate HTML FORM components.

Read/Write HTML field values from Java - Real's Java How-to

JSObject win = (JSObject)JSObject.getWindow(this); JSObject inputText = (JSObject) win.eval("document.forms[0].elements[0]"); String value = (String)inputText.getMember("value"); // read form value inputText.setMember("value" , value + " new stuff"); // write form value But this action requires a signed applet. in Netscape, you must PrivilegeManager.enablePrivilege("UniversalBrowserRead"); PrivilegeManager.enablePrivilege("UniversalBrowserWrite"); before using an JSObject related to an HTML document.

But there is a workaround, simply pass the informations through Javascript functions! [] [JSjava.html] For best result, never use LiveConnect JSObject in Applet's init() method.