|
It's always a good idea to be as consistent as possible when you're writing code. So when you're using settings from a configuration file it…
|
|
Context managers are a way of allocating and releasing some sort of resource exactly where you need it. The simplest example is file access: with file("/tmp/foo", "w") as foo: print >> foo, “Hello!” This is essentially equivalent to: foo = file("/tmp/foo", "w") try: print >> foo, “Hello!” finally: foo.close() Locks are another example. Given: import threading lock = threading.Loc....
|
|
Context managers are a way of allocating and releasing some sort of resource exactly where you need it. The simplest example is file access: with file("/tmp/foo", "w") as foo: print >> foo, “Hello!” This is essentially equivalent to: foo = file("/tmp/foo", "w") try: print >> foo, “Hello!” finally: foo.close() Locks are another example. Given: import threading lock = threading.Loc....
|
|
Context managers are a way of allocating and releasing some sort of resource exactly where you need it. The simplest example is file access: with file("/tmp/foo", "w") as foo: print >> foo, “Hello!” This is essentially equivalent to: foo = file("/tmp/foo", "w") try: print >> foo, “Hello!” finally: foo.close() Locks are another example. Given: import threading lock = threading.Loc....
|
|
Every time I post an article, I shamelessly submit it to Hacker News in the hopes that it will get picked up and generate a significant amount of attention and traffic to my site. Somewhere in the back of my mind, every time I submit something I wrote to Hacker News I think, “Maybe this is the one, the article that will go viral, and tomorrow I’ll see John Gruber post about it and hear Dan and Haddie talk about it on The Frequency. Maybe.....
|
|
In a Merlin Mann, Inbox Zero-esq fashion, I do my best to carefully limit the number of things allowed to compete for my attention. Although I regularly fall far short of this goal in most areas of my life, I do a relatively good job when it comes to the news I read and the writers I follow on the internet. While one could certainly make the argument against Hacker News as a news source with any rhyme or reason, that single exception aside ....
|
|
For me, the real ‘zero’ in Inbox Zero is more about consciously managing the amount of our attention that we commit (or, far more often, cede) to thinking and worrying about what may or may not be piling up while we’re away doing the real work of our lives. Which is to say: the Real Work that’s not, in this instance, about fiddling with email or drearily suffering the daily fusillade of random requests and information bombs that get lobbed ..
|
|
Most technical problems are like games. All of them have a way to win and all of them have rules; the easiest way to ensure you always win is to learn the rules inside and out, and more importantly what the rules don’t cover! Paying attention to what the rules don’t cover is what leads to out of the box thinking. What sets the great players apart from the rest is learning what the rules don’t cover which allows for creativity and, sometimes..
|
|
Python has become notorious for being somewhat problematic when it comes to concurrency. The language supports threads, but performance is known to be dismal in some cases. In particular, as David Beazley discovered , when I/O-bound and CPU-bound threads run in the same program, the GIL performs very badly (worse than if you ran the tasks one after the other on a single thread/CPU). Alternative approaches which have become popular are to u....
|
|
Python has become notorious for being somewhat problematic when it comes to concurrency. The language supports threads, but performance is known to be dismal in some cases. In particular, as David Beazley discovered , when I/O-bound and CPU-bound threads run in the same program, the GIL performs very badly (worse than if you ran the tasks one after the other on a single thread/CPU). Alternative approaches which have become popular are to u....
|
|
Python has become notorious for being somewhat problematic when it comes to concurrency. The language supports threads, but performance is known to be dismal in some cases. In particular, as David Beazley discovered , when I/O-bound and CPU-bound threads run in the same program, the GIL performs very badly (worse than if you ran the tasks one after the other on a single thread/CPU). Alternative approaches which have become popular are to u....
|
|
Just over two years ago, Heroku was acquired. I was around and peripheral to this just before the acquisition and came on board only barely after. While there is a large group of people that have been there longer than I have (several for 4+ years) I’m still commonly asked how things have changed, how things work, and other questions of that nature. I wrote about some of these processes over a year ago in the months after joining Heroku aro....
|
|
Just over two years ago, Heroku was acquired. I was around and peripheral to this just before the acquisition and came on board only barely after. While there is a large group of people that have been there longer than I have (several for 4+ years) I’m still commonly asked how things have changed, how things work, and other questions of that nature. I wrote about some of these processes over a year ago in the months after joining Heroku aro....
|
|
My last post about the speed of Django’s templating language caused a bit of a stir and it was clear that people didn’t really have a clue how long the templates were taking to render in their applications. Enter Template-timings Template-timings is a panel for Django-debug-toolbar (which everyone s...
|
|
My last post about the speed of Django’s templating language caused a bit of a stir and it was clear that people didn’t really have a clue how long the templates were taking to render in their applications. Enter Template-timings Template-timings is a panel for Django-debug-toolbar (which everyone s...
|
|
Android and the Fiber business and even Facebook fit into this analogy rather well. In this context more rainfall means more people using the Internet. If you have more people you’ll have more rivers and you’ll have more water and hopefully more fish. Fiber means the water will flow more rapidly: you’re essentially dredging the riverbed.” Some wonder why Google still pushes Android despite failing to make a significant profit from it, esp..
|
|
In almost any application it’s common to want to aggregate some set of values together, commonly in a comma separated form. Most developers do this by running a query to get much of the raw data, looping over the data and pushing it into a set, appending each new value to the appropriate key. Hopefully, it’s not a surprise that there’s a much better way to do this with PostgreSQL. Postgres has a flexible and robust array datatype that c....
|
|
In almost any application it’s common to want to aggregate some set of values together, commonly in a comma separated form. Most developers do this by running a query to get much of the raw data, looping over the data and pushing it into a set, appending each new value to the appropriate key. Hopefully, it’s not a surprise that there’s a much better way to do this with PostgreSQL. Postgres has a flexible and robust array datatype that c....
|
|
During some contracting I was doing recently there was a requirement to implement some search logic using only PHP. There are no issues with that but it turns out I couldn’t find a decent extract generator handy as usually one would just plug into the search engines provided version to do this. Off the top of my head I could only think of one example I was aware of which lives in Sphider (for the record it lives in searchfuncs.php from ..
|
|
The first area I tend to think about when it comes to developer marketing is around advocates. A simple definition of an advocate is someone that speaks/writes in favor of some thing . Creating advocates is a means of creating more of myself to go out and talk loudly and ideally effectively. However, they do take time to cultivate and it is a hard item to track. But by cultivating advocates I’m able to scale what would otherwise be a bot....
|
|
The first area I tend to think about when it comes to developer marketing is around advocates. A simple definition of an advocate is someone that speaks/writes in favor of some thing . Creating advocates is a means of creating more of myself to go out and talk loudly and ideally effectively. However, they do take time to cultivate and it is a hard item to track. But by cultivating advocates I’m able to scale what would otherwise be a bot....
|
|
Perhaps primarily due to the prominence of monads in the Haskell programming language, programmers are often curious about category theory. Proponents of Haskell and other functional languages can put category-theoretic concepts on a pedestal or in a mexican restaurant, and their benefits can seem as mysterious as they are magical. For instance, the most common use of a monad in Haskell is to simulate the mutation of immutable data. Others ..
|
|
Perhaps primarily due to the prominence of monads in the Haskell programming language, programmers are often curious about category theory. Proponents of Haskell and other functional languages can put category-theoretic concepts on a pedestal or in a mexican restaurant, and their benefits can seem as mysterious as they are magical. For instance, the most common use of a monad in Haskell is to simulate the mutation of immutable data. Others ..
|
|
Perhaps primarily due to the prominence of monads in the Haskell programming language, programmers are often curious about category theory. Proponents of Haskell and other functional languages can put category-theoretic concepts on a pedestal or in a mexican restaurant, and their benefits can seem as mysterious as they are magical. For instance, the most common use of a monad in Haskell is to simulate the mutation of immutable data. Others ..
|
|
The endpoint has traditionally accepted an parameter for ordering results by either creation date or ‘hotness’. The method for calculating…
|
|
I’ve been working full time on my Android workstation for over a month now, and it is time to write an update about it. How has it worked out? What I’ve been doing I would love to tell stories of working from parks and cafes, like Mark O’Connor has on his iPad setup , but unfortunately we had a backlash of winter here in Berlin and the warm spring weather only came back this week. Instead — quite atypically — I’ve been mostly desk-....
|
|
The endpoint has traditionally accepted an parameter for ordering results by either creation date or ‘hotness’. The method for calculating…
|
|
I’ve been working full time on my Android workstation for over a month now, and it is time to write an update about it. How has it worked out? What I’ve been doing I would love to tell stories of working from parks and cafes, like Mark O’Connor has on his iPad setup , but unfortunately we had a backlash of winter here in Berlin and the warm spring weather only came back this week. Instead — quite atypically — I’ve been mostly desk-....
|
|
I’ve been working full time on my Android workstation for over a month now, and it is time to write an update about it. How has it worked out? What I’ve been doing I would love to tell stories of working from parks and cafes, like Mark O’Connor has on his iPad setup , but unfortunately we had a backlash of winter here in Berlin and the warm spring weather only came back this week. Instead — quite atypically — I’ve been mostly desk-....
|
|
I’ve been working full time on my Android workstation for over a month now, and it is time to write an update about it. How has it worked out? What I’ve been doing I would love to tell stories of working from parks and cafes, like Mark O’Connor has on his iPad setup , but unfortunately we had a backlash of winter here in Berlin and the warm spring weather only came back this week. Instead — quite atypically — I’ve been mostly desk-....
|
|
Sites like Less Wrong exist because it’s hard for those contributors, inarguably highly intelligent, to bring attention to their work through other venues. We often tout Twitter, YouTube to an extent, and a flourishing blogging community as the epitome of ease, enabling those with good ideas and smart things to say to develop a personal brand and get their content to the masses. But that’s not really true, is it? Permalink.
|
|
Now, Apple pessimism is even stronger. No matter what they release and no matter how well it sells, they won’t win over the press, the pundits, the stock market, or the rhetoric. Not this year. They could release a revolutionary 60-inch 4K TV for $99 with built-in nanobots to assemble and dispense free smartwatches, and people would complain that it should cost $49 and the nanobots aren’t open enough.” Permalink.
|
|
You determine the greatness of your accomplishments by the amount of pain you’re willing to pay down. The more ambitious you are, the more glass you’ll have to chew. Everyone has their grind, even people doing what they love.” A wonderfully inspirational piece from Arram Sabeti, CEO of ZeroCater, on the important role determination plays in success, especially in the face of deficiencies. Permalink.
|
|
Probabilistic arguments are a key tool for the analysis of algorithms in machine learning theory and probability theory. They also assume a prominent role in the analysis of randomized and streaming algorithms, where one imposes a restriction on the amount of storage space an algorithm is allowed to use for its computations (usually sublinear in the size of the input). While a whole host of probabilistic arguments are used, one theorem in p..
|
|
Probabilistic arguments are a key tool for the analysis of algorithms in machine learning theory and probability theory. They also assume a prominent role in the analysis of randomized and streaming algorithms, where one imposes a restriction on the amount of storage space an algorithm is allowed to use for its computations (usually sublinear in the size of the input). While a whole host of probabilistic arguments are used, one theorem in p..
|
|
Probabilistic arguments are a key tool for the analysis of algorithms in machine learning theory and probability theory. They also assume a prominent role in the analysis of randomized and streaming algorithms, where one imposes a restriction on the amount of storage space an algorithm is allowed to use for its computations (usually sublinear in the size of the input). While a whole host of probabilistic arguments are used, one theorem in p..
|
|
No one wants to think of themselves as a Luddite, which is part of what makes technological conservatism so insidious. It can color the thinking of the nerdiest among us, even as we use the latest hardware and software and keep up with all the important tech news. The certainty of our own tech savvy can blind us to future possibilities and lead us to reject anything that deviates from the status quo. We are not immune.” Perhaps not necess..
|
|
Your job? You pick up the freshest, most interesting coffee from tiny roasters who do not drop ship (and of varieties not listed online from bigger roasters) and send them by request to customers around the world. Your customers trust you as a reporter and pay a small premium to have access to the strange diversity that surrounds you.” The first installment of Rich Stevens’ handmade, artisanal newsletter list. It’s been great fun so far; ..
|
|
By now, it's no secret that making mobile products has a unique set of design challenges. All companies and individuals making mobile products struggle with this. Finding the right balance between power and ease of use on a 3" - 4" screen is hard. It really all boils down to the natural rule of features: **More features => harder to understand, more useful.** **Fewer features => easier to understand, less useful.** So if you just add more f..
|
|
Everyone understands, to some degree, the impact that technology has on our lives. However, if you are an avid reader of “idea” books (for lack of a better word), then you also know that some people understand it poorly at best. Take, for example, the book The Shallows by Nicholas Carr. Carr argues that the Internet has reduced our ability to carefully reason through problems and use our imagination. And plenty of people have taken..
|
|
That depends on if the enum values provide methods which differ from one another. The following code produces just one class file, “Network.class”. “facebook” and “linkedIn” are just instances of the Network Java class. public enum Network { facebook, linkedIn; public void printName() { System.out.println(getName()); } } But the following code produces one class file for each value , named “Network$1.class” etc., as well as one cl..
|
|
Everyone understands, to some degree, the impact that technology has on our lives. However, if you are an avid reader of “idea” books (for lack of a better word), then you also know that some people understand it poorly at best. Take, for example, the book The Shallows by Nicholas Carr. Carr argues that the Internet has reduced our ability to carefully reason through problems and use our imagination. And plenty of people have taken..
|