# Beginners

**URL:** https://discourse.processing.org/c/processing/processing-beginners/14.md?page=30

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 31

---

## [2D Array of TreeMaps wont access the intValue()](https://discourse.processing.org/t/2d-array-of-treemaps-wont-access-the-intvalue/17245)

<div class="topic-metadata">

**Author:** [@tribblesontoast](https://discourse.processing.org/u/tribblesontoast)\
**Replies:** 2\
**Last updated:** [January 22, 2020, 7:01am UTC](https://discourse.processing.org/t/2d-array-of-treemaps-wont-access-the-intvalue/17245 "2020-01-22T07:01:04Z")

</div>

Hi all, I’m programmatically categorising colours in an image. I’m storing the colours and their values(frequency that they turn up) in a TreeMap. I’m using a single TreeMap for each colour range (ROYGBIV). What i’m sp…

---

## [Arrays with vectors](https://discourse.processing.org/t/arrays-with-vectors/17179)

<div class="topic-metadata">

**Author:** [@asherzelig](https://discourse.processing.org/u/asherzelig)\
**Replies:** 3\
**Last updated:** [January 19, 2020, 5:33pm UTC](https://discourse.processing.org/t/arrays-with-vectors/17179 "2020-01-19T17:33:52Z")

</div>

Is it possible to make an array of vectors? I tried; PVector \[ \] vtest = new PVector \[20\]; It lets me write it but gives me null messages when I execute.

---

## [Automatic type conversion?](https://discourse.processing.org/t/automatic-type-conversion/17175)

<div class="topic-metadata">

**Author:** [@beckerc](https://discourse.processing.org/u/beckerc)\
**Replies:** 9\
**Last updated:** [January 19, 2020, 5:17am UTC](https://discourse.processing.org/t/automatic-type-conversion/17175 "2020-01-19T05:17:17Z")

</div>

The parameters for ellipse() are all of type float (https://processing.org/reference/ellipse\_.html). Why does this work when I pass in all ints? Is there type conversion happening in the background? I have been using the…

---

## [selectInput() exception recovery](https://discourse.processing.org/t/selectinput-exception-recovery/17044)

<div class="topic-metadata">

**Author:** [@harrih](https://discourse.processing.org/u/harrih)\
**Replies:** 2\
**Last updated:** [January 17, 2020, 6:38am UTC](https://discourse.processing.org/t/selectinput-exception-recovery/17044 "2020-01-17T06:38:29Z")

</div>

Hi All, Am just learning Processing Not Java literate I am experimenting with selectInput() for loading files, All is good, as i can select a file load it etc. However if instead of selecting the file by mouse poi…

---

## [Flip upper case with lower case](https://discourse.processing.org/t/flip-upper-case-with-lower-case/17013)

<div class="topic-metadata">

**Author:** [@Andiwnl](https://discourse.processing.org/u/Andiwnl)\
**Replies:** 2\
**Last updated:** [January 10, 2020, 10:43pm UTC](https://discourse.processing.org/t/flip-upper-case-with-lower-case/17013 "2020-01-10T22:43:36Z")

</div>

hello, I want to swap upper case letters with lower case letters. But all I can find on the internet is just how I can completely convert the word either to lower case or to upper case. what I need is : Hello -\> hELLO

---

## [Make string from characters](https://discourse.processing.org/t/make-string-from-characters/16563)

<div class="topic-metadata">

**Author:** [@quinten](https://discourse.processing.org/u/quinten)\
**Replies:** 4\
**Last updated:** [January 7, 2020, 3:00am UTC](https://discourse.processing.org/t/make-string-from-characters/16563 "2020-01-07T03:00:17Z")

</div>

Hi everyone, why is the following not true (“ab” == str(‘a’) + str(‘b’)) and how can I adjust it so that it will be true? See the example below: void setup() { size(200, 200); } void draw() { println("ab", str('a…

---

## [Any way to use conditional operator in a case statement](https://discourse.processing.org/t/any-way-to-use-conditional-operator-in-a-case-statement/16846)

<div class="topic-metadata">

**Author:** [@ddownn](https://discourse.processing.org/u/ddownn)\
**Replies:** 3\
**Last updated:** [January 7, 2020, 1:06am UTC](https://discourse.processing.org/t/any-way-to-use-conditional-operator-in-a-case-statement/16846 "2020-01-07T01:06:46Z")

</div>

Is there any way to use a condition such as || or && in a case: statement? switch (int) { case 0 || 1: println("Not sure, let me check."); case 0: println("Nope."); break; case 1: println("Yup.");…

---

## [Terminology: function, method and event?](https://discourse.processing.org/t/terminology-function-method-and-event/16855)

<div class="topic-metadata">

**Author:** [@Teljemo](https://discourse.processing.org/u/Teljemo)\
**Replies:** 6\
**Last updated:** [January 6, 2020, 8:44pm UTC](https://discourse.processing.org/t/terminology-function-method-and-event/16855 "2020-01-06T20:44:33Z")

</div>

Hi I’m confused and the more I google the more confused I get, so I better ask here :slight\_smile: As me and my son study Processing im now trying to document our progress and I don’t know If i’m suppose to write that …

---

## [Add an Array to an ArrayList](https://discourse.processing.org/t/add-an-array-to-an-arraylist/16884)

<div class="topic-metadata">

**Author:** [@Psteely](https://discourse.processing.org/u/Psteely)\
**Replies:** 2\
**Last updated:** [January 5, 2020, 10:51pm UTC](https://discourse.processing.org/t/add-an-array-to-an-arraylist/16884 "2020-01-05T22:51:20Z")

</div>

I’ve created a REALLY simple code snippet to show what I’m trying to do. I need to add an array that I have defined into an ArrayList. I need an ArrayList as I don’t know how many arrays I will end up with. This will Obv…

---

## [keyPressed is behaving very oddly](https://discourse.processing.org/t/keypressed-is-behaving-very-oddly/16865)

<div class="topic-metadata">

**Author:** [@Psteely](https://discourse.processing.org/u/Psteely)\
**Replies:** 3\
**Last updated:** [January 4, 2020, 9:00pm UTC](https://discourse.processing.org/t/keypressed-is-behaving-very-oddly/16865 "2020-01-04T21:00:00Z")

</div>

This is going to be something dumb but… I have a code snipet showing my issue. int currentRow; void setup() { } void draw() { } void keyPressed() { currentRow = key; println(key); println(currentRow); } If I r…

---

## [Returning multiple values and also a problem with the class](https://discourse.processing.org/t/returning-multiple-values-and-also-a-problem-with-the-class/16821)

<div class="topic-metadata">

**Author:** [@ousmm](https://discourse.processing.org/u/ousmm)\
**Replies:** 1\
**Last updated:** [January 2, 2020, 9:04pm UTC](https://discourse.processing.org/t/returning-multiple-values-and-also-a-problem-with-the-class/16821 "2020-01-02T21:04:22Z")

</div>

void setup() { } float discriminant(float a, float b,float c ){ float x1,x2; float d=(b\*b)-4\*a\*c; if (d\>0){ x1=((-b)-sqrt(d))/2\*a; x2=((-b)+sqrt(d))/2\*a; return(x1) ; } if (d\<0){ x1=-b/…

---

## [Processing saying "width cannot be resolved"](https://discourse.processing.org/t/processing-saying-width-cannot-be-resolved/16814)

<div class="topic-metadata">

**Author:** [@anaapearl](https://discourse.processing.org/u/anaapearl)\
**Replies:** 3\
**Last updated:** [January 2, 2020, 3:29pm UTC](https://discourse.processing.org/t/processing-saying-width-cannot-be-resolved/16814 "2020-01-02T15:29:04Z")

</div>

I keep trying to make my images change when clicking, and for some reason I can’t seem to get the width right… Could someone help me find the answer? Thanks! :slight\_smile: float drawLength = 250; float noiseScale = 0.0…

---

## [Beginner with Processing](https://discourse.processing.org/t/beginner-with-processing/16767)

<div class="topic-metadata">

**Author:** [@christiank79](https://discourse.processing.org/u/christiank79)\
**Replies:** 3\
**Last updated:** [January 1, 2020, 2:57pm UTC](https://discourse.processing.org/t/beginner-with-processing/16767 "2020-01-01T14:57:14Z")

</div>

Hello, I wanted to learning to programming in Processing and drawing with pen plotter in SVG format. Which book do you recommend? Thank you. Christian

---

## [Can't add Syphon library through library manager](https://discourse.processing.org/t/cant-add-syphon-library-through-library-manager/3369)

<div class="topic-metadata">

**Author:** [@jhow](https://discourse.processing.org/u/jhow)\
**Replies:** 6\
**Last updated:** [December 30, 2019, 11:59pm UTC](https://discourse.processing.org/t/cant-add-syphon-library-through-library-manager/3369 "2019-12-30T23:59:49Z")

</div>

Hi there, I apologize in advance if my information is not specific enough. I am unable to import the Syphon library into Processing v2.2.1 through the Library Manager. I’ve attached screencaps of the error I receive. Ho…

---

## [ArrayList not behaving as expected](https://discourse.processing.org/t/arraylist-not-behaving-as-expected/16724)

<div class="topic-metadata">

**Author:** [@Psteely](https://discourse.processing.org/u/Psteely)\
**Replies:** 10\
**Last updated:** [December 30, 2019, 6:21pm UTC](https://discourse.processing.org/t/arraylist-not-behaving-as-expected/16724 "2019-12-30T18:21:20Z")

</div>

Hi Folks, I’m new to this coding lark as well as Processing so I’m sure this is just me being dumb but I can’t figure it. I have created a small subset of my code to more easily explain it. ArrayList\<trainData\> td; vo…

---

## [Object is not working in new versions of Processing](https://discourse.processing.org/t/object-is-not-working-in-new-versions-of-processing/16686)

<div class="topic-metadata">

**Author:** [@GeorgeJava](https://discourse.processing.org/u/GeorgeJava)\
**Replies:** 7\
**Last updated:** [December 28, 2019, 9:23pm UTC](https://discourse.processing.org/t/object-is-not-working-in-new-versions-of-processing/16686 "2019-12-28T21:23:26Z")

</div>

Hello, i want to store some type of Var in the Object, and it cant… see Object\[\] vars = new Object\[\] { 5, 10.0, true, 20 }; println(vars\[0\]); Tell me why ? Or how to make it working… ? :frowning:

---

## [Search and get position of a word in a comma separated string](https://discourse.processing.org/t/search-and-get-position-of-a-word-in-a-comma-separated-string/16671)

<div class="topic-metadata">

**Author:** [@molo32](https://discourse.processing.org/u/molo32)\
**Replies:** 3\
**Last updated:** [December 28, 2019, 12:58pm UTC](https://discourse.processing.org/t/search-and-get-position-of-a-word-in-a-comma-separated-string/16671 "2019-12-28T12:58:04Z")

</div>

suppose I have String s = "BANANA, APPLE, GRAPE" how to look for the word grape and return me position 2 foo (s, “grape”) // return 2 If I look for the word apple, I should return the position 1 If I look for the wo…

---

## [What is equivalent to splice in array of vectors?](https://discourse.processing.org/t/what-is-equivalent-to-splice-in-array-of-vectors/16629)

<div class="topic-metadata">

**Author:** [@Ruchi](https://discourse.processing.org/u/Ruchi)\
**Replies:** 3\
**Last updated:** [December 26, 2019, 8:59am UTC](https://discourse.processing.org/t/what-is-equivalent-to-splice-in-array-of-vectors/16629 "2019-12-26T08:59:42Z")

</div>

I want to add a pvector at a specific index in arraylist of vectors which already includes few vectors similar to splice function for array. Any idea how to go about this for vectors?

---

## [textStyle Italic bold and others](https://discourse.processing.org/t/textstyle-italic-bold-and-others/16557)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 4\
**Last updated:** [December 22, 2019, 5:33pm UTC](https://discourse.processing.org/t/textstyle-italic-bold-and-others/16557 "2019-12-22T17:33:45Z")

</div>

How, would I go about setting the text to italic in processing. There is textStyle() in p5.js but I cannot seem to find its equivalent in processing. Thanks.

---

## [ArithmeticException: / by zero](https://discourse.processing.org/t/arithmeticexception-by-zero/16525)

<div class="topic-metadata">

**Author:** [@unique\_username](https://discourse.processing.org/u/unique_username)\
**Replies:** 2\
**Last updated:** [December 19, 2019, 11:14pm UTC](https://discourse.processing.org/t/arithmeticexception-by-zero/16525 "2019-12-19T23:14:49Z")

</div>

Hello. I’ve been working on a new project, which has been going splendidly for me as I thought it would be quite a challenge, but it has been a breeze so far. I was then adding a new element and the first of this element…

---

## [Complex variables](https://discourse.processing.org/t/complex-variables/16349)

<div class="topic-metadata">

**Author:** [@humano](https://discourse.processing.org/u/humano)\
**Replies:** 11\
**Last updated:** [December 16, 2019, 11:46am UTC](https://discourse.processing.org/t/complex-variables/16349 "2019-12-16T11:46:05Z")

</div>

Hi guys, I’m trying to put all this code in a variable, but I don’t know how to do it. I mean, I only know how to do simple variables, but not variables that have many lines. Can you help my? I need to create a variabl…

---

## [How to append in a two dimensional array?](https://discourse.processing.org/t/how-to-append-in-a-two-dimensional-array/16359)

<div class="topic-metadata">

**Author:** [@AkaiKenshi](https://discourse.processing.org/u/AkaiKenshi)\
**Replies:** 1\
**Last updated:** [December 13, 2019, 5:51am UTC](https://discourse.processing.org/t/how-to-append-in-a-two-dimensional-array/16359 "2019-12-13T05:51:52Z")

</div>

I have a two dimensional array and I’m trying to append new values but I can’t figure out how to int\[\]\[\] prv = {{1},{1}}; int objX; int objY; void setup(){ size(200, 200) } void draw() { objX = mouseX; objY = mouseY…

---

## [Good practice / revisioning / template / backup](https://discourse.processing.org/t/good-practice-revisioning-template-backup/7615)

<div class="topic-metadata">

**Author:** [@kll](https://discourse.processing.org/u/kll)\
**Replies:** 16\
**Last updated:** [December 13, 2019, 3:36am UTC](https://discourse.processing.org/t/good-practice-revisioning-template-backup/7615 "2019-12-13T03:36:42Z")

</div>

my english is not good enough for a tutorial, but i have a idea about a good practice beginner info sticky revisioning it could be a good idea even for small tests to start with a revisioning system easy just as so…

---

## [How to convert a Double into an Integer?](https://discourse.processing.org/t/how-to-convert-a-double-into-an-integer/16190)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 22\
**Last updated:** [December 8, 2019, 5:58pm UTC](https://discourse.processing.org/t/how-to-convert-a-double-into-an-integer/16190 "2019-12-08T17:58:39Z")

</div>

Is there a better way to cast or convert a Double into an Integer? I want to put colour values into pixels. To do this I am using color(). The function “color()” expects parameters like “color(int,int,int)”, but the col…

---

## [Weird bug with this code](https://discourse.processing.org/t/weird-bug-with-this-code/16222)

<div class="topic-metadata">

**Author:** [@yes](https://discourse.processing.org/u/yes)\
**Replies:** 6\
**Last updated:** [December 8, 2019, 3:12pm UTC](https://discourse.processing.org/t/weird-bug-with-this-code/16222 "2019-12-08T15:12:59Z")

</div>

void setup() { size(720,1000); background(0); } void draw() { textSize(18); text(ROMNAME,100,100); } \` String ROMNAME = "UNTITLED"; // Open a file and read its binary data byte\[\] openbytes1 = loadBytes("sk…

---

## [Where does saveTable save?](https://discourse.processing.org/t/where-does-savetable-save/16220)

<div class="topic-metadata">

**Author:** [@yes](https://discourse.processing.org/u/yes)\
**Replies:** 2\
**Last updated:** [December 8, 2019, 6:49am UTC](https://discourse.processing.org/t/where-does-savetable-save/16220 "2019-12-08T06:49:05Z")

</div>

Does anybody know where save table saves?

---

## [Boolean trouble or something](https://discourse.processing.org/t/boolean-trouble-or-something/16217)

<div class="topic-metadata">

**Author:** [@ddownn](https://discourse.processing.org/u/ddownn)\
**Replies:** 9\
**Last updated:** [December 8, 2019, 12:38am UTC](https://discourse.processing.org/t/boolean-trouble-or-something/16217 "2019-12-08T00:38:06Z")

</div>

I can’t see why the value of pressLoc is constantly updated to the mouse PVector while the mouse is pressed and dragged around. Can someone please help me? PVector m, pressLoc; float dragDist; boolean firstPressCapture…

---

## [Cannot convert from boolean to int](https://discourse.processing.org/t/cannot-convert-from-boolean-to-int/16218)

<div class="topic-metadata">

**Author:** [@Ardy2743](https://discourse.processing.org/u/Ardy2743)\
**Replies:** 7\
**Last updated:** [December 7, 2019, 6:09pm UTC](https://discourse.processing.org/t/cannot-convert-from-boolean-to-int/16218 "2019-12-07T18:09:09Z")

</div>

Hey! I’m new to Arduino and Processing I’m making a game and I want to play a certain sound when I or the CPU scores on Arduino. I’m getting the error cannot convert from boolean to int I don’t know what I’m doing wrong…

---

## [Loadstrings with Umlauts Umlaut Umlaute / CSV from Excel](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132)

<div class="topic-metadata">

**Author:** [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Replies:** 10\
**Last updated:** [December 7, 2019, 10:14am UTC](https://discourse.processing.org/t/loadstrings-with-umlauts-umlaut-umlaute-csv-from-excel/16132 "2019-12-07T10:14:32Z")

</div>

Hello all, I am loading / loadstrings a CSV with swedish Umlauts öå They don’t come out right - What can I do? // ------------------------------------------------------------------------------------------- // loa…

---

## [Library acess some core function and other not](https://discourse.processing.org/t/library-acess-some-core-function-and-other-not/16077)

<div class="topic-metadata">

**Author:** [@matheplica](https://discourse.processing.org/u/matheplica)\
**Replies:** 5\
**Last updated:** [December 7, 2019, 1:07am UTC](https://discourse.processing.org/t/library-acess-some-core-function-and-other-not/16077 "2019-12-07T01:07:23Z")

</div>

I, I’m trying to create my own library and it’s not so easy. The small class I create don’t recognize the “color” type even he is in processing.core. public class Triangle { color\[\] colors = new color\[3\];} The functi…

[Previous page](https://discourse.processing.org/c/processing/processing-beginners/14.md?page=29)

[Next page](https://discourse.processing.org/c/processing/processing-beginners/14.md?page=31)
