May 2012 Archives
I recently revamped my photos page. I wanted an interactive, cross-device gallery to display the photos. In the past, I had been using jbgallery, a slick tool that used jQuery. I was having a bit of a hard time getting it to work the way I wanted and it was a little laggy on iOS and Android devices, so I decided to part ways with it. I don't want to speak poorly of it -- it works very well and the developer is friendly, happy to chat, and works to improve his library constantly. It's a nice tool, but wasn't what I was looking for in the end.
Photoswipe looked rad and performed pretty well on my iOS devices (an iPhone 4 and a 2012 iPad with Retina Display). I decided to give it a whirl.
This is my first tutorial related to this kind of stuff - take it with a grain of salt. And let me know if there are blatant errors or better ways to do things.
Into the body of your webpage, you'll need to put the code pointing to the flickr call. Place this wisely -- it'll play an important role in making all of your photos appear in the proper place. As placement is a bit context specific, we won't go into details here. Play around with it or view the source on photographs if you have initial questions.
Open your favorite text editor and create a new file. Paste the following into it. Create a reference to it in your photo gallery page. We'll go through it in more detail below.
Our first line defines our function. Ce n'est rien.
Our next couple of lines set a newly defined variable -- retina -- to see if the Pixel Ratio > 1.
Our next four lines check that we're getting an okay JSON response from flickr. If it's not okay, things are going to halt. This could be due to a poorly formed request, a lack of API key, etc.
Next, we're going to get the number of responses (photos) pulled from our response. This will be important later. We're also going to define a couple of empty variables that we'll use later.
Now comes a bit of a headache. The comment explains how we're choosing a number of different photo sizes and building URLs to access them. Flickr recently revised its API, so for more information / to keep this thing up to date check out the official documentation.
We basically choose a large square image for the thumbnail for retina displays and a smaller one for non-retina displays; similarly, we choose a large image for retina displays and a smaller one for non-retina displays. This introduces a bit of an issue -- if a user is on Edge with a retina display, the image will load slooooowly. There are ways around this, but its a bit too much for me to deal with.
The next bits -- r+= and s+= -- build list items for each image. This chunk should be filled with code relevant to the layout of your page. If you're not using PhotoSwipe, you can adapt this to whatever you need it to be. Just be sure to keep track of the quotation marks.
If we have a retina display, we embed the retina images; otherwise, we embed the standard images.
And we're off! I made a number of other small tweaks to the PhotoSwipe JS to make it work the way I wanted. But, overall, this covers the gist of it. Download a copy of the script here.
Jason Snell / Macworld: Tim Cook at All Things D →
Jason Snell did an amazing job covering Tim Cook’s interview with Walt Mossberg and Kara Swisher at this year’s All Things D conference. My favorite bits from Tim are below - secretive on products, opening up on all the other important stuff.
Tim: We’re going to double down on secrecy on products. I’m serious. However, there’s going to be other things where we’re going to be the most transparent company on the world. Like social change. Supplier responsibility. What we’re doing for the environment. We think that transparency is important in these areas, and if we are, other people will copy us.
In the past we did an annual report and that was our method of transparency. Did we do more than others? I think most people would say yes. Our actions were clearly much more. But our communication was once per year. Now we’re putting out monthly reports. We want everyone to know what we’re doing, and we hope people copy us.
Kara: Assess the China situation. You have many critics, not just fictional ones.
Tim: We decided over a decade ago that there were things we could do better than anyone else, and those things we could do ourselves. And other things, other people could do those better than we can… manufacturing was one of those. The operational expertise and engineering and supply chain mgt, Apple does all of that. But manufacturing, we said, you know, other people can do that as well as we can.
Walt: Is that still true?
Tim: I think it’s still true. We went through a lot of effort in taking overtime down. It’s hard, it’s complex. Some people want to work a lot. Some people want to work a whole lot because they want to move and work for a year or two and bring back as much money as they can to their village. We took a position to say we want to bring this down. We’re measuring working hours for 700,000 people. I don’t know who else is doing this. And we’re reporting it. It’s almost like the labor report that the U.S. puts out.
Walt: There’s been a lot of attention in the last month to revival of manufacturing in the US, WSJ today had a piece about wages in US being relatively attractive. You used to have factories in the US. Do you ever see the possibility? You’re a huge company, the most influential company in tech. One of the most in any industry. Will there be an Apple product ever made in the US?
Tim: I want there to be. This isn’t well known, but the engine for the iPhone and the iPad are built in the US, not just for the US but the world. The glass for your iPhone is made in a plant in Kentucky, not just for the US but other markets outside the US. so I think there are things that can be done in the US, not just for the US, but exported for the world
People focus on the final assembly, because that’s the part where people look at it and say that’s an iPhone, they don’t think of all the parts underneath that add significant value. So on assembly, could it be done in the US? I hope so some day. The tool and die maker skill in the US began to go down in the 60s and 70s. How many tool and die makers do you know now? We couldn’t fill a room. In China you’d need several cities.
So there has to be a fundamental change in the education system, to bring back some of this. But there are things that we can do. The semiconductor industry is fantastic in the US. The Corning deal with glass in Kentucky, this is fantastic. So we will do as many of these as we can do.
And we will use the whole of our influence [so] that we can do it.
Around 6p yesterday, I decided to head over to the Marin headlands to catch the Golden Gate Bridge’s 75th Birthday fireworks display. I wasn’t the only one with this idea — dozens of photographers and other Bay Areans were in the Headlands. The usual mix - beat-boxing Marin teenagers, reformed Hippies and Beats, wine and cheese toting young and old couples.
The hike to the lookout atop Slacker Hill is a short, uphill jaunt from the intersection of Conzelman and McCullough. The trail is, for the most part, wide and sandy. It climbs quickly to a vista with one of the best 360Âº views of the Bay Area. On a clear day or evening, it is truly a spectacular site. Even before the explosions began, it didn’t disappoint.
I talked with a few fellow photographers up there, everyone anxious to know where the fireworks were coming from - a barge west of the bridge? small boats in the Bay? - and commenting on the ‘cold.’ A pleasant, self-selecting bunch - after all, it takes a certain type to lug chairs, coolers, tripods, and themselves up a hill on a brisk night.
I wandered off for a while, catching a beautiful sunset that bathed the hill in radiant yellow, orange, and pink hues. When I returned, there were many more photographers; the area under the bridge on both sides had been cordoned off from any sea traffic. The bay was full of boats of all sizes, a school of tiny lights twinkling like rubies and emeralds, gently swaying in the ocean.
A little after nine, the bridge was emptied and all of its lights were turned off. A pretty neat sight, and as a fellow onlooker noted, a short break for grandpa golden gate after 75 years of service. We sang the bridge happy birthday.
Suddenly, streams of light poured off the bridge, bright white streaks quenched by the deep blue. The stalwart red scaffolding caught the light, blazing phosphorescencently. Much to our collective surprise, the bridge itself was fully equipped with pyrotechnics of its own, supplementing the small firework-festooned fleet flinging explosives. Meanwhile, the Slacker Hill onlookers flung strings of excitement-tinged expletives. I thought briefly about the air quality, valiantly trying to quiet those impulses.
The show lasted 30 minutes or so, ending with a spectacular display and a long, slow drive home.
This just happened. Drove over to Marin with the camera, the 50mm dreamboat lens, and a large, beast of a video tripod. More
From ABC News Blogs: Cows ♥ beer →
They’re smart. They’re organized. And they’re coming for your beer.
Police in Boxford, Mass., arrived at the scene of a backyard party on Sunday night to find six cows helping themselves to a table full of beer.
The cans of beer were left behind by the 12 or 13 young adult females who had been enjoying their Sunday night when the cows crashed their party in Boxford, a Boston suburb with a population of nearly 8,000, according to police.
“I could hear them [the partygoers] screaming in the backyard and I hoped they weren’t getting trampled,” Lt. James Riter told WickedLocal Boxford, which first reported the story.
“I saw one cow drinking the beer on its way down as it spilled off the table,” he told the site. “Some of the cows were also picking through the empties in the recycling bin. They just went in and helped themselves.”
Lt. Riter was first put on the cows’ trail around 9 p.m. when the department received a call that six cows were loose in the rural town’s Main Street area. Riter and his partner, officer Joseph Borodawka, drove behind the cows in their cruiser. But that sent the cows off the main road and into the surprised partygoers’ path.
Business Insider: Tar Sands: A View from Above →
Another look at the Athabascan tar sands operation, this time from above. The scale of the undertaking — both logistically and literally — is mind-bogglingly immense. From the air, the trucks look like micro-machines playing in the mud. Micro-machines, though, don’t have tires 17 ft tall; they don’t claim to be able to roll over full-sized Ford and Chevy trucks with little effort; they aren’t bucketwheels, the “largest crawling machine in existence”; they don’t cost 40-6000 USD each. They don’t obliterate their surroundings so completely that you can see the whole blighted region on Google Maps (embedded below - zoom in, scroll around).
Two things stand out. First, the whole thing is on the scale of a hellish scene from a Michael Bay Transformers movie — the machines; the muted colors, occasionally splotched with a frightening vibrance; the flames; the mud-spattered faces; the destruction. A disaster, in every possible sense of the word.
Second, and more seriously, the impact here is tremendous. There’s the immediate environmental impact, which is severe. Then there’s the fact that the tar sands contain two times the carbon dioxide emitted by humanity’s cumulative fossil fuel use. The long-term implications of accessing and using this resource, while continuing to exploit our current stores of coal, natural gas, and oil, is nothing short of apocalyptic.
James Hansen, the pre-eminent climate scientist, put it nicely in a recent NYT Editorial.
The concentration of carbon dioxide in the atmosphere has risen from 280 parts per million to 393 p.p.m. over the last 150 years. The tar sands contain enough carbon — 240 gigatons — to add 120 p.p.m. Tar shale, a close cousin of tar sands found mainly in the United States, contains at least an additional 300 gigatons of carbon. If we turn to these dirtiest of fuels, instead of finding ways to phase out our addiction to fossil fuels, there is no hope of keeping carbon concentrations below 500 p.p.m. — a level that would, as earth’s history shows, leave our children a climate system that is out of their control.
The Bay Lights Project will mount 25,000 individually controllable LEDs on the Bay Bridge’s suspension cables. You can see some BLP folks on the cables here, in an amazing video. Seems to be a massive undertaking and a potentially incredible art project. It should draw some pretty neat attention to one of the ‘other’ SF-area bridges.
The artist’s vision is to be able to control the individual LEDs to create a pulsing, mutating, living array of shapes, textures, and light.
The Bay Lights is an iconic light sculpture designed by internationally renowned artist Leo Villareal. This stunning fine arts experience will live for two years on the Bay Bridge West Span, starting with a Grand Lighting in late 2012.
In May of 2011, Robert Krulwich (co-host of RadioLab and Emmy-award winning communicator extraordinaire) gave the commencement speech at Berkeley’s School of Journalism. The whole thing is fascinating, outlining Krulwich’s path into journalism, his interactions at CBS, and his vision for the future of young journalists. As expected, some of it is specific to journalism, but much of it is sagely gold rendered from words. My favorite bit’s below, but the whole thing is, per the norm, worth a read.
Think about horizontal loyalty. Think about turning to people you already know, who are your friends, or friends of their friends and making something that makes sense to you together, that is as beautiful or as true as you can make it.
And when it comes to security, to protection, your friends may take better care of you than CBS took care of Charles Kuralt in the end. In every career, your job is to make and tell stories, of course. You will build a body of work, but you will also build a body of affection, with the people you’ve helped who’ve helped you back.
And maybe that’s your way into Troy.
There you are, on the beach, with the other newbies, looking up. Maybe somebody inside will throw you a key and let you in… But more likely, most of you will have to find your own Trojan Horse. And maybe, for your generation, the Trojan Horse is what you’ve got, your talent, backed by a legion of friends. Not friends in high places. This is the era of Friends in Low Places. The ones you meet now, who will notice you, challenge you, work with you, and watch your back. Maybe they will be your strength.
Hemingway, responding to a question about “the function of [his] art” from an interview published in the Paris Review.
From things that have happened and from things as they exist and from all things that you know and all those you cannot know, you make something through your invention that is not a representation but a whole new thing truer than anything true and alive, and you make it alive, and if you make it well enough, you give it immortality. That is why you write and for no other reason that you know of. But what about all the reasons that no one knows?
Seems true for all creative endeavors. Really enjoying the interviews series at the Paris Review.
Seems many people are on a redesign tear. All focused on readability and putting content front and center, and abstracting other elements to the background — navigation elements, ads, etc. Zeldman’s the latest — and most extreme — case. His site looks pretty amazing (and striking) and probably looks outstanding on retina-calibre displays (to be confirmed in a few minutes). If we believe the following, we’re blessed:
This redesign is deliberately over the top, but new ideas often exaggerate to make a point. It’s over the top but not unusable nor, in my opinion, unbeautiful. How can passages set in Georgia and headlines in Franklin be anything but beautiful? I love seeing my words this big. It encourages me to write better and more often.
But this is my personal site. There are many like it, but this one is mine. And on this one, I get to try designs that are idea-driven and make statements. On this one, I get to flounder and occasionally flop. If this design turns out to be a hideous mistake, I’ll probably eventually realize that and change it. (It’s going to change eventually, anyway. This is the web. No design is for the ages, not even Douglas Bowman’s great Minima.)
I don’t think you will see much type quite this big but I do think you will see more single-column sites with bigger type coming soon to a desktop and device near you. For a certain kind of content, bigger type and a simpler layout just make sense, regardless of screen size. You don’t even have to use Typekit or its brothers to experiment with big type (awesome as those services are). In today’s monitors and operating systems, yesterday’s classic web fonts—the ones that come with most everyone’s computer—can look pretty danged gorgeous at large sizes. Try tired old Times New Roman. You might be surprised.
The present day designer refuses to die.
Gary Snyder in the Paris Review →
Beth and I saw Gary Snyder speak at Berkeley in Doe Library a few nights ago. Snyder is among my favorite poets; hearing him speak and read some of his works fulfilled an old dream. He lectured mainly on his acts of translation, interwoven with anecdotes from his past.
This interview from the Paris Review sums up many of the reasons I like the man. A few gems follow (some line breaks added to split up the text):
I guess one’s work as a writer really holds one to the literally physical act of writing and visualizing and imagining and researching and following out the threads of one’s project. However, if one is a nonfiction prose writer or a poet, one is apt to be much more closely engaged with daily life as part of one’s real work, and one’s real work actually becomes life.
And life comes down to daily life. This is also a very powerful Buddhist point: that what we learn and even hopefully become enlightened by is a thorough acceptance of exactly who we are and exactly what it is we must do, with no evasion, no hiding from any of it, physically or psychologically. And so finding the ceremonial, the almost sacramental quality of the moves of daily life is taught in Buddhism. That’s what the Japanese tea ceremony is all about. The Japanese tea ceremony is a model of sacramental tea drinking. Tea drinking is taken as a metaphor for the kitchen and for the dining room. You learn how to drink tea, and if you learn how to drink tea well, you know how to take care of the kitchen and dining room every day. If you learn how to take care of the kitchen and the dining room, you’ve learned about the household. If you know about the household, you know about the watershed. Ecology means house, oikos, you know, from the Greek. Oikos also gives us economics. Oikos nomos means “managing the household.” So that’s one way of looking at it. I understand that there are other lines and other directions that poets take and I honor them. I certainly don’t believe there’s only one kind of poetry.
And then the fundamental ethical precept: whatever you do, try not to cause too much harm.
Bandwiches by John Peck →
Imagine your favorite rock band… as a sandwich. My favorites below, but check out the whole list. It is outstanding.
Led Zeppelin: Arum sandwich with hummus, lettuce, 22 thin-sliced deli meats; side of Colman’s mustard.
Bob Dylan: Scrapple, melted pepper jack, hemp-seed garlic bread.
Ted Nugent: Cubed Grizzly bear, white buffalo brisket, unicorn haunch, Jim Beam barbecue sauce, white bread.
Bruce Springsteen: Cheesesteak, peppers, grilled headband, ketchup, seeded bun.
Queen: Fried Corinthian leather, Pop Rocks, sprouts, mayo, baguette.
Prince: Braised peacock cheeks, lavender spread, mustard, mayo, baguette.
Roar your terrible roars... Maurice Sendak (1928 - 2012) →
Some gems from the NYT Obit follow:
Maurice Sendak, widely considered the most important children’s book artist of the 20th century, who wrenched the picture book out of the safe, sanitized world of the nursery and plunged it into the dark, terrifying and hauntingly beautiful recesses of the human psyche, died on Tuesday in Danbury, Conn. He was 83 and lived in Ridgefield, Conn.
In book after book, Mr. Sendak upended the staid, centuries-old tradition of American children’s literature, in which young heroes and heroines were typically well scrubbed and even better behaved; nothing really bad ever happened for very long; and everything was tied up at the end in a neat, moralistic bow.
Though he understood children deeply, Mr. Sendak by no means valorized them unconditionally. “Dear Mr. Sun Deck …” he could drone with affected boredom, imitating the semiliterate forced-march school letter-writing projects of which he was the frequent, if dubious, beneficiary.
But he cherished the letters that individual children sent him unbidden, which burst with the sparks that his work had ignited.
“Dear Mr. Sendak,” read one, from an 8-year-old boy. “How much does it cost to get to where the wild things are? If it is not expensive, my sister and I would like to spend the summer there.”
Deschutes County, Oregon may be Mecca for American beer aficionados. There’s Deschutes, of course, but also Cascade Lakes, Bend Brewing, Three Creeks, Boneyard, and Crux. Sounds pretty outstanding - and turns out all the craft beer making has had positive economic impacts. From the NYT:
While places like Seattle and Denver and Brooklyn and Delaware can claim impressive craft brewing scenes, and a weirdly large number of people nationwide now speak of hop fetishes and beer crushes, Bend is a per capita powerhouse. With 80,000 people surrounded by not much of anything — with no Interstate, no university, and the closest major city 160 miles away across steep and snowy mountains — beer has had room to make a difference.
And, from the Oregon Employment Department,
Eight brewers sold 106,115 barrels of beer, 27 percent of the total barrels sold in the state by Oregon breweries and brew pubs. In people terms, local breweries and brew pubs sold 222 pints per Deschutes County resident of legal drinking age in one year. This was more than six times the number sold by all Oregon breweries and brew pubs per Oregon resident of legal drinking age last year. Since 2005, Deschutes Brewery sold at least 20 percent of the state’s total taxable barrels concocted by Oregon breweries and brew pubs.
In Oregon, there were approximately 3,000 jobs at the 94 breweries and brew pubs that reported taxable barrels of beer in 2010. Not all of the 94 businesses on the OLCC list reported employment last year, but 80 firms did report. The reported jobs made up just 0.2 percent of the state’s total employment.
Deschutes County breweries and brew pubs reported 450 jobs in 2010. That is 15 percent of all of the brewing employment in the state. For a county that had 4 percent (one of every 25 jobs) of the state’s total employment that year, one out of seven jobs in Oregon brewing is quite impressive.
One wonders about the sustainability of the enterprise and the potential for dilution of quality by flooding the market with (delicious) niche products. That said, one of my favorites parts about my time in the Pacific Northwest was discovering small, local breweries that don’t sell their beers outside of a small geographic zone. In our increasingly globalized marketplace, it’s nice (and admittedly quaint) to be able to enjoy something at the site of its creation and nowhere else.
Stephen King, just slaying it with righteous anger. I appreciate anyone who can use “bullshit persiflage” and keep on steam-rolling. A few passages from the article below, though the whole thing is worth a read.
Cut a check and shut up, they said.
If you want to pay more, pay more, they said.
Tired of hearing about it, they said.
Tough shit for you guys, because Iâ€™m not tired of talking about it. Iâ€™ve known rich people, and why not, since Iâ€™m one of them? The majority would rather douse their dicks with lighter fluid, strike a match, and dance around singing â€˜Disco Infernoâ€™ than pay one more cent in taxes to Uncle Sugar. Itâ€™s true that some rich folks put at least some of their tax savings into charitable contributions. My wife and I give away roughly $4 million a year to libraries, local fire departments that need updated lifesaving equipment (Jaws of Life tools are always a popular request), schools, and a scattering of organizations that underwrite the arts. Warren Buffett does the same; so does Bill Gates; so does Steven Spielberg; so do the Koch brothers; so did the late Steve Jobs. All fine as far as it goes, but it doesnâ€™t go far enough.
What charitable 1 percenters canâ€™t do is assume responsibilityâ€”Americaâ€™s national responsibilities: the care of its sick and its poor, the education of its young, the repair of its failing infrastructure, the repayment of its staggering war debts. Charity from the rich canâ€™t fix global warming or lower the price of gasoline by one single red penny. That kind of salvation does not come from Mark Zuckerberg or Steve Ballmer saying, â€˜OK, Iâ€™ll write a $2 million bonus check to the IRS.â€™ That annoying responsibility stuff comes from three words that are anathema to the Tea Partiers: United American citizenry.
I guess some of this mad right-wing love comes from the idea that in America, anyone can become a Rich Guy if he just works hard and saves his pennies. Mitt Romney has said, in effect, â€œIâ€™m rich and I donâ€™t apologize for it.â€ Nobody wants you to, Mitt. What some of us wantâ€”those who arenâ€™t blinded by a lot of bullshit persiflage thrown up to mask the idea that rich folks want to keep their damn moneyâ€”is for you to acknowledge that you couldnâ€™t have made it in America without America. That you were fortunate enough to be born in a country where upward mobility is possible (a subject upon which Barack Obama can speak with the authority of experience), but where the channels making such upward mobility possible are being increasingly clogged. That itâ€™s not fair to ask the middle class to assume a disproportionate amount of the tax burden. Not fair? Itâ€™s un-fucking-American is what it is. I donâ€™t want you to apologize for being rich; I want you to acknowledge that in America, we all should have to pay our fair share. That our civics classes never taught us that being American means thatâ€”sorry, kiddiesâ€”youâ€™re on your own. That those who have received much must be obligated to payâ€”not to give, not to â€œcut a check and shut up,â€ in Governor Christieâ€™s words, but to payâ€”in the same proportion. Thatâ€™s called stepping up and not whining about it. Thatâ€™s called patriotism, a word the Tea Partiers love to throw around as long as it doesnâ€™t cost their beloved rich folks any money.