swap

Using hover to swap images, I don't want to swap images if I'm on '.this_page'...

When I land on the page, another function (not shown, that works fine) sets the class of the appropriate nav to '.this_page' and then I roll over, and the images swap correctly, but when I hover and leave 'img.this_page' it swaps, the second time I do the hover. I don't want it 'img.this_page' to swap. I tried unbinding mouseout, but on ...

How to force programs out of swap file when a resources-intensive batch finishes?

We use employees' desktops for CPU-intensive simulation during the night. Desktops run Windows - usually Windows XP. Employees don't log off, they just lock the desktops, switch off their monitors and go. Every employee has a configuration file which he can edit to specify when he is most likely out of office. When that time comes a bac...

Swap button for image (Jquery)

Hi I have a button and when it's clicked, I want to replace the button with an image. How can I do this in JQuery? Is it possible to replace the background of the image as well? The button itself is within a large div, and I don't want to add another div around the button because it messes up a previous layout. Thanks ...

switching pictures when hovering over a link choice

I am new to this. I am writing in html and I was curious if it is possible to switch to another image when the the link is hovered over. ...

Why the output is not same ??

The output of the fist System.out.println() is not same as the second System.out.println() What may be the reason? public class swapex{ public static int var1, var2; public void badSwap(int var1, int var2){ int temp = var1; this.var1 = var2; this.var2 = temp; System.out.println("var1 " + var1 + "...

Need a function in javascript to swap 2 elements in an array

A program to swap two numbers /* /* Function to swap two numbers. Function takes an argument which is an array of two elements. Function returns a new array containing the same two elements as the argument array but in reverse ord...

Can a memory page be moved by modifying the page table?

Is it possible (on any reasonable OS, preferably Linux) to swap the contents of two memory pages by only modifying the page table and not actually moving any data? The motivation is a dense matrix transpose. If the data were blocked by page size it would be possible to transpose the data within a page (fits in cache) then swap pages to ...

Swap function for a char*

I have the simple function below which swap two characters of an array of characters (s). However, I am getting a "Unhandled exception at 0x01151cd7 in Bla.exe: 0xC0000005: Access violation writing location 0x011557a4." error. The two indexes (left and right) are within the limit of the array. What am I doing wrong? void swap(char* s, i...

Swapping names using indexOf and substring and compareTo

I am having trouble understanding how to use the indexOf() and substring() and compareTo() methods to flip people's first name with their last name in an array. ...

Syntax for specializing function templates

Is there a difference between the following approaches? // approach 1 namespace std { template<> void swap<Foo>(Foo& x, Foo& y) // note the <Foo> { x.swap(y); } } // approach 2 namespace std { template<> void swap(Foo& x, Foo& y) { x.swap(y); } } I stumpled upon this when I tried to s...

jquery fade an element in when a link is clicked and then swap the element when another link is clicked

I have worked out how to fade an element in: Click here to view the page If you click on the heading Posture 1 : Standing Deep Breathing : you will notice the element fades in as it should. If you now click on posture 2 you will see the element fades in below posture 1. I need to be able to swap posture 1 with posture 2. I have a total...

sql server swap data between rows problem

I was asking b4 about swaping query to swap data between rows in same table and i got that qurey ALTER PROCEDURE [dbo].[VehicleReservationsSwap] -- Add the parameters for the stored procedure here (@FirstVehicleID int, @secondVehicleID int, @WhereClause nvarchar(2000)) AS BEGIN Create Table #Te...

C++ : Swapping template class elements of different types?

template< class T1, class T2 > class Pair { T1 first; T2 second; }; I'm being asked to write a swap() method so that the first element becomes the second and the second the first. I have: Pair<T2,T1> swap() { return Pair<T2,T1>(second, first); } But this returns a new object rather than swapping, where I think it needs t...

sql swap primary key values

Hi, is it possible to swap primary key values between two datasets? If so, how would one do that? ...

"How to: Multiple jQuery Image Swap Galleries on the Same Page?" / ASAP

I have multiple image galleries that use the following code (simply view the demo at the following link). However, when one clicks on the thumbnails of one gallery to change the large image preview - all the galleries change automatically to that large preview as well. In short, the question is: "How do I seperate each gallery from ea...

Optimizing Vector elements swaps using CUDA

Hi all, Since I am new to cuda .. I need your kind help I have this long vector, for each group of 24 elements, I need to do the following: for the first 12 elements, the even numbered elements are multiplied by -1, for the second 12 elements, the odd numbered elements are multiplied by -1 then the following swap takes place: Graph: b...

C# Virtual Mode List View Click 1 Selects More Than One Items

I have a list view with virtual mode set to true and other things. It doing ok. But 1) Say there are 25 items and 15 of them are visible, that is to see the rest of 10 items need to scroll down. 2) Before scrolling swap two items, say myItems[0], it must be visible & myItems[20], it must be not visible scroll required. 3) Now select t...

'Bank Switching' Sprites on old NES applications

I'm currently writing in C# what could basically be called my own interpretation of the NES hardware for an old-school looking game that I'm developing. I've fired up FCE and have been observing how the NES displayed and rendered graphics. In a nutshell, the NES could hold two bitmaps worth of graphical information, each with the dimen...

toggling div as well as "expand/collapse" text and image with jquery

Hi - I have a simple piece of jquery i am using to toggle the visibility of a div (below). What I'd like to add is some text and a little plus sign image that changes to different text and a minus sign image after the div is expanded. Here is my code: jQuery $(document).ready(function(){ $(".toggle").click(function(){ $(".hidden...

Clearing Textarea on Blur (jQuery)

// Clearing Textarea $('textarea').focus(function() { var $this = $(this); $.data(this, 'img', $this.css('background-image')); $this.css('background-image', 'none'); }); $('textarea').blur(function() { if($.trim($('textarea').val()).length){ $this.css('background-image', 'none'); } else { $(this).css('ba...