Life Lessons - Part 1

Posted by Linus Tue, 29 Apr 2008 15:41:00 GMT

This weekend I attended a friend’s birthday and it made me realize just how old I am getting. In the twenty six years that I have roamed the earth I have learned many important life lessons which I think I should start sharing. These aren’t going to be philosophical life lessons but instead a series of practical tips that have helped me so far. So without further ado…

Life Lesson #1 – Public toilets

We all know the situation; we’re out in public and then have a terrible stomach ache. Being nowhere close to the comfort of your own home, you need to find a clean public toilet.

Most people think the best place is to find a restaurant. However, often times you can’t find a clean one where you can just walk right without getting accosted by a host/hostess. Instead what you should look for is a hotel. Hotels always have great bathrooms and you can shamelessly walk right in, pretend you are a guest, and do your business.

Now I do agree that hotels are less abundant than restaurants but if you spend an extra five minutes in the car looking for one, you’d be surprised, there are more than you think.

Okay so once you get into the bathroom, I always have this problem. The way the toilet seat covers are designed it makes it so that the bottom flap (see picture below) always touches the water.

As the water soaks up the paper, it drags the whole cover into the bowl. This means you probably have at most 30 seconds to take off your pants and sit down.

The way to avoid this problem is to simply tear off either the bottom half of the flap so that it doesn’t touch the water. I can’t stress this enough because it will save you so much time in life setting a new cover.

That’s it for now, stay tuned for other life lessons…

Posted in  | no comments

Coolest Wine Opener Ever

Posted by Jeff Tue, 29 Apr 2008 15:07:00 GMT

OK - so I have to admit. I like wine. But something hit me over the weekend: how come we haven’t really improved the process of opening wine bottles?

I mean - we have such intricate systems for making wine - involving large amounts of chemical testing, big vats, and wine ‘scientists’ going in there to make sure everything is just right. But - I guess opening the bottle is just something that we omitted.

A year prior, after I landed a gig at IBM Research, I took my parents to The First Cabin at Balboa Bay Club. Really awesome views, really awesome food. We got a bottle for like $100 and while the waitress was poping the cork “CRACK” she cracked the bottle. Now c’mon, there got to be room for improvement there.

Let’s take a look at some of the old fashion openers:


So these openers go from pure stupid to a little more sophisticated. Take the one on the left, you have to PULL the cork out with all your might. Can you imagine doing that while hammered? You’d probably drop the bottle while pulling or spill half of it.

Now, the second one is the what the waitress used to crack our bottle at First Cabin. It uses the bottle top as a hinge - GLASS as a hinge??? That’s got to be bad. The last one is the one I currently have in our apartment. But just too big to carry around.

I FOUND something this weekend that’s REALLY Cool! It’s called a Cork Pop. Here you go:

This thing is awesome. First thing you notice is that there is no cork screw, just a needle. The idea is that instead of ‘pulling’ the cork of of the bottle, you ‘push’ it out with air.

There a small canister of air on the top - you simple jab that needle-like thing into the cork and then push the button on the top. Air gets pumped into the bottle and pushes the cork out with a POP.

That thing was amazing. Definitely going to buy one for mom for Mother’s Day in 2 weeks!

Posted in  | no comments

Krav Maga

Posted by James Sun, 27 Apr 2008 14:54:00 GMT

On Saturday, I went to my first Krav Maga class.

I really like Krav Maga. It’s one of the few martial arts that was invented after guns. It teaches you practical self-defense against realistic threats such as chokes, knifes, and assault rifles. It was designed to be easily learned, but difficult to forget. The movements are natural and for the most part instinctive.

In my first class, we did bunch of warm up drills, lots of punching, palm strikes, kicks, then for the last part, I learned a easy choke defense. I am completely sore… my back is killing me, but it feels good. I’m going to try to do Krav Maga twice a week… and see how far I can get with it.

I found an awesome Krav Maga video on youtube… enjoy.

Posted in  | 1 comment

How not to be a blowhard – do the exact opposite of Kanye…

Posted by Linus Tue, 22 Apr 2008 15:48:00 GMT

This weekend I went to the Kanye West concert down in San Jose. I already had my reservations about him from his outburst at the MTV music awards and his comments during Katrina. However I had free tickets and I love the song ‘Hey Mama’ so why not…

The concert was amazing: good food, good drinks, and good people. My only problem was with Kanye’s one man act. The whole 90 minutes or so, he was the only person on stage. He didn’t even ask Lupe to come out for their song ‘Touch the Sky’. To top it off, after the concert, I met his drummer and apparently Kanye moved the band’s stage three feet lower, JUST to make absolutely sure they weren’t seen by the audience.

This got me thinking, I hope that when I am met with incredible success, I never become like that. Don’t get me wrong, Kanye has incredible talent and has gotten to where he is through hard work, dedication and commitment. However I am positive he did not get there alone….

