Mongo Boston: Who’s coming?

via Mongo Boston: MongoDB conference in Boston, MA.

Meghan just announced on the New York Mongo mailing list that they are organizing a MongoDB conference in Boston. NYC to Boston is a nice road trip and the price is right… I’m in.

10gen is organizing a major MongoDB in conference in Boston on September 20. It is a full day event at the Microsoft NERD Center, featuring presentations from several of the developers at 10gen working on the project. In addition, there will be many presentations from companies using MongoDB in production – Totsy, Yottaa, Swipely, Sluggy.com, MyPunchbowl, tiptheweb.org, Harmony. There are even a few members of the NY Mongo User Group presenting, specifically Brendan McAdams (who gave the August talk on Scala + Mongo) and Mitch Pirtle.

I’ve already got my sessions planned out too…

  1. Introducing MongoDB into your organization: MyPunchbowl with Ryan Angilly
  2. Schema Design with Alvin Richards
  3. Indexing and Query Optimizer with Mike Dirolf
  4. MongoHQ: Cloud-based MongoDB Hosting with Ben Wyrosdick & Jason McCay
  5. Map/reduce, geospatial indexing, and other cool features with Mike Dirolf
  6. Replica Sets with Nosh Petigara
  7. Scala + Mongo for Java Developers who don’t know Scala with Brendan McAdams
  8. Python Development with Brendan McAdams
  9. MongoDB E-Commerce Case Study: Totsy with Mitch Pirtle
  10. Real World Data Modeling with MongoDB at Harmony with Steve Smith
  11. MongoDB Roadmap with Alvin Richards

And, of course, the After-Party :)

Posted in MongoDB | Leave a comment

A Better Way to Loop in WordPress 3

A core concept of WordPress development is understanding how The Loop works and how to juggle multiple loops on a single page. To make things easier, WordPress ships with several helper functions to access and render components of individual posts; for example the_title() and the_excerpt(). In order for these functions to work, you need to initialize the global variables which these helpers rely by calling setup_postdata() and pass in the post which you are trying to set up.

One of the problems with this approach is that each of these functions rely on several global variables to keep track of everything. When setup_postdata() is called, most of those variables are clobbered in favor of the new post data. If you wish to refer back to the some data in the original post, chances are you’ll simply be pulling in data from the last post rendered on the screen.

The get_posts() codex page offers some sample code which works around this limitation:

<ul>
    <?php
        global $post;
        $tmp_post = $post;
        $myposts = get_posts('numberposts=5&offset=1&category=1');
        foreach($myposts as $post) :
            setup_postdata($post);
    ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    <?php $post = $tmp_post; ?>
</ul>

Although it’s an obvious hack, it works. After looping over every other post in $myposts, the original post data is restored so other plugins and core WordPress functions will behave normally.

If you’re a WordPress 3 user (which I seriously hope you are), you don’t need to deal with that mess. Simply call wp_reset_postdata() and call it a day. Just like the code above, wp_reset_postada() simply rewrites the global $post with the original post in $wp_query. You can find the details inside of wp-includes/query.php:

/**
 * After looping through a separate query, this function restores
 * the $post global to the current post in the main query
 *
 * @since 3.0.0
 * @uses $wp_query
 */
function wp_reset_postdata() {
	global $wp_query;
	if ( !empty($wp_query->post) ) {
		$GLOBALS['post'] = $wp_query->post;
		setup_postdata($wp_query->post);
	}
}
Posted in WordPress | Leave a comment

Can the jQuery Ready Event Actually Slow Page Load?

An interesting post from Dave Ward came my way today which outlines a few conditions in which the jQuery Ready event my actually increase perceived load times.

…what if $document.ready is slowing you down? In this post, I’m going show you specific instances where postponing startup code until the document’s ready event slows perceived page load time, could leave your UI needlessly unresponsive, and even causes initialization code to run slower than necessary.

While I always do make a conscious decision to separate library and application code from my initialization methods, I’m starting to wonder if I should be paying more attention to applications similar to his examples.

Dave concludes that this certainly isn’t applicable in all situations. True, in fact, I’d say it’s always the safe bet to include your init routines in a ready event. When you get to the point where performance optimization matters, these are some great points to consider.

via Don’t let jQuery’s $document.ready slow you down | Encosia.

Posted in Bookmarks | Leave a comment

Adding Markdown Support to Notational Velocity

Steven Frank has made a wonderful contribution to the open source community today by adding Markdown support for Notational Velocity.

I forked the excellent open source! Notational Velocity app, and hacked in a third pane that shows you the note you’re viewing as rendered by Markdown.

As an avid note taker and fan of Simplenote and Markdown, this is an absolutely amazing addition an already excellent piece of software. You can fork the nv Github repository to get access. I haven’t found any binaries as of yet.

Update 8/30/2010: — Binaries may be found on the nv Downloads page.

via Steven Frank – I forked the excellent open source! Notational… and Minimal Mac.

Posted in Bookmarks | Leave a comment

Multi-Account Support for Google Accounts

This made my Sunday: although it’s been official for almost a month, I’m just now learning that Google now supports logging in to multiple accounts simultaneously.

