Tag Archives: Design Patterns

Google account of Twitter employee hacked

Ok, so this is a “retweet” of PCWorlds article aboout how the google account of a Twitter employee(s) was hacked a while ago. Since you can access nearly all of your google accounts with a single login this caused quite a chain of events.  Not only was some of the individuals gmail accounts compromised but also google docs and The Business Insider has screenshots of some of the information that was compromised.   Now in the article they mention that no twitter accounts were compromised due to this breach only some twitter employees personal accounts.

Read more »

# Function/Method Decorators

One of the reasons I like Python is because it’s simple but powerful. All the tools are there for whatever task needs to be done. I’ve found __getattr__ to be a very useful tool for creating sets of standardized class methods without having to explicitly declare them. Another useful tool is function decorators. Read on to get a quick idea of how to make your own class decorators.

Read more »

# __getattr__ Deserves Some Respect

One of Python’s built-in functions is __getattr__, which turns out to be quite useful but at the same time slightly dangerous. It is especially helpful for creating complex classes without using inheritance. For a brief tutorial, read on.

Read more »

# Iterators

I got the Gang of Four book on design patterns a couple of years ago and it was way beyond me (Alex Martelli at Google doesn’t suggest it as an introduction, I’ve since learned). I still haven’t mastered it, but every now and then I do find a useful idea.

Let me introduce you to the object-oriented idea of iterators.

Read more »