Tuesday, July 26, 2011

Gorgeous minimalist webdesign





In Jeet Kune Do, one does not accumulate, but eliminate.

It is not daily increase, but daily decrease.

The height of cultivation always tends to simplicity.


—Bruce Lee

Sunday, May 1, 2011

Solidworks

Solidworks is seriously cool stuff. It's a general-purpose CAD program--pretty much anything you can machine, you can design in Solidworks. We use it a lot the solar car team.

I'd been wanting to learn how it works for a while. So tonight, I finally decided to sit down and build something. I pulled out a pair of calipers and some longboard parts. Progress was pretty slow at first. With me, the ME force is not strong. Also, there are some random things in Solidworks where "Undo" doesn't work. Eventually, I got a wheel:


The carbon-fiber deck doesn't exist yet, so I had to improvise. I made a sketch with a bunch of lines and angles on it. It said "OVERCONSTRAINED" in big red letters. Our electrical ninja, Greg Hall, told me this was nothing to fear and showed me how to fix it by pretending that my carbon fiber was sheetmetal. Worked beautifully.


Two beers and five hours later, with a little more help from solar car teammates Forest and Greg, I had my assembly. Birds were now chirping outside, which usually means you have to stop OCDing and finish. Four wheels, two trucks, two rubber risers, and a deck.

Then I clicked "render". Solidworks' black magic voodoo code figured out how to set up the lightsources and everything else, did a little raytracing, and came up with this. Nice.




Stay tuned for the real thing, once I get around to building that!

Friday, April 29, 2011

Welcome back, ROTC

“The state that separates its scholars from its warriors will have its thinking done by cowards, and its fighting done by fools”

--Thucydides

Thursday, April 28, 2011

Raytracing

Just rediscovered the website of Friedrich Lohmüller, raytrace artist extraordinaire. He made a couple of the pictures on the excellent POV-RAY Hall of Fame. (Back in high school, by the way, that gallery inspired me to write a simple raytracer. It was pretty much my first real programming project.)

At first glance, his prints seem to have the simplified geometry, flat planes of color, and "plastic" look characteristic of low-budget CG.

For other artists, those qualities are usually tacky (eg most of the 3D stuff on DeviantArt). Even their "good" renderings often come across as a tech demo, not as art (eg the countless renderings of beams of light hitting a glass ball).

But Lohmüller's prints transcend the kitsch. He uses those same rendering limitations to great effect, conveying order and perfection--utopia, even.




I think he captures the German engineer ethos very nicely... or, at least, my interpretation of it. The detail in the machines, the geometry, the emphasis on solitude, the perfect infinite expanse, it's all there.






That one reminds me of a picture I took of the salt flats in Utah.


One of my favorites, apparently made a very long time ago:




Having linked to some of his pictures, I will also link to Mr. Lohmüller's gallery, where he sells a bunch of gorgeous poster prints.

Tuesday, September 28, 2010

Solar Car Strategy

The Solar Car Project has been recruiting really successfully. We now have an absurd 10% of the new Class of 2014 on our mailing list, and more than a hundred people who have showed up at the shop for over the past week.

The strategy team has lots of cool projects Sam and I have been working on. Going from one- or two-person projects to full teams with a wide range of math and coding experience is going to be both difficult and awesome. The list will keep growing.

array power simulation


Onwards!

Sunday, September 19, 2010

Another day, a new year

I just got back to Stanford. California is still glorious.

The summer was cool. I interned at a proprietary trading company that deals in equity options, in Chicago. Learned a ton. Didn't blog much because everything I worked on was, well, proprietary.

So today, I have two signs of the impending apocalypse.

#1. The flying robots from Half-Life have become reality
Yes, like this one
#2. The Solar Car Team's neighbors in VAIL are building a robotic rally car.
And when they say their fully autonomous car is going to climb Pike's Peak at "near race speed", it means quite a lot:

Cheers!

Sunday, February 7, 2010

Round two, featuring Bruce Schneier

 Bruce Schneier just wrote a post on all the suggestions to add authentication to the internet. The idea behind those is that if nobody on the internet was anonymous, legitimate users would be largely unaffected and the bad guys would be out of business. Schneier does a nice job refuting this. He says that the technological problem of attaching real names to everyone on the internet is "insoluble", and that trying to implement such a scheme will only hurt free speech, especially in countries that try to censor their citizens. As his first commenter summarizes, "if you outlaw anonymity on the internet, only outlaws will have anonymity on the internet."

