Trouble with changing Arraylist values.

So I have a bit of code that doesn't seem to do anything, I'm trying to swap 2 object values in an ArrayList, here is my code:

 Bar tempBar = new Bar(this.values.get(currentPointer)); this.values.get(currentPointer).update(this.values.get(currentPointer+1)); this.values.get(currentPointer+1).update(tempBar); 

I traced it through the debugger, and the conditions to get to the swap are happening, but it just isn't actually swapping anything. I don't think I understand how Arraylist's Get function works.

The constructor overload takes a Bar object or individual values.

What am I doing wrong here?

submitted by /u/I_wish_I_was_a_robot
[link] [comments]

MOMENTUM9. Maybe none of this is science fiction

Previously: MOMENTUM9 – “Alienation is our contemporary condition”.


Trollkrem, Deep Down Below, 2017. Official opening of the exhibition. Photo by Ingeborg Øien Thorsland


Jone Kvie, Untitled (Carrier), 2006

Accelerated technological, ecological and social shifts have created a world we feel we can’t control nor even fully comprehend. This sense of estrangement seems to be inescapable, it is embedded into processes and entities that we encounter into most aspects of our everyday life. The latest edition of MOMENTUM, the Nordic Biennial of Contemporary Art that opened a few days ago in Moss, explores this new sense of alienation and invites the visitors to look at it under a more receptive, even sympathetic gaze.

With alienation as its theme M9 will present diverse and conflicted ways of experiencing, explaining and imagining the world anew. Alienation represents a potential to expand the horizons of our current lives, to think and act progressively and usher in change. Thus M9 wants to welcome the alien, also the alien in us, without preconceptions of familiar and foreign. It wants to welcome the alien as a challenge to the present as well as a promise of better, extraordinary futures.

Several of the most interesting works are based on extensive research so each of them will get its full post and interview in the coming days.

Today, i’m going to mention a series of artworks that propel us into a decidedly parallel universe. A universe characterized by biological organisms that bypass human interventions and form new alliances with synthetic trash, by desks that perform obscure tasks, or by ancient civilizations that speak to us across time. Some of these works will remain science-fiction. Others, however, might not.

John Duncan, The Nazca Transmissions #2, 2005

“On Christmas Eve, 2004, John Duncan received a mysterious email from an archaeologist working at the site of the Nazca Lines in Peru. He claimed to have discovered, and over time recorded, a variety of sounds actually generated by the enigmatic lines themselves.” The enigmatic archaeologist, who called himself Anton Düder, asked Duncan if he’d be interested to use the files to compose new sound works.

Duncan created a 5-track piece with the material and sent it to the mysterious archaeologist. He never heard back from him. The musician claims that a hard disk crash erased all trace of the email correspondence between them.

The artist’s composition is broadcast inside an old museum theater in downtown Moss. It’s an uncanny experience. I doubt anyone believes Duncan’s story but what is certain is that the tracks are eerie, they left me slightly on edge, distressed and unsure the sounds were not playing with my brain. Which is a bit upsetting but also a sure sign that the artist has found his own way to translate the mystery of the ancient geoglyphs into equally perplexing auditory effects.


Pinar Yoldas, Ecosystem of Excess, 2017. Photo By Istvan Virag


Pinar Yoldas, Ecosystem of Excess, 2017. Photo By Istvan Virag

We are drowning in plastic. I read yesterday that the amount of plastic produced in a year is roughly the same as the entire weight of humanity. Today there isn’t a single cubic meter of sea water that is free of plastic particles. The situation is particularly dramatic in the central North Pacific Ocean where the famous Trash Vortex has been accumulating an obscene mass of plastic pollution as big as Texas since the 1980s. Pinar Yoldas, however, sees a possible redemption for this plastic garbage.

