swap

html and swf swapping (display html while swf file loads to 100%)

This is what I want to achieve. While the swf file is loading, wrapper div displays an html content (e.g. text content). When the swf file has loaded 100%, it replaces the text content within the wrapper div, and then plays within the wrapper div. When the swf file is finished playing, it is then replaced with the previous text content...

Image Replacement (gallery style) with Fade-In's / Fade-Out's

Hey Everyone, I'm sure you've all seen this demo of image replacement using this : $("#largeImg").attr({ src: largePath, alt: largeAlt }); http://www.webdesignerwall.com/demo/jquery/img-replacement.html So, imagine that I want to change 4 images on the screen to simulate that I am changing the entire 'page' , but avoiding using AJAX...

Unobtrusively swapping HTML by XMLHttpRequest

So, I have received a string of HTML from the server using Javascript. It should be relatively well formed, but each node does not necessarily have a common ancestor. Ex. Response: <li>Item 1</li> <li>Item 2</li> ... The purpose here is to replace HTML currently on the page with the HTML received from the server without requiring an i...

Is it possible to write swap method in Java?

Here is the question: write a method that swaps two variables. These two variables should be primitives. It doesn't need to be generic e.g. two int variables. Is there a way?! ...

Swapping div contents with jQuery

Here's my HTML: <div class="large"> <img src="/images/photos/Interior.jpg" alt="The interior" style="[...]" /> <div class="caption">The interior</div> </div> <div class="small"> <img src="/images/photos/Bedroom.jpg" alt="Bedroom" style="[A different ...]" /> <div class="caption">A bedroom</div> </div> Upon clicking a d...

Jquery Mouseenter/Mouse Leave image swap

Hey Guys, So I wrote this little bit of code to try out some new way of doing an image swap for purposes of preloading and I am having a bit of trouble. My problem is that I have a container with the images that has some padding and text, but the activation of my rollover only happens when someone rolls over the image, instead of the c...

On-demand paging to allow analysis of large amounts of data

I am working on an analysis tool that reads output from a process and continuously converts this to an internal format. After the "logging phase" is complete, analysis is done on the data. The data is all held in memory. However, due to the fact that all logged information is held in memory, there is a limit on the duration of the loggi...

MySQL status swap for bitwise operators

I am looking for a solution/best practice to do a swap of values for a status flag. The status INT(3) in mysql has a few values, and I'd like to be able to swap the LIVE and NOT_LIVE values around, without interrupting what other bitwise values are in there. If it was a flag field, as in 0 or 1, it is easy: 'status' NOT 'status' I w...

Java Hashmap: Swap two values?

Can I swap the keys of two values of a Hashmap, or do I need to do something clever? Something that would look something like this: Map.Entry<Integer, String> prev = null; for (Map.Entry<Integer, String> entry: collection.entrySet()) { if (prev != null) { if (entry.isBefore(prev)) { entry.swapWith(prev) } } prev = ent...

Can i limit apache+passenger memory usage on server without swap space

Hi, i'm running a rails application with apache+passenger on virtual servers that do not have any swap space configured. The site gets decent amount of traffic with 200K+ daily requests and sometimes the whole system runs out of memory causing odd behaviour on whole system. The question is that is there any way to configure apache or p...

Recently, I need a memory-file swapping algorithm

My boss asked me to find some algorithms or existed libraries. coz our application runs on linux, and it need lots of files, maybe over 5G-20G....but we dont need to load the files at one time, but at anytime when the file is needed. btw, we have maybe over 100-1000 files stored in our drive. However, this application is kinda realtime,...

Swapping Nodes on a single linked list

Trying to make a swapNode function that can take any two nodes and swap them. I've made an algorithm that works if they're at least 2 nodes away, but I can't seem to come up with an algorithm that will work if they are closer to each other. Here's what I wrote so far: void swapNode(call * &head, call * &first, call * &second){ call...

Calculating % memory used on Linux

Linux noob question: If I have 500MB of RAM, and 500MB of swap space, can the OS and processes then use 1GB of memory? In other words, is the total amount of memory available to programs and the OS the total of the physical memory size and swap size? I'm trying to figure out which SNMP counters to query, but need to understand how L...

Swap columns from two sql server tables

I would like to know if there is anyway I can compare two columns in SQL Server. The two columns are located in two different tables. When the column 1's value is smaller than the column 2's value: I want to replace the value of the column 1 with the value of the column 2. ...

Using pointers to swap int array values.

I am supposed to use pointers to swap ints in an array. It compiles with no errors or warnings and runs but does not swap the ints. Any suggestions would be helpful!!! Here is the tester: #import <stdio.h> void swap( int ary[] ); int main( int argc, char*argv[] ) { int ary[] = { 25, 50 }; printf( "The array values are: %i an...

animated swap position of two buttons

I am trying to swap the position of two buttons. my swapping code looks as below. private void exchangeButtons(Button btn1, Button btn2) { // Create the animation set AnimationSet exchangeAnimation = new AnimationSet(true); TranslateAnimation translate = new TranslateAnimation( Animation.RELATIVE_TO_SELF, btn2.getLeft()...

robust string reverse

Hi, I am trying to code a trival interview question of reversing a string. This is my code: #include <string.h> char* rev( char* str) { int i,j,l; l = strlen(str); for(i=0,j=l-1; i<l/2 ; i++, j--) { str[i] = (str[i] + str[j]); str[j] = str[i] - str[j]; str[j] = str[i] - str[j]; } re...

What are the possible ways to exchange data in binary format between windows and solaris?

Hi Everyone, Could someone please help and tell me if there is any possible way to pass a data structure (i.e. binary format) through internet sockets between a program running on Windows and other program running on Unix? Any idea or link to materials that deal with it would be very appreciated. Thanking you in advance for your help, ...

C++ swap problem in inheritance scenario

I want to add swap functionality to two existing C++ classes. One class inherits from the other. I want each classes' instances to only be swappable with instances of the same class. To make it semi-concrete, say I have classes Foo and Bar. Bar inherits from Foo. I define Foo::swap(Foo&) and Bar::swap(Bar&). Bar::swap delegates to ...

Basic image rotation with jQuery

I'd like to test banner (two css background images) and rotate them randomly on each page reload. Is it possible to achieve something like that without using any plugins? I just need to rotate two images, which is basically just swapping css classes randomly on the banner element, on each reload. Many thanks. ...