Search Results

Search found 2456 results on 99 pages for 'atomic swap'.

Page 12/99 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Optimizing Vector elements swaps using CUDA

    - by Orion Nebula
    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: because I don't yet have enough points, I couldn't post the image so here it is: http://www.freeimagehosting.net/image.php?e4b88fb666.png I have written this piece of code, and wonder if you could help me further optimize it to solve for divergence or bank conflicts .. //subvector is a multiple of 24, Mds and Nds are shared memory _shared_ double Mds[subVector]; _shared_ double Nds[subVector]; int tx = threadIdx.x; int tx_mod = tx ^ 0x0001; int basex = __umul24(blockDim.x, blockIdx.x); Mds[tx] = M.elements[basex + tx]; __syncthreads(); // flip the signs if (tx < (tx/24)*24 + 12) { //if < 12 and even if ((tx & 0x0001)==0) Mds[tx] = -Mds[tx]; } else if (tx < (tx/24)*24 + 24) { //if >12 and < 24 and odd if ((tx & 0x0001)==1) Mds[tx] = -Mds[tx]; } __syncthreads(); if (tx < (tx/24)*24 + 6) { //for the first 6 elements .. swap with last six in the 24elements group (see graph) Nds[tx] = Mds[tx_mod + 18]; Mds [tx_mod + 18] = Mds [tx]; Mds[tx] = Nds[tx]; } else if (tx < (tx/24)*24 + 12) { // for the second 6 elements .. swp with next adjacent group (see graph) Nds[tx] = Mds[tx_mod + 6]; Mds [tx_mod + 6] = Mds [tx]; Mds[tx] = Nds[tx]; } __syncthreads(); Thanks in advance ..

    Read the article

  • wpf binding by selected value - swap out bound object without disturbing binding

    - by Andy Clarke
    Hi, I've got combo box bound to a custom collection type - its basically an overridden ObservableCollection which I've added a facility to update the underlying collection (via Unity). I don't want to confuse the issue too much, but thats the background. My xaml looks like this <ComboBox ItemsSource="{Binding Manufacturers}" DisplayMemberPath="Name" SelectedValuePath="ID" SelectedValue="{Binding Vehicle.ManufacturerID}" /> And in my overridden collection i was doing this. index = IndexOf(oldItem); Insert(index, (T)newItem); RemoveAt(index + 1); I had hoped because it was bound by value, that inserting the new object(which had the same id) and then removing the old one would work. But it seems that although its bound by SelectedValue it still knows that its being swapped for a different one. The combo just looses its selection. Can anyone help please?

    Read the article

  • SQL Server Gender Swap Query

    - by Sanju
    I have a Table having the following column: ID, Name, Designation, Salary, Contact, Address, Gender Accidentally for all male Gender i have entered 'Female' and similarly for all Female gender i have entered 'Male'. For Exmaple 0023 Scott Developer 15000 4569865 Cliff_Eddington,USA Female I the above line There should be Male instead of female. And there are all Male whose gender has been updated as Female. Same case for all Female Gender has been updated as Male. Is there any Single query through which i can change all the Rows whose Gender is Male Change it to Female and All the Rows whose Gender is Female Change it to Male.

    Read the article

  • Swap CSS class on the basis of Scroll Position with Javascript

    - by Brian
    I'm looking to re-create the Apple Store shopping cart sidebar. http://store.apple.com/us/configure/MB535LL/A?mco=MTA4MTg3NTQ It is similar to "position: fixed" except that it starts out as "position: absolute" with the CSS class "pinned_top" and then switches to CSS class "floating" when a certain scroll-y position is reached. I've looked EVERYWHERE for this, it seems a tutorial should be obvious but I'm yet to find anything. Any help?

    Read the article

  • PHP/MySQL Swap places in database + JavaScript (jQuery)

    - by James Brooks
    I'm currently developing a website which stores bookmarks in a MySQL database using PHP and jQuery. The MySQL for bookmarks looks like this (CSV format): id,userid,link_count,url,title,description,tags,shareid,fav,date "1";"1";"0";"img/test/google.png";"Google";"Best. Search Engine. Ever.";"google, search, engine";"7nbsp";"0";"1267578934" "2";"1";"1";"img/test/james-brooks.png";"jTutorials";"Best. jQuery Tutorials. Ever.";"jquery, jtutorials, tutorials";"8nbsp";"0";"1267578934" "3";"1";"2";"img/test/benokshosting.png";"Benoks Hosting";"Cheap website hosting";"Benoks, Hosting, server, linux, cpanel";"9nbsp;";"0";"1267578934" "4";"1";"3";"img/test/jbrooks.png";"James Brooks";"Personal website FTW!";"james, brooks, jbrooksuk, blog, personal, portfolio";"1nbsp";"0";"1267578934" "6";"1";"4";"img/test/linkbase.png";"LinkBase";"Store and organise your bookmarks and access them from anywhere!";"linkbase, bookmarks, organisation";"3nbsp";"0";"1267578934" "5";"1";"5";"img/test/jtutorials.png";"jTutorials";"jQuery tutorials, videos and examples!";"jquery, jtutorials, tutorials";"2nbsp";"0";"1267578934" I'm using jQuery Sortable to move the bookmarks around (similar to how Google Chrome does). Here is the JavaScript code I use to format the bookmarks and post the data to the PHP page: $(".bookmarks").sortable({scroll: false, update: function(event, ui){ // Update bookmark position in the database when the bookmark is dropped var newItems = $("ul.bookmarks").sortable('toArray'); console.log(newItems); var oldItems = ""; for(var imgI=0;imgI < newItems.length;imgI++) { oldItems += $("ul.bookmarks li#" + imgI + " img").attr("id") + ","; } oldItems = oldItems.slice(0, oldItems.length-1); console.log("New position: " + newItems); console.log("Old position: " + oldItems); // Post the data $.post('inc/updateBookmarks.php', 'update=true&olditems=' + oldItems + "&newitems=" + newItems, function(r) { console.log(r); }); } }); The PHP page then goes about splitting the posted arrays using explode, like so: if(isset($pstUpdate)) { // Get the current and new positions $arrOldItems = $_POST['olditems']; $arrOldItems = explode(",", $arrOldItems); $arrNewItems = $_POST['newitems']; $arrNewItems = explode(",", $arrNewItems); // Get the user id $usrID = $U->user_field('id'); // Update the old place to the new one for($anID=0;$anID<count($arrOldItems);$anID++) { //echo "UPDATE linkz SET link_count='" . $arrNewItems[$anID] . "' WHERE userid='" . $usrID . "' AND link_count='" . $arrOldItems[$anID] . "'\n"; //echo "SELECT id FROM linkz WHERE link_id='".$arrOldItems[$anID]."' AND userid='".$usrID."'"; $curLinkID = mysql_fetch_array(mysql_query("SELECT id FROM linkz WHERE link_count='".$arrOldItems[$anID]."' AND userid='".$usrID."'")) or die(mysql_error()); echo $arrOldItems[$anID] . " => " . $arrNewItems[$anID] . " => " . $curLinkID['id'] . "\n"; //mysql_query("UPDATE linkz SET link_count='" . $arrNewItems[$anID] . "' WHERE userid='" . $usrID . "' AND link_count='" . $curLinkID['id'] . "'") or die(mysql_error()); // Join a string with the new positions $outPos .= $arrNewItems[$anID] . "|"; } echo substr($outPos, 0, strlen($outPost) - 1); } So, each bookmark is given it's own link_count id (which starts from 0 for each user). Every time a bookmark is changed, I need the link_count to be changed as needed. If we take this array output as the starting places: Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 ) Each index equalling the link_count position, the resulting update would become: Array ( [0] => 1 [1] => 0 [2] => 3 [3] => 4 [4] => 5 [5] => 2 ) I have tried many ways but none are successful. Thanks in advance.

    Read the article

  • searching for a programming platform with hot code swap

    - by Andreas
    I'm currently brainstorming over the idea how to upgrade a program while it is running. (Not while debugging, a "production" system.) But one thing that is required for it, is to actually submit the changed source code or compiled byte code into the running process. Pseudo Code var method = typeof(MyClass).GetMethod("Method1"); var content = //get it from a database (bytecode or source code) SELECT content FROM methods WHERE id=? AND version=? method.SetContent(content); At first, I want to achieve the system to work without the complexity of object-orientation. That leads to the following requirements: change source code or byte code of function drop functions add new functions change the signature of a function With .NET (and others) I could inject a class via an IoC and could thus change the source code. But the loading would be cumbersome, because everything has to be in an Assembly or created via Emit. Maybe with Java this would be easier? The whole ClassLoader is replacable, I think. With JavaScript I could achieve many of the goals. Simply eval a new function (MyMethod_V25) and assign it to MyClass.prototype.MyMethod. I think one can also drop functions somehow with "del" Which general-purpose platform can handle such things?

    Read the article

  • Color image swap javascript not working in IE7

    - by Lauren
    To test, you'd have to log in to the example page here: http://www.avaline.com /Drinkware/Sport-Water-Bottles/Monterey-DAB20 From there, the Color drop-down swaps out the right color images in IE8, FF3.6(the latest), Chrome4.1(up to date), but not in IE7. I don't get it...but I'm plugging along trying to debug it with visual studio.

    Read the article

  • Jquery fade and swap an element when clicked which will also relate to an accordian menu

    - by Nik
    You will notice when you click posture 1 the description drops down and images appear on the right. Now when you click posture 2 or posture 3 the images and description change as they should. What I need to do now is - If posture 1 has been clicked and then posture 2 is clicked the posture 1 menu needs to close so that there is only one posture description visible at one time. If I could also make it so that if the current open posture item is clicked so that it closes and there are no open posture descriptions that there also no images displayed on the right. Finally is there a way to make sure only one set of animation images is running, because just say the user goes through all 26 options and they continue to run in the background it may get sluggish (thanks to Nick Craver for bringing that up). At this stage only posture 1, 2 and 3 are available. Ok finally some code - //Description drop-down boxes $(document).ready(function(){ //Hide (Collapse) the toggle containers on load $(".toggle_container").hide(); //Switch the "Open" and "Close" state per click $("h5.trigger").toggle(function(){ $(this).addClass("active"); }, function () { $(this).removeClass("active"); }); //Slide up and down on click $("h5.trigger").click(function(){ $(this).next(".toggle_container").slideToggle("slow"); }); }); //Images on the right fade in and out thanks to aSeptik $(document).ready(function(){ $('#section_Q_01,#section_Q_02,#section_Q_03').hide(); $(function() { $('h5.trigger a').click( function(e) { e.preventDefault(); var trigger_id = $(this).parent().attr('id'); //get id Q_## $('.current').removeClass('current').hide(); //add a class for easy access & hide $('#section_' + trigger_id).addClass('current').fadeIn(5000); //show clicked one }); }); }); //Fading pics $(document).ready(function(){ $('.pics').cycle({ fx: 'fade', speed: 2500 }); }); Description boxes - <h5 class="trigger" id="Q_01" ><a href="#">Posture 1 : Standing Deep Breathing :</a></h5> <div class="toggle_container" > <div class="block"> <span class="sc">Pranayama Series</span> <p class="bold">Benefits:</p> </div> </div> <h5 class="trigger" id="Q_02" ><a href="#">Posture 2 : Half Moon Pose With Hands To Feet Pose :</a></h5> <div class="toggle_container"> <div class="block"> <span class="sc">Ardha Chandrasana with Pada-Hastasana</span> <p class="bold">Benefits:</p> </div> </div> <h5 class="trigger" id="Q_03" ><a href="#">Posture 3 : Awkward Pose :</a></h5> <div class="toggle_container"> <div class="block"> <span class="sc">Utkatasana</span> <p class="bold">Benefits:</p> </div> </div> and the images on the right - <div id="section_Q_01" class="01"> <div class="pics"> <img src="../images/multi/poses/pose1/Pranayama._01.jpg"/> <img src="../images/multi/poses/pose1/Pranayama._02.jpg"/> <img src="../images/multi/poses/pose1/Pranayama._03.jpg"/> </div> </div> <div id="section_Q_02" class="02"> <div class="pics"> <img src="../images/multi/poses/pose2/Half_Moon_Pose_04.jpg" /> <img src="../images/multi/poses/pose2/Backward_Bending_05.jpg" /> <img src="../images/multi/poses/pose2/Hands_to_Feet_Pose_06.jpg" /> </div> </div> <div id="section_Q_03" class="03"> <div class="pics"> <img src="../images/multi/poses/pose3/Awkward_01.jpg" /> <img src="../images/multi/poses/pose3/Awkward_02.jpg" /> <img src="../images/multi/poses/pose3/Awkward_03.jpg" /> </div> </div> It would be a bonus if images faded out when another element is clicked... but not a big deal. Thanks for having a look

    Read the article

  • Swap references at build time in VS

    - by NitroxDM
    I have a project that runs on both .NET and .NET CF. But it uses a 3rd party library that will not run on both. So I end up changing the reference every time the project gets built. Project A - References the 3rd party dll. Project B - References A and runs .NET CF Project C - References A and runs .NET Is there a way to automate it?

    Read the article

  • Swap CSS class on the basis of Scroll Position with Javascript

    - by Alan
    I have followed answer given by CMS in relation to getting a menu to stay in one place on the page whilst you scroll the page as per this original question and it works very well but I also have a number of images on the page where I'm using the jquery fancylink plugin to show an enlarged image on click. The problem is when you then close the fancylink popup and scroll to the top of the page the static DIV then decides to stick to the very top of the page. Any ideas or help would this would be greatly appreciated.

    Read the article

  • Is it possible to swap lines of xml code in soap

    - by John
    I wish to send a request like <v:Envelope xmlns:i="xxx"> <v:Header /> <v:Body> <sendTwoWaySmsMessage xmlns="xxx" id="o0" c:root="1"> <connectionId i:type="d:string">connectionId</connectionId> <twoWaySmsMessage> <message i:type="d:string">love it. It seems to work</message> <mobiles i:type="d:string">345</mobiles> <messageId i:type="d:string">123</messageId> </twoWaySmsMessage> </sendTwoWaySmsMessage> </v:Body> </v:Envelope> what i get is <v:Envelope xmlns:i="xxx"> <v:Header /> <v:Body> <sendTwoWaySmsMessage xmlns="xxx" id="o0" c:root="1"> <twoWaySmsMessage> <message i:type="d:string">love it. It seems to work</message> <mobiles i:type="d:string">345</mobiles> <messageId i:type="d:string">123</messageId> </twoWaySmsMessage> <connectionId i:type="d:string">connectionId</connectionId> </sendTwoWaySmsMessage> </v:Body> </v:Envelope> code is SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE, url); SoapObject message = new SoapObject("", "twoWaySmsMessage"); request.addProperty("connectionId", did); message.addProperty("message", "love it. It seems to work"); message.addProperty("mobiles", "435"); message.addProperty("messageId", "123"); request.addSoapObject(message); request.setProperty(0, "connectionId"); when i use SoapUI with the second with the "connectionId" swaped it seem to work can anyone help. of have ideas. I have looked at just about every ksoap question out there and cant seem to find an answer?

    Read the article

  • swap a div to an embed form when user tweets using the @anywhere function box

    - by Jeff
    I'm using the @anywhere twitter function on the front page of my site (vocabbomb.com) and right now it works great to allow users to tweet straight away. Problem is, when they click tweet, it just reloads the twitter box, empty. I want it to load something new, like a "thank you, now fill in this email form" and show a mailchimp form. Ok so this is the @anywhere code currently working fine: <div id="tbox"></div> <script type="text/javascript"> twttr.anywhere(function (T) { T("#tbox").tweetBox({ height: 100, width: 400, defaultContent: " #vocabbomb", label: "Use the word foo in a tweet:", }); }); </script> So this is fine, and when the user writes a tweet, it just re-displays the twitter box. I understand there is a function that lets you specify stuff after the tweet is made: (example from http://dev.twitter.com/pages/anywhere_tweetbox) <div id="example-ontweet"></div> <script type="text/javascript"> twttr.anywhere(function (T) { T("#example-ontweet").tweetBox({ onTweet : function(plaintext, html) { console.log(plaintext); alert(html); } }); }); </script> Is this the best way to attempt this? Or do I need a function or something that changes what's in the div to something else? I want the mailchimp email form to show up after the tweet. It includes a ton of script and tags and starts like this: <!-- Begin MailChimp Signup Form --> <!--[if IE]> <style type="text/css" media="screen"> #mc_embed_signup fieldset {position: relative;} #mc_embed_signup legend {position: absolute; top: -1em; left: .2em;} </style> <![endif]--> <!--[if IE 7]> <style type="text/css" media="screen"> .mc-field-group {overflow:visible;} </style> <![endif]--> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script> <script type="text/javascript" src="http://downloads.mailchimp.com/js/jquery.validate.js"></script> <script type="text/javascript" src="http://downloads.mailchimp.com/js/jquery.form.js"></script> <div id="mc_embed_signup"> <form action="http://faresharenyc.us1.list-manage.com/subscribe/post?u=106b58b4751a007d826715754&amp;id=2fe6ba4e6a" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" style="font: normal 100% Arial, sans-serif;font-size: 10px;"> ... So my attempt to just require it inside the function didn't work at all: <div id="tbox"></div> <script type="text/javascript"> twttr.anywhere(function (T) { T("#tbox").tweetBox({ height: 100, width: 400, defaultContent: " #vocabbomb", label: "Use the word foo in a tweet:", onTweet: function(plain, html){ <?php require_once('mailchimp.html'); ?> } }); }); </script> Nettuts had a brief discussion here: http://net.tutsplus.com/tutorials/javascript-ajax/using-twitters-anywhere-service-in-6-steps/ I am seeing now that the 'onTweet' function simply adds some text above the twitter box, but doesn't actually replace the entire twitter box. How do I do that? Is it possible? Thanks!

    Read the article

  • swap jquery backgroundColor for background image?

    - by Joel
    A friend gave me a solution that uses this jquery code: .css({ backgroundColor: '#ddd' }) Instead, i'd like to use a background image. How do I change the jquery code to do that? I'm wanting to do something like .css({ backgroundImg: 'images/newsletter-dropdown.jpg' }) Thanks!

    Read the article

  • jQuery Swap Image on Click and if/else

    - by jrutter
    Im stuck, Im setting a variable when someone clicks, then testing with if to see if the variable exists and doing something else. Its a simple script which Im probably overthinking, would love someone's thoughts. $('.view-alternatives-btn').live('click', function() { //$("#nc-alternate-wines").scrollTo(); //$('.nc-remove').toggle(); var showBtn = null; if (showBtn == null) { $('.view-alternatives-btn img').attr("src","../images/wsj_hide_alternatives_btn.gif"); $('#nc-alternate-wines').show(); showBtn = 1; console.log(showBtn); } else if (showBtn == 1) { $('.view-alternatives-btn img').attr("src","../images/wsj_view_alternatives_btn.gif"); $('#nc-alternate-wines').hide(); console.log("this " + showBtn); } return false; });

    Read the article

  • jquery image swap works in one html file but not another

    - by Jon
    I have two header templates for my site. One for the blog section and one for everything else. The below code swaps an image in my nav menu, on hover. It works for one template but not the other. The html code is pretty much identical in both header templates. Please help me!! $(document).ready(function(){ $('.nav-home, .nav-port, .nav-exp, .nav-cont, .nav-blog').hover(function(){ $(this).attr('src','/images/' + $(this).attr('class') + '-hover.gif'); }, function(){ $(this).attr('src','/images/' + $(this).attr('class') + '.gif'); }); });

    Read the article

  • How do I swap triangle icons when doing expanding/collapsing divs with Javascript/CSS

    - by SL
    I have a div that I want to toggle between displaying or not when a user clicks on a piece of text. I have a javascript function that toggles a div on or off. That works fine. What I don't know how to do is to have a triangle that points to the right or down depending on whether the div is open. My HTML looks like this: <a onclick="toggleDiv('myDiv');">Click here to expand or close div</a> <div id="myDiv" style="display:none"> ... </div> How do I add one of those triangles and have it point the right way, ideally with just HTML, Javascript, and CSS? The triangle would appear to the left of the "Click here..." string. Thanks.

    Read the article

  • jQuery .click() .toggle() - change display and swap character

    - by danit
    Here is my jQuery: $('.ask').click(function() { $('.addtitle').slideToggle('fast', function() { // Animation complete. }); }); And my HTML: <p class="ask">+</p> <div class="addtitle"> <p>Give your Idea a great title</p> <form name="input" action="#" method="get"> <input id="title" type="text" name="title" /> <input id="go" type="submit" value="Go" /> </form> </div> I have multiple .ask div's on the page and I only want it to effect the .next() div named .ask rather than all div's named .ask. I also want to .toggle() the '+' character to '-' Can anyone assist?

    Read the article

  • Java Concurrency: CAS vs Locking

    - by Hugo Walker
    Im currently reading the Book Java Concurrency in Practice. In the Chapter 15 they are speaking about the Nonblocking algorithms and the compare-and-swap (CAS) Method. It is written that the CAS perform much better than the Locking Methods. I want to ask the people which already worked with both of this concepts and would like to hear when you are preferring which of these concept? Is it really so much faster? Personally for me the usage of Locks is much clearer and easier to understand and maybe even better to maintain. (Please correct me if I am wrong). Should we really focus creating our concurrent code related on CAS than Locks to get a better performance boost or is sustainability a higher thing? I know there is maybe not a strict rule, when to use what. But I just would like to hear some opinions, experiences with the new concept of CAS.

    Read the article

  • How large should I make root, home, and swap partitions?

    - by starcorn
    Hello, I have a laptop with win7 installed. I have now made a 60gb partition which I want to install ubuntu into. The question I have, before I do the installation, is how large each of the root, swap, and home partition should be? I have read some place that root could be as small as 8GB, but isn't that too small? Since I guess beside ubuntu all the softwares installed will reside there as well? And I think I'm going to set my swap to be 2GB large. My main concern is how large should the root partition should be. I'm mainly going to use ubuntu for programming and browse the web.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >