Sidebars

The more I think about website design (both in theory and in practice), the more opposed to sidebars I become. They’re almost always useless and/or redundant, and eliminating them is almost always the first recommendation I make when working on a site’s design. There are instances when they work, of course – but I think it’s a worthy exercise to try eliminating them. And I think you should always start from a stance of “not using a sidebar”, and go back on that only if you can make a compelling case for using one. Unnecessary until proven necessary, if you will.

There are three big topics that I want to explore with this post, while looking at how they relate to the use of sidebars:

  • Horizontal space is more valuable than vertical space
  • You have a fixed amount of space in any given viewing window
  • Binary content should not be prominently featured, except in a few choice viewing windows

This is a long one, but I hope you find it interesting. Here we go!
Continue reading

Mi Viaje a Perú: Puno

To recap the trip so far:

Friday: Fly from Los Angeles to Lima
Saturday: Full day in Lima.
Sunday: Fly to Cuzco, travel to Urubamba
Monday: Full day in Urubamba
Tuesday: Machu Picchu
Wednesday: Full day in Cuzco

At this point in our trip, there was only one major destination left: the city of Puno, on the shores of Lake Titicaca. To get there, we took a chartered bus on Thursday, for roughly TEN HOURS. It was a long day for sure, and for me, it was even longer; I woke up Thursday morning feeling really really sick.

I’m not sure what it was, exactly – I think just a combination of altitude, lots of travel, and some food that didn’t quite agree with me. But whatever it was, I found it best to just spend the majority of the bus ride sleeping and drinking water. It was a rough time, but I’m glad that the only day I was really sick was the long day of travel. That day was also our only day of even remotely bad weather, so all in all I think it worked out ok.

But because I slept for so much of it, I can’t say much about the trip from Cuzco to Puno though. I know we stopped at another ruin on the way, but that’s about it:

Once we arrived in Puno, Alex and Alex went off to explore the city a bit while I kept sleeping in the hotel. Fortunately, it all paid off for me and I was feeling better on Friday for our trip out on Lake Titicaca.

The lake is home to the Uros people, who live on floating islands made out of reeds. It is really something to see and walk around these islands, knowing that there’s only a few feet of mud and reeds keeping you dry.

We also had the return of glorious weather, as you can see. It was beautiful out. We spent the rest of the day walking around and enjoying the city, soaking up our last “new” bit of Peru.

On Saturday, we took a short bus ride to a local airport, and flew back to Lima. We had a few hours to relax back there before dinner and our return flight to the states that night (which I touched on back in my opening post).

Mi Viaje a Perú: Cuzco

To recap the trip so far:

Friday: Fly from Los Angeles to Lima
Saturday: Full day in Lima.
Sunday: Fly to Cuzco, travel to Urubamba
Monday: Full day in Urubamba
Tuesday: Machu Picchu

After our day at Machu Picchu, we took a long bus ride back to Cuzco to spend the remainder of the day, and all of Wednesday. There were no predetermined group activities for Cuzco (just some optional half-day tours), and we had decided to just explore the city on our own. Some former coworkers at UCLA had told us how much they love Cuzco, and I can definitely see why. I loved Lima for how it reminded me of LA, but Cuzco was just a ton of fun.

We spent the morning at a large indoor market, buying souvenirs of the trip. Most of what I got here was for family, though I did pick up a cool black stone carving that adorns my computer. Perhaps more interesting than the market, at least to Alex & Alex, was the “Ministry of Culture” next door to our hotel. Specifically, the llamas and alpaca they had there.

There was just a large, open enclosure, with two llamas and an alpaca running around. Imagine it being like a petting zoo, except you weren’t allowed to pet them. Oh, and instead of being calm animals, they would just attack you. Literally, I had a llama jump at me, and I was chased by the alpaca.

I’ve never been big on horses, cows, or other large, hooved animals, and it turns out the same is true of these ones. But I’d get my revenge later.

After our shopping at the market, we made our way to the main square, and explored a small, ourdoor side market. It was here that we ran into our only bit of poor weather for the entire trip – a hailstorm. We actually enjoyed the hail, until it turned into a plain rainstorm, and we realized that we were not prepared. We took shelter in a small cafe, waited it out, and just kind of relaxed for the afternoon.

