Search Results

Search found 15634 results on 626 pages for 'foreach loop container'.

Page 6/626 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • jQuery toggle on a PHP foreach statement

    - by user313835
    The code for the page is the following <?php foreach ($organization->index() as $id=>$content) { ?> <a href="#" id="obtain_branch"><?= $content->name?></a> <div id="directory_brnach"><?= $content->about?></div> <?php } ?> The JavaScript code using jQuery is // Directory inner branches $('#obtain_branch').click(function(){ $('#directory_brnach').toggle('fast'); }); The problem it will only work on the first one given the the ID is not changing, the rest will not change. How can I send an array to the jQuery function to give an individual ID on every iteration? Thanks in advance.

    Read the article

  • foreach with an array of stdclass objects

    - by Jared Steffen
    So, what I want to do is quite simple in my mind. I have an array that consists solely of four objects. I want to create a loop that will echo an attribute of each object in the array. The only success I've had, however, is echoing every object and every property of the objects. I've never dealt with objects so this is probably the TRUE root of the problem. There's been a few revisions but the only thing I've really excelled at is creating error codes. Here is what I have: $categories = get_categories(array('child_of' => '8')); foreach ($categories as $cat) { echo $cat->name; };

    Read the article

  • php foreach looping twice

    - by Jack
    Hi, I am trying to loop through some data from my database but it is outputting it twice. $fields = 'field1, field2, field3, field4'; $idFields = 'id_field1, id_field2, id_field3, id_field4'; $tables = 'table1, table2, table3, table4'; $table = explode(', ', $tables); $field = explode(', ', $fields); $id = explode(', ', $idFields); $str = 'Egg'; $i=1; while ($i<4) { $f = $field[$i]; $idd = $id[$i]; $sql = $writeConn->select()->from($table[$i], array($f, $idd))->where($f . " LIKE ?", '%' . $str . '%'); $string = '<a title="' . $str . '" href="' . $currentProductUrl . '">' . $str . '</a>'; $result = $writeConn->fetchAssoc($sql); foreach ($result as $row) { echo 'Success! Found ' . $str . ' in ' . $f . '. ID: ' . $row[$idd] . '.<br>'; } $i++; } Outputting: Success! Found Egg in field3. ID: 5. Success! Found Egg in field3. ID: 5. Could someone please explain why it is looping through both the indexed and associative values? UPDATE I did some more playing around and tried the following. $fields = 'field1, field2, field3, field4'; $idFields = 'id_field1, id_field2, id_field3, id_field4'; $tables = 'table1, table2, table3, table4'; $table = explode(', ', $tables); $field = explode(', ', $fields); $id = explode(', ', $idFields); $str = 'Egg'; $i=1; while ($i<4) { $f = $field[$i]; $idd = $id[$i]; $sql = $writeConn->select()->from($table[$i], array($f, $idd))->where($f . " LIKE ?", '%' . $str . '%'); $string = '<a title="' . $str . '" href="' . $currentProductUrl . '">' . $str . '</a>'; $sth = $writeConn->prepare($sql); $sth->execute(); $result = $sth->fetch(PDO::FETCH_ASSOC); foreach ($result as $row) { echo 'Success! Found ' . $str . ' in ' . $f . '. ID: ' . $row[$idd] . '.<br>'; } $i++; } The interesting thing is that this outputs the below: Success! Found Egg in field3. ID: E. Success! Found Egg in field3. ID: E. Success! Found Egg in field3. ID: 5. Success! Found Egg in field3. ID: 5. Success! Found Egg in field3. ID: E. Success! Found Egg in field3. ID: E. Success! Found Egg in field3. ID: 5. Success! Found Egg in field3. ID: 5. I have also tried adding $i to the output and this outputs 2 as expected. If I change fetch(PDO::FETCH_BOTH) to fetch(PDO::FETCH_ASSOC) the output is as follows: Success! Found Egg in field3. ID: E. Success! Found Egg in field3. ID: E. Success! Found Egg in field3. ID: 5. Success! Found Egg in field3. ID: 5. This has been bugging me for too long, so if anyone could help I would be very appreciative!

    Read the article

  • Problem with anonymouse delegate within foreach

    - by geting
    public Form1() { InitializeComponent(); Collection<Test> tests = new Collection<Test>(); tests.Add(new Test("test1")); tests.Add(new Test("test2")); foreach (Test test in tests) { Button button = new Button(); button.Text = test.name; button.Click+=new EventHandler((object obj, EventArgs arg)=>{ this.CreateTest(test); }); this.flowLayoutPanel1.Controls.Add(button); } } public void CreateTest(Test test) { MessageBox.Show(test.name); } } when i click the button witch text is 'test1', the messagebox will show 'test2',but my expect is 'test1'. So ,would anyone please tell me why or what`s wrong with my code.

    Read the article

  • Wrapping 3 objects or less inside a while / foreach in PHP

    - by DarkGhostHunter
    Simple question. I have an array of 21 elements, and show every three of them inside a <div> block. The code is something like this: <?php $faces= array( 1 => 'happy', 2 => 'sad', (sic) 21 => 'angry' ); $i = 1; foreach ($faces as $face) { echo $face; $i++; } ?> The problem lies when this array doesn't have 21 elements, sometimes it gets 24, an other times 17. How I wrap every three of them, and wrap alone the rest? I came up with using switch and case, but that works only when there are 21 elements only. I think I could count them beforehand and put a closing in the last one (even if it is a group of one element).

    Read the article

  • Action(Of T) in Visual Basic in List(Of T).ForEach

    - by Jason
    I have searched high and low for documentation on how to use this feature. While the loop I could write would be simple and take no time, I really would like to learn how to use this. Basically I have a class, say, Widget, with a Save() sub that returns nothing. So: Dim w as New Widget() w.Save() basically saves the widget. Now let's say I have a generic collection List(Of Widget) name widgetList(Of Widget) and I want to run a Save() on each item in that list. It says I can do a widgetList.ForEach([enter Action(Of T) here]) ....but how in the F does this work??? There is no documentation anywhere on the intrablags. Help would be much much appreciated.

    Read the article

  • In languages which create a new scope each time in a loop block, a new local copy of the local loop

    - by Jian Lin
    It seems that in language like C, Java, and Ruby (as opposed to Javascript), a new scope is created for each iteration of a loop block, and the local variable defined for the loop is actually made into a local variable every single time and recorded in this new scope? For example, in Ruby: p RUBY_VERSION $foo = [] (1..5).each do |i| $foo[i] = lambda { p i } end (1..5).each do |j| $foo[j].call() end the print out is: [MacBook01:~] $ ruby scope.rb "1.8.6" 1 2 3 4 5 [MacBook01:~] $ So, it looks like when a new scope is created, a new local copy of i is also created and recorded in this new scope, so that when the function is executed at a later time, the "i" is found in those scope chains as 1, 2, 3, 4, 5 respectively. Is this true? (It sounds like a heavy operation). Contrast that with p RUBY_VERSION $foo = [] i = 0 (1..5).each do |i| $foo[i] = lambda { p i } end (1..5).each do |j| $foo[j].call() end This time, the i is defined before entering the loop, so Ruby 1.8.6 will not put this i in the new scope created for the loop block, and therefore when the i is looked up in the scope chain, it always refer to the i that was in the outside scope, and give 5 every time: [MacBook01:~] $ ruby scope2.rb "1.8.6" 5 5 5 5 5 [MacBook01:~] $ I heard that in Ruby 1.9, i will be treated as a local defined for the loop even when there is an i defined earlier? The operation of creating a new scope, creating a new local copy of i each time through the loop seems heavy, as it seems it wouldn't have matter if we are not invoking the functions at a later time. So when the functions don't need to be invoked at a later time, could the interpreter and the compiler to C / Java try to optimize it so that there is not local copy of i each time?

    Read the article

  • CMD For Loop does not hold set /a value

    - by Bob Hope
    Didn't know how to explain this well, so here is the code @echo off set test=0 for /f %%a in (textfile.txt) do ( rem loops five times(5 lines in textfile.txt) set /a test=test+1 rem Adds 1 to Test echo %%a rem Echo's correct line in file echo %test% rem Echo's whatever X was before the loop ) echo %test% rem Displays the correct value of X pause this is just an example of where I am finding the problem, txtfile.txt has 5 lines, so the for loop goes 5 times, each time, test gets +1 to it, and the /a displays the correct value of X, but the last echo on the for loop displays 0, which is what test is set to before the loop. The value of test is not changing until the loop is finished... is there any way to fix this? Here is what I want to accomplish, as there may be an easier way: I want to run a for loop that findstr's all rtf's in a series of sub folders, and copies them all to a all directory with a new name, 1.rtf,2.rtf,3.rtf, etc. The reason I need to rename them on the transfer is they all have the same name.

    Read the article

  • Scalable stl set like container for C++

    - by Pqr
    Hi, I need to store large number of integers. There can be duplicates in the input stream of integers, I just need to store distinct amongst them. I was using stl set initially but It went OutOfMem when input number of integers went too high. I am looking for some C++ container library which would allow me to store numbers with the said requirement possibly backed by file i.e container should not try to keep all numbers in-mem. I don't need to store this data persistently, I just need to find unique values amongst it.

    Read the article

  • asp.net mvc radioButtonFor in forEach

    - by George
    Does anyone know why this isn't working? any source code changes would be great. <% foreach (var i in Model.talentImages) { %> <div style="padding:15px;"> <img src="<%: i.uri %>" width="95" height="84" alt="" style="float:left; padding:0px 20px 0px 0px" /> <div style="padding:30px 10px 10px 10px"> <%: Html.RadioButtonFor("group-" + i.uriId.ToString(), i.isApproved)%> Approved <br /> <%: Html.RadioButtonFor("group-" + i.uriId.ToString(), i.isApproved)%> Deny <br /> </div> <hr width="0"/> <%= Html.RadioButton("isProfileePicGroup", i.isProfilePic, false)%> Make Profile Picture <br /> </div> <hr /> <%} %>

    Read the article

  • PHP foreach help

    - by sea_1987
    Hello I have an array that looks like this, Array ( [cfi_title] => Mr [cfi_firstname] => Firstname [cfi_surname] => Lastname [cfi_email] => [email protected] [cfi_subscribe_promotional] => [cfi_tnc] => [friendsName] => Array ( [0] => Firstname 1 [1] => Firstname 2 [2] => Firstname 3 ) [friendsEmail] => Array ( [0] => [email protected] [1] => [email protected] [2] => [email protected] ) [submit_form] => Submit ) My dilema is I need to save the values from the friendsName and friendsEmail arrays into a database, I know I can loop through them but how can I send the matching data, for example I need to save [friendsName][0] and friendsEmail][0] on the same row of database? I know I need to use a foreach but I just cannot figure out the logic.

    Read the article

  • A loop (while/foreach) with "offset" wrapping and

    - by DarkGhostHunter
    After applying what wrapping objects using math operator, I just tought it will be over. But no. By far. <?php $faces= array( 1 => '<div class="block">happy</div>', 2 => '<div class="block">sad</div>', (sic) 21 => '<div class="block">angry</div>' ); $i = 1; foreach ($faces as $face) { echo $face; if ($i == 3) echo '<div class="block">This is and ad</div>'; if ($i % 3 == 0) { echo "<br />"; // or some other wrapping thing } $i++; } ?> In the code I have to put and ad after the second one, becoming by that the third object. And then wrap the three all in a <div class="row"> (a br after won't work out by design reasons). I thought I will going back to applying a switch, but if somebody put more elements in the array that the switch can properly wrap, the last two remaining elements are wrapped openly. Can i add the "ad" to the array in the third position? That would make things simplier, only leaving me with guessing how to wrap the first and the third, the fourth and the sixth, an so on.

    Read the article

  • One True Event Loop

    - by CyberShadow
    Simple programs that collect data from only one system need only one event loop. For example, Windows applications have the message loop, POSIX network programs usually have a select/epoll/etc. loop at their core, pure SDL games use SDL's event loop. But what if you need to collect events from several subsystems? Such as an SDL game which doesn't use SDL_net for networking. I can think of several solutions: Polling (ugh) Put each event loop in its own thread, and: Send messages to the main thread, which collects and processes the events, or Place the event-processing code of each thread in a critical section, so that the threads can wait for events asynchronously but process them synchronously Choose one subsystem for the main event loop, and pass events from other subsystems via that subsystem as custom messages (for example, the Windows message loop and custom messages, or a socket select() loop and passing events via a loopback connection). Option 2.1 is more interesting on platforms where message-passing is a well-developed threading primitive (e.g. in the D programming language), but 2.2 looks like the best option to me.

    Read the article

  • Bash loop to move directories on a remote host via ssh

    - by I Forgot
    I'm trying to figure out a way to perform the following loop on a remote host via ssh. Basically it renames a series of directories to create a rotating backup. But it's local. I want it to work against directories on a remote host. while [ $n -gt 0 ]; do { src=$(($n-1)) dst=$n if [ -d /backup/$src ]; then { mv /backup/$src /backup/$dst; } fi; } ((n--)) done;

    Read the article

  • Why is an inverse loop faster than a normal loop (test included)

    - by Saif Bechan
    I have been running some small tests in PHP on loops. I do not know if my method is good. I have found that a inverse loop is faster than a normal loop. I have also found that a while-loop is faster than a for-loop. Setup <?php $counter = 10000000; $w=0;$x=0;$y=0;$z=0; $wstart=0;$xstart=0;$ystart=0;$zstart=0; $wend=0;$xend=0;$yend=0;$zend=0; $wstart = microtime(true); for($w=0; $w<$counter; $w++){ echo ''; } $wend = microtime(true); echo "normal for: " . ($wend - $wstart) . "<br />"; $xstart = microtime(true); for($x=$counter; $x>0; $x--){ echo ''; } $xend = microtime(true); echo "inverse for: " . ($xend - $xstart) . "<br />"; echo "<hr> normal - inverse: " . (($wend - $wstart) - ($xend - $xstart)) . "<hr>"; $ystart = microtime(true); $y=0; while($y<$counter){ echo ''; $y++; } $yend = microtime(true); echo "normal while: " . ($yend - $ystart) . "<br />"; $zstart = microtime(true); $z=$counter; while($z>0){ echo ''; $z--; } $zend = microtime(true); echo "inverse while: " . ($zend - $zstart) . "<br />"; echo "<hr> normal - inverse: " . (($yend - $ystart) - ($zend - $zstart)) . "<hr>"; echo "<hr> inverse for - inverse while: " . (($xend - $xstart) - ($zend - $zstart)) . "<hr>"; ?> Average Results The difference in for-loop normal for: 1.0908501148224 inverse for: 1.0212800502777 normal - inverse: 0.069570064544678 The difference in while-loop normal while: 1.0395669937134 inverse while: 0.99321985244751 normal - inverse: 0.046347141265869 The difference in for-loop and while-loop inverse for - inverse while: 0.0280601978302 Questions My question is can someone explain these differences in results? And is my method of benchmarking been correct?

    Read the article

  • python: how to design a container with elements that must reference their container

    - by Luke404
    (the title is admittedly not that great. Please forgive my English, this is the best I could think of) I'm writing a python script that will manage email domains and their accounts, and I'm also a newby at OOP design. My two (related?) issues are: the Domain class must do special work to add and remove accounts, like adding/removing them to the underlying implementation how to manage operations on accounts that must go through their container To solve the former issue I'd add a factory method to the Domain class that'll build an Account instance in that domain, and a 'remove' (anti-factory?) method to handle deletions. For the latter this seems to me "anti-oop" since what would logically be an operation on an Account (eg, change password) must always reference the containing Domain. Seems to me that I must add to the Account a reference back to the Domain and use that to get data (like the domain name) or call methods on the Domain class. Code example (element uses data from the container) that manages an underlying Vpopmail system: class Account: def __init__(self, name, password, domain): self.name = name self.password = password self.domain = domain def set_password(self, password): os.system('vpasswd %s@%s %s' % (self.name, self.domain.name, password) self.password = password class Domain: def __init__(self, domain_name): self.name = domain_name self.accounts = {} def create_account(self, name, password): os.system('vadduser %s@%s %s' % (name, self.name, password)) account = Account(name, password, self) self.accounts[name] = account def delete_account(self, name): os.system('vdeluser %s@%s' % (name, self.name)) del self.accounts[name] another option would be for Account.set_password to call a Domain method that would do the actual work - sounds equally ugly to me. Also note the duplication of data (account name also as dict key), it sounds logical (account names are "primary key" inside a domain) but accounts need to know their own name.

    Read the article

  • CSS: 100% of container height without modifying the container

    - by Rena
    Yeah, this ugly question again. I'm writing some HTML that gets inserted into a page. I have no control over the rest of the page. The structure is something like: <table <tr <td rowspan="2"left column</td <td height="1"top row above content</td </tr <tr<td height="220"my content here</td</tr </table I can write whatever I want into that table cell (including style tags to pack in my CSS), but I can't touch anything outside of it, which means I can't set the height of any parent element (including html and body), add a doctype (it has none), etc - that already kills just about every solution I can find (all seem to be "add a doctype" and/or "give the parent container a fixed height"). What I want to do is simply have a <div fill the entire cell. Width is no problem but unsurprisingly height is being a massive pain. Writing "height: 100%" doesn't do anything unless the container has a fixed height (the height="220" attribute apparently doesn't count) or the div uses absolute positioning - and then it seems to want to use 100% of the window's height (and width even) instead of the cell's. The root of the problem is the left column varies in height, as does the content, and when the left column cell is larger than the content, it won't expand to fill the cell it's in. If I set a fixed height for the content, it'll be much larger than necessary most of the time, and if I don't, it doesn't take up all of the cell and leaves an ugly gap at the bottom.

    Read the article

  • Selenium navigation inside foreach loop

    - by smudgedlens
    I am having an issue with navigation. I get a list of rows from an html table. I iterate over the rows and scrape information from them. But there is also a link on the row that I click to go to more information related to the row to scrape. Then I navigate back to the page with the original table. This works for the first row, but for the subsequent rows, it throws an exception. I look at my row collection after the first time the link inside a row is clicked, and none of them have the correct values like they did before I clicked the link. I believe that there is something going on when I navigate to a different URL that I'm not getting. My code is below. How do I get this working so I can iterate over the parent table, click the links in each row, navigate to the child table, but still continue iterating over the rows in the parent table? private List<Document> getResults() { var documents = new List<Document>(); //Results IWebElement docsTable = this.webDriver.FindElements(By.TagName("table")) .Where(table => table.Text.Contains("Document List")) .FirstOrDefault(); var validDocRowRegex = new Regex(@"^(\d{3}\s+)"); var docRows = docsTable.FindElements(By.TagName("tr")) .Where(row => //It throws an exception with .FindElement() when there isn't one. row.FindElements(By.TagName("td")).FirstOrDefault() != null && //Yeah, I don't get this one either. I negate the match and so it works?? !validDocRowRegex.IsMatch( row.FindElement(By.TagName("td")).Text)) .ToList(); foreach (var docRow in docRows) { //Todo: find out why this is crashing on some documents. var cells = docRow.FindElements(By.TagName("td")); var document = new Document { DocID = Convert.ToInt32(cells.First().Text), PNum = Convert.ToInt32(cells[1].Text), AuthNum = Convert.ToInt32(cells[2].Text) }; //Go to history for the current document. cells.Where(cell => cell.FindElements(By.TagName("a")).FirstOrDefault() != null) .FirstOrDefault().Click(); //Todo: scrape child table. this.webDriver.Navigate().Back(); } return documents; }

    Read the article

  • Computer loop restarts on Windows loading

    - by Robinson G.
    My computer restarts, just after or during Windows loading (4 squares getting together), or after some time on the desktop IF I'm idle. In order to start the computer I either have to swap my RAM (24Go) in differents DIMM slots, for example (I have 4 slots) : 1-2-4 or 2-3-4 or 1-3-4, not the same position each boot or it restarts in a loop... I can also change the ram timing from 1.5 to 1.6V and it starts, at the next reboot I have to change it again to 1.5 or it won't boot... And If after all, I succeed to boot, I have to use the computer for about 10 minutes, and it's ok, if I don't, it restarts by itself after some minutes. If I stay on the BIOS, It's all OK, I can stay for a whole year without restarting. I have check my RAM on Memtest (4*8G SDRAM DDR3) : OK I have check without graphic card : Still the same. I tried to reset the bios stack by getting it off and on : Still the same. I tried to reset my BIOS, and many settings about the RAM in the menu : Still the same. CPU temps are just fine (around 35°C) I was thinking ofc about the motherboard but I want to be sure. Motherboard : MSI zh77a-g43 RAM : 4*8G Dual Mode or not (depends on the number I put ofc.) PSU : 600W (enough to run all the config) CPU : i7 3770 non K

    Read the article

  • Cannot resolve Dictionary in Unity container

    - by IanR
    Hi, I've just stumbled upon this: within a Unity container, I want to register IDictionary<TK, TV>; assume that it's IDictionary<string, int> _unityContainer = new UnityContainer() .RegisterType<IDictionary<string, int>, Dictionary<string, int>>(); but if I try var d = _unityContainer.Resolve<IDictionary<string, int>>(); it fails to resolve... I get... Microsoft.Practices.Unity.ResolutionFailedException: Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "System.Collections.Generic.IDictionary`2[System.String,System.Int32]", name = "(none)". Exception occurred while: while resolving. Exception is: InvalidOperationException - The type Dictionary`2 has multiple constructors of length 2. Unable to disambiguate. At the time of the exception, the container was: Resolving System.Collections.Generic.Dictionary2[System.String,System.Int32],(none) (mapped from System.Collections.Generic.IDictionary2[System.String,System.Int32], (none)) --- System.InvalidOperationException: The type Dictionary`2 has multiple constructors of length 2. Unable to disambiguate.. So it looks like it has found the Type to resolve (being Dictionary<string, int>) but failed to new it up... How come unity can't resolve this type? If I type IDictionary<string, int> d = new Dictionary<string, int>() that works... any ideas? thanks!

    Read the article

  • forcing a child component to resize itself larger than its container

    - by Josh
    I am creating a component that displays a variable amount of "gauges" (square tiles of content if you will), that is laid out like so: <HDividedBox id="container"> <VBox id="myComponent"> <HBox id="header"> ...header content... </HBox> <Tile id="body"> ...gauges are added to the body... </Tile> </Vbox> </HDividedBox> The body Tile has a horizontal direction. When I drag the HDividedBox to make myComponent smaller, the body component will get smaller as well, and eventually if there are too many gauges to fit horizontally, they will be bumped to the next row, and thus the smaller I make myComponent, the number of vertically stacked gauges grows. This is all well and good. The problem is, no matter what combination of settings I use, I absolutely cannot get the body (a Tile) to size itself beyond the size of myComponent, which would ideally cause myComponent to scroll vertically. Even setting the maxHeight of the body to some huge value, it will never size itself larger than it's container. Any ideas on how to accomplish this? Thanks

    Read the article

  • How to fix the endless printing loop bug in Nevrona Rave

    - by Sean B. Durkin
    Nevrona Designs' Rave Reports is a Report Engine for use by Embarcadero's Delphi IDE. This is what I call the Rave Endless Loop bug. In Rave Reports version 6.5.0 (VCL10) that comes bundled with Delphi 2006, there is a nortorious bug that plagues many Rave report developers. If you have a non-empty dataset, and the data rows for this dataset fit exactly into a page (that is to say there are zero widow rows), then upon PrintPreview, Rave will get stuck in an infinite loop generating pages. This problem has been previously reported in this newsgroup under the following headings: "error: generating infinite pages"; Hugo Hiram 20/9/2006 8:44PM "Rave loop bug. Please help"; Tomas Lazar 11/07/2006 7:35PM "Loop on full page of data?"; Tony Chistiansen 23/12/2004 3:41PM reply to (3) by another complainant; Oliver Piche "Endless lopp print bug"; Richso 9/11/2004 4:44PM In each of these postings, there was no response from Nevrona, and no solution was reported. Possibly, the problem has also been reported on an allied newsgroup (nevrona.public.rave.reports.general), to wit: 6. "Continuously generating report"; Jobard 20/11/2005 Although it is not clear to me if (6) is the Rave Endless loop bug or another problem. This posting did get a reply from Nevrona, but it was more in relation to multiple regions ("There is a problem when using multiple regions that go over a page-break.") than the problem of zero widows.

    Read the article

  • Is "map" a loop?

    - by DVK
    While answering this question, I came to realize that I was not sure whether Perl's map can be considered a loop or not? On one hand, it quacks/walks like a loop (does O(n) work, can be easily re-written by an equivalent loop, and sort of fits the common definition = "a sequence of instructions that is continually repeated"). On the other hand, map is not usually listed among Perl's control structures, of which loops are a subset of. E.g. http://en.wikipedia.org/wiki/Perl_control_structures#Loops So, what i'm looking for is a formal reason to be convinced of one side vs. the other. So far, the former (it is a loop) sounds a lot more convincing to me, but I'm bothered by the fact that I never saw "map" mentioned in a list of Perl loops.

    Read the article

  • Asynchronous Request make for-Loop waiting for didFinishLoading

    - by rdesign
    Hey guys, I have a asynchronous url request within a for loop. This loop is called 20 times, each time one parameter of the webaddress is changed. Everytime the didFinishLoading method is called I want to hand over the data of this specific webadress. The problem now is that when I run the for loop, the didFinishLoading method is not called, only at the end. Any suggenstions on how to make the loop wait for complete loading the data for the specific URL? Thanks a lot.

    Read the article

  • writing to a dataframe from a for-loop in R

    - by CCID
    I'm trying to write from a loop to a data frame in R, for example a loop like this for (i in 1:20) { print(c(i+i,i*i,i/1))} and to write each line of 3 values to a data frame with three columns, so that each iteration takes on a new row. I've tried using matrix, with ncol=3 and filled by rows, but only get the last item from the loop. Thanks.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >