Archive for September, 2009

Yahoo Mail WTF?!

2

I still have a big soft spot in my heart for Yahoo, but Yahoo mail, WTF?

Yahoo Mail WTF?

Of the entire screen only the area I’ve highlighted in orange is dedicated to the contents of the message. And this is with the app maximized to full screen.

The interface is unusable as a mail reader: I can’t read the email message.

How on earth did the product people agree to this? Where’s the customer advocate?

Tim Bray on Design Patterns, Threads, and COM

0

From Tim Bray:

My experience suggests that there are few surer ways to doom a big software project than via the Design Patterns religion. Also, that multi-threading is part of the problem, not part of the solution; that essentially no application programmer understands threads well enough to avoid deadlocks and races and horrible non-repeatable bugs. And that COM was one of the most colossal piles of crap my profession ever foisted on itself.

You may have read my own two cents on design patterns (hate them) and threads (not a huge fan).

On Gmail Fail, Rot, and Broken Windows

0

Gmail is once again unavailable this morning. Normally I’d let it go – fail happens – but it’s part of a disturbing trend that looks a lot like neglect. The service has been getting slower and slower over the last few months, with search taking ridiculous amounts of time.

Why is it disturbing?

It’s important to understand that Google doesn’t directly make money on email. Think of it as a loss-leader of sorts.

Yes, I know there’s advertising on there. I also know a bit about advertising systems.

Gmail brings in a relatively a much smaller amount of revenue than Adwords and Adsense, and the margins are much lower. You have to pay for all that Gmail infrastructure, and click-thru rates on email ads (or ads placed next to most other compelling content) are very low.

Google is smart enough to know where their money comes from, and they go to great pains to ensure their search remains superior. They invest a lot in search.

But what do you do with properties that make money, but at small amounts and with much lower margins?

For example, Yahoo Finance, Small Business, My Yahoo, and many of the other businesses are nice, profitable business, but not large enough or high-margin enough to get a lot of love or resources.

You neglect them. You put resources on projects that move the top or the bottom line.

My concern with Gmail is the trend that looks like neglect. It’s a relatively large property for Google, but it’s been experiencing problems. I know fail happens, but I also know that if Google put their mind to it they could make it much more available than it has been.

As Google branches out into more new and different products, it needs to be very mindful of neglect. Rot at the edges of your systems deteriorate the overall perception of your offerings. And search market share is very dependent on perception: witness the studies that removed branding from Google, Yahoo, and Microsoft search results and found nearly identical user satisfaction scores. 

So Google’s outlook has to be: if we’re going to do something we’re going to do it extremely well. The apple philosophy.

And if we’re not doing something extremely well, we need to fix it or shut it down. 

It’s a tough balance – how do you foster innovation and allow people to quickly create and launch projects, while maintaining a commitment to long term maintenance of quality?

It’s crucial to identify your core offerings, mark the rest as alpha, beta, “labs”, or any other label that signals the service might go away, and be absolutely fanatical about the quality of the core offerings on a continuous basis.

Here’s hoping Gmail gets its act together so I don’t once again have to switch providers.

On Presenting At And Attending TechCrunch 50 and Demo

2

I was fortunate enough to attend both TC50 (thank you Heather, Michael, and Jason) and Demo (thank you Matt and Chris) and have a booth at one. Thoughts:

If you’re presenting or have a booth,

Have something to say. Don’t look confused, wondering how to describe your company – you should’ve practiced this ad nauseum by the time you get to the show. That goes for everybody at your booth – if they’re at the booth, they should know what to say.

Say it. Briefly. Tell me what you do and why I should care in 30 seconds. Have a 3 minute version. Give me a chance to escape after 3 minutes. If I still care, delve into details and exchange contact info.

Have a Hollywood pitch. Nivi of Venture Hacks came up with ours – the first time I described Xpenser to him he said “cool – Tripit for expenses”. I’ve been using it since. You want to be “the something of something”. Sounds silly but it really works – Jason Calacanis, for example, told me he got what we did the moment I told him our hollywood pitch.

Pick one thing. You’re three people. You can’t possibly be solving all of the world’s problems. Pick one problem, present a solution for it. If you find yourself saying “or, we could do XYZ”, then you’re probably screwing up.

Demo. Don’t talk about it, show it. Both Demo and TC50 companies have been very good with this actually.

Explain how you will make money. Maybe you haven’t figured it out yet; that’s probably ok. But you will be asked, so have something to say.

Address the competition, particularly if they’re 900 pound gorillas. If your product is a better facebook, google reader, twitter, yelp, etc, at least acknowledge the competitor. If you’re showing me a page that looks just like facebook updates, I’m going to be thinking you’re competing with facebook. Tell me how you are not, of if you are how you’ll beat them.

