print '<div id="wrap">';
print "<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"3\">";
for($i=0; $i<count($news_comments); $i++)
{
print '
<tr>
<td width="30%"><strong>'.$news_comments[$i]['comment_by'].'</strong></td>
<td width="70%">'.$news_comments[$i]['comment_date'].'</td>
</tr...
Hi guys, I haven't coded in C++ in ages. And recently, I'm trying to work on something
involving structs. Like this
typedef struct{
int x;
int y;
} Point;
Then in a loop, I'm trying to create new structs and put pointers to them them in a list.
Point* p;
int i, j;
while (condition){
// compute values for i and j with som...
Hi,
I have problem in adding autocomplete plugin to multiple text inputs in loop (no errors are returned).
// get text inputs to attach autocomplete
var locinputs = $('#localizations').find('input:text');
// iterate over elements and add autocomplete plugin
for (var i = 0; i < locinputs.length; i++) {
// asp.mvc...
I have a table that lists number of comments from a particular site like the following:
Date Site Comments Total
---------------------------------------------------------------
2010-04-01 00:00:00.000 1 5 5
2010-04-01 00:00:00.000 2 8 ...
How do I achieve the following?
Sub Macro1()
'
' Macro1 Macro
'
'
Worksheets("Drop-down").Select
n = Cells(1, 1).End(xlDown).Row
For i = 1 To n
ActiveSheet.Cells(i, 2).Select
*******************************************************
If Worksheets("Misc").Cells(2, i).Value = "" Then
continue...
Hey Guys,
I'm basically having a bit of trouble with traversing through an unordered list and retreiving list items.
foreach (MyTypeObject s in result)
{
oList.Clear();
{
oList.AppendFormat("<ul id='OuteroListItems'>");
oList.AppendFormat("<li>");
oList.AppendFo...
I have a list of arrays that contains multiple arrays.
Each array has 2 indexes.
First, I want to loop the list. Then I want to loop the array inside the list.
How can I do that ?
I tried to use this way, but it doesn't work:
1. foreach (string[] s in ArrangList1)
2. {
3. int freq1 = int.Parse(s[1]);
4. foreach (string[] s1 ...
I'm using a loop to try to generate keyword combinations and also find the ones that have been used the most.
The loop finds all the records in the "posts" table where keyword = "chicago".
Within this loop, I need to generate strings. Which, would look something like "chicago bulls" "chicago bears" "chicago cubs" etc... How do I tempo...
Hi,
I am using JQuery to position a series of div tags which basically use a class inside of the tag which decorates the divs as bars. So the div is a green box based on its css specifications to the glass.
I have a list of STARTING postions,
a list of left coordiantes- for the starting points I wish to position my DIV
say 556, 560, ...
how can I loop through these items?
var userCache = {};
userCache['john'] = {ID: 234, name: 'john', ... };
userCache['mary'] = {ID: 567, name: 'mary', ... };
userCache['douglas'] = {ID: 42, name: 'douglas', ... };
the length property doesn't work?
userCache.length
...
Our computer science teacher once said that for some reason it is more efficient to count down that count up.
For example if you need to use a FOR loop and the loop index is not used somewhere (like printing a line of N * to the screen)
I mean that code like this :
for (i=N; i>=0; i--)
putchar('*');
is better than:
for (i=0; i<...
I was reading a blog post and saw a groovy snippet that looked lik
while ( entry = inputStream.nextEntry ) {
// do something
}
In the while loop, is this groovy syntax that will cause the loop to break when entry is null?
...
My code is below, and I had an issue with nearly the same code, and it was fixed here on StackOverflow, but, again, its not working. I haven't changed the working code, but i did wrap it in the for...in loop youll see below. The issue is that no matter what marker I click it always triggers the last marker/infoWindow that was placed.
$(...
I have a structure in matlab that has a value of <1x1 struct>., its name is figurelist.
Inside that structure, there is a field called images. Inside images, I have 25 images that have the name img1, img2, img3, ..... , img25.
Now I made a for loop to extract those images, I basically did:
For K=1:25
image(figurelist.images.imgK)...
Dear Members, Scholars.
As it may seem obvious I am not armed with Objective C knowledge. Levering on other more simple computer languages I am trying to set a dynamic name for a list of buttons generated by a simple loop (as the following code suggest).
Simply putting it, I would like to have several UIButtons generated dynamically (wi...
hi every one.
i need to change my loop variable inside the iterationa as ihave to acces array elements in the loop which is changing w.r.t size inside the loop.
ashort piece of code is that:
que=[];
que=[2,3,4];
global len;
len=size(que,2)
x=4;
for i=1:len
if x<=10
que(x)= 5;
len=size(que,2)
x=x+1;
end
end
que
a...
hello.
just out of curiosity I tried to do the following, which turned out to be not so obvious to me;
Suppose I have nested loops with runtime bounds, for example:
t = 0 // trip count
for l in 0:N
for k in 0:N
for j in max(l,k):N
for i in k:j+1
t += 1
t is loop trip count
is there a general algorithm/...
Hi there,
I have a problem that I thought I knew how I can fix it, but apparently I failed ..
I got a .mat file that I created, it has 2 columns and 25 rows of numbers. I would like to do a loop to get each value in the first column and put it in the X value, and the second column in the Y value. I then need to plot the points on the g...
Hi guys,
I'm trying to create a sudoku game, for those that do not know what it is. You have a 9x9 box that needs to be filled with numbers from 1-9, every number must be unique in its row and column, and also in the 3x3 box it is found. I ended up doing loads of looping within a 2 dimensional array.
But at some point it just stops, wi...
Hello,
I was hoping to get some help on a question. I have an infinite loop that I need run and I need to update a set of variables (x in this case) at random times from the command-line. Is there any way to do this?
For example:
x = 0
while True:
x = x + 1
if x < 30:
do something
and I need to update x's value from the comma...