processing

Reconnect Serial Port on Processing

人盡茶涼 提交于 2019-12-13 00:42:25
问题 I'm using processing and I'm reading inputs from Arduino with a serial port but connection drop may occur, in this case how to I reopen this connection? 回答1: You can catch RuntimeExceptions thrown by Serial.java, which generally indicate the serial port is no longer available. Within that catch block, then, you can start polling the serial port; once it allows you to reinstantiate your Serial instance, the port is again available (e.g. the USB cable is plugged back in) and you're back in the

Processing video library does not work on Linux (Ubuntu 13.04)

可紊 提交于 2019-12-12 21:49:47
问题 I have a problem. I'm trying to run the Mirror sample from the Processing video library, with the latest version of Processing (2.0.3). However, I get this error; Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 14: reading configurations from ~/.fonts.conf is deprecated. libEGL warning: failed to create a pipe screen for i965 java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Unable to load library 'gstreamer-0.10': libgstreamer-0.10.so: cannot open shared object file: No

animating sin waves in processing

孤街浪徒 提交于 2019-12-12 18:36:13
问题 how do I animate the sin lines in the following code to move along the y-axis, to somehow look more like moving water waves? -if you take out the velocity and acceleration codes you will see what I was trying to work with float scaleVal = 6.0; float angleInc = 0.19; float velocity=0.0; float acceleration=0.01; void setup(){ size(750,750); stroke(255); } void draw(){ background (0); float angle=0.0; for (int offset = -10; offset < width+10; offset += 10) { for (int y = 1; y <= height; y += 3)

How can the arguments to bash script be copied for separate processing?

泄露秘密 提交于 2019-12-12 14:31:12
问题 There is an existing bash script I need to modify, but I want to encapsulate the changes required to it in a function without affect how it manipulates the '$@' variable. My idea is to copy the argument string to a new variable and extract the arguments required separately, but it seems that applying the 'shift' operates only on the $@ variable and modifies it permanently. Is there way to emulate the processing of the $@ variable and its related functions on a normal string? 回答1: You can

Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Mapper method 'xxxxxxxxx' has an unsupported return type: interface java.util.List

倾然丶 夕夏残阳落幕 提交于 2019-12-12 09:55:57
报错信息:Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Mapper method 'xxxxxxxxx' has an unsupported return type: interface java.util.List 报错原因:返回的类型不对 报错列表 org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Mapper method 'com.shixun.dao.CakeCarDao.saveCarOrder' has an unsupported return type: interface java.util.List org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982) org.springframework.web.servlet.FrameworkServlet.doGet

How to get my program to run outside of eclipse

痞子三分冷 提交于 2019-12-12 08:15:49
问题 I have a project in eclipse. It does everything I want it to do when I click on the green circle play button in the IDE - opens the window, plays the stuff, everything. But, try as I might, I cannot figure out how to get it to do that outside of eclipse. My project uses the processing.core library to do some of its stuff, but I am unable to get the project to function in the Processing IDE, because of some stupid stuff about one of my classes not being a valid substitute for the type

When i rotate an image it goes off screen

做~自己de王妃 提交于 2019-12-12 06:56:20
问题 im trying to rotate an image 90 degrees but when i do it goes off screen (to the left of the window) here is my code: here is a link to my image: http://imgur.com/gallery/pQ85Z right now im just trying to get it to rotate when i press 'r' but after this i need to make it rotate when it hits the edge of the screen. PImage head; int fizzyX = 400; int fizzyY = 50; int movementX=0; int movementY=0; float x; void setup() { size(800,800); background(255); head = loadImage("Fizzy.PNG"); } void

How to loop over an ArrayList using the index value of an Array (Processing)

谁说我不能喝 提交于 2019-12-12 06:21:16
问题 The second loop (for (int j = years[i].xrateValue.size ()-1; j >= 0; j--)) is retrieving all the xrate values for each Year from the array (years[i]). Please do you have any ideas of how I can only return the xrate values for each year in the array. For example, Year 1990 has Xrate 2,5,6,5.6 and Year 1991 has Xrate 3,6.7,5,8,1.4. The loop should only return the Xrate values for 1990 and then 1991 and so on. for (int i=0; i<years.length; i++) { //code to display each year for (int j = years[i]

Run Code Inside One Thread In Another

痴心易碎 提交于 2019-12-12 06:06:29
问题 I am writing a Processing project (Processing is based on Java). I want to run the code inside one thread in another thread (the main thread). //This method runs in the main thread public void draw() { } //This is a callback that runs in a separate thread void addTuioObject(TuioObject tobj) { rect(0, 0, 20, 10); } The rect(0,0,20,10) does not run in the main thread (it is supposed to draw a rectangle on the screen). I suppose this is because it runs in a separate thread. How would I make this

Enums in Processing 1.2.1?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 05:42:40
问题 Here is my sketch: enum Foo { bar, baz } void setup() { } void draw() { } This fails to compile: Unrecognized type:46 (ENUM_DEF) Am I doing something wrong, or are enums not supported? 回答1: Looks like they aren't supported unfortunately, but there are some workarounds. From the FAQ: We currently only support Java 1.4 (and earlier) syntax. You cannot currently use 1.5 syntax in the Processing Development Environment. This means no generics, templates, enum, varargs, foreach, and the rest. If