Don’t look glum. I don’t care if you’ve had a bad day. I was having a particularly rough day when we had our booth at TC50, and was derailed from my plans to mope all day only by my partner’s persistent professionalism. Suck it up and present. I did and we ended up getting some fantastic coverage for Xpenser.

Don’t look bored. If you’re bored how do you expect people to be interested?

Don’t be shy. If you see someone wandering around and somewhat receptive, grab them. If you’re sitting in your chair as people walk by you’re doing it wrong.

Attendees and presenters alike:

Network. Meet someone new, shake a few hands. This is the main reason you’re at the conference. Some conferences do a good job of providing you with opportunities – O’Reilly conferences, for example, include an online app that allows you to find other attendees and connect with them. All conferences should do this. Demo in particular would be a great candidate for this, since the attendees are likely to be interesting to each other.

At the last Hadoop conference, for example, where I was actually very interested in the presentations, I ended up catching only 4 presentations in person. The rest of the time I was talking to people in the hallway, catching up with old colleagues, etc. Best conference I’ve been to in a while.

VCs and investors working booths: good on you. I’ve been impressed by the number of investors actually putting in real work. Henry Oh, for example, was absolutely a machine and left me very impressed. If you’re an investor, what better opportunity to see your investment in action, gauge feedback, and see how your team interacts with people? Take the time to show up and man a booth; the golf course will still be there tomorrow.

So how would I compare TC50 and Demo? Bottom line is they’re both excellent shows and you should do your very best to get into either. If you get accepted to either you can’t lose. Each reflects the personality of its founders; TC50 is louder and has more ambient energy, Demo is more professional and structured. TC50 is very web/online focused, Demo has a broader range of technologies.

I preferred TC50’s approach to the presentations. After each company presents they get immediate feedback from a panel of experts. At Demo the feedback comes in a lump after all of the session’s companies have presented. Having the immediate feedback helps complete the story on each company and provides a natural break.

I preferred Demo’s scheduling and focus on the booths. At Demo attendees spend  a good bit of time at the Pavilion where the presenter booths are. This is a very good thing – they get a chance to actually interact with and touch the products. At TC50 the booths seemed a bit more like an obstacle on the way to and from the main presentation area.

Very Tiny Javascript/jQuery Templating

0

I was in need of very simple templating capabilities in Javascript, and with the smallest library I found weighing in at 500 lines found myself compelled to write a solution. Here it is:


function render(text, data) {
	pieces = text.split(/\{(\w+)\}/)
	for (var i=0; i < pieces.length; i++ ) {
		if (i%2 == 1) {
			pieces[i] = data[pieces[i]];
		}
	}
	return pieces.join('');
}

It simply looks for variables in curly brackets and replaces them with values from a dictionary (or associative array).

I was going to add looping capabilities, but found I was ok doing the looping in javascript - that is, instead of having the loop in the html template, I'd create small html snippets that I would render in via a javascript loop and insert into the document.

Sample usage:

html:


<p id="something">Hello {name}, I wish you would {verb}.</p>

javscript:


render($('#something').html(), {name: 'Joe', verb: 'disappear' } );

So to replace the text with the rendered version:


$('#something').html( render($('#something').html(), {name: 'Joe', verb: 'disappear' } ) );

Finding and Fixing Slow MySQL Queries

1

Notes to self, for future reference.

Edit /etc/mysql/my.cnf . Uncomment the following lines:

log_slow_queries        = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes

This enables logging of slow queries and queries not making use of indexes.

Now tail -f the mysql-slow.log file. You’ll see the slow and non-index-using queries.

Grab a query that you’d like to examine. Open a mysql shell and run “explain” on it:

explain your_query_here;

You’ll see output that looks like:

+----+-------------+---------------------+------+---------------+------+---------+------+------+-------------+
| id | select_type | table               | type | possible_keys | key  | key_len | ref  | rows | Extra       |
+----+-------------+---------------------+------+---------------+------+---------+------+------+-------------+
|  1 | SIMPLE      | some_table          | ALL  | NULL          | NULL | NULL    | NULL |  166 | Using where |
+----+-------------+---------------------+------+---------------+------+---------+------+------+-------------+

Look at the rows and key fields in particular. rows shows how many rows were examined for query – you don’t want to see a high number. If you’re not using an index you may be doing a full-table-scan, examining every single row to find the value you’re looking for.

key shows which index, if any, was used. If you see NULL then no index was used.

To make the query go faster you may need an index. Look at the query and see what your’e selecting based on, and then create the corresponding index. For example, if we’re doing the selection based on the “myfield” field, you could create the index:

CREATE INDEX myapp_mytable_myfield_idx on myapp_mytable(myfield);

Once you create the index you should see that query no longer appearing in the slow query log.

Rinse and repeat for other queries.