The day I take center stage, I am going to make absolutely sure that it is shared with the people who have helped me get there, regardless if it was directly or indirectly. I owe everything I have: my personality, my wants, and my goals to my friends, my family, and especially my business partners. I hope that you never see me like that person below because it must be a very lonely, lonely, world….

1 comment

The NEW Web 2.1 - The Viral Web

Posted by Jeff Tue, 22 Apr 2008 15:18:00 GMT

So what the heck is web 2.1??? First, the meaning of web 2.0 isn’t even clear, so how can you increment versioning on something that no one really knows the meaning of?

Well - here is a little history of the web that should qualitatively give you an understanding of what I see Web 2.0 is and what is now Web 2.1, which I will call The Viral Web.

The web as we know it today came a long way. First, you had Yahoo listing pages on one website like the yellowpages, then more data grew and Google started to make searching easier and more accurate. As for the content of webpages up to around 2000 were generally made by one person and then consumed by the masses. Examples of this are like personal home pages, online newspapers, and corporate websites.

Then the web started to evolve, things like Wikis (collaboration of many people for consumption by many people), YouTube (many people uploading videos to be viewed by even more people), and Facebook (many people customizing profile pages and uploading pictures to be consumed by even more people). In one sense, Web 2.0 involves giving users power to create content and using people’s social network to distribute information.

For a majority of websites, the discrimination is less clear - what do we make of websites such as eBay, where users put up items to be sold to other people. Even though eBay has been around for a while, it shares the characteristic of empowering users. There are many more examples in this area, and you can feel free to dub them whatever you want.

Recently, ‘Viral Marketing’ and ‘Viral’ growth have become the Fad of the Valley. Everyone wants their application, website, or plain old company to ‘Go Viral’. What is this really about?

Well this is really about harnessing the users ability to create content (such as in Web 2.0) in a different manner. In fact, the content that users create are actually messages sent to other users. For example, within the Facebook platform, we see this happening on many applications that attain millions of installations after just a few weeks! This is already happening outside of social network environments Ning has accomplished this by letting users create their own social networks.

The Viral Web involves startups taking the learnings from Social Networks and companies like Ning and applying the concepts broadly across other traditional internet companies. Having users participate in Viral Loops that the website uses is going to give the traditional internet companies a run for their money.

1) Essentially Nil marketing costs 2) Brand Names develop quickly 3) Further leveling the playing field between large and small companies (small companies can get big very quickly) 4) Lower overall cost structure of startups will make things cheaper in general for consumers (yay for us!)

The next few years are going to be quite exciting - get ready for the ride!

Posted in ,  | 1 comment

Talking to Chuck

Posted by James Thu, 17 Apr 2008 18:26:00 GMT

Today I went to open an investment account at Charles Schwab. Instead of opening an account online, I actually went down to their offices and talked to a real person. Since I live in San Francisco, I went down to their headquarters at 101 Montgomery Street at 8:30 am.

After I finished everything and on my way out, I took the elevator. Waiting with me, was an older man, with white hair, in a very elegant blue pin-stripped suit. We got in the elevator together.

We were the only ones in the elevator and the old man asks me, “so, how did Schwab treat you today?”

I looked at him and answer, “good, good. I just opened my first account.”

He looks at me and asks, “how old are you?” (For some reason, I get asked that question all the time)

I reply, “25.”

He goes, “ha… that’s a good time to start.”

Then we arrived at our floor (we took it for only 1 floor). We then went our separate ways. And I was thinking to myself: who was that guy? Could it be… nah… really? Did I just talk to Chuck?

So I went home and googled Charles Schwab (the man). And this is what I found. Sure enough… that was the old man I saw in the elevator.

So, I went to Charles Schwab and talked to Chuck.

Posted in ,  | no comments

Meeting Buzz Aldrin!

Posted by Jeff Tue, 15 Apr 2008 14:51:00 GMT

For those of you who don’t know Buzz Aldrin - he’s the 2nd man on the moon!

I became a space fanatic when I was 12 years old - okay, I admit, the coolness wore off when I realized that my bad vision would prevent me from being an astronaut. (tear) But nevertheless, I pretended to be an astronaut by looking at a bunch of pictures and watching NASA WebCast (this was ‘98 mind you and webcasts were ‘rare’ and ‘difficult’ to get working).

Oh - and the most important part of the entire space excursion was playing Buzz Aldrin’s Race into Space. This was by far the most difficult game I have ever played. The goal is to do a moon landing and make it back alive while racing against the USSR. There were a great many quirks about the game - if your rocket blew up, you to start R&D on rockets from the beginning. You train your crew, and then have to keep them motivated by putting them on missions. I’m not a gamer at all, and this was one of the only games I really liked.

So - Saturday we went to Yuri’s night Celebration at Nasa where we actually got to meet Buzz Aldrin. That was awesome. I asked him what he thought of the space program - interestingly, he said “We should stop putting out the fires of today, and instead take a longer term look into the future” Wow - digging a little deeper, I found that from Buzz’s point of view, NASA can do a lot better than it has in the last 2 decades.

