Search
New Code
Australia Post eParcel For Magento 1.1.1
Source Control for SQL Server 2.0
Answers phpSoftPro 3.12
Exlcart 2.0
School College ERP 1.3.2
White-label Grocery Delivery App Solution 2.0
Best Classified Script 5.1
Readymade B2B Script 1.3.1
Uber Clone with Safety Measure Addons 2.0
Equity Investing Software 1.3.2
C# QR Code Generator 2020.6.0.0
The .Net PDF Library 2020.7.1
dbExpress driver for MySQL 7.2
dbForge Documenter for Oracle 1.2
dbForge Studio for Oracle 4.2
Top Code
phpEnter 5.1.
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
Code Listing by Garrett

Code 1-4 of 4   






What if you had a list like this: [1, -10, [1,2,[3,4]], xrange(200)], and you just wanted to go through each element in order (wanted it to return a simple list of [1,-10,1,2,3,4,1,2,3,4...199])

I've seen a couple of attempts to flatten arbitrarily deep lists. Many of them involve recursion, like this one: http://rightfootin.blogspot.com/2006/09/more-on-python-flatten.html

Recursion is generally considered non-pythonic...



Oftentimes you want to find the index of a list-like object. Numpy arrays, for example, do not have a index member function. These get the job done quickly.

Note: these do not raise exceptions, instead they return -1 on error. You...



an object which extends the xrange object to support slicing and indexing (simple)



I have looked far and wide for code for fast sorting of n dimensional arrays by the first element, for example if I had the array:
ray = [[1,2,3,7,5][10,11,12,13,14]]

I would want it to come out as
ray =...