Questions tagged [reverse]

Rearranging the order of a sequence such that the final order is a mirror image of the original.

Rearranging the order of a sequence such that the final order is a mirror image of the original.

3773 questions
1
vote
2 answers

jquery loop on textarea text reverse order?

i have textarea with text that is sperated with line break i want to loop this list in reverse order? so if i have text that loop like this 1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,2 1,1,1,1,1,1,1,3 1,1,1,1,1,1,1,4 1,1,1,1,1,1,1,5 it will read from…
user63898
  • 29,839
  • 85
  • 272
  • 514
1
vote
1 answer

Reverse Polish converter

I am trying to make a reverse Polish printer which can perform the following operation- Inputs: (a+(b*c)) ((a+b)*(z+x)) ((a+t)*((b+(a+c))^(c+d))) Outputs: abc*+ ab+zx+* at+bac++cd+^* This is my code: #include #include char…
Alpa8
  • 470
  • 4
  • 12
1
vote
0 answers

Reverse backward text from a pdf file?

The texts looks like this "stnetnoc." only even the letters are facing the wrong direction. And the pages displayed its side at the bottom and the top. I'm not familiar with pdf coding or manipulation libraries. There's a post suggesting another…
Ross
  • 11
  • 1
  • 2
1
vote
3 answers

How to reverse and concatenate strings at certain indexes?

For my assignment, I'm required to first come up with a function that reverses a string that is inputted (which I've already done using the code below) def reverse(s): if len(s) <= 1: return s return reverse(s[1:]) + s[0] The next…
Abort Mission
  • 13
  • 1
  • 6
1
vote
1 answer

how do i get "this = this" in prototype working

Ok peep's so I know it's bad practice to mess with prototypes but here it is anyway... Array.prototype.rev= function(){ this.reverse(); } Works fine! Updates the source array variable, ary, as expected eg: ary = [123,…
LostInCyberSpace
  • 413
  • 4
  • 19
1
vote
2 answers

Reverse the order of comma separated string of values

I have a string of values that looks like this: strSubjectIDs = "20,19,18,17,16,15"; Is there anyway to reverse that order of the string strSubjectIDs so that the IDs look like this: "15,16,17,18,19,20"
frontin
  • 733
  • 2
  • 12
  • 28
1
vote
1 answer

String reversal performance

After being intrigued by this question I tried to copy the algorithm that the user Simon Nickerson suggested as well as the algorithm that the top answer provided from docjar: docjar algorithm. I tested both out (which hopefully I did not make any…
Alex Koukoulas
  • 998
  • 1
  • 7
  • 21
1
vote
3 answers

python reverse function and boolean values error

i have written a function that produces a tuple of two lists from one list. one list contains the second, fourth and fifth values and the other list contains all the remaining values. i also have a condition that if reverse=True the values of the…
tribo32
  • 333
  • 3
  • 15
1
vote
2 answers

Find Random BitshiftRight Combination

I have a problem. I am trying to find a combination of right shift operations. An example. I have an Input: Let's say 30. I now what to find a and b, so that a >> b = mynumber (30). That's my attempt: private static Random rnd = new Random(); …
Dark Side
  • 695
  • 2
  • 8
  • 18
1
vote
1 answer

Django NoReverseMatch - view with two parameters

views.py: def cal_main(request, year=None): if year: year = int(year) else: year = time.localtime()[0] nowy, nowm = time.localtime()[:2] lst = [] # create a list of months for each year, indicating ones that contain entries and current for y…
Meii
  • 33
  • 7
1
vote
1 answer

inverting the order of lines in a list

I'm having some difficulty with writing a program in Python. I would like the program to read lines between a set of characters, reverse the order of the lines and then write them into a new file. The input is: AN10 G17 G21 G90 N20…
1
vote
7 answers

Java method to reverse every word in an array of strings

I'm trying to make a method that will take an array of strings and return an array with all the words in reverse order but my code is not working. When I run it i get "[Ljava.lang.String;@74122d9c" Test case:…
Justin
  • 21
  • 1
  • 1
  • 5
1
vote
1 answer

delete first three and last three elements from list, and save it to list2 in prolog

I am completely new to Prolog, but I have to do this for a homework. I have tried something like this delete(_,[],[]). delete([X,Y,Z],[X,Y,Z|List],Temp) :- reverse(Temp,List). But can't figure out, how to implement second delete from…
kristofyk
  • 41
  • 1
  • 1
  • 4
1
vote
6 answers

Reverse array using temporary variable C++

Trying to reverse elements in array by using a temporary variable. I can't figure out how to do it int arraysize = 12;//Size of the array int option;// Option to be switched int list[12];//numbers in the array int total = 0;// Total of all numbers…
user3429270
  • 31
  • 1
  • 9
1
vote
4 answers

String operation in SQL to reverse a string

In DB2 9.7 I am looking for a way to reverse a string in a SQL query. I am familiar with SQL Server where the query would be like SELECT REVERSE(LEFT_TO_REIGHT) AS RIGHT_TO_LEFT FROM TABLE1; I couldn't find a similar function in DB2. is…
Joe Platano
  • 586
  • 1
  • 14
  • 27
1 2 3
99
100