I would like to create a simple filter for VirtualDub application. The filter had to invert colors on image. How to create a simple loop, which would invert the colors for each pixel?
Hey,
I want to use a method of an object.
Like $myObject->helloWorld().
However there are a couple of methods so I loop through an array of method names and call the method like this:
my $methodName ="helloWorld";
$myObject->$methodNames;
This works quite nice but some objects don't have all methods.
How can I tell whether $myObject has a method called helloWorld or not?
can you get the last or newly added element in std::set? for example say if the loop runs to collect the elements to fill in the std::set.
if on the first run the set was,
[0] "A"
[1] "B"
[2] "D"
and, on second run, the set becomes
[0] "A"
[1] "B"
[2] "C"
[3] "D"
How would you check if 'C' is the new element that was added?
I two sets of k-dimensional vectors, where k is around 500 and the number of vectors is usually smaller. I want to compute the (arbitrarily defined) minimal distance between the two sets.
A naive approach would be this:
(loop for a in set1
for b in set2
minimizing (distance a b))
However, this requires O(n² * distance) computations. Is there a faster way of doing this?
I'm just wondering if it would be possible (and legal) to port an Android app to desktop?
I'm creating an android game that would work well on PC too (even with the cellphone like layout) and was thinking that maybe I could 'embed' an android emulator with an installer or would that process be a bit hard for a novice Java coder?
Hi
This is a doubt on mysql select query
let me axplain my doubt with a simple example
consider this is my query
SELECT dbCountry from tableCountry
tableCountry has fields dbCuntryId dbCountry and dbState
I have the result as
dbCountry
india
america
england
kenya
pakisthan
I need the result as
1 india
2 america
3 england
4 kenya
5 pakisthan
the numbers 12345 must be generated with the increase in data and itis not a autoincrement id
How can i get it
is it something like loop
Haven't seen this before so hopefully someone has a easy solve, I have a 3 feature panel divs side by side, what I want happen is the 1st panel has a "hover" class added so I can change the background etc and then on a timed interval the hover class jumps to the next panel then the next panel then back to the start on a loop.
Also on a side note can you keep the code in mind to be able to add more then 3 feature divs so you could have for example 6 or more or less etc.
I have a text file containing a number of records. Each record is stored on a single line that is 100 characters long.
Let's say I want to directly access the nth record. I could do it using a for loop, reading in n lines until I get to the record.
But how could I access it directly?
Hey Guys,
I am wokring on a dialog, where in execution I want to round up all items that have a specific attribute and place an attribute value of their's into a comma delited list.
This is as far as I have gotten, which isnt far.
buttons: {
'Hook': function(){
$('.grid_pic:has(border=3)').(loop through id's, grab src, build variable with srcs comma delimeited)
}
Any ideas?
I need to get some children elements and loop over them using inline javascript for a onmouseover event. When I try to use this.getElementsByName I'm getting an error that the object does not support this property. I was under the impression that getElementsByName work for element objects which I thought 'this' would be considered. Anyone have any other ideas on how I can achieve this?
I'm creating a game and I create sprites(enemies). I keep creating and destroying sprites. Flash/Flex has a garbage collector which handles the destruction of unused resources. Should I create an object pool to reuse them, or should I leave flash/flex to handle the creation/destruction of objects?
Which option is better from the performance point of view?
Hi -
In my shell script, I am trying to search using terms found in a $sourcefile against the same $targetfile over and over.
My $sourcefile is formatted as such:
pattern1
pattern2
etc...
The inefficient loop I have to search with is:
for line in $(< $sourcefile);do
fgrep $line $targetfile | fgrep "RID" >> $outputfile
done
I understand it would be possible to improve this by either loading the whole $targetfile into memory, or perhaps by using AWK?
Thanks
I'm trying to log URLs that access broken images, using an HTTP module to catch those images when accessed.
How do you retrieve the URL where that image sits on? is there a way to do it the other way round too? That is, loop through images served in a URL and decide which ones are broken.
This is all in ASP.NET with C#.
I'm looking for a way for a function to take actions based on how long it has been executing. For example, my function would loop continuously until 5 seconds has elapsed, in which case it returns immediately. Any suggestions?
hi all
i am new in the field of iphone development ....
i am working on a game in which when user touch on a image then a nib file must be pop up on the scree and i am unable to do that..
please help provide some sample code or any kind of help
thanks in advance
Hello,
What is the fastes way to add string prefixes to array keys?
was
$array = array(
'1' => 'val1',
'2' => 'val2',
);
needed
$array = array(
'prefix1' => 'val1',
'prefix2' => 'val2',
);
According to http://www.phpbench.com/ (see Modify Loop) I should use "for" statement, but probably there is more elegant way?
Thank you.
in R , when i use "print", i can see all the values, but how can i save this as a vector
for example, in for loop,
for (i in 1:10), i want the value of A , when i= 1,2,3,4..... but if i use the x=A, it only have the final value of A which is the value when i = 10. so , how can i save the vaule in print(A)
Click here to see a simple example of what I want. It's really easy, but for some reason Google won't display it.
It's part of a foreach loop, if needed I can add other codes.
There is nothing else in the rest of the css to mess with this, I have checked about 10 times.
Thanks.
Question:
I want to loop over all open tabs in Internet Exporer (for all open IE windows) and save the URL in a text file. How can I do that ? I have windows 7 32 bit and IE 8.
Code for Firefox/Google chrome would also be welcome.
I'm making a speed game in VB.Net (Console Application) and users have a certain time to press a certain key. So how can I give the Console.ReadKey function a timeout without just waiting until a key was pressed?
What is the easiest way to take an objects and convert any of its values from null to string.empty ?
I was thinking about a routine that I can pass in any object, but I am not sure how to loop through all the values.
Hello all ,
I have a string like "SAB_bARGS_D" . What I want is that the string gets divided into list of characters but whenever there is a _ sign the next character gets appended to the previous one.
So the answer to above should be ['S','A','B_b','A','R','G','S_D']
It can be done by using a for loop traversing through the list but is there an inbuilt function that I can use.....
Thanks a lot
Instead of making a macro for each letter, as in
\def\bA{\mathbf{A}}
...
\def\bZ{\mathbf{Z}}
Is there a way to loop over a character class (like capital letters) and generate macros for each? I'd also like to do the same for Greek letters (using bm instead of mathbf).