Questions tagged [array-reverse]

29 questions
0
votes
0 answers

Reverse a read only tuple

How I can reverse this array of "readonly" function tuples? I borrowed Reverse from this library here typescript- tuple. Playground namespace Utils { export type IsFinite = { empty: Finite …
ThomasReggi
  • 55,053
  • 85
  • 237
  • 424
0
votes
1 answer

PHP json decode array reverse

What am I doing wrong? I'm trying to reverse a json_decode using array_reverse but I'm getting the following error Warning: array_reverse() expects parameter 1 to be array, object given Using the code below: $data =…
Simon Webb
  • 31
  • 4
0
votes
0 answers

Convert a reversed array to a java.math.Biginteger in java

I'm trying to write a Java code equivalent of the below Javascript code (convert JS to Java) JavaScript Code (it reverses an Array and converts to/forms a Big Integer to the base decimal): var decimal=bigInt.fromArray(binArr.reverse(), 2); Java…
SidTechs1
  • 67
  • 4
  • 12
0
votes
1 answer

Making array_reverse when using fgets | text file

I want to reorder my array from last bottom line to first on the top. I'm trying use array_reverse, but i fail all runs. Anyone of you, have an idea how i could implement this into my code? Everything works, but i only need array in…
Arek
  • 3
  • 1
0
votes
2 answers

MySQL: make record last in alpha sort

I can make a selected record appear at the beginning of a sorted query: $sql = "SELECT meetID, meetingTitle FROM meetings ORDER BY meetingTitle = 'Other Meetings' DESC, meetingTitle DESC"; That forces "Other Meetings" to be at the top of an…
parboy
  • 67
  • 8
0
votes
2 answers

Why this code is returning undefined?

var rarr = []; var reverseArray = function(arr) { if(arr[0]) { rarr.push(arr[arr.length-1]); arr.pop(); reverseArray(arr); } else { return rarr; } } console.log(reverseArray(["A", "B", "C"])); While debugging value of rarr…
kamal kokne
  • 175
  • 10
0
votes
0 answers

jQuery read text file in reverse order

I was using this php line to make the magic happens : $contents = array_reverse(explode("\n", $contents)); I was wondering how to do the same magic in jQuery. This is the line without reverse…
masteringtaiwan
  • 315
  • 1
  • 4
  • 9
0
votes
1 answer

Reading a log file into an array reversed, is it best method when looking for keyword near the bottom?

I am reading from log files which can be anything from a small log file up to 8-10mb of logs. The typical size would probably be 1mb. Now the key thing is that the keyword im looking for is normally near the end of the document, in probably 95% of…
user1547410
  • 863
  • 7
  • 27
  • 58
0
votes
1 answer

Reverse reading a text file till a random date is encountered

I have a text file like: ================================================ [Feb 11 2013 13:17:14] - some string here and here General options - [something] Line y ================================================ Line 1 Line 2 Line 3 Line 4 Line 5 …
-1
votes
2 answers

Array_reverse "again"

This is my first post, so please be indulgent/lenient. This array is steps enumeration of an embroidery program And I have to keep "0" values between not null steps and to do not take null values after $oldArray =…
-1
votes
2 answers

Skip repeating array and reverse order of the array

I have this array. In this I want to skip the value for reverse data. $data = array( array(2, 1), array(1, 2), array(1, 2), array(2, 1), array(2, 3), array(3, 2), array(4, 5) ); I want to skip the…
madhu
  • 114
  • 7
-1
votes
1 answer

Reverse array data

I've got this array, and i would like to reverse the data array Array ( [0] => Array ( [name] => Name [data] => Array ( [22] => 1679076 [21] => 1674610 …
Zuker
  • 456
  • 2
  • 6
  • 18
-2
votes
1 answer

PHP: Reverse a JSON array

Can someone help me with some PHP please. The original code ~works, but the output is in the wrong order. So I need to REVERSE the sequence/order of the JSON array.
-4
votes
2 answers

How to reverse my array

Im making a blog and im trying to make it so it displays my posts from soonest to oldest. I thing the easiest way it to use the array_reverse() function. I have never used it before so i need some advice on doing so. here is my current code how do i…
TheWebDev
  • 37
  • 1
  • 7
1
2