Tagged Questions
0
votes
1answer
16 views
Plese help me. Matlab 'while' loop. A set of data is given
Now I calculate the value of F from equation. From the F that I determined, I need to find the diameter from set of data.
THe method is like this. If my F value is smaller than the value of F from ...
0
votes
2answers
64 views
PL SQL Function while loop ending unexpectedly
i have a function where i want to calculate seconds between two dates these seconds should be calculated only in our companys opening hours. because it can take several days for the task to be ...
1
vote
2answers
102 views
Combining Continuous Loop in Switch-Case Function
I have a robot performing a dance, and I am trying to make it so that during the dance, if at any point the robot runs into a wall (a while loop im assuming), it will display something on the lcd ...
0
votes
2answers
96 views
c++ functions while loop
When I type in a decimal for number of employees it outputs "Please enter a value of atleast 1" an infinite number of times. But shouldnt the decimal be truncated? How do i fix this so the decimal is ...
3
votes
3answers
121 views
Why `do { …; exit(…); } while (0)` in C? [duplicate]
As a C newbie I'm having trouble understanding the following code:
#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \
} while (0)
I gathered that the reason ...
0
votes
1answer
68 views
While loop using only mysql query language
I have some trigger to save call records as blob into database. I want to add some extra function that will execute each time with trigger and will help to keep database in some size limits: function ...
1
vote
3answers
80 views
Lua table read and match efficient
My problem is simple, i used to do this in order to check if any of my lines (see photo) bump into any other line (or trail of any other line). But the way i do this now is by doing a lot of if ...
0
votes
1answer
175 views
While Loop Won't loop C++
I can't seem to figure out why this while loop stopped looping. It was doing fine before I moved some code around. Now I got something else working and it just doesn't loop. I've also tried making ...
1
vote
1answer
52 views
functions outside of loop not updating
I'm trying to do a loop that display a few conditions based on load average and cpus/memory etc. However, it seems like it only pull the usage information once for the entire loop. I want it to update ...
1
vote
2answers
56 views
Return a value from a function called in while loop
The point is to guess a random number choosen from an interval of integers and do it within a fixed numbers of attempts.
The main function asks the upper limit of the interval and the number of ...
-2
votes
1answer
55 views
Function to return a character into a while loop
I'm trying to write a calculation program that, when it has run through once asks the user if they wish to make another calculation. This has the form of a separate function that is called at ...
0
votes
2answers
42 views
printing randome choices from an array
I am working on a function that picks random numbers from a given array and prints them to stdout. These numbers should not repeat and how many numbers are picked is given to the function along with ...
2
votes
2answers
45 views
Cleanest way to use multiple values in a complex routine?
See the following pseudocode snippet that approximates my situation:
function foo () {
for ( velocity=0; velocity<100; velocity++ ) {
root1 = computeRoot1();
root2 = computeRoot2();
...
2
votes
1answer
458 views
Using a Loop Inside a Function
I'm still learning functions and how they work. I know what I'm doing wrong just not how to fix it. I am writing a function to pull image data out of a database and return it onto the screen. It works ...
1
vote
1answer
163 views
Perform loop while function return false until it return true (or fail)
How can i write this code with a loop ?
$date = new DateTime;
if(checkForDate($date->format('m')) == true) {
return true;
}
else {
$date->sub(new ...