swap

get thumbnail image swap to fade

hello everyone, I'm just getting to throwing myself into the javascript, jQuery pool and have found some possible alternative solutions but I wanted to see if there was a way I could acheive fadeIn/fadeOut with the existing javascript I am using. right now it is thumbnails that switch images in a main area onclick (actual site is onmo...

Staying away from virtual memory in Windows\C++

I'm writing a performance critical application where its essential to store as much data as possible in the physical memory before dumping to disc. I can use ::GlobalMemoryStatusEx(...) and ::GetProcessMemoryInfo(...) to find out what percentage of physical memory is reserved\free and how much memory my current process handles. Using ...

CSS based banner image swap triggered by text mouseover

I'm looking to replace an image background on a banner above my navigation bar with a specific image for each menu item when the user rolls over the menu text. I want it so that each menu item causes the banner to swap the background for an image related to the text of each menu item, and only use CSS.. not javascript. This seems like ...

Why the swap program which collects addresses in pointers to pointers did not work ?

I have a program below void swap(char **s1,char **s2); int main() { char *list[] = { "Das", "Kannan", "Rajendran", "Shahul" }; printf("Before swap list[0] = %s,list[1] = %s\n",*list[0],*list[1]); swap(&list[0],&list[1]); printf("After swap list[0] = %s,list[1] = %s\n",*list[0],*list[1]); retur...

Switch pointers in a function in the C programming language

How do you switch pointers in a function? void ChangePointers(int *p_intP1, int *p_intP2); int main() { int i = 100, j = 500; int *intP1, *intP2; /* pointers */ intP1 = &i; intP2 = &j; printf("%d\n", *intP1); /* prints 100 (i) */ printf("%d\n", *intP2); /* prints 500 (j) */ ChangePointers(intP1, intP2); printf("%d\n", *intP1); /* ...

How to swap filenames in Unix?

Any way to do this quickly without using a temp variable? Is there a built in function? Edit: Thanks for the answers guys. Looks like I need to clarify my question but for the most part you guys assumed correctly: There are two files and the filenames names are reversed. File A has name B-name.file File B has name A-name.file I'd l...

Benefits of a swap function?

Browsing through some C++ questions I have often seen comments that a STL-friendly class should implement a swap function (usually as a friend.) Can someone explain what benefits this brings, how the STL fits into this and why this function should be implemented as a friend? ...

Stepping through all permutations one swap at a time

Given a list of n distinct items, how can I step through each permutation of the items swapping just one pair of values at a time? (I assume it is possible, it certainly feels like it should be.) What I'm looking for is an iterator that yields the indices of the next pair of items to swap, such that if iterated n!-1 times it will step t...

What are the exact conditions based on which Linux swaps process(s) memory from RAM to a swap file?

My server has 8Gigs of RAM and 8Gigs configured for swap file. I have memory intensive apps running. These apps have peak loads during which we find swap usage increase. Approximately 1 GIG of swap is used. I have another server with 4Gigs of RAM and 8 Gigs of swap and similar memory intensive apps running on it. But here swap usage i...

whats the easiest way to exchange row HTML in table via jquery (not drag and drop)

what's the easiest way in jquery to take the entire html for a (including the tr itself, not tr innerhtml) and swap it with another one? i'm kinda messing around with replaceWith, but that's swapping the innerHtml and i want to swap the whole TR html. seems like it should be an easy task for jquery. i'm thinking there's gotta be a wa...

swap or move DOM elements with jQuery through different containers

Hi, guys, I have the next HTML: <div id="Dummy" class="video"> <div class="videoDummy">Video Dummy</div> </div> <div class="bd"> <ul class="items"> <li class="video"> <a href="#" class="launch-video vid_{{VAR:vid_contentId}}"> {{module:video_imagethumbnail/contentId={VAR:contentId}}·clippingWidth=68}} </a...

Swap two items in List<T>

Is there a LINQ way to swap the position of two items inside a list<T>? ...

How do the Linux kernel swap the file mapped page?

I use file mapping to read a 20 GB file. And when the main memory is exhausted, how is the kernel swapping the file mapped pages to the disk? A possible way I guess is to set the page entry to NULL. Then next time if the page is accessed, the do_no_page() function will be called again to map the file to memory. Is it right? Another qu...

Swap method with const members

Hi everyone! I want to implement a Swap() method for my class (let's call it A) to make copy-and-swap operator=(). As far as I know, swap method should be implemented by swapping all members of the class, for example: class A { public: void swap(A& rhv) { std::swap(x, rhv.x); std::swap(y, rhv.y); std:...

Overloading global swap for user-defined type

The C++ standard prohibits declaring types or defining anything in namespace std, but it does allow you to specialize standard STL templates for user-defined types. Usually, when I want to specialize std::swap for my own custom templated type, I just do: namespace std { template <class T> void swap(MyType<T>& t1, MyType<T>& t2) {...

How do you flip an equation (exchange LHS with RHS) in Maple?

I have an equation which has been reduced to the form eqn1 := f(x,y,z) = T; Now I have another equation that involves T as a variable eqn2 := g(T,x,y,z); I want to replace T with f(x) in eqn2. If I had eqn1 in the form eqn1better := T = f(x,y,z); Then the following command would do what I want. algsubs(eqn1better, eqn2); So ...

Portable c++ atomic swap (Windows - GNU/Linux - MacOSX)

Hi, Is there free a portable (Windows, GNU/Linux & MacOSX) library providing a lock-free atomic swap function? If not, how would it be implemented for each of these platforms? (x86 with VC++ or g++) Thanks ...

Does std::vector call the swap function when growing? Always or only for some types?

As far as I know I can use a vector of vectors (std::vector< std::vector >) and this will be quite efficient, because internally the elements will not be copied, but swapped, which is much faster, because does not include coping of the memory buffers. Am I right? When does std::vector exactly make use of the swap function? I can't find ...

How does OS handle a python dict that's larger than memory?

I have a python program that is going to eat a lot of memory, primarily in a dict. This dict will be responsible for assigning a unique integer value to a very large set of keys. As I am working with large matrices, I need a key-to-index correspondence that can also be recovered from (i.e., once matrix computations are complete, I need...

best algorithm for swapping?

i have heard from a friend of mine that the best algorithm for swapping is " (a^=b^=a^=b)" where a and b are two integers to be swapped. but when i applied this using c language it resulted in crashing. can anyone of you fine people explain the possible reason for that? please suggest the best algorithm for swapping. thank you!!!! guys ...