Sunday, June 10, 2007

Miscellaneous Update

I haven't been blogging much recently, but hopefully I haven't lost all of my readers. Here's some of what's been going on:

  • I mentioned in a previous post that I have been creating a website for the school. It's not quite finished, but it's now online at http://dfa.qflpc.com.cn.
  • Three weeks ago, we had a group of 18 Americans here from ELT Edge. It was English Week here at the school while they were here. The students really get excited about English Week every year, and this year was no exception. Sometimes you get tired of answering the same old questions such as "Can you use chopsticks?", "Do you like Chinese Food?" and "Do you like China?" so it was nice to have some other guinea pigs foreigners here to answer those questions. Seriously though, it was a great week.
  • Last Summer, before I came to China, I played on several recording projects. One of them was recently released: Oratorio of Prayers: Supplication by Grace Seattle Experimental Orchestra. You can listen to some free song clips and purchase the CD here. (I highly recommend the songs "Canticle of Faith", "Canticle of Jonah", "John 3:16" and "The Holy Spirit"). Obviously, I'm a bit biased since I played on the CD, but I think it's a fantastic recording and a significant artistic achievement. I'm not just saying that because I'm on it.
  • There is only 1 more week of class (this week) and then finals next week!
  • I won't be coming home after next week, though. My cousin Tim and Mari Becker, a friend from college, will both be coming to visit for 2 weeks. We're planning to travel to Yunnan province, to visit Lijiang and Tiger Leaping Gorge, and then hopefully make it to Chengdu in Sichuan province before coming back here. I'll be flying home July 10th.
  • My former employer, Intuitive Manufacturing Systems, is rehiring me on a permanent part-time basis, starting this summer.
  • I've decided to come back to China for at least one more semester (I'm not yet sure if I'll be staying the whole year, or just fall semester). I also get a special contract from the school for next semester--I'll be teaching part time again (8 hrs/week rather than the usual 18) at a lower salary. With the extra time, I plan to continue to work for Intuitive from China next semester, thanks to the miracle of the internet.
That's it for now.

Saturday, May 05, 2007

My Job this Semester

So far this semester, I've basically just been posting about the traveling I did this winter. But there has been stuff going on here at the school in spite of my silence about it.

The school's current website for the department of foreign affairs is awful. In addition to the fact that it's just plain ugly, it's composed entirely of static html pages--which is a royal pain to maintain. Since I have a computer science background, the school asked me if I'd be willing to create a new website for them while teaching fewer classes. I don't enjoy teaching very much (at least not when I teach the same lesson nine times per week), so I was more than happy to make that swap. Originally, I was only going to teach 2 classes (for 4 hours per week), but one of the English teachers had to go home to be with her sister (who was just diagnosed with cancer), so I wound up with 4 classes (for 8 hours per week). I still spend lots of time with students (which is what I enjoy about being here), and my classes are more enjoyable since I teach fewer of them, and the rest of the time I spend working on the website.

I know I've got a few readers who are also computer programmers, so I thought I'd talk about the website project for a bit. If you're not the technical type, feel free to stop reading here, as the rest of this probably won't make too much sense to you.

