Cover photo
Peter Shinners
169 followers|139,454 views


Peter Shinners

Shared publicly  - 
This must be the reason chat roulette was even invented.
Brett Cannon's profile photoJens Kapitza's profile photo
Add a comment...

Peter Shinners

Shared publicly  - 
Cheers to +Rene Dudfield for getting the new Pygame website live during his last sprint. I'll miss the green but I'm more excited for real content. Nice work! #pygame #python  
Add a comment...

Peter Shinners

Shared publicly  - 
This is out, imho you need this.
DECEPTIVELY SIMPLE. INSANELY FUN.Blackrock Mountain: A Hearthstone Adventur...
Add a comment...

Peter Shinners

Shared publicly  - 
I don't often play the Hearthstone Arena. Tricky choice here between Cain and Troggzor! I ended up picking Cairn Bloodhoof! Any fans of the Earthinator out there?
Add a comment...
Python 2.6 added the `any` and `all` functions. I love these two functions, but I think they could be improved.

My biggest problem is that they return booleans. Unlike the flexibility I get from the logical `and` and `or` operators, which result in the last value that was evaluated.

This change alone would make `any` and `all` more useful. For example, if I had a list of strings and I wanted to find a string that was non-empty, I could use "any(my_sparse_strings)" to fetch it. This becomes the same as doing "my_sparse_strings[0] or my_sparse_strings[1] or .. my_sparse_strings[n]".

They become more useful if we also add a "key" argument to transform the values. This might be just as useful as the key function in `sort`, `min`, and `max`. I'm still not sure about this because you then cannot know if the value returned met or did not meet the criteria, without checking it again.

Lastly, did you know `all` generates a `True` for an empty list and `any` generates `False` for an empty list? It seems like it would be convenient to control the value when given an empty iteratable.

Well, I took a stab at improving both of these in my yter library. See the `yall` and `yany` methods. I was highly tempted to name them `yand` and `yor`, but I steered towards naming them after the existing Python functions.
Marc Rintsch's profile photoPhillip Adkins's profile photoPeter Shinners's profile photoSerge K's profile photo
I really dislike the conditional "else" operator. But I use the logical "and" and "or" operators all the time. So often I frequently want to pass a list of values into them. 
Add a comment...
Python classes make terrible iterators. (Because performance)

I've been writing a few iterators and doing some simple benchmarking. I was suprised to see that python classes are nearly an order of magnitude slower than a generator.

I've documented my findings and shared them on my new, barely interesting library of iterators.

TLDR, use combinations of itertools if at all possible, otherwise go for a generator, and never build a class with a next method!
Creating your own Python iterators can cost you in performance where you were not expecting. A Python class that iterates values is orders of magnitude slower than the fastest options. (Order of magnitude defined as 10x slower, an entire decimal place). One of the simplest test cases I can think ...
Matan Weissbuch's profile photoSerge K's profile photoJun Wang's profile photofranck ebel's profile photo
+Marek Lewandowski  Your version runs at the same speed as the original (at least with Python 3). Indexing a list in Python has never been, or never will be a slow operation.

If we change your version to "it = iter(i)" then that improves performance to only 3x slower than a generator! I'm still convinced the conclusion is correct.
Add a comment...

Peter Shinners

Shared publicly  - 
This stage was stunning to see in real life at the SC2 WCS world championships. Video shows a light look behind the scenes.
Add a comment...
In his circles
120 people
Have him in circles
169 people
Robert Ray's profile photo
Billy Shih's profile photo
Eric Davis's profile photo
Cliff O's profile photo
Furqan Arif's profile photo
sarmy3d's profile photo
Ian Mallett's profile photo
John Burnett's profile photo
Horst JENS's profile photo


5 communities

Peter Shinners

Shared publicly  - 
Good overview of the latest patch and hero standing. Seems to line up with my experience.
Updated 5/14/2015 Having a short but storied history, Heroes of the Storm is Blizzard's attempt a...
Add a comment...

Peter Shinners

Shared publicly  - 
Stuff like this makes me even more excited about work.
 ·  Translate
Add a comment...

Peter Shinners

Shared publicly  - 
So hot right now! Well, so hot next year.
The star and Owen Wilson confirm the long-awaited sequel will be out next year
Add a comment...

Peter Shinners

Tips & Tricks  - 
What is the quickest way to count the items in an iterator, using pure Python?

I spent some time thinking of various techniques and benchmarking them. It turns out the simplest is the fastest. Copy the iterator into a list and see how big the list is. I find that surprising since the data must be copied into a flat array that must occasionally be resized.

The fastest solution I like is to copy the iterator into a fixed size list, until the iterator is empty. That is about 3x faster than a simple for loop.

