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
-1
votes
1 answer

Algorithm that finds a simple cycle in the graph and prints it

Let G=(V,E) be a simple undirected graph. Suggest an algorithm that finds some simple cycle in the graph and prints it (the sequence of nodes composing it). If there is no such cycle, the algorithm will not print anything. Algorithm: Initiate an…
-1
votes
2 answers

Compare two column in python and return matches in first table

Help to compare two columns in different tables by cycle and return the matches to the first table. data1: |name | revenue | |-------|---------| |Alice | 700 | |Bob | 1000 | |Gerry | 300 | |Alex | 600 | |Kyle | 800 …
Alex
  • 1
  • 2
-1
votes
2 answers

how do i count the number of cycles per 1.5 seconds on python?

I have a column on time and a column with binary data. every time the binary number changes from 1 to 0, that's 1 cycle. i'd like to add up the number of cycles per 1.5 second. something like first 1.5s - 1,0,1,0 -> 2 cycles second 1.5s - 1,0 -> 1…
-1
votes
1 answer

Validate title function

Write a title validation function - validateTitle, which takes an argument and validates it by the rules: Title length must be less than 2 characters but less than 20. Title must start with an uppercase letter Function should return ‘VALID’ if…
-1
votes
1 answer

How to skip specific cycle loops?

I would like to create such a Shape. Just draw a Circle and then Lines. import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import javafx.scene.shape.Circle; import…
Michal Rama
  • 173
  • 1
  • 1
  • 10
-1
votes
1 answer

Censoring a file

I would like to use awk to modify a text file. The modified text file should transform any word starting with "te" or "Te" and doesn't include a number into "yyyyy" - to sort of censor the file. So for example a file Hello everyone, today is a great…
-1
votes
2 answers

Adding elements to array as sub-elements dynamically in PHP

I want to find a workaround for the following problem: I have n vectors(unique), like the following: ("val1", "val2", "val3", ..., "valn" ). Each vector's length is different. I want to add any of those in a new array, but using the vector…
-1
votes
2 answers

placing value between specific numbers in cycle

so lets say I have x = 1,4,2 i = 2 j = 4 k = 3 So i = 2 and j = 4, the point is i need to place k (3) between the numbers i,j in x so the result would be x = 1,4,3,2. I need it to work in a cycle because the numbers in i,j,k always change and so…
-1
votes
2 answers

Infinite cycle due to QTextStream

So, I get infinite cycle while trying to read lines from file (line by line). I was trying to use do{}while(); cycle like that: QTextStream stream(stdin); QString line; do { line = stream.readLine(); } while (!line.isNull()); but I get empty…
bogdyname
  • 358
  • 2
  • 10
-1
votes
2 answers

How to write a cycle for creating numpy arrays?

How to write this in cycle, please? k1 = np.empty(np.shape(u)) k2 = np.empty(np.shape(u)) k3 = np.empty(np.shape(u)) k4 = np.empty(np.shape(u)) I tried: k = [k1, k2, k3, k4] for i in k: i = np.empty(np.shape(u)) k.append(i)
Alex
  • 347
  • 1
  • 10
-1
votes
1 answer

What name should I use for the "root" of a cycle?

So, I'm writing a cyclic data structure. (In C#, but my question is language-nonspecific.) It's pretty simple: just a doubly-linked list that loops around on itself. But while all nodes are equal, I need to single out one of them as my default entry…
Travis Reed
  • 1,572
  • 2
  • 8
  • 11
-1
votes
1 answer

Circular C++ Header includes

I'm making a neural net in C++ and i have got a serious problem with headers include look at this code: Neurone.cpp: //NEURONE.CPP #include "stdafx.h" #include "Neurone.h" #include using namespace std; Neurone::Neurone(Layer*…
Francois
  • 1
  • 2
-1
votes
1 answer

passing a double pointer boolean array to a function

I have a double pointer boolean. I would like to pass this boolean to a function The code is used for graph theory, to create an adj matrix, check if the graph has cycles or not ... The problem comes from the cycle function The function doesn't like…
Toms lns
  • 39
  • 8
-1
votes
1 answer

For...of : undefined log

I got this simple function, and I want to console out the values in an array: function findRoutes(routes) { for (let value of routes) { console.log(value) } } console.log(findRoutes([["MNL", "TAG"], ["CEB", "TAC"], ["TAG", "CEB"],…
Fabio Russo
  • 271
  • 1
  • 3
  • 13
-1
votes
1 answer

Which is the best away to create and store cycles using c/c++?

Which is the best away to create and store cycles using c/c++? I have the structs: struct CYCLE { vector route; float COST; } struct Arc { int i, j; Arc () {}; Arc (const Arc& obj): i(obj.i), j(obj.j) {}; Arc(int _i,…
rbl
  • 17
  • 6