My previous programming experience is almost entirely in building desktop database applications (that's what we developed at Intuitive Manufacturing Systems, my former employer). I've developed a grand total of one web application. I took a class in college called "Web Application Development using C#." The resulting stock quote website is still online. (But I hesitated to post a link to it because it's so embarrassing. Also, some parts no longer work due to upgrades to some of the software on the server, including MySQL). Web development is not my forte--but I figured it was time to start getting better at it, since the web is taking over more and more of the computing world.

All of my development work the past 3 years has been done using .NET. I like .NET, and I like it a lot. If I could have used Visual Studio 2005, I probably would have used ASP.NET for this project. However, the only version of VS that I own is VS .NET 2002 (using .NET 1.0. It's not even .NET 1.1!). I know they have free "express" versions you can download from the Microsoft website, but to download them you have to have Windows XP Service Pack 2 installed, which in turn requires a "genuine windows" validation check. You've probably heard about how rampant software piracy is in China, and I'm using a computer provided by the school....so you do the math. After getting used to new .NET 2.0 features like generics, there was no way I was going back to .NET 1.0. So I decided to rule out using ASP.NET.

Instead, I decided to use a very new framework: Ruby on Rails. It's the "new kid on the block", so to speak, but so far I've found that it's been deserving of the accolades it's received. In no particular order, here are some of the things I like and dislike about Ruby on Rails:

  • I like that Rails uses the MVC (Model-View-Controller) design pattern. This is a proven design pattern that works well for nearly all business applications (we never called it this, but I realize now that we used it at Intuitive, too). Rails is opinionated in that it essentially forces you to use this pattern. This is a good thing for 99% of the websites being built. For the occasional website that doesn't need this pattern, Rails probably isn't the right choice. But I love how it's baked right into the framework.
  • I like that Rails has unit-testing built right into the framework, and has some great assertions designed specifically for unit testing web applications.
  • I dislike that Rails uses a dynamic scripting language (Ruby). I'm used to static, compiled languages such as VB.NET, C#, C++ and Java. It still seems weird that there is no compile step. It's nice not to have to declare the types of all my variables, but this is also really annoying when I'm looking at some of the framework code and I have no idea what types the variables are (and consequently, what methods the objects have).
  • I like that Rails uses a dynamic scripting language (Ruby). Yes, I just said I dislike this. But I'm learning to like it, too. Rails does lots of things that are "magical", for lack of a better word--things that are virtually impossible in a statically typed language like any of the .NET ones (technically, they probably are possible, but they would be incredibly difficult--you'd have to do tons of crazy reflection and add lots of methods at runtime). For example, your model object dynamically generates attributes ("properties", in .NET-speak) for each of the fields of the database table the model is based on. You can call Person.find_by_name("Myron") and even though this method doesn't exist when it is called, the model object will generate it because their is a name field in your Person table. You can declare "has_many :orders" on your Person model, and suddenly you will have an orders method that acts as an array of order objects, as well as a whole bunch of corresponding methods to work with this association. It's really, really cool--but also a bit difficult to work with first, because looking at the code for the base Model object doesn't tell you what methods it has--instead it has an implementation of the "method_missing" method that adds the necessary methods as they are called.
  • I like how Rails gives you "scaffolding" for use during development. Using one line of code, Rails will generate the necessary pages to do the basic CRUD operations (create, read, update, delete). This isn't intended for use in production applications, and the idea is that you'll change all that code, but it's nice to have that there to start with. It makes incremental development very easy.
  • I like how integrated the AJAX support is. Yesterday I was able to add a drag-and-drop sorting feature to the administrative interface for the photo album portion of the website. This was absolutely a piece of cake. I have no idea how you'd do this with ASP.NET.
  • I dislike the lack of a good IDE. Maybe I'm just an intellisense addict, but a good IDE does wonders for my productivity. I've been using an IDE called RadRails (based on the Java Eclipse IDE) but it doesn't have good intellisense support. And I think this would be tremendously difficult to do, given the dynamic nature of Rails. As I mentioned before, rails sometimes adds methods to your objects at run time when you try to call them and they are missing (by implementing "method_missing"). I can't think of an easy way for an intellisense engine to be able to figure out all the methods that can be added.
  • I dislike the lack of a debugger. Rails comes with a command line utility for use in debugging (you add breakpoint statements to your code, and then run the utility--when it hits the breakpoint, the utility takes over control, and you can inspect variables). However, this is broken with the current release. I've gotten very used to having a debugger, and it's certainly been difficult at times troubleshooting issues without being able to step into the code. Instead, I've had to do things like raise exceptions to see a stack trace, or add logging statements to see variable values at various points in my code. Who knows, maybe it's been good for me to have to do without a debugger, in order to expand my programming skills.
Overall, I'd recommend Ruby on Rails to anyone starting a new web application project. It works best when you can create your database schema to conform to certain expectations Rails has (although all of those can be overridden). I don't think it would work very well for a legacy application.

Hopefully, I should be able to deploy the website soon, and I'll be sure to post a link to it when it's up.

Tuesday, April 24, 2007

Winter Travels Recap

Well, that's it for my posts on my travels during the winter. I thought it'd be nice to visually see where all I've traveled in China, so I used a red marker to mark up my China map:


Almost all of that is from my travels this winter, the exception being my travels to Dalian and Chang Bai Shan back in October and my visit to Tai Shan and Qufu in Shangdong province this last weekend.

In case you missed any of my posts about my winter travels, here's the full list:

Monday, April 16, 2007

My Winter Travels, Part 16: Beijing, Again

Beijing Picasa Photo Album
After seeing the Army of Terracotta Warriors in Xi'an, my parents, Allen and I took a night train back to Beijing. We had previously seen most of Beijing's sights, but there were a couple more things we wanted to see, so we decided to stay in Beijing for a day before heading back to my school for the start of the semester. Specifically, we wanted to see Beijing's hutongs and the Great Wall of China near Beijing.

The Great Wall of China

Qinhuangdao has two places to see the Great Wall--Lao Long Tou (where I've previously been and was not very impressed) and Jiao Shan. Several people have told me they like the wall better at Jiao Shan than in Beijing, but only because it's so much less crowded. The views in Beijing are definitely more spectacular. So we decided to see it in Beijing, and I'm glad we did. We went to Badaling, wear most Beijing tourist see the Great Wall. It certainly was crowded, but the views were really something.
On to the pictures:














Beijing's Hutongs

A hutong is a narrow street/alleyway where communities of families have lived for generations. Many of them are disappearing as Beijing undergoes more and more construction, but a number still remain. They are littered throughout town, but there are a few areas where there is a concentration of them. We visited one of these areas where you can take a rickshaw ride through them.






My parents on the rickshaw.

After our rickshaw ride through the hutongs, we took a train back to Qinhuangdao, 2 days before the start of the semester. My parents stayed with me at the school for 4 days before heading back to Beijing to catch their flight to Seattle.

And that was the end of the trip. Hopefully you've enjoyed reading about it and seeing the pictures!

Sunday, April 15, 2007

My Winter Travels, Part 15: Xi'an

Xi'an Picasa Photo Album
After we spent Spring Festival in Beijing, we took a sleeper train to Xi'an in Shaanxi province. Sleeper trains in China are great--it saves you the cost of staying at a hotel, and you wake up in the morning at your location. If you ever travel in China, I highly recommend you travel by sleeper train. Xi'an has one of the longest and most impressive histories of any city in the world--it has been the capital of 13 Chinese Dynasties, beginning from before the birth of Christ. Yet for some reason, it's not a well-known city in the west (I had never heard of it before coming to China). Overall, I'd say Xi'an might have been my favorite place we visited on the trip--primarily because of the Army of Terracotta Warriors, one of the most amazing things I've ever seen. We spent 3 full days in Xi'an, before we took a sleeper train back to Beijing on February 22nd.

Xi'an City Walls

On our first day in Xi'an, we visited the ancient city walls of Xi'an. The current city walls were built in the 14th century. Much of the city of Xi'an is outside the walls today, but most of the historical buildings and interesting sights are within the city walls. Some pictures:




The city walls had some decorations along the southern portion of it. I think it was just there for Spring Festival.




The southeast corner of the city walls.


We rented bicycles and biked the entire 8.7 miles around the city walls.


There were various battlements and guard towers at regular intervals.


I think this was some kind of ancient catapult.


The city walls stretch for as far as the eye can see...

We rounded out our first day in Xi'an by doing some souvenir shopping and walking through the Muslim quarter (Xi'an is home to a very large Muslim population).

The Army of Terracotta Warriors

On our second day in Xi'an, we visited the Army of Terracotta Warriors, our main reason for visiting Xi'an. In the 3rd century B.C., Qin Shi Huang unified China and became China's first emperor. He began many construction projects (including the initial version of the Great Wall of China), one of which was a grand mausoleum where he was buried. Being a mad tyrant, he had his laborers build him a grand army to guard his tomb. More than 6,000 unique, individual statues were built and buried. The army lay unknown for over 2,000 years before being discovered by a farmer in 1974. It's turned out to be perhaps the greatest archaeological find of the 20th century (the Dead Sea Scrolls would also rank up there).

Pictures don't do the terracotta warriors justice. There are some things in the world that look just as good (or maybe even better) in a photograph than in person. The terracotta warriors are not one of them--seeing it in person is breath taking. Some pictures:


Pit #1. There are about 10 rows of these statues.
















Different statues were different kinds of warriors. This one was an archer. They've taken all the bronze weapons and put them in a vault for now.


Lots of the warriors were headless. This is from pit #3 were the warriors were arranged like they are officers in the military command center.


Each warrior has a unique face.


They also found a bronze chariot with 4 horses.

China likes to toot its own horn, and it was no exception here. They say they have no record of the warriors (and hence were completely unknown until the farmer found them), and yet somehow they know it took 700,000 workers 38 years to construct it. Where does a number like that come from? They also make some pretty extravagant claims about the nearby tomb of Emperor Qin, where there are supposedly tons of gold and buried treasure beneath the giant mound. But they haven't opened it up because they say we don't yet have the technology to properly excavate it and keep all the artifacts from corroding. I think its just as likely that there's nothing impressive there--either because there never was or because grave robbers have taken all of it.

Shaanxi History Museum

On our last day in Xi'an, we visited the Shaanxi History Musuem. The museum has artifacts from all of China's known history. Here are a couple of the more interesting items:







We also saw several other things in Xi'an that I would not recommend. If you ever visit Xi'an, make sure you see the above three things, but don't bother with the Tomb of Qin Shihuang, Banpo Neolithic Village or the Huaqing Pool.

After our three days in Xi'an, we took a sleeper train back to Beijing, where we wrapped up the trip with a visit to the Great Wall and Beijing's Hutongs.

Saturday, April 14, 2007

My Winter Travels, Part 14: Beijing

Beijing Picasa Photo Album
After visiting the gorgeous mountains of Huang Shan, we took a bus back to Hangzhou to catch a flight to Beijing on February 16th. Originally we were planning to go to Xi'an next, but I think it turned out better being in Beijing during Spring Festival. My friend Liu Kai--who I traveled with during the first two weeks of the trip (to Hainan, Guilin and Yangshou)--is from Beijing and was home during Spring Festival, so he was able to hang out with us and show us around Beijing a bit. We spent 3 days in Beijing before taking a train to Xi'an, after which we came back to Beijing for another day (I'll talk about that last day in a separate post). We did a lot during those 3 days in Beijing--we visited Tiananmen Square, the Forbidden City, the Temple of Heaven, the Summer Palace, went shopping at the Pearl Market, saw lots of fireworks, went to a Spring Festival street carnival and saw an acrobat show. Our hotel (which Liu Kai booked for us) was at a great location--most of this stuff was within walking distance.

Tiananmen Square & the Forbidden City

Tiananmen Square is the largest public square in the world (Wikipedia lists it as 440,000 square meters!). Unfortunately, it's so big that there's no way to adequately capture it on film. But here's my attempt:


The Monument to the People's Heroes at Tiananmen Square.

We visited Tiananmen Square first thing on our first morning in Beijing. The Forbidden City is next to it, so we visited that on the same day. The Forbidden City was the imperial palace for about 500 years. It was forbidden for the public to enter it (hence the name). Calling it a city might be a bit of a stretch, but it is enormous--my guide book says it has 9,999.5 rooms (I don't know how you have half a room, but it's supposed to be just less than 10,000 to show the emperor's inferiority to the gods). It's one of the highlights of Beijing. However, I didn't enjoy it as many of the other things we saw in Beijing and elsewhere on the trip. Part of that might be because some of the main buildings were undergoing renovation to be ready for the 2008 Olympic games. Here are the pictures:


The Forbidden City.


Check out the painting on the underside of the roof.


The interior of one of the 9,999.5 rooms.


You could feed a lot of people using this pot!


The Forbidden City had several of these alleys.




Chinglish strikes again. Although maybe it explains why I'm not very beautiful :).


These lion-like creatures are found all over China.


Quite the carving, isn't it?



Spring Festival

Spring Festival (also called Chinese New Year) was February 18th--our second full day in Beijing. It was cool to see how this was celebrated (at least how it's celebrated in Beijing). On Spring Festival eve, they set off tons of fireworks, especially right at midnight. You may think Americans go crazy with the fireworks on the 4th of July, but that's nothing compared to the Chinese on Spring Festival eve (the Chinese invented fireworks, after all). It was a bit scary, to be honest--there are millions of people on the streets all setting of their own fireworks in every which direction. Looking down one street, you could see 30-40 separate groups setting off their own fireworks, oblivious to the others around them. I'm surprised they don't have many injuries or burned buildings on Spring Festival, but apparently that's a rarity (at least rarer than on the 4th of July in the states). I was planning to walk towards Tiananmen Square to view the fireworks from there, but there were so many fireworks going off on the streets that I didn't feel like I could safely navigate them. So I just enjoyed the fireworks from where I already was. Here are some pictures:





The next day (Chinese New Year's day) we met up with Liu Kai and got a great meal at a restaurant of Beijing Duck, one of my favorite Chinese dishes. You put the roasted duck, cucumbers, onions and a fermented bean sauce on a wheat pancake, roll it up, and eat it. Very tasty.


My parents, Liu Kai and I. You can't see it very well, but the Beijing Duck is on the white tray that has a handle shaped like a duck's head.

Then we went to a street carnival. There were lots of street vendors here. We also found a Chinese musical instrument store, so I bought an Erhu. Some pictures:






The Five Friendlies--Beijing's Olympic mascot. From left to right, they are named Beibei, Jingjing, Huanhuan, Yingying and Nini. If you take out the duplication, together they spell "Beijing Huangying Ni", which means "Beijing Welcomes You".

The Temple of Heaven

The Temple of Heaven is another of Beijing's highlights. It's a park with several ancient buildings. The emperor would come here annually to pray to the gods for a good harvest. We visited it the morning of Chinese New Year's day, before meeting up with Liu Kai. I liked it better than the Forbidden City.


We met this kid at the Temple of Heaven. I think he'd win any cuteness contest he entered.




The Hall of Prayers for Good Harvest.






The interior of the Hall of Prayers for Good Harvest.


The park grounds.

Chinese Acrobat Show

After visiting the Temple of Heaven and hanging out with Liu Kai, we ended our Chinese New Year's day by taking in a show of Beijing Acrobats. The acrobats were amazing--they did things I didn't know anyone could do. These videos should give you a taste for what they did:












The Summer Palace

The Summer Palace is another of Beijing's major sights. It doesn't have as much history as the Temple of Heaven or Forbidden City, but it was still quite spectacular. We visited it on February 19th, the day after Chinese New Year. Some pictures:








The Tower of Fragrant Buddha.




The Long Corridor. It's almost 1 Km long and is covered in paintings--Wikipedia says there are more than 14,000 of them.


The Marble Boat.




This is called the Thousand-Handed Buddha, even though it doesn't have nearly a thousand hands.


Another view of the Tower of Fragrant Buddha.


My parents on the stairs up to the Tower of Fragrant Buddha.

After we visited the Summer Palace, we took a night train to Xi'an, where we spent 3 days.