Here's a link to my data and a basic description of the different techniques. I'd love for someone to surprise me with something new and novel!
The fastest way to walk through all elements of an iterator is collections.deque(iter, maxlen=0) . The deque works like a cyclical buffer when given a maximum length. And with 0 actual elements it is very fast at collecting the data. Unfortunately this does not tell us much about what happened ...
Jacob Aimino's profile photoJason DeRose's profile photoPeter Shinners's profile photoRobert Lauer's profile photo
You use up the iterator though which can be annoying 
Add a comment...

Peter Shinners

Questions  - 
Api design:
The opposite of 'append' is 'prepend'. So the opposite of 'extend' is 'pretend'? OK, that is funny but terrible, but what is the right method name?
Dan Pettersson's profile photoPeter Shinners's profile photoMarc Poulin's profile photo
+Peter Shinners 
verb (used with object), preceded, preceding.
1. to go before, as in place, order, rank, importance, or time.
Add a comment...
That python for movies guy
Basic Information
Apps with Google+ Sign-in
  • Sky Force 2014
  • Fallout Shelter
Peter Shinners's +1's are the things they like, agree with, or want to recommend.
Hearthstone Heroes of Warcraft

Hearthstone only supports tablets with screens that are 6 inches and larger at this time.DECEPTIVELY SIMPLE. INSANELY FUN. Pick up your card

PyPy Status Blog: PyGame CFFI

One of the RaspberryPi's goals is to be a fun toolkit for school children (and adults!) to learn programming and electronics with. Python an


Real-life sharing rethought for the web, wherever you are. Google+ for mobile makes sharing the right things with the right people a lot sim

Pandora Radio - Listen to Free Internet Radio, Find New Music

Pandora radio is the personalized internet radio service that helps you find new music based on your old and current favorites. Create custo


INTRODUCTION. Alembic is an open computer graphics interchange framework. Alembic distills complex, animated scenes into a non-procedural, a

Google Search

The fastest, easiest way to find what you need on the web and on your device.Google Search app for Android: The fastest, easiest way to find

News - pygame - python game development

pygame. News. About. Screenshots. Downloads. Documentation. Tutorials. Pygame FAQ. Help (irc, lists). Bugs & Patches. Mercurial. Links.

Paris 1900-2013 en photos : grimpez dans notre fabuleuse machine à remon...

Dix autochromes, commandés par un riche banquier, de la capitale au siècle dernier... en face de dix photos, prises par nous cette année. Ru

The Switch: Python to Node.js | Paul's Journal

The Switch: Python to Node.js. Posted on December 18, 2011 by Paul Querna. In my previous post, I glossed over our team switching from Pytho

PyCharm 2.0 beta 2 | JetBrains PyCharm Blog

PyCharm 2.0 beta 2. Posted on November 30, 2011 by Dmitry Jemerov. We're happy to announce the update for the Beta release of PyCharm 2.

PyCharm 2.7 is available: back to core Python | JetBrains PyCharm Blog

We've released PyCharm 2.7, a big update for our Python and Django IDE. The main focus of this update is better Python coding experience. We

Graydon’s work on Mozilla » Blog Archive » Rust 0.1 release

Another six months and we have our first release. Rust is now at a point where we'd like to invite people to write code in it. It's

PyCharm 2.5 Released! A Really Environment Friendly IDE | JetBrains PyCh...

Hurray! We made it! PyCharm 2.5 is officially available. PyCharm has been green since its version one, but this update makes it truly enviro

Portal 2 is Games Radar's Most Favorite 2011 Video Game

Their readers thought the best video game of 2011 was Skyrim, but the editors of Games Radar have picked Portal 2. It's their top game of th

4K Download | Free, useful applications for all modern plaforms

Free, useful applications for all modern platforms. Download video and audio from YouTube or photos from Instagram, make slideshows. And muc

YouTube - Brave Trailer

Utwórz kontoZaloguj się. Home. PrzeglądajPrześlij. Witaj, to nie jest przerwa na reklamę. Używasz starej przeglądarki, której serwis YouTube

Installing Amazon MP3 Downloader on Ubuntu 11.04 | dgf64art

Installing Amazon MP3 Downloader on Ubuntu 11.04. Posted by dgf64 on Jul 5, 2011 in Application, Main Topics, Tutorials | 4 comments. Not ev

Togepi sings Mario Bros

Calopsita linda. Meu twitter Pra quem acha que é fake (for those who think it's fake):

There are shade covers over all the equipment and tables. Don't be fooled by Woodfield Park which is adjacent to this one. A paved waking path connects them, but it is a mini-hike.
Public - a year ago
reviewed a year ago
34 reviews