(via npr)
Handling timezones in apps: a quick guide
Time is an illusion, lunchtime doubly so. ~Douglas Adams
Many apps need to show the actual time based on a user’s timezone, instead of the more popular pretty date format (e.g. 2 days ago). Handling timezone information can be a pain if done wrong, specially when dealing with daylight savings, so here’s a little guide to help developers.
Storing time information in database
Always store time (including date-time) in UTC, and only convert it into the required timezone when displaying to user.
How to determine user’s timezone (for display)
On a browser, in order to reliably determine the user’s timezone, use jstz. jstz.determine_timezone() will give you the timezone with offset, name and whether daylight savings are on. When the user loads your app, you can determine the timezone and push it to your server in a Ajax request (or any other way).
The timezone returned here can by used server side by libraries like pytz for python.
Bonus tip: Make timezone conversions on server-side than javascript
Better performance.
Additional reading:
The C Word
Earlier this week, popular site Brain Pickings’ Maria Popova announced the Curator’s Code, a couple of obscure symbols to indicate the “source” of a shared link. While it got tremendous coverage across the web, the best response to the “code” was by Matt Langer:
First, let’s just get clear on the terminology here: “Curation” is an act performed by people with PhDs in art history; the business in which we’re all engaged when we’re tossing links around on the internet is simple “sharing.”
The word curator has always reminded me of that old man who was killed in the Louvre in the opening of the bestseller novel, The Da Vinci Code. Not someone who reblogged, retweeted or reshared a post, image or video on the web. I’m not trying to undermine the great work Maria is doing with Brain Pickings and her other projects, they’re a source of very interesting articles for me every day, but Marco nails it in his post:
The value of authorship is much more clear. But regardless of how much time it takes to find interesting links every day, I don’t think most intermediaries deserve credit for simply sharing a link to someone else’s work.
Reliably linking to great work is a good way to build an audience for your site. That’s your compensation.
But if another link-blogger posts a link they found from your link-blog, I don’t think they need to credit you. Discovering something doesn’t transfer any ownership to you. Therefore, I don’t think anyone needs to give you credit for showing them the way to something great, since it’s not yours. Some might as a courtesy, but it shouldn’t be considered an obligation.
Excellent infographic summarizing the awesomeness of QR codes…
TED Conference and the intellectual movement
In an interesting piece titled Those Fabulous Confabs in New York Magazine, Benjamin Wallace says this about TED and a slew of TED-wannabes:
All promise much the same thing: a velvet rope to keep out the attitudinally unwashed, serendipitous interaction, quirky content, and at least the illusion of egalitarian elbow-rubbing. They have their own vocabulary, too. These are “thought-leader gatherings” where “rock stars” emerge from their “silos” to learn about “disruptive” ideas that have been carefully “curated.”
Last year around the time Hindustan Times was organizing the Leadership Summit, I got into an argument with a friend on the substance to BS ratio of these summits. Granted, they get the who’s who of our times together under one roof, but I have a natural aversion for such elitism and self-promotion. Anyway, at that time I decided to give up than continue the argument, as the friend in question was a particularly cute specimen of the opposite sex that I may or may not have been seeing at the time.
In 2008, TED’s attendee list was leaked to Valleywag. Anderson implored site owner Nick Denton “as a decent person” to take it down; Denton, who probably doesn’t even consider himself a decent person, ignored the request and posted Anderson’s e-mail. The list was revealing. “If you look at it primatologically,” one TED attendee says, “it was originally designed like an eighteenth-century salon, where the very smart and the very rich pretend they have something in common for a very short time. But now there’s a very small cohort of smart people and CEOs—alphas—and a huge panoply of betas: senior vice-presidents. What’s fascinating is how many betas are in the room.”
All criticism aside, Wallace gives TED credit where it’s due. Tracking the rise of TED, he says:
In the six years since its launch, TED has added over 1,100 talks—the most popular TED-conference talks, plus TED-approved talks from other conferences and events. The most popular of these include Jill Bolte Taylor, a brain researcher, recounting the story of her own stroke; a British educator, Ken Robinson, bringing an effortlessly droll delivery to the argument that schools kill creativity; and David Gallo, an oceanographer, narrating underwater footage of bioluminescent sea creatures and crafty octopuses defending themselves. The idea that would prove more contagious than any other, though, was that of TED itself. Collectively, the TED Talks have been viewed more than 500 million times.
On its impact on the speakers:
The speakers seemingly most affected by their talks on TED are academics previously unknown outside their specialties. Hans Rosling, a Swedish professor of international health, had researched in obscurity before being asked to speak at Davos in the mid-aughts. He was then approached by TED. At first, Rosling declined; TED sounded frivolous, and he considered himself a serious scholar… Collectively, his talks have been viewed more than 8 million times. Rosling has calculated that his TED Talks have garnered more “hours of attention” than his entire preceding life’s work. He has largely given up teaching to work full time on his nonprofit, non-advocacy Gapminder foundation. “TED changed my life,” Rosling says. And not just his: After Larry Page saw Rosling’s first TED Talk, Google acquired the software and ended up hiring Rosling’s son.
My daily lunch workday lunch routine involves Radbox playing my video queue - mostly TED talks and short films, while I eat. That’s where TED shines - the brightest, otherwise little-known academics talk to me about great scientific findings while I grab lunch at my desk in a distant corner of the world.
It might be too soon to worry about it, but Wallace is concerned about the slew of copycats and the resulting dilution of the TED movement:
Until recently, the universal self-actualizing creative ambition was to write a novel. Everyone has a novel in them, it was said. Now the fantasy has changed: Everyone has a TED Talk in them. There are people on YouTube who upload webcammed soliloquies about whatever and title them things like “My TED Talk.” There’s now even a genre of meta–TED Talks. What happens when the idea of ideas worth spreading gets spread thin? What happens when the concept of innovation itself becomes stale?
I strongly recommend you read the complete article (warning: it is quite long) while I go back to working on something TED-worthy!
There are only two hard problems in Computer Science: cache invalidation and naming things.
Phil Karlton
(Found on this redis tutorial)
Consumer internet and privacy: Weighing in on the Path controversy
A few years ago when I was in Oracle, our entire product team got a mandate to make the an older version of an application “accessibility compliant”. This included a huge number of super boring tasks like adding alternate text to images so that the visually impaired who rely on screen-readers could better understand the web page contents. In the consumer tech world, where our everyday engagement with personalized socially curated content relies heavily on cool and awesome sounding buzzwords, compliance is dirty word. In the enterprise world however it is taken seriously, even though developers hate the boring tasks and processes surrounding this concept.
I woke up this morning to the controversy surrounding the Path app’s handling of users’ contact data, and it set me thinking about the state of consumer tech in general. Here’s a brief snapshot of recent controversies which have generated quite a few storms in the tech community tea-cup:
- Curebit (YC, 500 Startups): too lazy to design their own app 1
- Path, Hipster and a bunch of other iOS apps: uploading contact directory to their servers without permission 2
- Facebook ($5 billion IPO): countless controversies, most recently about photographs staying on their CDN years after they were deleted 3
- AirBnB: Lead generation on Craigslist; identity and physical theft in a host’s home and stupid handling of the issue subsequently 4
- Zynga ($2 billion IPO): blatant cloning of popular games, and whole lot of other ugly stuff 5
- Pinterest: non-disclosure of affiliate links 6
This list goes on and on. Name any big or popular consumer company and there’s probably a story from the past year about a transgression that, at best, was a minor “violation of users’ trust” and at worst, completely illegal. What’s interesting, though, and this is just a guess, that all that hate these companies generate on communities like Hacker News doesn’t correspond to any major dent in their growth. I’d love to see some stats if my guess is wrong.
It is quite possible to evolve a compliance framework which certifies apps with ratings across major areas like privacy, security, user experience and so on. The details of this framework are hazy in my mind, but the idea is to have a universally trusted and recognized “badge” which rates apps after a combination of automated and manual checks. Storing passwords in plain text? Poor rating. Dark UX patterns? Bad rating. Great privacy compliance? Awesome. The rating should be analogous to “Verisign secured” for financial transactions.
However, regardless of how well this framework functions, at the end of the day if the market and consumers don’t care enough to punish bad behaviour, then it probably isn’t bad enough to raise such a hue and cry. At the end of the day the ends seem to justify the means for all these companies and if we, the people, let them get away with it, we shouldn’t be complaining.
(CC photo from Dave Makes on Flickr)
Adventures in TodoLand
I can’t explain myself, I’m afraid, Sir, because I’m not myself you see.
~ Alice in Wonderland.
A long time ago, when I was still in school, I used pen and paper to make TODO lists. Stuff like “copy exercise #4 from V and submit tomorrow”. Yeah, I was kinda using GTD years before I heard the term.
Over the past five years, I have had a string of affairs with all the hottest todo apps out there - from Remember the Milk to Wunderlist, but I’ve remained married to pen and paper (or pencil and paper, just to spice things up every now and then). Nothing beats its simplicity, speed and flexibility, and crossing off items on a paper list is a great feeling.
Last week I think I finally found that one TODO app that’s closest to pen-and-paper. It’s called t. Let me warn you though, it’s not for everyone, but hackers should totally love it. It works in the terminal, and this is what it looks like:
adsahay$>t
2 - [blog] post on todo apps
4 - [email] mail someone about something
Creating a new task is this simple:
adsahay$> t [dev] fix some bug
2 - [blog] post on todo apps
4 - [email] mail someone about something
d - [dev] fix some bug
Done with a task? Strike it off the list.
adsahay$> t -f d
2 - [blog] post on todo apps
4 - [email] mail someone about something
Use all sorts of command line goodness to pipe the output of t to count the tasks in the list with wc -l or search by type with grep. Awesome, right? Wait, that’s not all. If you check out the t homepage you can see how to create multiple todo lists. It uses plain text files, so it’s easy to collaborate on a list by sharing a single file (for e.g., using Dropbox). Can you beat that?
Steve, the author of t, says this tool is for those who’d rather do things than organize their TODO list. So far he’s completely correct. Let’s see how long this affair lasts!




