Profiling code is important. In python, the easiest way to time your code is to do the following: from datetime import datetime start = datetime.now() # Some long-running process end = datetime.now() print "process run in %s" % (end – start) This solution works, but it can be annoying to write, and you’ll have to [...]
Author Archives: Omar
Dawson on “The Gains of Drudgery”
Came across an interesting post this morning that related to some thoughts I’ve been having about my own personal work ethic. It takes from a piece written by William James Dawson, called The Gains of Drudgery. I’ll paste the first paragraph here, the rest is after the fold. By drudgery, I mean work that in [...]
Interesting Article from good.is on the “Information Arms Race”
[...] The rise of microtargeting is a function of new logarithms—and computers fast enough to process them—that are able to capture all this trash and turn it into gold. Over the years, the data-mining industry has become adept at recycling information about the websites we visit and the products we buy. Rumor has it that [...]
There exists a continuous rail service that goes between Moscow & Vladivostock. It spans 9,259km.
And Google Maps knows about it. In fact, it recommends it if you ask for Public Transit directions between the aforementioned cities. View Larger Map Brilliant. In the words of Kurt Vonnegut, ”bizarre travel plans are dancing lessons from God.” More info on the railway on Wikipedia.
Thin Python Cache Decorator
def cache(func): """ A thin middleware that caches based on function name and arguments. """ def _inner(*args, **kwargs): a_str = "&".join([str(a) or None for a in args]) kw_str = "&".join(["%s=%s" for key, val in kwargs.iteritems()]) key_name = slugify("%s:%s:%s" % (func.__name__, a_str, kw_str)) cached = cache.get(key_name) if not cached: cached = func(*args, **kwargs) cache.set(key_name, cached) return [...]
On Meditation
Third, meditation can help a man “be his own man” and feel comfortable in his own skin. That constant stream of input we face each day often carries messages of what we’re supposed to think or feel. Talking-heads spout off opinions as if they were facts. Advertisers try to convince us that buying such-and-such product [...]
Focus Time Hack (OSX)
Block facebook and reddit on your Mac; focus longer and get work done instead. Open up a terminal, copy and paste this: sudo echo “127.0.0.1\tfacebook.com\n127.0.0.1\treddit.com” >> /etc/hosts
User Interfaces that Involve Uncertainty
I installed Marco Polo today. It seems like a useful application, but it left me wondering. What are some ways to represent decisions that involve uncertainty in user interfaces? The first mental framework that came to mind was the different types of measurement scales. An ordinal scale might make sense, but it’s hard to order things [...]
Google Circles
I started using Google Plus three weeks ago. I like it a lot; I think I’ll keep using the service. The UI works, a lot of my friends are already on it, but most importantly it solves a problem that has not yet been solved online: easy, logical information sharing. Logical information sharing. Information sharing [...]