reverse

django 'url' template tag error

My URLconf contains this pattern: url(r'^accounts/logout/$','django.contrib.auth.views.logout', name="logout"), And I've trying to reverse that in a template with the URL tag like this: <a href="{% url logout next_page=request.path %}">logout</a> But I keep getting the following error: Reverse for 'logout' with arguments '()' and...

Unique Constraint on two fields and their reverse

Hello, The problem is the following, I have a table of friendships in my database, the friendship table has two foreign keys to the users table. I want to set a unique key on the two foreign keys so that I will have no duplicates, but I want more, I want that if user A added user B, then B won't be able to add A, and I want to have on...

C++ to UML ( Reverse engineer / Round-trip engineering )

I am looking for a tool that can reverse engineer C++ to UML (and vice-versa). However, the crucial requirement is that it can correctly parse method (member function) bodies so that dependencies are correctly identified. More Detail: In the following code, ClassA is dependant on ClassB, so the UML tool needs to show this with a dashed...

Invert function: base 38 conversion

Hello! Can you tell me how the invert function for the following PHP function is? <?php function id2secure($old_number) { $alphabet_en = '1357902468acegikmoqsuwybdfhjlnprtvxz-_'; $new_number = ''; while ($old_number > 0) { $rest = $old_number%38; if ($rest >= 38) { return FALSE; } $new_number .= $alphabet_en[$rest]; $old_num...

Volume DNS Lookup API Provider which finds all domains for a given IP Address

We're currently looking for a reliable Reverse DNS lookup service (Input IP Address -> output domain name) which is accessible by API. Volumes are not not huge but we need a reliable service. Anybody know any providers? experience with them? NB: I need reverse lookup - i.e. I have the IP address, I want to domain name. ...

How to reverse a string with PHP?

$s = '1000'; after process,should be '0001' ...

Reversing CRC32

I'm looking for a way to reverse a CRC32 checksum. There are solutions around, but they are either badly written, extremely technical and/or in Assembly. Assembly is (currently) beyond my ken, so I'm hoping someone can piece together an implementation in a higher level language. Ruby is ideal, but I can parse PHP, Python, C, Java, etc. ...

Python Reverse Generator

Hi, I'm looking for a way to reverse a generator object. I know how to reverse sequences: foo = imap(seq.__getitem__, xrange(len(seq)-1, -1, -1)) But is something similar possible with a generator as the input and a reversed generator as the output (len(seq) stays the same, so the value from the original sequence can be used)? ...

Why does *(str+i) = *(str +j) not work here?

void reverse(char *str){ int i,j; char temp; for(i=0,j=strlen(str)-1; i<j; i++, j--){ temp = *(str + i); *(str + i) = *(str + j); *(str + j) = temp; printf("%c",*(str + j)); } } int main (int argc, char const *argv[]) { char *str = "Shiv"; reverse(str); printf("%s",str); return 0; ...

Need a program to reverse the words in a string

I asked this question in a few interviews. I want to know from the Stackoverflow readers as to what should be the answer to this question. Such a seemingly simple question, but has been interpreted quite a few different ways. ...

reversing an array of characters without creating a new array

write a program that enters an array of characters from the user and reverses the sequence without creating a new array ...

Is it possible to redefine reverse in a Django project?

I have some custom logic that needs to be executed every single time a URL is reversed, even for third-party apps. My project is a multitenant web app, and the tenant is identified based on the URL. There isn't a single valid URL that doesn't include a tenant identifier. I already have a wrapper function around reverse, but now I need a...

How to reverse a string in Go?

How can we reverse a simple string in Go? A Perl-like 'reverse' function does not seem to exist there. ...

NoReverseMatch in django

Hi. After debugging for a while I found what the error was, but I don't know how to fix it. I have an urlConf whit the name 'ver_caja' who receives as argument the id of a caja object, and then call the generic object_detail. The queryset is correct: get all the caja objects correctly. In the template I have the call: {% ver_caja caja...

Django reverse() for JavaScript

In my project I have a lot of Ajax methods, with external client-side scripts (I don't want to include JavaScript into templates!) and changing URLs is kind of pain for me because I need to change URLs in my Ajax calls manually. Is there is some way to emulate the behavior of {% url %} templatetag in JavaScript? For example, print ur...

Foreign key disappears when i do reverse engineering using mysql workbench

Hello, When i use mysql workbench, the schema of reverse engineering disappears. I don't know why. Do you have solutions? Thanks. ...

Help with writing a void reverse() method and use recursion to reverse a complete sentence(Java).

I already wrote something that removes the first character of a string and puts it after the remaining substring and then prints it out, the instructions were to reverse the sentence using recursion by removing the first letter of the sentence and concatenate it to the reversed remaining substring, ie. "Hello" yields "olleH". But i dont ...

Apache Reverse Proxy Server.

I have been trying to set up a reverse proxy to IIS6.0. The the charset is gb2312. But the responses the proxy server sent to browser were not as expected. I understood that the libxml2 needs to parse the responses from iis and fix the links. And I am pretty sure that libxml2 did not parse the html with the indicated charset from the re...

what is the use of Long.reverse(long ) method?

I found one method in Long class public static long reverse(long i) {..} What is the use of this method? ...

Reverse Geocoding for Israel

Where can i find a free service for reverse geocoding a coordinate in israel to get a street address? the google api web service doesnt give me a street address in israely coordinates... Thanks. ...