Delivering on visions such as going to Mars - I asked Buzz what he thought. His response was “We have to think about today - not how to get to Mars, but once we get there, what we are going to do and plan R&D accordingly” One example is rapid deployment of teams - it takes 6 months to get to Mars with a crew of 6. We are definitely going to need to think about how we can do ANYTHING with 6 people. That’s so little!

All the best to NASA - it was an awesome event!

Posted in ,  | no comments

Scaling write intensive MySQL DBs

Posted by James Sun, 13 Apr 2008 23:40:00 GMT

Recently I’ve been doing work on scaling some of our medium sized web applications. In our case, the bottleneck is in the data layer, which is often the case for most web applications. And of course, scaling the data layer is always the most challenging.

Most people, instinctively think memcached when you tell them to scale the data layer. While memcache is great, it’s not the big hammer that everyone think it is. In most cases, memcache can speedup reads significantly, especially for data that is accessed repeatedly, however, it does very little to speed up writes, with few exceptions (as I will illustrate shortly).

The MySQL database in question, handles approximately 97% writes and only 3% reads. There are a few commonly known techniques for scaling this type of database.

  • Group the writes in batches, thus doing fewer writes.
  • Use insert delayed or update low_priority
  • Insert into memory table and later batch insert it into the persistent table.
  • Use master-slave setup and write to master and read from slave.
  • Write a customized data layer to handle the writes asynchronously.

Obviously, these increases in difficulty as you go down the list. For our application, most of the writes can’t be batched. So we had to start with technique #2.

We really don’t worry too much about data consistency and transactions, because of the nature of the application, so insert delayed works just fine. The problem is that insert delayed and update low_priority queries only work with myisam and memory tables in MySQL. Rails by default uses innodb tables, so the tables in question must be converted. Depending on the size of the database, this could mean some downtime for the app. Additionally, myisam uses table-level locking, so we have to be really careful in how we use the database. This is where memcache comes in handly. I was able to cache the results of some commonly executed queries so they no longer hit the database, and the performance improved significantly. Using technique #2 along with memcache sped up our application 2 to 3 times.

The actual implementation was pretty simple. I wrote a Rails plugin to add a method save_delayed to ActiveRecord::Base. The are two problems with this. First the timestamp fields (created_at and updated_at) no longer auto populate. So, I added methods in the plugin to fill them out if they exist. The second problem is more serious. The records no longer automatically get assigned a primary key id when they’re saved. Because the save happens asynchronously, the id will always be 0. There’s no way around this except to not use the record after it’s saved. And if you need to access it in anyway, you should do a find and construct a new record object instead. This is okay for us, because we do a fire-and-forget save operation anyways.

The drawback to using myisam is that at some point, the table locking just won’t scale anymore. Innodb is a much better storage engine for larger datasets and we’ll have to move to technique #3. We can use insert delayed into a memory table, then have a process that moves data from the memory table to a persistent innodb table. This reinsertion process will have to be very well implemented because you don’t want to do deletes and inserts and start inserting multiple times or losing rows. I haven’t tried this, but will soon.

Scaling data layer is one of the most challenging part of my job. I love to see the application fly after making a few changes. This is partly why my job rocks!

Posted in  | 1 comment

Olympic Torch

Posted by Linus Wed, 09 Apr 2008 22:13:00 GMT

Today the team took a trip to go see the Olympic torch! We really wanted to take advantage of the benefits of living in the city.

We arrived at the planned route at the right time but unfortunately no one was there. The only people to be found were pro-China demonstrators on one side and China protestors on the other. Though it was quite an event, after 20 minutes or so we realized there was no way the torch would ever come through where we were. In addition the live blog feed we received from our phones said the torch had gone “missing” in a warehouse near the ballpark. Deject we headed back to the office.

To make matters worse, we took a wrong turn on the way back, which landed us in traffic gridlock. Curious as to why a usually free flowing street was suddenly at a standstill we looked around and saw the street in front of us had been closed. Well, we all put two and two together, parked the car in a random lot, and immediately ran towards the street closure.

It was a fortunate coincidence that we just happened to bump into the new path of the torch! Here are some pictures:

Posted in  | no comments

We are going to blog more!

Posted by Jeff Mon, 07 Apr 2008 14:45:00 GMT

I know - we haven’t been very good at keeping this blog updated…

Well - in case you didn’t know, we work on applications for social networks such as Facebook - and in case you didn’t know, these networks have been changing a whole lot. Facebook changed its invite system and started to limit the growth of applications. As announced earlier see announcement - this is going to be yet another battle for us!

Keeping in tune with the changing dynamics - what is going on with Open Social? We’d love to have a bunch of apps for you guys but your platform is so developer-UNfriendly!

Anyways - expect to see more blogs from us!

Posted in  | no comments

Older posts: 1 2 3 4