Hello,
I am experimenting with jQuery lately, and I was wondering if it's possible with js or pure jquery to reorder <li> elements. So if I have a silly list like the following:
<ul>
<li>Foo</li>
<li>Bar</li>
<li>Cheese</li>
</ul>
How would I move the list elements around? Like put the list element with Cheese before the list element with Foo or move Foo to after Bar.
So is it possible?
If so, how?
Thanks!!
I had a piece of code which uses windows SHFileOperation function with FO_MOVE operation. Additional flags specified were FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT.
A particular weird behavior was observed when the destination drive was full. In this case, MOVE could not place the file in destination folder but the source file was also lost. This was highly unexpected and this caused a loss of data.
Is this the standard behavior of SHFileOperation?
Can we have something like MOVE if the destination drive has space otherwise leave the file at the original place?
Hi,
I am trying to use the jquery bubble popup inside the jquery carousel. the problem everything works fine. but say if i have 10 items in the carousel, display 5 at a time, hiding the remaining 5 items(which could be opened by clicking the left or right navigation). so when we move the mouse over each carousel item that is visible on the screen, we can see the bubble popup.
here, if i move the mouse over the empty area on the screen, i am still getting the bubble pop which shouldnt be visible because that particular carousel item is hidden.if i keep on moving over all the hidden items, i am able to see the bubble popup.
is there anyway to hide the bubble pop when the carousel item is not visible on the screen.
Hello,
In my view I have a toolbar with a button at the top and a table view underneath, like in the following picture:
An you can see there are text fields in the cells of the table view.
The problem appears when I want to edit the tet fields which are in the bottom of the table view. As you can imagine the keyboard overlaps the text fields. Let say I want to edit the fields in the C section, the result is following:
I tried different approaches for moving the table view, but I always end up with the toolbar being hidden. In one cae the toolbar was moving up with together with the table view, in the second case the table view overlaps the toolbar:
All the ideas how to move the table view to make the cell being edited visible together with having the toolbar visible?
How to move/resize the table view?
Thanks!
ive created a single user dungeon which i would like to create into a multi user dungoen so at least two plays can play how would i do that what code do i need to add can anyone help?
i would show coding but if i do then everyone would see it and all my work will be copied as i know other students do use this site to so plz understand my situation and yes this is a homework/assignment work.
I have this method:
public static int what(String str, char start, char end)
{
int count=0;
for(int i=0;i<str.length(); i++) {
if(str.charAt(i) == start)
{
for(int j=i+1;j<str.length(); j++)
{
if(str.charAt(j) == end)
count++;
}
}
}
return count;
}
What I need to find is:
1) What is it doing? Answer: counting the total number of end occurrences after EACH (or is it? Not specified in the assignment, point 3 depends on this) start.
2) What is its complexity? Answer: the first loops iterates over the string completely, so it's at least O(n), the second loop executes only if start char is found and even then partially (index at which start was found + 1). Although, big O is all about worst case no? So in the worst case, start is the 1st char & the inner iteration iterates over the string n-1 times, the -1 is a constant so it's n. But, the inner loop won't be executed every outer iteration pass, statistically, but since big O is about worst case, is it correct to say the complexity of it is O(n^2)? Ignoring any constants and the fact that in 99.99% of times the inner loop won't execute every outer loop pass.
3) Rewrite it so that complexity is lower.
What I'm not sure of is whether start occurs at most once or more, if once at most, then method can be rewritten using one loop (having a flag indicating whether start has been encountered and from there on incrementing count at each end occurrence), yielding a complexity of O(n).
In case though, that start can appear multiple times, which most likely it is, because assignment is of a Java course and I don't think they would make such ambiguity.
Solving, in this case, is not possible using one loop... WAIT! Yes it is..!
Just have a variable, say, inc to be incremented each time start is encountered & used to increment count each time end is encountered after the 1st start was found:
inc = 0, count = 0
if (current char == start) inc++
if (inc > 0 && current char == end) count += inc
This would also yield a complexity of O(n)? Because there is only 1 loop.
Yes I realize I wrote a lot hehe, but what I also realized is that I understand a lot better by forming my thoughts into words...
select @[email protected]('*')
for xml raw,type
Above statement will generate following alert:
Msg 6819, Level 16, State 3, Line 2
The FOR XML clause is not allowed in a ASSIGNMENT statement.
I need help making this loop to move a label move smoothly across the screen using count for the animation (its required). The labels location is currently in location 0,0 I'd like to make it go in a square right - down - left - back to its original position
how can I accomplish this ? please give me an example using my code below. Thank You in advance.
private void xAnimeTimer_Tick(object sender, EventArgs e)
{
int count;
this.xAnimTimer.Stop();
for (count = 0; count <= 100; count++)
{
this.xAnimLabel.Left = count;
}
for (count = 0; count <= 150; count++)
{
this.xAnimLabel.Top = count;
}
I want to replace new lines in text with coma or space but do not change the last new line.
I know of this question: How to replace new lines with tab characters - but it does produce an tab on end instead of new line.
So far I have come with:
awk 'NR>1{printf","} {printf $1} END{printf"\n"}'
Is there an easier way to do this? This is not an assignment, I am just curious want to level up my scripting.
Hi can anyone help me with a problem please. I am not looking for anybody to write code for me but just give me a few pointers.
I want to to put a frame or border around an image in actionscript3. I want to use an image that is considerably bigger than the border. the effect would be that the image would move around but only show what is inside the border. similar to looking through a keyhole ?? my best effort was to do a reverse mask, where the mask did not move but without success.
If anyone has any idea's I would be very grateful
Thanks
So this question:Warning-used as the name of the previous parameter rather than as part of the selector
answers part of my problem, but I really don't want anything to change inside this method and I'm a bit confused on how this works. Here's the whole method:
-(void) SetRightWrong:(sqzWord *)word: (int) rightWrong
{
if (self.mastered==nil) {
self.mastered = [[NSMutableArray alloc]initWithCapacity:10];
}
//if right change number right
if (rightWrong == 1) {
word.numberCorrect++;
//if 3 right move to masterd list
[self.onDeck removeObject:word];
if(word.numberCorrect >= 3 )
{
[self.mastered addObject:word];
}
else
{
//if not 3 right move to end of ondeck
[self.onDeck addObject:word];
}
}
else if(rightWrong == 0)
{
//if wrong remove one from number right unless 0
NSUInteger i;
i=[self.onDeck indexOfObject:word];
word = [self.onDeck objectAtIndex:i];
if (word.numberCorrect >0) {
word.numberCorrect--;
}
}
}
The warning I am getting is: 'word' used as the name of the previous parameter than as part of the selector.
I'm just diving into ruby development for a class assignment and the machines at my Uni have only got ruby 1.8.7 on them so I need to develop for that. I have found tutorials on the web for ruby = 1.9 and rspec that are really good but I haven't found anything for ruby 1.8.7 (I'm guessing it's pretty dated?). Does anyone have anything using rspec testing and has an indepth discussion on ruby 1.8.7 for me? I'd really appreciate it!
Thanks!
What's going on when the assignment statement executed at Line 4, does compiler ignore the new operator and keep the foo variable being null or something else happen to handle this awkward moment?
public class Foo {
// creating an instance before its constructor has been invoked, suppose the "initializing"
// gets printed in constructor as a result of the next line, of course it will not print it
private Foo foo = new Foo();//Line 4
public Foo() {
System.out.println("initializing");
}
}
I'm working on a class assignment that involves reading an XML document and inserting the contents into a database. Language choice is wide open - so I figure, why not consider all my options!
What languages are able and appropriate for the reading of XML?
Yes this is a homework/lab assignment.
I am interesting in coming up with/finding an algorithm (I can comprehend :P) for using "backtracking" to solve the subset sum problem.
Anyone have some helpful resources? I've spent the last hour or so Googling with not much like finding something I think I could actually use. xD
Thanks SO!
How can I remove these warnings?
char foo[10];
int k;
for (k = 0; foo[k] != NULL; k++) //comparison between pointer and integer
msg2[k] = NULL; //assignment makes integer from pointer without a cast
Thanks.
I need help making this loop to move a label move smoothly across the screen using count for the animation (its required). The labels location is currently in location 0,0 I'd like to make it go in a square right - down - left - back to its original position
how can I accomplish this ? please give me an example using my code below. Thank You in advance.
private void xAnimeTimer_Tick(object sender, EventArgs e)
{
int count;
this.xAnimTimer.Stop();
for (count = 0; count <= 100; count++)
{
this.xAnimLabel.Left = count;
}
for (count = 0; count <= 150; count++)
{
this.xAnimLabel.Top = count;
}
I have a neat little jQuery script I am working on.
Goal: parent div with overflow hidden holds a larger div with image. When I move the mouse to the left or right of the parent div, the div with image changes margin-left to move left or right. Problem is... if I move the mouse out of the parent div (left or right), the image keeps going. I need the image to stop when the mouse is not on the inside left or right edge of the parent div. Any ideas?
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
//<![CDATA[
jQuery.noConflict ();
jQuery(document).ready(function(){
jQuery('#container').mousemove(function(e){
var parentWidth = jQuery('#container').width();
var parentWidthLeft = Math.round(.1 * jQuery('#container').width());
var parentWidthRight = Math.round(jQuery('#container').width() - parentWidthLeft);
var parentHeight = jQuery('#container').height();
var parentOffset = jQuery('#container').offset();
var X = Math.round(e.pageX - parentOffset.left);
var Y = Math.round(e.pageY - parentOffset.top);
if (X<parentWidthLeft)
{
jQuery('#image').animate({'left': '-' + parentWidth }, 5000);
}
if (X>parentWidthRight)
{
jQuery('#image').animate({'left': parentWidth }, 5000);
}
if (X<=parentWidthRight && X>=parentWidthLeft)
{
jQuery('#image').stop();
}
if (X<1)
{
jQuery('#image').stop();
}
});
jQuery('#container').mouseleave(function(){
jQuery('#image').stop();
});
});
// ]]>
</script>
</head>
<body>
<div id="container" style="width: 500px; height: 500px; overflow: hidden; border: 10px solid #000; position: relative; margin: auto auto;">
<div id="image" style="position: absolute; left: 0; top: 0;"><img src="http://dump4free.com/imgdump/1/Carmen-Electra_1wallpaper1024x768.jpg" alt="" /></div>
</div>
</body>
</html>
Few years before, I attended an interview for a company. I was given a programming assignment and I wrote a code which I thought at that time was perfect. But now after 3 years when I look back, I cannot find a more horrible code than that.
Not to indulge in a lengthy subjective argument. But I would like to know what is the worst set of code you've developed/written?
I just finished coding a complex job assignment application where a lot of the work was done using priority queues. When I deployed, however, I discovered the web server ran PHP 5.2.
Has there been an implementation for PHP<5.3 that can server as a drop-in replacement for SPLPriorityQueue?
I have a homework assignment with a number of questions. One is asking why the strcpy() function doesn't need the call by reference operator for CStrings. I've looked through the book numerous times and I can't, for the life of me, find the answer. Can anyone help explain this to me?
It is an array of sorts so I would think you would need the call by reference.
Hello! I have an application on Vista which loops through all processes and finds associated main windows in order to move and resize them.
The problem is that some windows get moved and resized and some don't. Also it even seems that moved and resized windows aren't moved and resized according to the MoveWindow function call because they are resized to title bar and all of them are on the same line (same y coordinate).
Here's the sample code:
IntPtr handle;
Process[] processList = Process.GetProcesses();
int i = 0;
foreach (Process process in processList)
{
handle = process.MainWindowHandle;
if (handle != IntPtr.Zero) //If the process has window then move and resize it.
{
bool moveResult = MoveWindow(handle, i * 50, i * 50, 500, 500, true);
i++;
}
}
Is this because of Vista? What alternative should I use?