The day has finally arrived. We are finally living in the future. Buck just sent me a link that head tracking for the iPhoneis real (kinda). The horseless carriage and printing press have nothing on this!
Just barely over a year ago, I posted that somebody should build a head-tracking iPhone app. Since the iPhone can’t literally track your head/eyes, it couldn’t be “real” head tracking, but it could infer from the accelerometer well enough… and sure enough someone has done just that! Awesome!
The good folks over at Drömsynt have fullfilled my dream and built Diorama, the first head-tracking-but-not-really iPhone app in the entire universe ever. They even built stereoscopic-i-need-blue-red-glasses 3d into it (?!) incredible! I am purchasing it right now.
I got an interesting email this week, asking about how to use Columnizer to help layout a multipage and multicolumn newsletter. The length of the content would vary from week to week, so the newsletter needed to be grow/shrink to as many pages as necessary. It also needed a custom header and footer for each page.
How does it work? Let’s take a look at the source, beginning with the HTML:
<body>
<div id="page_template">
<div class='header'>This is a header<hr></div>
<div class='content'></div>
<div class='footer'><hr><span>Page: </span>This is the footer.</div>
</div>
<div id="newsletterContent"> Newsletter Content Goes Here</div>
</body>
We define the template for what we want each page to look like. For our case, every page will have the exact same header and footer (with the page number shown in the footer), and page content should be split into 2 columns. Beneath our template, we just print out the entire contents of the newsletter that we want columnized.
Columnizing the Content
Our basic algorithm will be:
Copy the page template and append it to the bottom of the <body>
Columnize what’s in #newsletterContent into that last page until it’s full
Put whatever doesn’t fit back into #newsletterContent
Repeat until #newsletterContent is empty
Awesome, so lets see that in real life code:
$(function(){
// the height of the content, discluding the header/footer
var content_height = 652;
// the beginning page number to show in the footer
var page = 1;
function buildNewsletter(){
if($('#newsletterContent').contents().length > 0){
// when we need to add a new page, use a jq object for a template
// or use a long HTML string, whatever your preference
$page = $("#page_template").clone().addClass("page").css("display", "block");
// append the page number to the footer
$page.find(".footer span").append(page);
$("body").append($page);
page++;
// here is the columnizer magic
$('#newsletterContent').columnize({
columns: 2,
target: ".page:last .content",
overflow: {
height: content_height,
id: "#newsletterContent",
doneFunc: function(){
console.log("done with page");
buildNewsletter();
}
}
});
}
}
buildNewsletter();
});
The Result
Check out the fully columnized and multi-paged newsletter sample, and be sure to check out the Columnizer project page for more samples, documentation, and of course, to download Columnizer!
It’s been really fun over the past few months to see how different people are using Columnizer. If your site uses Columnizer, give me a shout in the comments, I’d love to check it out!
Friendfeed now reports subscriber counts to feedburner, so you have a more accurate view of your total subscriber counts all in one place. This is particularly good news for a data nerd like me, since the Friendfeed API doesn’t even let you find out your ff subscriber count.
In my opinion this is an incredibly bad move from FeedBurner. It is incredibly easy to get people to subscribe to an RSS feed through FriendFeed. Just like Twitter, many people follow anyone who follows them. This means that the feedburner count can be very easily manipulated to show a higher count than it actually has.
There’s absolutely some truth to that, and comments in freindfeed’s blog post go further.
I push out a full feed, so those subscribers are getting the content. They are the equivalent of site visitors. Friendfeed merely publishes the headline so that is a very different kind of subscription.
Absolutely true. I’m in the same boat, my feed has the entire article, but friendfeed shows only headlines.
On a similar topic, I was excited not long ago about the idea of automatically subscribing to my twitter followers blogs in friendfeed. It was a dead simple way to subscribe to all their blogs and get some awesome content - but it turned out that headlines-only-feeds pretty much suck. Awesome opportunity gone. Anyone else have any good soultions for massively subscribing to a twitter followers’ blogs?
Benjamin Sherman just put up an awesome post about how to get Juniper VPN working on 64-bit Ubuntu. I’m working remotely for the next 3 ish weeks, so this has saved me.
WASHINGTON (AP) — After a line-by-line scrub of the federal budget, President Barack Obama has signed off on a roster of 121 budget cuts totaling $17 billion — or about one-half of 1 percent of the $3.
Dr. Evil Antinori (pictured below) claims to have cloned 2 boys and a girl nine years ago and just broke the news today?! How on earth did I miss this until now? I’m hours late to this news.