The project she exhibits at MOMENTUM, Ecosystem of Excess, explores the life forms, part organic-part synthetic, that might evolve from this dispiriting plastic monstrosity. The seeds have already been planted: plastic in the ocean is already decomposing into tiny pieces (the so-called mermaid tears) and sea creature eat it instead of plankton; or else it’s the algae on drifting plastic waste that gives off a sulfur compound which smells similar to the krill many marine birds feed on, etc.

Taking her cue from a species of bacteria that eats PET, Yoldas imagines that one day, however, other living things will be able to metabolize and thrive on plastic, forming a post-human ecosystem that merges nature and culture.

An Ecosystem of Excess is born at the intersection of ecological and feminist thinking; hence it negates the utilitarian, anthropomorphic approach which disregards the intrinsic value of any life forms regardless of its use value to human subjects. Therefore an ‘Umwelt’ for every single organism in the ecosystem is generated as a first step to the speculative design process.

For more details about the work, have a look at the video of the talk she gave about the work at Aksioma back in 2014.


H.R. GIGER, Chair for Giger Bar Tokyo, 1991-96. Photo by Istvan Virag. Courtesy H.R. Giger Estate


H.R. GIGER, Harkonnen-Capo chair, 1983. Photo by Istvan Virag. Courtesy H.R. Giger Estate


H.R. GIGER. Photo by Istvan Virag. Courtesy H.R. Giger Estate

The name of Hans Ruedi Giger will always be associated with one of movie history’s most iconic creatures, Alien but he also applied his ‘biomechanical’ Alien style to furniture and decorative objects.

One of the chairs exhibited at Momentum was originally intended as a Harkonnen throne for an abandoned Dune film project. Others came from a short-lived Giger bar that opened in Tokyo in the late 1980s.


Levi Van Veluw, Workspace II, 2016. Photo by Istvan Virag. Courtesy Galerie Ron Mandos


Levi Van Veluw, A Grid with Purpose, 2017. Photo by Istvan Virag. Courtesy Galerie Ron Mandos


Levi Van Veluw, Workspace II, 2016. Photo by Istvan Virag. Courtesy Galerie Ron Mandos

I was much more attracted to Van Veluw’s vision of sci-fi furniture piece. His desk, however, is far from inviting. Angular, dark, full of geometrical little alcoves containing unknown minerals, it points to a future ruled by supreme bureaucracy, aloof, all-knowing and intractable.


Rana Hamadeh, The Big Board or ‘And Before It Falls It Is Only Reasonable To Enjoy Life A Little’, 2013. Photo by Istvan Virag


Rana Hamadeh, The Big Board or ‘And Before It Falls It Is Only Reasonable To Enjoy Life A Little’, 2013. Photo by Istvan Virag


Rana Hamadeh, The Big Board or ‘And Before It Falls It Is Only Reasonable To Enjoy Life A Little’, 2013. Photo by Istvan Virag

Rana Hamadeh‘s The Big Board evokes a war-room map, it weaves together uncanny figures such as Paulus Fürst’s 1656 engraving of Doctor Schnabel of Rome, tokens from far-flung places and stories of hygiene and quarantine. The work is part of Alien Encounters, a larger project that looks at the notion of ‘alienness’, where the alien is seen both as an extraterrestrial but also an outcast with regard to the law which leaves him or her at the mercy of state-sponsored forms of violence.


Patrick Jackson, Pig Paradise, 2017. Photo by Istvan Virag


Patrick Jackson, Pig Paradise, 2017. Photo by Istvan Virag


Patrick Jackson, Pig Paradise, 2017. Photo by Istvan Virag


Patrick Jackson, Pig Paradise, 2017

Patrick Jackson photographed portions of 1 kilometer long mural surrounding the Farmer John’s Meat Packing Plant in Vernon, California. The work portrays happy pigs and humans frolicking gaily in the countryside.

The mural makes an appearance in Brian De Palma’s movie Carrie. Which is quite appropriate if you think that this is in fact a pork-processing plant and that the animals brought there don’t enjoy the cheerful fate of their painted cousins.

Gathered under the title Pig Paradise, shot in black and white and shown under the impassive light of a gallery space, Patrick Jackson’s photos are completely estranged from their original and distasteful context.

Can we fantasize a future in which people realize that eating pigs, those smart and scorned sentient beings, is no less revolting than eating dogs? Or would that be too alienating?

More images from the show:


Ragnar Þórisson, Untitled, 2015


Serina Erfjord, Among Stars, 2009-2004. Photo by Istvan Virag


Wael Shawky, The Cabaret Crusades: The Path to Cairo, 2012. Photo by Istvan Virag


Sonja Baümel, Being Encounter, 2017. Photo by Istvan Virag


Johannes Heldén, New New Hampshire, 2017. Photo by Istvan Virag


Búi Adalsteinsson, Posters. Photo by Istvan Virag


Rolf Nowotny, Ravaged House, 2017. Photo by Istvan Virag


Jone Kvie, Untitled (Carrier), 2006. Photo by Istvan Virag


Jenna Sutela, Sporulating paragraph, 2017. Photo by Istvan Virag

Momentum 9, The Nordic Biennial of Contemporary Art, is curated by Ulrika Flink, Ilari Laamanen, Jacob Lillemose, Gunhild Moe and Jón B.K Ransu. The exhibitions remain open in various location in Moss, Norway, until 11 October 2017

Previously: MOMENTUM9 – “Alienation is our contemporary condition”.

Help making a stopwatch timer?

I'm trying to make a timer that can start and stop and keep recording. This is what I have and it stops fine but when I start it again it doesn't pick up where it left off, probably because of my update() method. However, this is the only method I tried that got the timer to run in the first place!

class Timer{ int elapsed; int start; int limit; Boolean running; Timer(int limit) { this.limit = limit; } void reset() { start = millis()/1000; elapsed = 0; } void start() { running = true; } void stop() { running = false; } void update(){ if(running) { elapsed = (millis()/1000) - start; } else { } if(elapsed >= limit) { stop(); } } } 

Thanks!

submitted by /u/DHPNC
[link] [comments]

Need help with ease problem

I want a value to fluctuate between 0 and 255. But I want it to happen slower when its closer to 127.5.

 

When the color value increases the speed of the increase should decrease when the color value is between 0 and 127.5 and increase between 127.5 and 255. And when the color value decreases do the opposite so speed should decrease between 255 and 127.5 and increase between 127.5 and 0.

 

from left to right

time 1 2 3 4 5
speed 1 2 1 2 1
color 0 127.5 255 127.5 0

 

I am currently trying it with booleans but I don't even know if thats the solution.

 

The code does not work as planned at all because it breaks when I apply ease to speed, but I hope it helps getting the idea across And in the perfect solution I would like to change the "base speed" without breaking the system. Maybe mapping is the solution but I can figure out how to use it in this problem.

 

Current code:

 int r; boolean colorSwitch = true; float speed = 1; float ease = 2; boolean easeSwitch = true; void setup() { size(600, 600); background(0, 0, 0); } void draw() { background(r, 0, 0); if (r >= 126 && r <= 128) { easeSwitch = false; } if (r <= 1 || r >= 254) { easeSwitch = true; } if (easeSwitch == false){ ease += 0.01; }else{ ease -= 0.01; } if (r >= 255) { colorSwitch = false; } if (r <= 0) { colorSwitch = true; } if (colorSwitch == true) { r += speed; }else{ r -= speed; } translate(width/2, height/2); noFill(); strokeWeight(25); float r2 = map(r,0,255,255,0); stroke(r2,0,0); ellipse(0, 0, 200, 200); println(ease); } 

In this example I would like the speed of the color change to be slower when the background and the ellipse are both the same color.

Any help would be appreciated!

submitted by /u/Floempie
[link] [comments]