Taffy DB version 1.4

Taffy DB There as been a lot of improvements with Taffy DB since I first open sourced it on March 10th. Aside from being faster and smaller there are also a ton of new ways to search and use your data when you have it within a Taffy DB collection.

In case you missed it, Taffy DB is an open source JavaScript Database library that builds thin and very useful data layer into your Ajax apps. Taffy DB 1.4 introduces object and array comparison along with a host of data type comparisons. You can also filter based on length.

Consider the following JSON collection:

var people_collection = [

{name:”Bob”,friends:[”Dan”,”Sarah”]},

{name:”Sarah”,friends:[”Dan”]},

{name:”Dan”,friends:[”Bob”,”Sarah”]},

{name:”Kyle”,friends:[”Sarah”]}

];

Using regular JavaScript you would have to do something like this to find all the people who are friends with Dan.

var friendsOfDan = (function () {
var f = [];
for(var x = 0;x<people_collection.length;x++)
{
for(var y = 0;y<people_collection[x].friends.length;y++)
{
if (people_collection[x].friends[y] == “Dan”)
{
f[f.length] = people_collection[x].name;
}
}
}
return f;
} ());

But that is a pain. It also isn’t easily portable to other types of problems with your friends collection. Using this method how would you find friends of both Dan and Sarah? What if you want to modify those people records who are friends of Dan or access another variable in their object (gender or birthrate, for example). It would be a mess.

With Taffy DB all this becomes really easy. First you create a Taffy collection:

var people = new TAFFY(people_collection);

Then you find Dan’s friends:

people.find({friends:{contains:”Dan”}});

Then you find friends of both Dan and Sarah by nesting another call to find:

people.find({friends:{contains:”Dan”}},people.find({friends:{contains:”Sarah”}}));

Cool huh? How about if you want to introduce some grade school drama into the example and delete anyone who is friends were Sarah? Easy:

people.remove({friends:{contains:”Sarah”}});

You should probably also delete Sarah herself:

people.remove({name:”Sarah”});

Simple. Easy. Amazingly flexible. You can filter in over a dozen different ways as well as sort, run updates, apply functions, and more. If it isn’t part of your library you may want to take a serious peek.

16 Things I Wish They Had Taught Me in School

16 things I wish I they taught me in schoolThere are blog posts and then there are blog posts. Rarely does a blog post hit the nail on the head as cleanly as Henrik Edberg’s 16 things I wish they had taught me in school. Besides the obvious “I should have thought of that” factor, the article really sounds off on many of the things I’ve learned (and that I’m still learning) that would have been huge if someone had told me about them in when I was of highschool age. That said, they are tough lessons to learn without experience. All and all a great read.

Joe’s Goals Tips and Tricks

How to be an Original just put up a great post with some quick tips and tricks on how to use Joe’s Goals.

Some highlights:

  • Configuring your goals and habits
  • Using logbooks as dividers.
  • How to use bonus points for “perfect” days.
  • Sorting your goals.

The biggest benefit of using Joe’s Goals is the fact that you’re inclined to check in daily, to score your progress. Doing this on a daily basis will help you build your goals and habit changes into your daily routine, increasing the likelihood of success.

Good post and well worth checking out.

Pixar, Wall-E, and the virtue of work

Wall-EI’m pretty exited about Pixar’s upcoming robot film called Wall-E. The premise is that Wall-E is a robot left on earth to clean up all the trash humans left behind when they flew off into the stars. Or, to put it another way, he’s a robot with a job.

Watch the newest Wall-E Trailer here.

The idea of “jobs” in Pixar’s highly successful series of animated movies is not entirely new. Far from it, it is even a reoccurring theme. Ratatouille’s whole thrust is about the seemingly mundane and underappreciated grunt work of food production in a high class restaurant. Monsters Inc is centered around a fantastical “scream” powered energy company. Even Cars drives around the topic with advertising executives, toe trucks, hotel keepers, truckers, auto mechanics, and (of course) professional race cars. Compare these films with the majority of the drivel produced by Disney, 20th Century Fox, or Dream Works and you get a stark contrast both in box office success and quality. Pixar has tapped into something that transcends age and gender and background. Something that speaks to the heart of 9 to 5 folks and their kids. Something common, understandable, and virtuous.

Isn’t it strange that people pay good money to watch cartoon characters go through the struggles, conflicts, and challenges of good old work? Maybe. But I think it is more strange that people pay money to see fantastic story lines with space ships, princesses, and magic spells that are so far removed from daily bread winning and bed making. Why idealize and fantasize about the impossible? Why not be content with what you have?

Perhaps none of Pixar’s films hits this theme more than the Incredibles. While falling into the fantastic adventure category the film is also also about a house wife making dinner, vacuuming, and unpacking boxes. It shows a man frustrated with being a cog in a cube farm, having a crummy commute, and being forced to leave his youthful glory days behind. It shows the dirty work of feeding a family, the fun of guys night out, the trepidation of trusting a baby sitter with your infant. It shows life. And it shows work. And that is a good thing.

Everyday 99% of 6 and a half billion people get up, throw on some clothes, and face the day. That could mean school, it could mean bathroom cleaning, it could mean chopping wood. It could even mean taking a ride on the space shuttle. Whatever the case, it is incredible. Fantastic if you will. Far more amazing than any space battle or prince charming sword fight or smoke ring blowing hobbit in a make believe world without toilets or grocery stores. I commend Pixar for doing such an excellent job in their work and for promoting the virtue of work itself. Good show!

TaffyDB: A Javascript database for your browser

Taffy DBI’d like to take a moment to introduce something I’ve been working on a while: TaffyDB.