Then, Schneier draws a parallel between universal authentication and copy protection:
The whole attribution problem is very similar to the copy-protection/digital-rights-management problem. Just as it's impossible to make specific bits not copyable, it's impossible to know where specific bits came from. [...]
Just as the music industry needs to learn that the world of bits requires a different business model, law enforcement and others need to understand that the old ideas of identification don't work on the Internet. For good or for bad, whether you like it or not, there's always going to be anonymity on the Internet.

Couldn't agree more.

Monday, January 4, 2010

Back

It's been an adventure. After
...after all that, I'm back at Stanford now, five minutes out from my first lecture in six months. CS110: "Principles of Computer Systems." Based on MIT's 6.033, I hear. I'm also taking CS108, where I'll write an ungodly amount of Java, and CS109, stats for programmers, taught by the always-awesome Mehran.



The solar car team is meeting tonight for the first time since the race. A few fixes and, if all goes according to plan, we'll be rolling around campus on battery power, recruiting freshmen. Sometime between now and this summer, we'll have to build a new top shell and get ready for the North American Solar Challenge.

This will be an interesting quarter. More news as it comes in. Peace.

Monday, December 14, 2009

Two Decades, Two Birthdays

I'm twenty now. This will take some getting used to.

It happened en route from Bangkok, on my way home to Utah, somewhere on the flight from Kuala Lumpur and Sydney. I took in the biggest skyline Down Under for the third time in three months, chilled for a few hours, then got on a plane to San Fransisco. The sunset from the window seat six miles up was gorgeous. It also happened in 2x fast-forward, since the plane was going east almost as fast as the earth's rotation at that tropical latitude. Just three hours later instead of the usual six, it was midnight, December 13. Then we crossed the international date line, and it became my birthday again.



(True-color Earth, courtesy of NASA.)

If I could somehow go back to that other hemisphere exactly a year from now, I'd troll the stewardesses with a ridiculous legal edge case: I'd try buying a beer four times on the plane. It wouldn't work the first time, because I'd still be twenty. Then, after midnight, I could celebrate being twenty-one. Crossing the date line the other way, the date would jump back, to Dec. 11, and I'd be underage again. Finally, by the time we landed in Sydney, my legal age would change a third time.

Not that it would matter, since the drinking age Australia is 18. Cheers!

Sunday, December 6, 2009

Heading South

...we've just come full circle a second time. We started our Thailand trip in Bangkok, and after all our adventures in Chiang Mai, we passed through Bangkok again a week ago. Here we are now in Bangkok a third time, looking out across the Chao Prahya river, which is buzzing quietly with millions of mosquitoes and loudly with a handful of overpowered ferries.

We just finished an awesome trip. A side-trip, but still--we spent the week in southern Thailand, on hills, on a beach, and in no less than four caves.

The first two of these were in Petchaburi, our first stop. A place so far off the tourist trail that it was hard to find any signs in letters I could recognize, and where getting food was an exercise in sign language. The town's one attraction was that pair of caves, which had been converted into religious spaces--one was a wat, or temple, while the other was just filled with Buddha images. Both had an interesting, unexpectedly postapocalyptic feel to them, empty and surrounded with stray dogs. Hundreds of monkeys sat in the side streets as much as in the trees, scratching themselves and squawking at us. They seemed to be waiting for throngs of snack-laden tourists that didn't exist. Inside the "cave of a thousand buddhas" were two women in white robes, meditating in silence. The darker corners of the cave were filled with the guano and high-pitched chirps of lots of bats.



...the Buddhas


..and us, waiting patiently for the shutter timer.


The real Terminator vibe, however, came from the wat cave. Its entrance was halfway up a hill that rose out of the otherwise flat outskirts of Petchaburi. As we approached the hill, locals were burning trash and leaves in ditches by the side of the road. The smoke wafted up to large, but decaying facilities--a half-finished parking structure, some food stalls, and a long line of bathrooms. These buildings, like the monkeys that surrounded them, seemed to be waiting for visitors that never came. We were the exception.

