Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
6 votes
2 answers
401 views

Shortening this Code to process nested tuple even further without the use of max()

I have the code: ...
Dark Programmer's user avatar
3 votes
2 answers
577 views

Remove duplicates from list and order it by count? (python 3)

How do I remove all duplicates from list and order it based on count? ...
12944qwerty's user avatar
3 votes
1 answer
202 views

Summing intertwined terms of an array

I'm recieving 2-dimensional positions of two objects as a string with this format: x1,y1,x2,y2. The string is recieved from a ...
William A.'s user avatar
15 votes
3 answers
2k views

How to swap elements in a vector using an anonymous function in Octave?

Swapping two elements in a vector/matrix is very simple in Octave: x='abcde'; x([4,1])=x([1,4]) x = dbcae Unfortunately, I have yet to find a way to do this ...
Stewie Griffin's user avatar
1 vote
1 answer
171 views

JSON tips: filter objects from array of objects where object name is alpha [closed]

What could be the shortest code for filtering the following array in Javascript without any library? My code is: filtered_obj = _.where(obj, { name: "Alpha" }); ...
Gupteshwari's user avatar
5 votes
3 answers
2k views

Shortest Code to Translate a PHP array

NOTE: This question was migrated from https://stackoverflow.com/q/27134588/1442685 PHP QUESTION Almost purely out of curiousity, how can I take an array like this: ...
Rick Buczynski's user avatar
11 votes
1 answer
516 views

Golfscript Diagonal Array

Is there a way in Golfscript to bring all of the diagonals of an array into a single array? For example, for the array [[1 2 3][4 5 6][7 8 9]] return ...
Josiah Winslow's user avatar