-
as seen on Stack Overflow
- Search for 'Stack Overflow'
As far as I understand, when you write a for-loop similar to this one
for (int i = 0; i < SOME_NUM; i++) {
if (true)
do_something();
else
do_something_else();
}
The time complexity of this operation is mostly affected by the if (true) statement because the for-loop iterations don't…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a while loop to show the replies for a post on my website.
The value for parentID used in the query is $post['postID'] which is an array of details for the post being viewed.
As seen below it outputs the following (each subject is a link to view the full post)
$q = $dbc -> prepare("SELECT…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi, I'd like to find easier way to write loops inside loops.
Here is example code of 3 levels of 'for' loops:
int level = 0;
int value = 0;
bool next = false;
for (int i0 = 0; i0 < 6; i0++)
{
level = 0;
value = i0;
method();
if (next)
for (int i1 = 0; i1 < 6; i1++)
…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a program to use the IMDB database and am having very slow performance on my query. It appears that it doesn't use my where condition until after it materializes everything. I looked around for hints to use but nothing seems to work. Here is my query:
SELECT *
FROM name as n1
FULL JOIN…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
A query (see below) that extracts climate data from weather stations within a given radius of a city using the dates for which those weather stations actually have data. The query uses the table's only index, rather effectively:
CREATE UNIQUE INDEX measurement_001_stc_idx
ON climate.measurement_001
…
>>> More