Only one other person entered the cave with us--a lady, like those in the by the "thousand buddhas", dressed in white. Three dogs followed her in; they looked as though they had definitely seen better days. We followed the dogs.

Inside, the wat was lit with bare flourescent tubes. The Buddhas were beautiful, but the smell was consitent with the handful of stray animals that seemed to call the place home. Nathan and I found a side cave that was accessible only by crawling through a tunnel a few yards long. It was just big enough to stand in, and black except for the dim glow of Nathan's iPhone. It also contained two floorboards, a broom, and a piece of cloth--we're guessing that a monk spent some quality time alone there.


...then we set the iPhone flashlight to red and Ben took a really long exposure shot.

We kept walking. One of the coolest statues in the cave was a very large reclining Buddha. So Matt whipped out his headlamp and Ben did another 15-second exposure:



...every year during New Student Orientation, there's a slideshow of the wildest pictures people have taken with the word "Stanford." With a little luck, this might qualify. (Also, the way the word overlaps the Buddha a bit was unintentional.)

We walked deeper into the cave, and into the most surreal experience I've had on this trip so far. We heard someone's voice echoing from the walls, piling syllables on top of each other in a fast staccato rhythm. It was the lady who had walked into the cave in front of us, and it was clear that she wasn't saying anything in any language. She was exerting herself visibly, though, taking short sharp breaths between long stretches of sound. This was glossolalia--"speaking in tongues." I had only known it from the book Snow Crash (which, by the way, is awesome.) In real life, however, there was something seriously disconcerting about it. I watched open-mouthed for about a minute. The three unkempt dogs stared back, presumably hoping for food, but the lady was facing one of the Buddha images and never acknowledged our presence.

We left the cave and climbed to the top of the hill, which is capped with an enormous (20-ish yard tall) sitting Buddha.



...and some extreme scaffolding

The statue was under renovation, surrounded by an abandoned-looking construction site. The hilltop also had some excellent views of Petchaburi and the countryside.


...like this one


The next day, we took the slow train to Hua Hin, through some scenic farmland. Hua Hin is only about 100 km south of Petchaburi, but in many ways the cities seem to be opposites. Hua Hin, it turned out, is a sunny beachside resort town. Once an annual destination for the Thai royal family, it is now full of Hiltons, Courtside Marriotts, and middle-aged vactioners in beach chairs. Nathan found some really good seafood.

Our last stop was lots more memorable. It was Khao Sam Roi Yot National Park, and it was almost as devoid of tourists as Petchaburi. Steep, dramatic, jungle-covered limestone peaks rose up next to a white-sand beach. We had a bunglow surrounded by palm trees.


...yes, it was this good.

