I have a folder full of *.command files on my OS X workstation.
(For those that don't know, *.command files are just shell scripts that launch and run in a dedicated Terminal window).
I've dragged this folder onto my Dock to use a "stack" so I can access and launch these scripts conveniently via a couple clicks.
I want to add a new ...
Hi, I've got a list of 100 websites in CSV format. All of the sites have the same general format, including a large table with 7 columns. I wrote this script to extract the data from the 7th column of each of the websites and then write this data to file. The script below partially works, however: opening the output file (after running ...
I am currently developing a piece of monitoring software that takes an input file of server names and ip addresses and creates a rudimentary database of information. I want to default some values as it processes the config file and it works fine for the first time round the loop but any subsequent entries get created with weird (well wei...
I'm trying to add borders to the middle column in a three column row. This:
var subcount = $j('#sub > div').size();
Gives me 6, and I'm trying to figure out how to apply a style to the divs in the middle? (in this case, div 2 and div 5)
<div id="sub">
<div>div 1</div> <div>div 2</div> <div>div3</div>
<div>div 4</div> <div>div 5</div...
Is there any way of finding out the start of a loop in a link list using not more than two pointers?
I do not want to visit every node and mark it seen and reporting the first node already been seen.Is there any other way to do this?
...
I'm sure this is simple, but I'm a noob, so I'm not sure how to achieve this... Basically, I have 3 separate divs with 3 separate WP loops. I want to create a script to assign certain the "next post" & "previous post" links to refresh within the div, while the other links would behave normally. This would be easier with a normal site, bu...
I have a string which consists of different fields. So what I want to do is get the different text and assign each of them into a field.
ex: Hello Allan IBM
so what I want to do is:
put these three words in different strings like
string Greeting = "Hello"
string Name = "Allan"
string Company = "IBM"
//all of it happening in a loop.
...
I have this for-each-loop:
for (Component c : container.getComponents()) {
// Loop code
}
Is getComponents called on every iteration? Does it make sense to call getComponents before the look and only work on a cached array?
...
I'm familiar with the problem of modifying a collection while looping over it with a foreach loop (i.e. "System.InvalidOperationException: Collection was modified"). However, it doesn't make sense to me that when I use Linq to create a List of keys to delete from a dictionary, then loop over my new List, I get the same exception.
Code ...
Hi, I'm trying to figure out how to apply a for-loop to this script and I'm having a lot of trouble. I want to iterate through a list of subdomains which are stored in csv format (ie: one column with 20 subdomains) and print the html for each. They all have the same SourceDomain. Thanks!
#Python 2.6
from selenium import selenium
impo...
On my project there're various search results of different content-types. For unimportant reasons, not all content-types carry a unique ID. However, I tried to write this loop that will detect IDless content-types, and will give them a unique ID.
Basically, the results look like this:
Category ID 3
Category ID 3
Category ID 4
NON-ID C...
Hi!
I have a multidimensional array like this:
array(2) {
[1]=>
array(3) {
["eventID"]=>
string(1) "1"
["eventTitle"]=>
string(7) "EVENT 1"
["artists"]=>
array(3) {
[4]=>
array(2) {
["name"]=>
string(8) "ARTIST 1"
["description"]=>
string(13) "artist 1 desc"
...
Hello,
I have a foreach loop that is suppose to check to see if a checkbox is checked by an item. If the checkbox is checked I need to see if the file upload part of the script has a value and if so then proceed to check the file type and size of the file the user is trying to upload.
Currently if there is only an error with the firs...
I've been trying to assign a function to onclick event of a dynamically created "a" tag in JavaScript. All of the tags are created in a loop as follows:
for ( var i = 0; i < 4; i++ )
{
var a = document.createElement( "a" );
a.onclick = function( ) { alert( i ) };
document.getElementById( "foo" ).appendChild( a );
}
The alerted v...
How do you properly write a double for loop in R?
For example, in C I would do
int i, j;
for (i = 1; i < 6; i++) {
for (j=i; j <= 3; j++) {
printf("%i,%i\n",i,j);
}
// Do more operations for i > 3...
}
which would generate the (artificial) sequence:
1,1
1,2
1,3
2,2
2,3
3,3
In R you do not get the same behaviour...
I was wondering whether it is possible to use the lapply() function to alter the value of the input, similar to:
a1<-runif(100)
a2<-function(i){
a1[i]<-a1[i-1]*a1[i];a1[i]
}
a3<-lapply(2:100,a2)
I'm looking for something akin to a for() loop, but using the lapply() infrastructure. I haven't been able to get rapply() to do this.
The r...
Hello
Does anyone know what Join algorith does LINQ performs with its Join operator.
Is it NestedLoop, Merge, or HashSet? Is there any way to specify a different one, if supported?
Regards
Albert
...
I want to write a C function that will print 1 to N one per each line on the stdout where N is a int parameter to the function. The function should not use while, for, do-while loops, goto statement, recursion, and switch statement. Is it possible? I want to find an answer to this as this a challenge question
...
The below program seems to be crashing at the very end each time, and I'm assuming that this is because once I get to i = (size-1) then wordList[i+1] won't return anything, returns null, or something equivalent. Any way around this? Am I correct that this is the source of my problem?
#include <iostream>
#include <string>
#include <vecto...
code:
c = 0
items.each { |i|
puts i.to_s
# if c > 9 escape the each iteration early - and do not repeat
c++
}
I want to grab the first 10 items then leave the "each" loop.
What do I replace the commented line with? is there a better approach? something more Ruby idiomatic?
...