Questions tagged [cycle]

A cycle is a process or series of items, which repeats several times.

Cycle is processes or events, which repeat several times. Number of repetitions can be known before starting the cycle or cycle can be repeated until some condition is true.

1551 questions
6
votes
6 answers

While loop, extra loop even though condition is false

I'm using javascript, but I'm looking for a general purpose solution that might apply to multiple languages. I want to have a while loop that runs one time longer than it's supposed to. For instance (assume the variables are defined above): while (x…
mmm
  • 2,272
  • 3
  • 25
  • 41
6
votes
4 answers

finding all vertices that are a part of a simple cycle

Is there a way to find all vertices that are a part of a simple cycle in a graph in a linear time? I found a way to do it in O(|V|(|V|+|E|)) time but was wondering if there is a way to do it faster?
Amnon
  • 195
  • 3
  • 12
6
votes
2 answers

Cycle2 make images links

Hi Ive just swapped from Keyframes to Cycle2 (http://jquery.malsup.com/cycle2/) as a way of slideshowing images , I swapped to cycle2 as i believed this would allow me to make the images links , I only need one of the images to a link not all of…
Coco
  • 79
  • 1
  • 4
6
votes
4 answers

VB.NET How give best performance "Select case" or IF... ELSEIF ... ELSE... END IF

I have a huge DataTable, and I need go by each row and validate an specific value. Which method give me more performance, an structure of IF ELSE or SELECT CASE? (I'm focused in the method that offer me the best performance) IF ELSE (METHOD #1) For…
MiBol
  • 1,985
  • 10
  • 37
  • 64
6
votes
2 answers

Find all the paths forming simple cycles on an undirected graph

I am having some trouble writing an algorithm that returns all the paths forming simple cycles on an undirected graph. I am considering at first all cycles starting from a vertex A, which would be, for the graph below A,B,E,G,F A,B,E,D,F…
Jose Ospina
  • 2,097
  • 3
  • 26
  • 40
5
votes
1 answer

jQuery Cycle Error: Cannot read property 'cycleW' of undefined

Not sure why I'm getting this error and can't figure it out? The cycle works, I'm just getting this error in the console and would like to fix it. That's why I'm here now :) I'm creating 3 different cycles on the same page with the same selector and…
Siebird
  • 638
  • 4
  • 13
5
votes
2 answers

JQuery cycle - fadein/fadeout interrupted

I have a JQuery slideshow where some text/slide fades in and out. At the same time I have a navigation/spots to click. When you click on a spot the slide/text changes. The problem is when the text/slide is fading and the user clicks on a spot, the…
5
votes
1 answer

How can I define an infinite / looped algebraic datatype in haskell?

I have a music note datatype defined like so: data Note = Ab | A | Bb | B | C | Db | D | Eb | E | F | Gb | G deriving (Eq, Ord) How can i make it an instace of Enum so that succ G returns Ab ?
Atavixion
  • 53
  • 4
5
votes
2 answers

Any way to make jQuery cycle not loop when reaching the end or the beginning?

I realize that the plugin is called CYCLE because it cycles throgh the element of the list. But what I like most about it is its flexibility, so I was wondering if there is any way to make the plugin not cycle. So if you try to go to the previous…
agente_secreto
  • 7,959
  • 16
  • 57
  • 83
5
votes
5 answers

Database relationship cycle

Database relationship cycles smell like bad database design. Below is a situation in which I think it can not be prevented: a Company has Locations (City) a Company has Products (Big Mac) Products are/are not available on Locations (No Bacon Burger…
Yvo
  • 18,681
  • 11
  • 71
  • 90
5
votes
4 answers

Eliminating cyclic flows from a graph

I have a directed graph with flow volumes along edges and I would like to simplify it by removing all cyclic flows. This can be done by finding the minimum of the flow volumes along each edge in any given cycle and reducing the flows of every edge…
J D
  • 48,105
  • 13
  • 171
  • 274
5
votes
1 answer

Stop Heroku Dyno from cycling

I have a Hobby Dyno that hosts an application in Heroku in which users can upload images. What I've noticed is the Dyno restarts during his cycle causing all images to be gone. 2018-07-27T16:23:09.914767+00:00 heroku[web.1]:…
lch
  • 2,028
  • 2
  • 25
  • 46
5
votes
3 answers

Insert items from an array into a div when clicking

I have an array with predefined lines: var linesArr = ["asd", "dsa", "das"]; I have a div, which i created with JS and styled it with my CSS: var div = document.createElement("div"); div.className = "storyArea"; div.innerHTML =…
5
votes
6 answers

How to detect when the app goes to minimized or exit

Hey I have an application where I want to now when the APP goes to onPause or onDestroy because I want to call a certain function when this happens. I tried to override the onPause in an activity and extended that activity in all project but the…
Hussein M. Yassine
  • 181
  • 1
  • 1
  • 9
5
votes
1 answer

Cycles in c++ like in python (range-based for)

What is the easiest way to do cycles in c ++ like in python? for i in range(10): #or range(4, 10, 2) etc foo(i) I mean something simple and one-line like this for(auto i: range(10)) //or range(4, 10, 2) or range(0.5, 1.0, 0.1) etc …
NikBond
  • 743
  • 1
  • 5
  • 20