That night, I walked over a short, steep path to a nearby fishing village. The boats were all ridiculously colorful. No English was spoken or written anywhere, so I just walked up to some dude who was loading fishes into a giant cooler and asked "khao lai"--"how much?", one of the five or so phrases of Thai I know. (I have the same understanding of Thai that a parrot might have if it was still in training. It worked, though, and with a bit more gesticulation and waving of Baht bills, I got some fish.) I got a few other things from two little shops. (This town was so small, it didn't even have a 7-Eleven. Those are totally ubiquitous in Thailand, kind of like McDonalds in America, and like McDonalds, you know you're really off the map when you find a place that doesn't have one.) In any case, I carried the fish back and Nathan showed me how to cook them Japanese style, encrusted in salt. We made a bonfire out of coconut shells and palm fronds.


...the fish was ridiculously delicious.

We got up the next morning to go caving again. These were a different kind of cave altogether, though--no black chambers or hair-raising utterances here. Instead, these caves were gigantic, and most of their roofs had caved in, creating two gaping sinkholes. Lots of sunlight filtered in through really tall trees reaching toward the surface. We shared the space with a couple of butterflies and a group of elementary-school kids.






We rolled back to Bankok again by the scenic route--chugging along in a German-built diesel contraption from a couple of decades ago.


...yours truly and friends

Until next time... peace!

Monday, November 23, 2009

Welcome to the Jungle

We're in Chiang Mai now, the center of northern Thailand and gateway to the madness that is the Golden Triangle jungle. We trundled in a few hours ago on a sleeper train. It smelled strongly of grease and chunked its way relatively slowly over a rough track. Nevertheless, I slept well after walking around Bangkok all of yesterday.

Tomorrow morning, we're going on a three-day jungle trek. Of all the places we've been on this trip, this is the least beaten path. According to those storytelling history bubbles in Lonely Planet, Northern Thailand only became reasonably stable in the 1980s. Before that, it was torn between Burmese, Chinese, and, during the Vietnam War, even CIA influence. It was home to a vicious drug trade, a lot of the world's opium production, and to some colorful personalities like this guy.


then...


That's Khun Sa, the Burmese warlord who got his start with the Kuomintang, amassed a personal army big enough to have territorial feuds with the governments of Thailand and Burma, and trafficked more than 1000 tons of heroin to America. The party, it seems, has since moved to Afghanistan, and the indigenous people now cultivate rice paddies where the poppy fields used to be.


...and now


The plan is to ride some elephants, go bamboo rafting, and hang out with some hill tribes. I'll have some pictures and updates when I come back.

Monday, November 16, 2009

Thailand Ahoy

...it's been a pretty intense month. We drove across the outback twice, racking up 8000km of desert. We broke and then (mostly) fixed the array on our solar car, then raced it across Australia--we managed to go coast to coast on just sunshine. Great success! That weather script I posted about a few weeks ago worked great, but was totally unneccesary since the entire race was cloudless and not particularly windy.

Then we went to New Zealand, a land of hippies, awesome hikes, good surf, and more than a hundred million sheep. A land with so much grass and so many timid meaty animals that steak burgers cost less than veggie burgers. It was like Sunday-school picture-book Heaven, with sunshine and rolling green hills and fluffy white lambs.

Now were going the last leg of our trip: Thailand. Here's what I just posted on our travel blog:

...so we spent two relaxing days in the lovely town of Wellington, and are now sitting in the international terminal of its airport. On Saturday night, the All Whites beat Bahrain at "football" and the city filled with load people in white jumpsuits and live music and generally turned into a giant seaside party. The atmosphere of revelry continued well into Sunday, which saw some major streets cordoned off and lined with flag-waving kids for the Santa Day Parade. I said goodbye to Wellington's palatial Burger King, complete with an extravagant neo-Baroque ceiling and an espresso machine, by getting a giant pancake breakfast. Yes, even the fast food here is pretty extreme.



...almost like this

In a few hours, we'll be Down Under again. Next stop: Thailand. I spent this morning reading a bit about that country's history--an elaborate fugue of warlords, farmers, clashing ethnic groups and abortive attempts at democracy. The country has 17 different constitutions since they first tried that sort of thing in 1932. Their most recent PM was kicked out after the Royal Thai Army walked into Bangkok with lots of guns and accused him of having a "conflict of interest" because he was also a host on a TV cooking show. Apparently this sort of thing happens every few years. Thailand is a very peaceful country in spite of everything--it's mostly Buddhist and hasn't had a real war or particularly violent coup since WWII.

Political ridiculosity aside, Thailand sounds like a promised land of teak temples and spicy street food, where a dollar will get you 33 Baht and a couple Baht will get you really good tea. Updates forthcoming!

Tuesday, October 13, 2009

Solar Car Strategy

One of my jobs over the past couple of days has been to program a weather data feed for the solar car. (The race is in twelve days! More on that soon.) After a lot of looking, we settled on NOAA's Global Forecast System as our source.


the world, simulated. thanks NOAA!

(That, by the way, is a really cool system. It gives you everything that's going on at any point on the globe, in three hour increments, from right now to more than a week in advance. By "everything", I mean everything from the chance of rain to "soil porosity" and "total cloud water (atmospheric column)." They run the simulation four times a day. That means that the NOAA guys crank out gigabytes of data every six hours, and anyone can just go there and download it.)

For the World Solar Challenge, we're interested in two things: the amount of power we're going to get (or as NOAA likes to call it, "downward shortwave radiation flux") and the amount of headwind or tailwind.


solar power, in W/m^2

The only problem is that the race is one one of the most remote highways in the world. We're bringing extra fuel canisters so that our vans make it from one outpost to the next. Those gigabytes of real-time data aren't going to get there. Instead, we're bringing a satellite phone, which gets us a couple kilobits per second--1991 style--and at exorbitant cost. Sasha calculated that loading Gmail would take more than an hour and cost $400.

To get around this, I wrote a script that runs at regular intervals on my server back in California. Each time, it downloads the latest weather data and parses out only the variables we care about, does a little bit of voodoo, and samples them roughly every kilometer along the race route.

Plan A was to compress the output into a hackish text file. I'd output one line for each waypoint along the route, and each line would have one character per forecast: the first character would be the amount of sun we're getting now, the second would be the amount of sun we expect in three hours, and so on for the entire six-day race.

~3000 waypoints * 60 forecast times * 1 character per value = 180000 bytes. 180 kB. Doable over a satellite phone! Still, I forgot the obvious part: the weather at one point in the middle of nowhere in the desert is very similar to the weather a kilometer away, or a kilometer after that... as a result, many of the lines in the script output were very similar to each other. Not optimal. So I tried something else...


scriptin'

Plan B was to round each value to the nearest integer, then write them as a regular text file. Number, comma, number, comma, on every line, one per waypoint.

Then I zipped the file and made it available for download. Much easier, and fewer moving parts since we can just open the zip file with software we already have. As Donald Knuth once famously said,

premature optimization is the root of all evil.

Simplicity rules.

Tomorrow at the crack of dawn (according to Sasha), we are leaving for Adelaide, then for Darwin. I'll post when I can, but internet will be spotty. In fact, internet access sucks in Australia, in general. More on that later. Peace!

Saturday, October 3, 2009

I'm in Sydney

...on my way to Melbourne. Jesus, Australia is awesome. I think even the bag claim conveyor belts go counterclockwise here.

Over the next few weeks, we'll be putting as many miles onto the solar car as we possibly can, and then we're racing. It's the World Solar Challenge--from Darwin to Adelaide, across the outback, sun power only.

(The car, just before shipping, with about half the solar panels on. Taken a few weeks ago by Nathan.)

I'll be blogging from the road, of course, and on the trips to New Zealand and Thailand some friends of mine and I are doing afterward. Nathan has some great pictures of the solar car on his blog (which he started writing just for this trip, and which I'm sure will be excellent). If we have time, we'll throw some content on the Stanford Solar Car team blog, too. And Wired.com's Autopia did a post about us a few weeks ago.

Peace!

Saturday, August 29, 2009

Drive-By Journalism

So I was cruising down the boulevard in the Stanford Solar Car last Thursday. I was the middle car in a three-car convoy. Cars would slow down as they passed by to do a double take on our carbon fiber contraption.

One guy pulled up next to me and started taking pictures. The "experimental prototype" he snarks about is the car we're taking to Australia, and "Solstice" is the old model, this one's Apogee. Cool pictures, nonetheless. And mad props to Mr. Zbrozek for digging this up.



And if you want more production value and more ridiculous commentary, Wired.com did a post about us, too.

More pictures forthcoming!

Friday, August 7, 2009

Finding the Next Dot-Com

Its seems like everyone and their mom has a domain name nowadays, and domain squatters have the rest.

The land grab is speeding up. VeriSign says that more than 2.4m new .coms are registered every month. Virtual real estate is just a name, but domain auctions sometimes make actual real estate look cheap--and even if you aren't paying $7.4m for "business.com", a lot of domain names are expensive. If it's pronounceable, paying a few thousand bucks is apparently normal.

All this squatting and grabbing makes life harder for people who actually want to build a web presence. Just look at the names of some of the newer companies around here: Ooyala, anyone? DealKat? SaaSure? That first one reads like a misspelling of a French exclamation. The second is a misspelling. The third is a pun on SaaS, which is usually pronounced "sass", so it sounds like a lisp ("sass-sure"?).

These guys seem to have gotten what lots of people want: an unregistered domain name. Those sell for about $10, renewed yearly; the details depend on the specific TLD you want. In any case, they're vastly cheaper than domains that are already registered, whether by previous legitimate users or by squatters.

After spending half an hour recently typing stuff into whois, looking for the coveted "not found" that would tell me a name was unregistered, I found nothing. I thought: there's got to be a better way...

So I wrote a few quick-and-dirty programs that generate domain names, then used a shell script to test them automatically and pick out the unregistered ones. I wanted domains that were reasonably short and looked and sounded like English words. Since all the tricks I tried to that end rely on a large English word list, and since I didn't feel like waiting very much, I wrote these mini-programs in C++.



Attempt #1 goes through a list of English words and builds a map of all each 'syllable' along with how often that syllable occurs. For syllables, I just used all the substrings in each word of 2-5 letters that had at least one vowel. The most common were es, in, er, ed, ing...

Then, I combined two syllables at a time, starting with the the most common and the second most common: esin.com, ines.com, eser.com, eres.com...

The names got a bit more complicated after that, but they weren't very wordlike. Worse, the first 1000 were all four or five letters long, so despite sounding like gibberish, almost all of them were taken.

Attempt #1 results

500 domains
53 of which happen to be in the original wordlist. None of those was available.
Of the remaining 447, 2 were available: 0.4%

I needed something better...



Attempt #2 is a Markov model of the words in the dictionary. After a bit of experimenting, I decided to use a Markov model. For every three-char sequence in the input word list, I kept track of all the characters that come next. I included the null character at the end of each word, to model the length of English words as well as the characters they're made of.

To generate names, I sampled the most common three-character sequences at the beginning of dictionary words. For each sequence, I randomly picked from the characters that could come next, and repeated that until I got to a null character.

This one worked a lot better:

dislew.com
comm.com
trati.com
fore.com
staying.com
impo.com
recre.com
stri.com
gravel.com
miss.com
...

I especially like comm.com. Maybe a communications or PR agency? It's a sweet domain.

These names were generally a bit longer, but pronounceable. A lot more of them were available--it seems like raw length is what the squatters really care about.

Attempt #2 results:

500 domains
122 of which happen to be in the original wordlist. None of those were available.
Of the remaining 378, 61 were available: 16.4%

Possibilities abound. I could..
  • Artificially crank up the probability of the null character for every seed in the Markov model, to make it produce shorter domain names while still trying to keep them wordlike.
  • Exclude long words from the wordlist and then build the Markov model, also in an effort to produce shorter domain names.
  • Use the Markov model to generate two words at a time, and simply concatenate them, also to get more compound-word domain names.
  • Repeat the experiment for languages other than English.
  • Run a bunch of popular domains and less popular ones through the Markov model to see how they score. Are domains that look like words more popular than those that don't?
  • Compare some sites with a lot of direct traffic (people typing the domain into their URL bars, instead of going through a link or a search engine) and see if those tend to be more wordlike than their less typeable counterparts.

I might try some of this stuff. If I do, I'll keep you posted. Peace...

Sunday, April 19, 2009

I'll be BAWK



Last weekend, we went on an epic roadtrip through California.

It's an annual section leader tradition, and this was its fourth year. On Friday afternoon, we piled into cars with food, sleeping bags, laptops, and cameras, and started our trip. The goal? Solving puzzles and getting places as fast as possible. BAWK is framed as an adventure game. The theme? Always a B-movie. This year it was Cannibal Women of the Avocado Jungle of Death The route? TBD. We go nowhere fast, then hang out and have fun.



It turned out that we were driving from Stanford to within 90 miles of Mexico on that first afternoon. It was a beautiful drive through the Sacramento Valley and the Mohave Desert.

Stop 1: the Salton Sea.



A rainbow on the way to Dinosaur Point (San Luis Resovoir).

We camped on the Salton Sea our first night. In the morning, we went to an abandoned trailer park that had sunk into a wet marsh. Pictures coming soon.



Antelope Valley California Poppy Reserve.



Joshua Tree National Park.

On the way back, we made it to Big Sur before sunset. It was gorgeous.



Brandon, the B in BAWK and roadtrip planning genius.



The sun.




The sea.





The beach. We swam here.

I love the desert. I love the backroads, the cogs under the surface of society, the small towns that grow our food, transport our goods, generate our electricity. I love the freedom of driving with friends through the middle of nowhere, going wherever we want to go.



California is beautiful.
 
Views