Not necessarily the most superior way performance/Pythonicity wise but it’s simple to remember and short:
list = [1, 2, 3, 4, 5, 6, ...]pairs = zip(list[::2], list[1::2])for pair in pairs: # do stuff
Got a Logitech Performance MX on “special” at Best Buy this weekend (80$ for a mouse… what a slaughter) because I just have a laptop mouse and am tired of not having anything to rest my palm on. At first, it’s great. Looks like a race car, good performance, nice receiver…
Used a NumPy array. Doesn’t work if the diagonal+1s are white of course.
import Imagefrom numpy import array, zeros, uint8
line = Image.open('wire.png')# third dimension is for coloursa = zeros((100, 100…
Here’s my experience on Microsoft’s MB2–633 exam which I just passed, on the second try.
First of all, as far as I can tell, the Prometric exam has 50 questions and there are only 50 questions in…
As a gadget enthousiast and as a mobile developer, here’s some thoughts on the Google Android HTC Dream / T-Mobile G1 phone at the time of Android 1.6 ‘Donut’
This is a criticism of the Garmin GPS product Nüvi and most importantly its software.
While in the fields of physical design and graphical interface, Garmin has outperformed TomTom, it seems that Garmin hasn’t bothered to pay any attention…
Unlike what the intuitive impression might reassure, the new Unibody Macbook is just as fragile as the old white Macbook as discovered rather violently today only 2 weeks after my purchase.