TaffyDB is a free (opensource) JavaScript database for Ajax applications. It works by creating a thin (under 10K) data layer within your application. You can insert, update, delete, order, loop, and query against the data layer and integrate it with just about any JavaScript framework such as YUI and JQuery.

The idea came to me as I was working on Joe’s Goals 2.0 and I realized that one of the hardest parts about building any Web 2.0 application is working with data. There is no good way to use JavaScript by itself to gather, search, and maintain a collection of data. There are lots of great ways to great interfaces now days, but what about the data behind them? TaffyDB is the result of the research and testing I did for Joe’s Goals and is now avaliable for everyone to use.

TaffyDB is not a visual library. You’ll still need to code the user interface. TaffyDB reduces acres of custom JavaScript data handling code to single line commands, giving you more time to work on interface.

Examples:

  • Create a contact collection:

var contacts = new TAFFY([]);

  • Add a contact:

contacts.insert({id:1,first_name:”John”,last_name:”Smith”,age:29});

  • Find contacts with a last name of Smith than are older than 22:

contact.find({last_name:”Smith”,age:{greaterthan:22}});

  • Order contacts by last name and then first name:

contacts.orderBy([”last_name”,”first_name”]);

You can also update, delete, loop, and much more. To learn how check out the Getting Started article. I’d also be delighted to hear any feedback or bug reports you have. Please submit them here.

More Bugs Stomped

Bug Fix Good evening everyone. Well I’ve stomped a few more bugs and added back a few of the features missing from the new version (the badge). Things are going very well with 2.0 and most users are now on the new version. I still need to add the reports and make a few other tweaks and then I’ll probably look at turning off the old version. As always, let me know if you see any problems.

Update on 2.0

Bug FIx Bugs be gone!

The 2.0 update is going very well. Fixed a issue keeping it from running at all in Safari, fixed several problems with the logbook, and greatly increased the speed for larger accounts.

I think it is about time to start rolling it out to more testers. You’ll get an email when you are added to the test. You can also look at the top of your tracker (refresh if you already have it open) for a link to try and the new version. As always, report bugs and feedback here.

Also: If you are interested in reading a little more about 2.0 and why it is different please check out the post on Ajaxian and on  Rey Bango’s blog.

Joe’s Goals 2.0

Joe's Goals 2.0It has been a long time in coming but Joe’s Goals 2.0 is finally rolling out of development and into a closed beta test. Everybody say woot!

What’s new?

This is a complete rebuild of the core application with an emphasis on speed, ease of use, and scalability. Here are the major changes currently in the testing version:

  1. Speed Speed Speed! 2.0 is a full Ajax application, no more waiting around for page refreshes.
  2. Improved stats including a longest chain stat for positive goals and longest gap stat for negative goals.
  3. Lighter design means there are less links to deal with and better clarity. Goals can now be edited by clicking on their name instead of on the options link.
  4. Customizable display options means you can pick which stats you want to watch for each goal.
  5. Printable tracker for those who like to work on a hard copy during the week and update their tracker on the weekend.
  6. You can also switch back and forth between 2.0 and the classic version until everyone gets ported over.

When can I try it?

  • Subscribers: you can try the new version right now! Just click on the link at the very top of your goal tracker. Subscribers always get to use the latest version of Joe’s Goals. A subscription only costs $12 a year and it makes the tracker ad-free.
  • Existing users: Click on the link at the top of the page to opt-in to the beta test. We’re rolling people into the test quickly so hopefully you won’t have to wait too long. When we do add you to the beta test a link will appear at the top of the page allowing you to get in.
  • New users: Signup for Joe’s Goals and then click on the link at the top of the page to become part of the testing group. We’ll roll you into the test as soon as possible.
2.0 Screenshot

Bugs, feedback, suggestions

Joe’s Goals 2.0 is still a work in progress. There are other features to add and no doubt there are still bugs to fix. If you have any ideas or suggestions please use the feedback form as the best way to get in touch.

How one lawyer uses Joe’s Goals

LawThe surest way to be more productive, to be more consistent, and to accomplish what you’ve set for yourself is to track. Track, track, track. Track in detail. Track daily. Dieters know this, businesses know this, and Joe’s Goals users know this.

James Gross is a Lawyer and Joe’s Goals user who tracks his productivity daily. I asked him if he could write up a quick summary of his efforts so other users can get ideas from his example:

I am the managing partner of Thyden, Gross and Callahan, a law firm with 8 lawyers and 3 staff in Chevy Chase, Maryland. We practice in Maryland, DC and Virginia. That’s a lot to keep track of so I use checklists a lot. I have set up Joe’s Goals to track the activities the make money for me.

First is marketing activities. I write three blogs and an email newsletter, all of which generate new leads. So those goals are called:

Second, is my Simplified Contact Management System. I need a way to track whether my marketing activities are paying off. I have tried several other systems but I find all of them have too many bells and whistles for what I need. So I made up my own simple system using Joe’s Goals. These goals are called:

  • Leads
  • New Cases

This tells me if my marketing activities are paying off. Each telephone call or email from a prospective client gets a checkmark. When I collect a retainer, I put a checkmark in New Cases. I can see each week how many leads and how many new cases I got.

Finally, I produce these financial reports every day. With the computer it only takes a few seconds. This is how we count the money we are making.

  • Hours & Dollars
  • Key Numbers
  • Four Billable Hours

The first is a tally of dollars for the work we are doing for the month that has not yet been billed. The second is a summary of our bank accounts, loans, daily hits on our website and financial condition of the firm. The last is my daily goal for billable hours. Oh, and I have, one more Joe’s Goal, which is Exercise. That one helps me keep all the other goals in perspective.

Fun with Joe’s Goals

A friend was playing around on the Joe’s Goals website and sent me this screen shot:

Fun with Joe's Goals

It isn’t art but it is kind of funny.