processing

Jetty embed in Processing.org, static assets + POST

给你一囗甜甜゛ 提交于 2019-12-08 09:16:42
问题 I'm trying to embed Jetty in a Processing Sketch. So far I made it working to serve static files (a html directory in the Sketch folder). I want to react to one POST with a user input from one of the static pages. As I have no knowledge on Jetty and coming from a PHP & Ruby (RoR) web programing background I am very confused with the way things go in Jetty. I simply want something similar to routes where everything except e.g. "localhost:8080/post?string=whatever" is a static file. The post

Android/Processing MotionEvent getX() raises exception

被刻印的时光 ゝ 提交于 2019-12-08 08:34:38
问题 I'm new to android development so bear with me. I've written a processing script that works with two simultaneous presses. To do this I'm using android.view.motionevent. In my main script (pde) I have this: public boolean surfaceTouchEvent(MotionEvent event) { if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { //do action down stuff... } //etc do other actions... This works fine. The problem comes in handling the ACTION_MOVE: //ACTION_MOVE else if (event.getActionMasked() ==

数据仓库介绍

房东的猫 提交于 2019-12-08 08:30:30
面向业务的数据库常叫 OLTP(on-line transaction processing)面向 分析的数据仓库常叫OLAP(On-Line Analytical Processing),区别见 : https://www.cnblogs.com/hongfeng2019/p/12004551.html 一个交易流程包括多个事务,比如定单 ,支付 等,比如购物篮的分析 ,比如做了一次活动后的分析,比如拉新转换率有多高, 这些都是面向场景的分析。还有支持决策的分析,如BI 来源: https://www.cnblogs.com/hongfeng2019/p/12004552.html

C++ equivalent of Processing's map() function

蹲街弑〆低调 提交于 2019-12-08 08:03:26
问题 Processing has a function map that Re-maps a number from one range to another. For example int ans = map(5, 0, 10, 0, 100); ans will be 50 as 5 is halfway between 0 and 10 and halfway between 0 and 100 is 50 . If there is no built in function how would I write my own one? 回答1: Processing is open source, and you can view the source for the map() function here. Specifically, this is the line you care about: float outgoing = start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1)); 来源:

How to keep a color in a fill() the same after mousePressed?

二次信任 提交于 2019-12-08 05:48:45
问题 What would be the easiest and simplest way to keep the fill() the same after clicking (that's when it changes) and then unclicking, and leaving hover? In this project, I simply made a grid. When the mouse hovers over a specific rect (at x , y ) it changes color based on the state it is in. fill(50) is the default, fill(75) is when the mouse is hovering, and fill(100) is when the mouse clicks. But here when the mouse is unclicked it returns to hover fill until the mouse leaves the rectangle.

Generate a n-color rainbow palette

一笑奈何 提交于 2019-12-08 03:40:20
问题 I'm trying to generate a rainbow with 15 different colors with (runnable code here): size(360,100); colorMode(HSB, 360, 100, 100); // Hue in degrees in [0, 360], // saturation/brightness in [0, 100] // like in Photoshop noStroke(); for (int i = 0; i < 15; i++) { fill(i*24, 100, 100); // 24*15 = 360 rect(i*24, 0, 25, 100); } but it doesn't produce a rich 15 rainbow-color palette, instead some colors are missing (vivid yellow for example). Is there a well known algorithm to produce a vivid

Using Processing, creating interactivity with an SVG

旧时模样 提交于 2019-12-08 03:02:01
问题 I am hoping I can find some help here, I've been researching and trying over and again but can't seem to find a solution. I am using processing 2.0.3. I have an SVG file that is a map of US states. I have an excel sheet saved as a .csv with data for each state. I've been trying to find a way to click on the state on the displayed SVG file, and have it display some sort of graph from the data in the excel sheet. My questions are: How do I make the SVG file clickable, and how do I link it to

Efficient javascript equivalent of Processing functions

隐身守侯 提交于 2019-12-08 03:01:25
I tweaked a Processing sketch to produce a variant of a TV static effect I need for a web app. Now I want to convert this effect into JS/canvas. What are the pure javascript/canvas equivalents of loadPixels() , copyArray() , updatedPixels() , and draw() as given in the following Processing code, or how best to go about the conversion given that, probably, JS/canvas are not as efficient as Processing/Java? int[] ppx; Random generator = new Random(); void setup() { size(640,480); loadPixels(); ppx = new int[pixels.length]; for (int y = 0; y < ppx.length;y++) { int spread = generator.nextInt(5);

Processing 3d object .obj import

别说谁变了你拦得住时间么 提交于 2019-12-08 02:46:10
问题 I'm trying to import 3d objects in Processing from .obj files found on the web. I've seen that there are several ways to import objs into the scene. I'm using PShape in this example and an obj file found here. I've started from the Examples>Basic>Shape>LoadDisplayObJ sample in which textures work. I was able to import the obj file using the loadShape function but no textures and colors were displayed. Am I missing something? Should I import the .mtl file as well? Here is the code: PShape

Integrate Processing with Minim Libraries in Website

岁酱吖の 提交于 2019-12-08 02:45:52
问题 I have seen similar questions posted before but seems the general answer is that it cannot be done. So, here is my HTML code : <head> … <script type="text/javascript" src="js/processing.js"></script> … </head> <body> … <canvas id="my_prog" data-processing-sources="project/my_prog.pde project/my_class.pde"/></canvas> … </body> And in my sketch I use Minim libraries : import ddf.minim.*; import ddf.minim.spi.*; import ddf.minim.ugens.*; Instead of having my project on my website, there is a