In the evening, we went to a restaurant that was recommended to us by our former colleague, called Two Nations. They serve Peruvian/Australian fusion food, and we’d heard it was the best restaurant in all of Cuzco. We each ordered some form of alpaca meat for our main course, which was delicious (take that, evil creatures!). It’s served rare, but there was no blood or anything (due to the leanness of the meat).

I can safely say that this dish, along with the ceviche from Lima, is one of my top meals EVER. Holy wow was it good. Two Nations certainly lived up to its hype. If you ever find yourself in Cuzco, go there. Seriously.

After dinner, we decided to go grab drinks and enjoy a little bit of Cuzco nightlife. Our former boss, Laura, had told us about a place called “Mama Africa”; more specifically, she told us to avoid it because shady things happen there. So naturally, we found it, and went in for a drink! We met up with a couple from our trip, and spent the night drinking and talking (and doing karaoke at a place across from our hotel). In typical party fashion, specific memories of the night are a bit hazy. I blame this drink:

On Thursday morning, we woke up, hopped on our bus, and began the long trek to our final destination (other than the return to Lima) – Puno.

Optimize It!

At work today, some coworkers and I were talking a bit about how Windows 7 is less resource intensive than Vista, despite being a newer, more powerful system. While I don’t know what exactly Microsoft did to achieve this, I told them how you can drastically improve performance of certain processes just by spending some time optimizing. They asked for an example of how you might optimize something, and the one I used was basically this:

Imagine you’re looking up a word in a dictionary. Perhaps the simplest, most obvious way to find what page it’s on is to just go, page by page, looking for it. But unless the word is ‘aardvark’ or something, this is probably going to take forever. Imagine grabbing a dictionary, starting at page 1, and going one at a time looking for the definition of ‘snake’!

You can, of course, speed this process up. Just find the section for the first letter of the word (most dictionaries have it marked on the side), then go page by page. You’ve cut it down a bunch already!

But you can speed it up even more. Since everything is in alphabetical order, you can open to somewhere in the middle of the section, then work your way backwards or forwards as necessary.

I would argue that most people can find any given word in a dictionary with just a few “page turns” (any number of pages moving at once). They liked the example, and it got me thinking. This is basically a rudimentary “binary search” algorithm. And it’s no surprise to me that I jumped to this particular example. I LOVE the binary search algorithm. It is insanely powerful. Imagine this scenario:

You pick any whole number, from 1 to 1000 (inclusive). I’ll guess your number, and you tell me “higher”, “lower”, or “correct”. Assuming you don’t lie to me, how many guesses do you think it will take me to find it?

Answer? I could do it with no more than 10 guesses.

A 1000 number range, and I can find it in just 10 guesses. I think that’s pretty awesome. Just for comparison, if I were to guess numbers at random, there’s roughly a 1% chance that I’d get it within 10 guesses. That chance is a lot higher when you factor in the higher/lower aspect, but it’s fairly unreliable.

So how can I do it so simply? Basically, I just cut the set of possible numbers in half over and over again. First guess would be 500 (middle of the range). You would tell me higher or lower, and I would then guess 750 or 250, respectively (middle of the new range). After just 2 guesses, I’ve cut the possibilities down from 1000 to just 250. Two more guesses gets the possible range down to ~62 numbers. Two more and we’re at 15 possibilities. Two more and we’re at 3 (or 4, depending). Two more, and there’s only 1 possibility – your number. In 10 guesses.

What’s especially cool about this approach is that it gets comparatively better the larger the initial set is. For example, finding your number between 1 and 30 will take me five guesses (max). But with twice as many guesses, I can find a number from a pool that is 33x as large.

And to find your number between 1 and 30,000? I only need 15 guesses to do that.*

This search algorithm requires that you have a clearly defined notion of “greater than” and “less than”. I couldn’t use it to determine which painting out of 1000 choices you picked out, for instance. But for numbers, words, or anything else with an ordering, it’s extremely powerful.

There is a risk to “over-optimizing” your code, if you end up spending too much time trying to squeeze out small gains. I think people who focus too much on “academic programming” fall into that trap fairly easily. Once you’ve faced a time crunch or two in the real world, you start to learn where you can make tradeoffs. Spending 5 hours to cut my number of searches down by 1 isn’t that useful. But spending 5 hours to go from 500 searches to 10 really is.

*For any pool of size N, you only need log2N guesses.

What the hell is a “good man” anyways?

