I’m about to try outlook 😉
I know I said 3D touch is not the thing, but is handy. Of course, I’m used to the usual way to do things (entering to the app and then hit the action button) and I expect the apps really make use of this technology, I hope.
And talking about the device, It’s great, as you can see in my flickr photostream I’ve been using it for a couple of weeks now, pictures are great although with the bandwidth I have here (near to Guatemala) is hard to upload several pictures, not to mention videos. But pictures are fine, about 2MB in size and look definitively great (I still want my DSLR camera). In terms of performance, you can watch several videos about the 6S performance in youtube. Its also great, reloading apps happens not to often, sometimes it’s barely noticeable, sometimes it is but almost all time you won’t notice.
Apple have this chrome extension so you can sync your Safari favourites with Chrome, but it is designed to run on Windows 7/8, bad luck for those that use OS X and prefer to use Chrome.
I also use Safari, but for my day to day I use chrome because of the extensions. If Safari could add good extensions that would be great!
via Flickr
This also happens in the “Heists” missions, and you know what happens when one member of the crew dies… basically this makes impossible to play heists which by now is pretty hard to start the mession to be killed just starting it.
Reposting from the old blog.
Hay una versión de este post en español, si lo prefieres puedes léerla aquí: Truco de Python, como crear objetos “flojos” (Lazy objects)
This time I’m about to talk about lazy object, I called like that because they are more or less similar to what we use in lazy treeviews (In Gtk) where the Tree shows expanders but didn’t load the child nodes until you expand the node). What I want to do is create objects and count them, but don’t load any data until I need it.
Why would I need this?. Well. I’m currently writing a program for my employer, this program load a list of customers and shows how many accounts it has. As this accounts are kind of complex I create an object for them. This object is responsible for load/save the data for it, and any data you need is accessed via properties.
In my first approach, the object was loading the data as soon as the constructor was called, but sometimes I never access to any info in that object, remember, a customer may have many (and I mean really many) accounts, then why load all the data if there is a chance that I’ll never use it?. Well, that is because there is a chance that I have to use that data.
Then how could I create the object and then load the data when somebody require it?. That may be easy, may not. :-). One approach is making use of python properties. Just create the object and when someone want to use a “value” from the object use the property to retrieve the data, process it and then return a value. A simple property may be defined like this:
I just create a class “demo” and the property “some_property”, every time you use this:
Python will call the method get_some_property allowing you to do your trick. But if you have an object with more and more properties is better to get all data at one time and then just use properties to return a piece of it. You could call a method on every property if the data container is empty but for me it is not the best.
What you could do, is get the data the first time you need it. But, how could I know when a property/variable is requested on my object?
Well, Python classes have several reserved methods, and one of them is __getattribute__. This method let you handle every request to any property/class variable in your object.
With this you can dig in your object to know if the container is empty, and if it is empty fill it with data before returning the property value :-).
Lets say that the demo object have a __data dictionary containing the data. and propeties look into it for the right value, it also have a reference to the storage layer called storage.
Pay attention that I used object.__getattribute__ instead self.property, if I use self.property it will call self.__getattribute__ and will cause a recursion exception.
With this, we can create a great number of objects quickly and reducing the memory footprint. The downside is that getting the data will be a lot expensive if we require the data of all (or several) objects at once.
How would you do it?, let me know in the comments.
You know, when you have kids there is little time to seat and watch a full movie at once, I usually watch movies in periods, half hour in the morning, half hour at the night and have it done in two to four days.