Now, you can visit google.com/accounts and click the link next to “Multiple sign-in.” After you sign into your first account, you can sign in with up to two additional accounts from the new accounts menu in the upper right hand corner of Gmail, then easily toggle back and forth between them. You can even open multiple Gmail tabs — one for each of your accounts.

If you’re a Google Apps customer you may have noticed that this has always been allowed so I can’t say that this is a huge surprise — though I’m quite happy to see they’ve taken the steps to improve the usability in standard google accounts by adding a menu next to your account name. According to the post, the drop-down (for something similar) will be coming to Apps customers after they roll out their new infrastructure.

Since Google Apps customers can already sign in to their accounts at the same time as their personal Google Accounts, we won’t be adding this new feature to Google Apps until the new infrastructure is in place.

via Access two Gmail accounts at once in the same browser – Official Gmail Blog.

Posted in Bookmarks | Leave a comment

Dark Patterns

We all know them. If you’ve ever registered a domain name before, purchased a car, or hell, watched TV for 10 minutes, then you’ve experienced a dark pattern.

Normally when you think of “bad design”, you think of laziness or mistakes. These are known as design anti-patterns. Dark Patterns are different – they are not mistakes, they are carefully crafted with a solid understanding of human psychology, and they do not have the user’s interests in mind.

Out of all the pattern catalogs I have bookmarked, this is possibly one of the most interesting.

via Dark Patterns.

Posted in Bookmarks | Leave a comment

Extending the Magento API

Branko Ajzele posted a really interesting post today on the Inchoo blog about extending the Magento core API. Surprisingly, it’s not as easy as one would think…

Its all about simple things, right? Well, here is one bottom line simple thing I would like to do with my Magento API. I would like to get a list of all available websites, stores and store views. Can I do that with the latest (as of this writing, 1.4.1.1) Magento? No I cannot! Can I get a list of … etc. For any serious scenario you will most likely be out of luck. What’s interesting is that rarely even a combination of several method calls will give you what you might need. Trust me on this one, I am writing Android application for Magento and its killing me.

I’ve oftentimes thought about this, but to be honest, every time I’ve had to use the core API, it’s been because the project was really, really simple or because it was my last resort (trust me, I avoid anything Soap-related like it’s the plague).

If you’re not trying to do anything complicated, the API is actually one of the more pleasant parts of Magento to work with. Unfortunately, it’s Soap-based and slow as hell, but for simple tasks it does the job well.

As Branko points out, the moment you try to do anything interesting with it (like build a mobile app), you quickly realize that it’s simplicity is actually a weakness and a point of great frustration.

The key to overcoming this limitation is to extend every core API method with your own library, made available via a plugin. When you need to add functionality, you add the method to your subclass and publish the method via the extension’s configuration.

Branko was kind enough to make his solution available on Github and he promises to document it more in the coming weeks.

via Inchoo.

Posted in Bookmarks | Leave a comment

Come See Me Speak at The Rich Web Experience

Who’s going to be in FL this year? You should come see me speak at the 2010 Rich Web Experience! I’ll be giving several talks and probably giving a workshop too.

No Fluff Just Stuff is pleased to announce The 2010 Rich Web Experience.

RWX 2010 will cover the hot areas of interest in the web space today: HTML5, CSS3, JavaScript, Ajax Libraries, Semantic Web, iPhone, Android, Flex, GWT, NodeJS, Security, and more. RWX 2010 will feature 6 parallel tracks with over 15 speakers and 60 plus technical sessions/workshops. At RWX 2010 you will interact with industry experts, project leads, authors, and top developers.

Front-end development practices continue to evolve at a frantic pace. RWX 2010 will help you stay up-to-speed with the latest tools, frameworks, usability, and development practices. Our speakers are opensource leaders, project committers, published authors, and professional trainers. We are excited to make them available to you!

If you are ready to take your web skills to the next level, join us in Fort Lauderdale. All Inclusive Package available – registration pass, airfare and lodging!

via The Rich Web Experience Conference.

Posted in Misc | 1 Comment

A Lesson in Basic Accounting

I just finished reading WorkingPoints 10 Minute Lesson in Basic Accounting Concepts.

… we’ve created a 10 minute, easy to use guide to basic accounting and terms so that you have the understanding you need to set up any kind of accounting or payroll software by teaching you the basic concepts and vocabulary you might come across.

While it doesn’t replace a full book on the subject (or better yet, rolling up your sleeves and doing it yourself) it serves as a great introduction into what can be a very complex topic.

Funny enough, when you read the guide (PDF), it really does take 10 minutes. This is definitely a good resource to keep around.

via WorkingPoint.

Posted in Business | Leave a comment

Auto Increment with MongoDB

Chris Shiflett just posted a great summary on how he was able to achieve auto-incrementing identifiers in MongoDB.

We are currently working on an app that uses a number of technologies, including PHP, Python, and MongoDB. Recently, a need arose to use sequential identifiers for users, similar to an auto_increment column in MySQL.

The technique is simple, although some may argue not as elegant as the MySQL implementation. It works by defining a collection of incrementors, which hold an incrementing value for other collections.

Each time a new document is added, you simply findandmodify() your incrementor collection and put the new incremented value into your document to be saved.

While not elegant (compared to MySQL or similar), this approach actually offers much more flexibility in the long run.

via Chris Shiflett.

Posted in MongoDB | Leave a comment