Search Results

Search found 115 results on 5 pages for 'reversing'.

Page 1/5 | 1 2 3 4 5  | Next Page >

  • Reversing animated sprites

    - by brandon sedgwick
    I have created a sprite sheet of which consists of 6 frames with a character moving legs each frame, now I have coded it so that the animation is running successfully from frame 1 to 6, however I am trying to reverse this so then when it goes from 1 to 6 instead of restarting it go's 6 to 1 in a continuous loop. The coding for current animation is: void SpriteGame::Update(int tickTotal, int tickDelta) { //This is where you manage the state of game objects if ( tickTotal >= this->playerLastFrameChange + 4) { //Four ticks have elapsed since the last frame change this->playerFrame = this->playerFrame + 1; this->playerLastFrameChange = tickTotal; //We've just changed the frame if (this->playerFrame >= this->playerSheetLength) { this->playerFrame = playerLastFrameChange + 4; } //Frame has changed so change the source rectangle this->playerSourceRect->left = this->playerFrame * 64; this->playerSourceRect->top = 0; this->playerSourceRect->right = (this->playerFrame + 1) * 64; this->playerSourceRect->bottom = 64; } } any help please I am using DirectX11 as thats what we are being told to use as its for an win 8 game.

    Read the article

  • Mail Reversing (Opposite of Forwarding)

    - by Duall
    I know mail can be forwarded, e.g. mail I receive will be sent to another account. However, can the reverse be true? That mail can be sent out and be delivered to another account before being sent to it's intended address. For instance: Guy #1 sends an e-mail to Guy #2 Guy #2 gets the e-mail, and passes it on to Guy #3 as well; mail forwarded. Guy #2 sends and e-mail to Guy #1 Guy #3 receives the e-mail on its way out. If this is possible, how would I go about this on an Exhange server 2007? And what would this be called anyways? It can't be mail reversing!

    Read the article

  • Reversing an lvreduce of LVM to original size

    - by praspa
    On a RHEL system that uses LVM 2 with 4K blocks. Have been successful in reducing the LV, but trying to get steps to reverse the operation so that the LV returns to its original size. Using these steps to reduce the LV by 1GB, # umount /foo # e2fsk -f /dev/mylvm/foo # resize2fs /dev/mylvm/foo <Current LV Block count - 1GB/4K> # lvreduce --size <Current # GB - 1GB> /dev/mylvm/foo Then to reverse the reduction # lvextend --size <Original #GB> /dev/mylvm/foo # resize2fs /dev/mylvm/foo The reversal gets close to the orignal size. A 'df -h' reports that it seems to be about ~ 0.1GB shy of the original size. Using these utilities, is there a better procedure to shrink and grow the LV so that the original state can be recovered effectively?

    Read the article

  • Reversing a mod_rewrite rule

    - by KIRA
    I want to redirect accesses from http://www.domain.com/test.php?sub=subdomain&type=cars to http://subdomain.domain.com/cars I already have mod_rewrite rules to do the opposite: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{HTTP_HOST} !^(www)\. [NC] RewriteCond %{HTTP_HOST} ^(.*)\.(.*)\.com [NC] RewriteRule (.*) http://www.%2.com/index.php?route=$1&name=%1 [R=301,L] What changes do I need to make to these rules to redirect requests from the script to the subdomain?

    Read the article

  • Reversing a circular deque without a sentinel

    - by SDLFunTimes
    Hey Stackoverflow I'm working on my homework and I'm trying to reverse a circular-linked deque without a sentinel. Here are my data structures: struct DLink { TYPE value; struct DLink * next; struct DLink * prev; }; struct cirListDeque { int size; struct DLink *back; }; Here's my approach to reversing the deque: void reverseCirListDeque(struct cirListDeque* q) { struct DLink* current; struct DLink* temp; temp = q->back->next; q->back->next = q->back->prev; q->back->prev = temp; current = q->back->next; while(current != q->back->next) { temp = current->next; current->next = current->prev; current->prev = temp; current = current->next; } } However when I run it and put values 1, 2 and 3 on it (TYPE is just a alias for int in this case) and reverse it I get 2, 3, null. Does anyone have any ideas as to what I may be doing wrong? Thanks in advance.

    Read the article

  • Reversing page navigation on PHP

    - by ilnur777
    Can anyone help me with reversing this PHP page navigation? Current script setting shows this format: [0] | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ... 14 • Forward • End But I really need it to reverse for this format: [14] | 13 | 12 | 11| 10 | 9 | 8 | 7 | 6 ... 0 • Back • Start Here is the PHP code: <? $onpage = 10; // on page function page(){ if(empty($_GET["page"])){ $page = 0; } else { if(!is_numeric($_GET["page"])) die("Bad page number!"); $page = $_GET["page"]; } return $page; } function navigation($onpage, $page){ //---------------- $countt = 150; $cnt=$countt; // total amount of entries $rpp=$onpage; // total entries per page $rad=4; // amount of links to show near current page (2 left + 2 right + current page = total 5) $links=$rad*2+1; $pages=ceil($cnt/$rpp); if ($page>0) { echo "<a href=\"?page=0\"><<< Start</a> <font color='#CCCCCC'>•</font> <a href=\"?page=".($page-1)."\">< Back</a> <font color='#CCCCCC'>•</font>"; } $start=$page-$rad; if ($start>$pages-$links) { $start=$pages-$links; } if ($start<0) { $start=0; } $end=$start+$links; if ($end>$pages) { $end=$pages; } for ($i=$start; $i<$end; $i++) { echo " "; if ($i==$page) { echo "["; } else { echo "<a href=\"?page=$i\">"; } echo $i; if ($i==$page) { echo "]"; } else { echo "</a>"; } if ($i!=($end-1)) { echo " <font color='#CCCCCC'>|</font>"; } } if ($pages>$links&&$page<($pages-$rad-1)) { echo " ... <a href=\"?page=".($pages-1)."\">".($pages-1)."</a>"; } if ($page<$pages-1) { echo " <font color='#CCCCCC'>•</font> <a href=\"?page=".($page+1)."\">Forward ></a> <font color='#CCCCCC'>•</font> <a href=\"?page=".($pages-1)."\">End >>></a>"; } } $page = page(); // detect page $navigation = navigation($onpage, $page); // detect navigation ?>

    Read the article

  • Reversing Django URLs With Extra Options

    - by Justin Voss
    Suppose I have a URLconf like below, and 'foo' and 'bar' are valid values for page_slug. urlpatterns = patterns('', (r'^page/(?P<page_slug>.*)/', 'myapp.views.someview'), ) Then, I could reconstruct the URLs using the below, right? >>> from django.core.urlresolvers import reverse >>> reverse('myapp.views.someview', kwargs={'page_slug': 'foo'}) '/page/foo/' >>> reverse('myapp.views.someview', kwargs={'page_slug': 'bar'}) '/page/bar/' But what if I change my URLconf to this? urlpatterns = patterns('', (r'^foo-direct/', 'myapp.views.someview', {'page_slug': 'foo'}), (r'^my-bar-page/', 'myapp.views.someview', {'page_slug': 'bar'}), ) I expected this result: >>> from django.core.urlresolvers import reverse >>> reverse('myapp.views.someview', kwargs={'page_slug': 'foo'}) '/foo-direct/' >>> reverse('myapp.views.someview', kwargs={'page_slug': 'bar'}) '/my-bar-page/' However, this throws a NoReverseMatch exception. I suspect I'm trying to do something impossible. Any suggestions on a saner way to accomplish what I want? Named URLs aren't an option, since I don't want other apps that link to these to need to know about the specifics of the URL structure (encapsulation and all that).

    Read the article

  • Decoding not reversing unicode encoding in Django/Python

    - by PhilGo20
    Ok, I have a hardcoded string I declare like this name = u"Par Catégorie" I have a # -- coding: utf-8 -- magic header, so I am guessing it's converted to utf-8 Down the road it's outputted to xml through xml_output.toprettyxml(indent='....', encoding='utf-8') And I get a UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128) Most of my data is in French and is ouputted correctly in CDATA nodes, but that one harcoded string keep ... I don't see why an ascii codec is called. what's wrong ?

    Read the article

  • Reversing column values in mysql command line

    - by user94154
    I have a table posts with the column published, which is either 0 (unpublished) or 1 (published). Say I want to make all the published posts into unpublished posts and all the unpublished posts into published posts. I know that running UPDATE posts SET published = 1 WHERE published = 0; UPDATE posts SET published = 0 WHERE published = 1; will end up turning all my posts into published posts. How can I run these queries in the mysql command line so that it truly "reverse" the values, as opposed to the mistake outlined above? Thanks

    Read the article

  • Reversing permutation of an array in Java efficiently

    - by HansDampf
    Okay, here is my problem: Im implementing an algorithm in Java and part of it will be following: The Question is to how to do what I will explain now in an efficient way. given: array a of length n integer array perm, which is a permutation of [1..n] now I want to shuffle the array a, using the order determined by array perm, i.e. a=[a,b,c,d], perm=[2,3,4,1] ------ shuffledA[b,c,d,a], I figured out I can do that by iterating over the array with: shuffledA[i]=a[perm[i-1]], (-1 because the permutation indexes in perm start with 1 not 0) Now I want to do some operations on shuffledA... And now I want to do the reverse the shuffle operation. This is where I am not sure how to do it. Note that a can hold an item more than once, i.e. a=[a,a,a,a] If that was not the case, I could iterate perm, and find the corresponding indexes to the values. Now I thought that using a Hashmap instead of the the perm array will help. But I am not sure if this is the best way to do.

    Read the article

  • reversing keys/values - create new instance of HashMap

    - by stck777
    I’ve got an existing instance of HashMap simply called sale (it is Map) I use it to log customers and items history. Is there a way to create a new instance of HashMap, that effectively reverses this usage? i.e will show each item purchased as a unique key and the corresponding value as a String set of the customers that have purchased that product. I suspect there is a simple process using keySet() in some way to iterate over the sales map but I just can’t see how to do this. Any help would be much appreciated.

    Read the article

  • Reversing the effects of mkimage to get an original gzipped file back

    - by Alex Marshall
    Hello, We develop for a specific embedded device at our company, and part of that is making initial root disks that get loaded onto the devices over ethernet via netboot. We've experienced some problems, and as a result, the original folder with the contents of the initial root disks was lost along with its backups, but we do still have the initrd images, that have been created by gzipping the contents of a ramdisk that's been mounted as a local loop device, and then running mkimage on the gzipped file. Is there any way to undo the effects of mkimage and obtain the original gzipped content so that we can recover the original images ?

    Read the article

  • Reversing strings in a vector using for_each and bind

    - by fmuecke
    Hi! I was wandering how it's possible to reverese strings that are contained in a vector using a single for_each command just in one "simple" line. Yea, I know it is easy with a custom functor, but I can't accept, that it can't be done using bind (at least I couldn't do it). #include <vector> #include <string> #include <algorithm> std::vector<std::string> v; v.push_back("abc"); v.push_back("12345"); std::for_each(v.begin(), v.end(), /*call std::reverse for each element*/); Edit: Thanks a lot for those funtastic solutions. However, the solution for me was not to use the tr1::bind that comes with the Visual Studio 2008 feature pack/SP1. I don't know why it does not work like expected but that's the way it is (even MS admits that it's buggy). Maybe some hotfixes will help. With boost::bind everything works like desired and is so easy (but sometimes relly messy:)). I really should have tried boost::bind in the first place...

    Read the article

  • What's up with this reversing bit order function?

    - by MattyW
    I'm rather ashamed to admit that I don't know as much about bits and bit manipulation as I probably should. I tried to fix that this weekend by writing some 'reverse the order of bits' and 'count the ON bits' functions. I took an example from here but when I implemented it as below, I found I had to be looping while < 29. If I loop while < 32 (as in the example) Then when I try to print the integer (using a printBits function i've written) I seem to be missing the first 3 bits. This makes no sense to me, can someone help me out? int reverse(int n) { int r = 0; int i = 0; for(i = 0; i < 29; i++) { r = (r << 1) + (n & 1); n >>=1; } return r; }

    Read the article

  • Reversing a number in c++

    - by Marcel Bujnowski
    I created a program to show the sum and show the reversed number a person has typed. The sum function works but the revers function is not. Can anyone give me any tips on how to fix it. I created a program to show the sum and show the reversed number a person has typed. The sum function works but the revers function is not. Can anyone give me any tips on how to fix it. #include<iostream> #include<iomanip> using namespace std; void printSum(int n, bool reverse); int sm(int n); int reverseInt(int n); void printAddTable(int n); int main() { int reverse; int sum=0; int n; cout<<"Enter N value:"<<endl; cin>>n; if(n>0) { reverse = true; printSum( n, reverse); // calls the printSum Method } else { //cout<<"enter positive Number only:"<<endl; } sum = sm(n); //err // calls the sum Method reverse = reverseInt(n); // calls the reverseInt Method cout<<"The reverse value is:"<<reverse; printAddTable(n); // calls the printAddTable Method //getch() } //end of main() void printSum(int n, bool reverse) { int sum=0; // print sum of reverse numbers for(int i=n; i>=1; i--) { sum=sum+i; cout<<i<< " "<<"+"<<" "; } cout<<sum; } int sm(int n) {int sum =0; for(int i=1; i<=n; i++) { sum = sum + i ; cout << endl; cout<<i<<" "<<"+"<<" "<<endl; // print n positive integers cout << endl; } cout<< "Are " <<n<< " positive integers"<<endl; cout<< "Sum is "<<sum <<endl; return sum; } int reverseInt(int n) { int reminder=0; int sum =0; while(n<=0) { reminder = n/10; sum = (sum * 10) + reminder; // it returns the reverse number n = n % 10; } return sum; } void printAddTable(int n) { for(int i=1; i<=n; i++) { cout<<i<<endl; for(int j=1; j<=n; j++) // print n X n add table { cout<<i+j<<endl; } } } {

    Read the article

  • Reversing a hash function

    - by martani_net
    Hi, I have the following hash function, and I'm trying to get my way to reverse it, so that I can find the key from a hashed value. uint Hash(string s) { uint result = 0; for (int i = 0; i < s.Length; i++) { result = ((result << 5) + result) + s[i]; } return result; } The code is in C# but I assume it is clear. I am aware that for one hashed value, there can be more than one key, but my intent is not to find them all, just one that satisfies the hash function suffices. Any ideas? Thank you.

    Read the article

  • Reversing linked list C

    - by user2976389
    node *rever(node *root) { node *prev = NULL; node *xnew = NULL; while (root != NULL) { xnew = malloc(sizeof(root)); xnew->value = root->value; xnew->next = prev; prev = xnew; root = root->next; } return xnew; } Hello I wrote this linked list reverse function. However it doesn't work(empty response): I suspect it's because of prev index getting overwritten. Could someone explain me whats going on? I know I could find working code on the internet but I wanna know what am I doing wrong. Thanks

    Read the article

  • When reversing a Google Analytics e-commerce transaction is the per-unit price positive or negative?

    - by Michael Glenn
    Google's own instructions for reversing an e-commerce transaction seem to contradict themselves regarding the unit price. In the instructions it states The item field has a positive per-unit price and a negative quantity. yet, the code sample has a negative per-unit price and negative quantity. _gaq.push(['_addItem', '1234', // order ID - necessary to associate item with transaction 'DD44', // SKU/code - required 'T-Shirt', // product name 'Olive Medium', // category or variation '-11.99', // unit price - required '-1' // quantity - required ]); Which is correct?

    Read the article

  • How to get the most out of the book 'Practical Reverse Engineering: x86, x64, ARM, Windows Kernel, Reversing Tools, and Obfuscation'? [on hold]

    - by user3565816
    I was reading the book Practical Reverse Engineering: x86, x64, ARM, Windows Kernel, Reversing Tools, and Obfuscation by Bruce Dang et. al, as I am interested in learning about Reverse Engineering. However I found that most of what I was reading made very little sense to me and I felt confused. So my question is, what material should I go through first before returning to this book so that I can get the most out of it? Thanks in advance for your assistance.

    Read the article

  • smart reversing of compressed javascript with obscured variable & function names ?

    - by Jerome WAGNER
    Hello, I want to know if there exists a tool to help in reversing a compressed javascript that has obscure variable names. I am not looking for a pretty-printing beautifier, but for a tool that actually know a to change & propagate variable name choices. Let me be more specific : - some of the functions belong to the 'public' API and i want to impose readable argument names in their prototypes - there are intermediary variables for document, window and other browser idioms I would like to give this knowledge to the tool and then let it create another javascript where the knowledge would have been correctly propagated. thanks Jerome Wagner

    Read the article

  • Issues with reversing bit shifts that roll over the maximum byte size?

    - by Terri
    I have a string of binary numbers that was originally a regular string and will return to a regular string after some bit manipulation. I'm trying to do a simple caesarian shift on the binary string, and it needs to be reversable. I've done this with this method.. public static String cShift(String ptxt, int addFactor) { String ascii = ""; for (int i = 0; i < ptxt.length(); i+=8) { int character = Integer.parseInt(ptxt.substring(i, i+8), 2); byte sum = (byte) (character + addFactor); ascii += (char)sum; } String returnToBinary = convertToBinary(ascii); return returnToBinary; } This works fine in some cases. However, I think when it rolls over being representable by one byte it's irreversable. On the test string "test!22*F ", with an addFactor of 12, the string becomes irreversible. Why is that and how can I stop it?

    Read the article

1 2 3 4 5  | Next Page >