processing

Passing data from C# to jQuery

痞子三分冷 提交于 2019-12-13 14:13:24
问题 Seeking some advice how to best handle the following situation, I am a sole-programmer. I am currently developing a C# Winforms application, new functionality that I am writing allows a user to create Processing.js sketches for data analysis purposes. I have built a Processing.js IDE (working) which allows the user to write and test Processing.js sketches and HTML code. The final piece of the puzzle is to expose data from the database to the sketches. What is the best approach I should

Converting a String Array to an Int array [closed]

流过昼夜 提交于 2019-12-13 11:30:37
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . I am reading a text file which has numbers in. Each number has its own line, and I can read them in and display them using a println fine. But I am trying to convert them to an integer array so that I can then use the numbers coming in. String lines[] = loadStrings("movements.txt"); for (int i = 0

What is the processing libraries processing.js can execute?

本小妞迷上赌 提交于 2019-12-13 10:38:53
问题 I want to create socket connection with processing.js. But processing.js can't use java library. Can I use processing.net.* ? And What is the processing libraries processing.js can execute? I can't find the list of libraries. Help me!! 回答1: As far as I know, Processing.JS has no support for Processing libraries. But since it is JavaScript, you can use a framework like jQuery and any libraries for jQuery. As far as socket connections, take a look at Socket.io (http://socket.io/) to connect to

Processing.py - Unknown Error on Class Definition

风格不统一 提交于 2019-12-13 10:29:55
问题 I have no idea how to fix this error. Maybe there's an open parenthesis or quotation mark somewhere before this line? What is wrong with this code? Class Ribbon: # I got an error on this line! def __init__(self, xpos, ypos, m, g): self.x=xpos self.y=ypos self.mass=m self.gravity=g .. def update(self, xpos, ypos): .. def display(self, xpos, ypos): .. 回答1: Here is your problem: Class Ribbon (object): def __init__(self, xpos, ypos, m, g): self.x=xpos self.y=ypos self.mass=m self.gravity=g also

implement game of life with only 2 array

心已入冬 提交于 2019-12-13 09:48:07
问题 I want to memory-efficient this (the game of life code of shiffman in the nature of code book). how can change the below code to have only two arrays and constantly swap them, writing the next set of states into whichever one isn’t the current array? class GOL { int w = 8; int columns, rows; int[][] board; GOL() { // Initialize rows, columns and set-up arrays columns = width / w; rows = height / w; board = new int[columns][rows]; //next = new int[columns][rows]; // Call function to fill array

Error message: The file “countries.geo.json” is missing or inaccessible

随声附和 提交于 2019-12-13 07:55:18
问题 I am taking the Coursera OOP in Java class. In the module 4 assignment, I run the code that the course provides in EarthquakeCityMap.java, and I get an error as "The file "countries.geo.json" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable. Exception in thread "Animation Thread" java.lang.NullPointerException" I tried to set countryFile as "../data/countries.geo.json", "data/countries.geo.json", and the complete path of

Why is this processing.js code not displaying in firefox?

时光怂恿深爱的人放手 提交于 2019-12-13 07:44:08
问题 <html> <body> <script src="processing.js"></script> <script type="text/processing" data-processing-target="mycanvas"> Table table; void setup() { table = new Table(); table.addColumn("name"); table.addColumn("type"); TableRow newRow = table.addRow(); newRow.setString("name", "Lion"); newRow.setString("type", "Mammal"); newRow = table.addRow(); newRow.setString("name", "Snake"); newRow.setString("type", "Reptile"); newRow = table.addRow(); newRow.setString("name", "Mosquito"); newRow.setString

Integrating Arduino and Processing - button counter

僤鯓⒐⒋嵵緔 提交于 2019-12-13 07:16:32
问题 I am looking to integrate Arduino controls and Processing Interface. In my Arduino code, there are three buttons attached to pin a1, a0 and d0 (all digitalRead). int x;// assigned to A0 input int y;// assigned to A1 input int z; //assigned to D0 input int votes[3]={0,0,0}; void setup() { // initialize the serial communication Serial.begin(9600); while(!Serial); } void loop() { // first we need to read the values from the BUTTONS x = digitalRead(A0); y = digitalRead(A1); z = digitalRead(0); if

Arduino and Processing Code Error “disabling_serialevent()”

99封情书 提交于 2019-12-13 06:58:55
问题 I am facing the following error in Processing application off and on, sometimes it works perfectly. Error, disabling serialEvent() for COM2 null Here are the codes: Arduino's: void setup() { Serial.begin(9600); } void loop() { int sensorValue1 = analogRead(A0); int sensorValue2 = analogRead(A1); Serial.print(sensorValue1); Serial.write("-"); Serial.println(sensorValue2); delay(1); } Processing's: import processing.serial.*; Serial myPort; // The serial port void setup () { size(1043, 102);

Obtaining mouse coordinates in current coordinate system

大憨熊 提交于 2019-12-13 06:14:44
问题 How may I obtain the mouse coordinates in the current coordinate system i.e. in the coordinate system determined by the transformation matrix? mouseX and mouseY return coordinates in untransformed screen space. 回答1: One option is to keep track of the transformation matrix manually and use the inverse transformation to convert between local and global coordinate systems. To convert from the global to the local coordinate system, multiply the global position to the inverse of the local