A little over a year ago, an article appeared in the Wall Street Journal titled “Where Have the Good Men Gone?”. I read it shortly after it came out, and was incredibly turned off by it. And that was the last I saw of it, until today, when two of my close friends shared it on Facebook.

The article is called “Where Have the Good Men Gone?” (you can read it here) and it is based on a bullshit premise.

Let me back up a bit. This article really talks about two things:

1) It talks about societal changes, and how they’ve affected people (men AND women) in their 20s (basically, the older parts of my generation).
2) It talks about men in particular, and how these changes have affected them.

In fact, not only does it talk about both of these things, but it does so with even weight. Seriously – 10 paragraphs each (plus a 1-paragraph sentence for #2). Just for fun, I split the article into two articles, based on these two points. You can read only about the societal changes here, and read only about men here. Both open in new tabs.

I need to be clear, before I go off about this article, that my objections are to #2 only. If you follow the link above about societal changes, you get a somewhat interesting, and totally benign, article. I have no objections to it at all.

No, my issues are with the second one. In particular, the tone the author (a woman) takes. Part of it is specific examples and language that she chooses, but a HUGE part of it is the fact that she included it, period. Seriously, that first edit of mine can pretty much stand on its own really shows that everything else is superfluous. Yet there it is nonetheless.
Continue reading

Mi Viaje a Perú: Machu Picchu

To recap the trip so far:

Friday: Fly from Los Angeles to Lima
Saturday: Full day in Lima.
Sunday: Fly to Cuzco, travel to Urubamba
Monday: Full day in Urubamba

Tuesday began with a 4:00am wakeup. Under almost any other circumstance, I would’ve considered a 4am wakeup to be criminal during vacation, but today was an exception. We were going to see Machu Picchu!

To get there, we first took a train to Aguas Calientes, the small town at the base of Machu Picchu. We then took a bus up the winding road to get to the entrance.

I really wish I could write more about Machu Picchu, to really convey how incredible it was. But I really can’t. Words won’t do it justice. Hell, I don’t even think the pictures do it justice. But they’re the best I’ve got:

Mi Viaje a Perú: Urubamba

After spending Saturday in Lima, we began our trip inland, and up, on Sunday. Up, up, up, from Lima (at sea level) to Cuzco, at 11,000 feet. We would return to Cuzco later in the trip, but for now, it was just a stopover.

From Cuzco, we took a bus to Urubamba, also known as The Sacred Valley, with a lunch stop in Chinchero.

Chinchero is a weaving village in the mountains, were they make many hand-woven crafts. They also make a fantastic lunch. We had a small feast here:

Traditional presentation of guinea pig

After lunch, we had a quick demonstration of how they weave various items. It was particularly cool to see how they made different color dyes:

Natural ingredients used in fabric dyes.

We spent a small amount of time at their market, and then it was back on the road. The drive was pretty scenic, and we took another short stop at some old ruins (the name of which I can’t remember, unfortunately).

After some time at these ruins, we finally arrived in the town of Urubamba, where we would spend the rest of Sunday, and all of Monday. Urubamba is a very small town, and we had a full day and a half there, which seemed odd. But we actually were able to fill our time, and it was a lot of fun. We went to a pottery workshop called Seminario, and bought a bunch of pottery as souvenirs.

We paid a visit to the local market, which really hammered home to me how much emphasis they put on their agriculture. There were so many different varieties of fruits and vegetables, and I was actually really bummed that I couldn’t buy them up and cook something! I was particularly enamored with this massive collection of peppers:

Just think of all the salsa I could make with that! We also had a really delicious lunch:

Fresh river trout

Urubamba presented an interesting look at one of the cultural differences between Peru and the US. Here, especially in LA (but also in other major cities), we put a lot of emphasis on what our cities look like. We design fancy buildings, with perfectly manicured lawns, and put a lot of effort in making them look good/cool from the outside.

Urubamba, by contrast, was very different. Walking the streets, it was very “uncivilized” by our standards. Walls in disrepair, things looking like they were falling apart, etc. The near left wall in this picture gives a good idea of what I’m talking about:

But despite the “run down” look of Urubamba (and other places on our trip), there was a sense of better care for the land. The gardens and paths INSIDE these walls were absolutely beautiful. There was no trash on the streets, and for a place with dirt roads and walls, it was oddly clean. And it was clean in a way Los Angeles isn’t.

There was nothing particularly impressive about Urubamba, but it was thoroughly enjoyable nonetheless. It was also a good precursor to the highlight of the trip (for me at least) – Machu Picchu.

Mi Viaje a Perú: Lima

(This is a long, long overdue blog series. I just really haven’t been in the mood to sit down and write it, and I didn’t want to half-ass it. But better late than never!)

A few weeks ago, I took my first trip out of the country since my senior year of high school. Heck, if you discount Las Vegas, it was the first time I’ve even been outside of the state of California. Needless to say, I was very much in need of a true vacation.

So I went to Perú.

Why Perú?

Alex: come to peru with me

Seemed like a good enough reason. So Alex, his friend Alexandra, and I booked a 10-day trip to Perú.

We left on Friday (Alex and Alexandra from SF, me from LA), meeting up in Houston, and then flying together to Lima, Perú. The first day was all travel; we landed late in the day, and by the time we had cleared customs and met up with our tour contact, it was after midnight. We made our way to the hotel, grabbed computers to email family / update Facebook, and went promptly to bed.

On Monday, we had a group orientation meeting, and then went on a short bus tour of the city. Afterwards, we had the rest of the day to ourselves. On a recommendation from our tour guide, we went to Pescados Capitales, a very fancy seafood restaurant.

I should take a moment to explain what I mean by “very fancy”. You could’ve picked this restaurant up, dropped it on Ocean in Santa Monica, and set the prices in dollars instead of Soles, and it wouldn’t have been out of place in the least. That last point is pretty key though – the dishes which would’ve cost $40-50 here were roughly 1/3 of the price (in US dollars). I think we each paid, after tip, maybe S./65 for our dishes and drinks (sixty-five Soles), which is roughly $24.

The ceviche I ordered was absolutely the greatest meal I’ve ever had. Very few things even compare (one which does was what we had in Cusco, but I’m getting ahead of myself).

After lunch, we decided to walk back to our hotel, taking the scening route along the beach. This ended up being a 2-hour walk, but it was just so beautiful out.

Lima reminded me instantly of Los Angeles. It is divided into 43 districts, some nicer than others. We stayed in one of the nicer ones, called Miraflores, which was just Santa Monica transplanted to Perú. I’m talking gorgeous weather, situated on bluffs overlooking the ocean, great food, parks, etc.

For dinner, we went to a small side street with lots of different restaurants, and were immediately bombarded by representatives trying to get us to come to their restaurant. Their method of competition? Free drinks. The drinks we got ended up being small, but free is still free. Dinner was good, but not as great as lunch. In Perú though, lunch is the marquee meal, so it makes sense.

On Sunday, we returned to the Lima airport to catch a flight to Cusco, and continue our trip away from the coast (and, by extension, sea level). Then, after one week of traveling around the countryside and mountains (which I’ll recap in detail later), we returned to Lima for a final day.

For us, it was just some time to chill before beginning the long trip home. But we did have a fantastic farewell dinner with the rest of our group: a three-course meal with small samplings of different Peruvian dishes, included beef heart (delicious, by the way).

Mmmmm, beef heart.

The whole trip was incredible, and it was a nice way to cap it off. After dinner, we returned to the Lima airport, and began the long trip home. But there is much more to write about Perú, so I’ll spare the details of the trip, and just promise another post in the near future about Urubamba, aka, the Sacred Valley.

Notice Anything Different?

Sorry, that’s kind of a trick question – there’s nothing different about this post that you would be able to notice. But I certainly notice it. Unlike my previous posts, this one is being composed on some seriously powerful hardware.

See, I just finished building my new computer. And it is a thing of beauty. Very powerful, very fast, and I built it myself (with some guidance from my younger brother and the internet, of course). I’ll upload some pictures at some point, but for now, I’m too busy enjoying it.

Happy New Year!

Happy New Year!

Happy New Year!

Lots of people like to do retrospective posts for New Years, which is totally understandable, but I’m going to pass on doing that. I’ve never been one for focusing too much on the past. Instead, I like to look forward. I didn’t set any explicit resolutions last year, but I do have one for this year:

Do more.

It’s intentionally ambiguous (which normally isn’t good for goals); I want this to be my 2012 motto in all things. Work harder, do more with my free time, and just try to avoid having so much “wasted time”. There will always be the need to veg out, of course, but the goal is for that to be the break from doing more in everything else.

I’m excited for 2012. If the doomsdayers are right, it’ll be our last one on Earth, so let’s make it count.