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
5
votes
0 answers

Detecting rising and falling edge via SQL (loading cycles)

i need to detect rising and falling edges from a loading state in my logs and need to list all loading cycles. Lets say i have a table LOG UTS | VALUE | STATE 1438392102 | 1000 | 0 1438392104 | 1001 | 1 1438392106 | 1002 | 1 1438392107 |…
Jan S.
  • 331
  • 1
  • 3
  • 10
5
votes
2 answers

Minimum distance between two elements of a circular list?

Suppose I have a list like this: my_list = [A, B, C, D, E, F, G] Actually, I use my list like a cycle. This means that after G there is A, and before A, there is G. I want to know what is the shortest distance between, for example, B and…
Delgan
  • 18,571
  • 11
  • 90
  • 141
5
votes
2 answers

How to detect if an undirected graph has a cycle and output it using BFS or DFS

The other question on this only answered how to detect a cycle, not also output it. So, I'd like to write an algorithm run BFS or DFS in O(V + E) time (V=vertices, E=edges), on an undirected graph, and output the cycle if it has one. What I know so…
5
votes
2 answers

Detecting negative cycles using SPFA algorithm

Using the SPFA algorithm below in a directed graph with negative and positive weights, how can we detect negative cycles? procedure Shortest-Path-Faster-Algorithm(G, s) 1 for each vertex v ≠ s in V(G) 2 d(v) := ∞ 3 d(s) := 0 4 …
mehmetin
  • 69
  • 4
5
votes
2 answers

NMAP continuous ping

I need to implement a code which is able to send ping packets each second toward a certain amount of destinations. The problem is that I'd like to ping as much destinations as possible inside 1 second window. For this reason I was thinking if there…
NotoAnonimo
  • 151
  • 2
  • 7
5
votes
4 answers

jquery cycle - add then remove css class - infinite loop

How do I use jQuery to infinitely add then remove a CSS class on a set of 4 li's. Basically, see this simple fiddle (without any jquery): http://jsfiddle.net/kHsvN/ I want to cycle through the boxes to change the css of a box, flip back to original…
Ben Davis
  • 51
  • 1
  • 2
5
votes
1 answer

jQuery Cycle Lazy Loading

I have a jQuery cycle presentation page that contains about 48 slides. The problem is that initial load of all the assets takes a while so the page looks distorted for about 1-5 seconds. Is there a way to lazy load the assets needed by each slide…
David Thompson
  • 115
  • 2
  • 6
4
votes
5 answers

Why does Java toString() loop infinitely on indirect cycles?

This is more a gotcha I wanted to share than a question: when printing with toString(), Java will detect direct cycles in a Collection (where the Collection refers to itself), but not indirect cycles (where a Collection refers to another Collection…
13ren
  • 11,887
  • 9
  • 47
  • 64
4
votes
5 answers

What's wrong with this C# struct?

Note: My question has several parts to it. I'd appreciate it if you would please answer each of the questions, instead of simply telling me what to do to get this to compile. :) I'm not by any means good with C#. In fact, the reason why I don't know…
Bob
  • 1,219
  • 1
  • 14
  • 28
4
votes
1 answer

Detecting whether an edge is the heaviest edge in a cycle

So it seems that determining whether an edge is in a minimum spanning tree can be reduced down to the question of whether the edge is the heaviest edge of some cycle. I know how to detect whether an edge is in a cycle, using DFS, but how to…
Yiren Lu
  • 153
  • 3
  • 13
4
votes
3 answers

#include and possible cyclical reference

So my latest error is starting to bug me really bad and I've looked around the internet and the best solution I have come up with is that I have a cyclical #include error, but I'm not sure what is exactly causing that. My include structure looks…
Bob
  • 1,219
  • 1
  • 14
  • 28
4
votes
5 answers

Scala Graph Cycle Detection Algo 'return' needed?

I have implemented a small cycle detection algorithm for a DAG in Scala. The 'return' bothers me - I'd like to have a version without the return...possible? def isCyclic() : Boolean = { lock.readLock().lock() try { nodes.foreach(node…
jts
  • 715
  • 7
  • 22
4
votes
2 answers

How to make uiscrollview's content in cycle?

I want to make content of uiscrollview to be run in cycle. In other words, I mean when we move to the top and try to access the previous then the last content of the scrollview should be displayed AND if I am on last content and try to access next…
Sanchit Paurush
  • 6,114
  • 17
  • 68
  • 107
4
votes
2 answers

List cycle detection

Given a linked list, return the node where the cycle begins. If there is no cycle, return null. After detecting the loop using hare and tortoise algorithm, I cant understand how equal moves from starting and loop detection address is resulting in…
4
votes
4 answers

Implementation of Johnson's algorithm to find elementary circuits (cycles) in a graph

Does anyone have source code implementing this algorithm for finding cycles, preferably in a modern statically-typed language like SML, OCaml, Haskell, F#, Scala?
J D
  • 48,105
  • 13
  • 171
  • 274