Computers for moms

My mom is 71 years old and she wants to have a computer. Because—according to her – “I will have a dictionary (she is trying to learn some English), a phone (I showed her how convenient to make oversea long distance calls with Skype), and a movie player all integrated into one device”.

So, I let my mom play with my laptop while I was at work. The result was a disaster. Even though Windows 7 (I have Chinese version installed) is the most user-friendly OS in Microsoft’s history. It is still way beyond what my mom’s reach with minimum training (I spent about 2 hours explaining how things work before I left home). There are so many little glitches everywhere that we learnt to quickly go around them without noticing they are there. But for someone like my mom they are disasters. So, I gave up the thought of buying a laptop for her and decided she was better off with the traditional devices.

I was never an apple fan because of their pricing strategies. Paying 200 dollars more for a computer/phone just because it has an apple logo was never my thing. In the morning of May 28th, after come back home from a grave yard shift, I found myself surrounded by the news of IPad reaching Canada. I needed a reading device, so I decided to give apple a try. I ended up to be one of the first Canadian customers of IPad (the third in queue in front of Bestbuy located at Kingsway).

I wouldn’t say that IPad gave me 100 percent satisfaction. After paying 600+ bucks of my hard-earned money, I don’t even get a file management system? I can’t make a pdf file with my laptop and drag it to my IPad so that I can view it later? Don’t even mention that there are no usb port at all. Well, it felt like you are a PRISONER of the device. I was enraged.

Since 600 dollars is a lot of money and I didn’t feel like to return the device I got after standing in line for 2+ hours. I calm down myself and baby-stepped to explore the evil toy. I wouldn’t yap about the experience (which was painful for first-time apple users like me) of eventually get my pdf book showing with iBook. But the result was surprisingly good. The iBook software is so well made that using it is like reading a real book, but with a dictionary on top of my figuretips (literally). And as I played with different applications, I found myself spending more time on IPad than on my laptop. This device gradually grew from an e-reader to a PIM system and a personal financial management system. I still don’t have the freedom I anticipated when buying this device, but I am a much happier prisoner now. The only complaint I still hold strong is the wireless connection issue.

I let my mom played with the IPad after downloading a Chinese book from iBook store. She just opened the book and started reading. She asked much less “where is …” questions than she was playing with my laptop. Things seem to be at where there are supposed to be and no need for learning.

I used to think the overpriced Apple products were only targeted for younger generation because of their “cool” look. But my mom’s experience told me that Mr Jobs must has done something right to bring his company to today’s success. While my mom still doesn’t have her precious Chinese-English dictionary IPad, I almost have the urge to throw another 1500+ hard earned dollars to buy a mac to develop one just for her. This is just a crazy thought. But who knows, I may become an Apple developer one day if the motivation is strong enough.         

A simple math question

Friend’s kid is a happy, bright boy attending junior high. Last weekend, he showed me some of his math home work questions while we chatted online. One of them was interesting enough that I thought it is worth to share with everyone who reads my blog.

The question was simple enough:  Find a the value of ? in the given Hexgon.

 

With a degree in applied science, this was a non-brainer to me.

“I found the pattern of these numbers. The formula is (next = 3*previous + 1).” I proudly announced after some quick calculation. The young man's face brighten with admiration and I was content with my own mathematical ingenuity.


I was still thinking of this question after got offline. What IS the answer then? If my pattern was correct, then the value should be either 1(because 1*3+1=4) or 364*3 + 1 = 1093. So this question should have two answers and both of them are correct. I was satisfied and quickly forgot about this question.


For some strange reason, the shape of this hexagon jumped into my head while I was preparing dinner today. It can’t be right! Both of these answers violate a basic geometrical rule—in any geometrical figure, the length of the longest side should be less than the sum of lengths of all other sides. This sounds dry and boring, but it is actually pretty simple. In our example, if we took 1 as the answer. When we sum the number from 1 to 121, we get 1+4+13+40+121 = 179. The longest side is 364, which is greater than 179. So, we CANNOT form a hexagon with these values. Same conclusion can be drawn if we take 1093 as the answer.

I tried to prove myself correct by using sticks with given lengths. But no matter what unit I use, the sticks I found are either too short or too long.  However, it is easy to test with sticks with more reasonable measurements. Find 6 sticks with length of 5cm, 6cm, 7cm, 8cm, 9cm, and 50cm respectively. Try to form a hexagon with them and you will know what I mean. (Hint: there are lots of falling twigs outside after the last night’s storm in Vancouver). 

Using SVN as Document Management System

This document is aiming to help two groups of people:
1.    Normal (by which I mean those who don’t spend 18 hours a day hacking in front of laptops in their basements) people who work with lots of documents and are seeking ways to organize their work. You may find the screen shots helpful.
2.    Computer geeks who happen to need managing their binary files. Maybe you don’t need to read any further.  “Use SVN! You idiot” could be sufficient. :)

Be aware: This is a mini howto of using SVN to manage documents on Windows platform. I am using Windows 7, I can’t promise these steps work for other Windows operating systems, and I CAN promise that they WON’T work for Linux/Mac OS since the software used here are for Windows only. So, if you are using non-M$ operating system, you can safely ignore the rest of blabbing and enjoy your life elsewhere.
.
.
.
Firstly, some background BS, you can skip it and jump to the real stuff:
 
Moving is a serious business. You have to face a lot of changes—weather, work, the community your live—basically everything around you. I have been in this situation since moving back to Canada this February. I suddenly found myself doing a lot of paper work -- reactivating credit card, changing bank address, applying for new health care card—things that I didn’t need to do when I was in China. This morning, while working with yet another document, a thought kicked in my mind: “I wonder if I can find a software application to manage all these documents so that I can track the changes when need to.”

As a faithful googler, I eagerly typed “Document Management System” in my Chrome address bar, and was taken to a sea of sites that point to different DMSs (yes, they even have an acronym for this kind of systems). However, all these applications looked overly complex and none meet my requirement of tracking changes (I could be wrong, since I didn’t finish reading even one complete description of these products due to impatience+boredom).

Then my geekyness as a programmer woke up. I had been using SVN to manage source code for work and it did the job just fine, why not use it for my documents? Even though the binary format nature of these documents would make features such as merge and diff stop working, but all I needed was to be able to grab “snap shots” of documents at certain point of time. SVN seems to be perfect for doing that.

So, I rolled up my sleeves and started building the home-made DMS.  Also, I decided to record every step so that maybe someone sitting on the other end of the Internet can benefit from it.


Now the real stuff:
1    Setting up Visual SVN Server
1.1 Go to http://www.visualsvn.com/ and download and install the latest SvnServer software.
1.2 Create a user, for example: weima.
1.3    Create a new repository, for example weima_docs.
1.4    Assign read/write privilege of weima_docs to user weima.

2    Download and install Tortoise SVN client
2.1 Goto http://tortoisesvn.net/downloads to download and install Tortoise SVN client. Reboot your computer.

3    Import documents to repository
3.1    In your windows explorer, goto the parent directory of the directory where you store documents.
3.2    Right click to bring up the tortoises menu and click import.
 
A dialog asking for repository url should pop up

 
3.3    Goto VisualSvn UI, right click on the repository, select copy url to clipboard .

 
3.4    Go back to tortoise svn import dialog box, use Ctrl+V to paste the contents to the URL address bar. Then click on OK.
 

3.5    A dialog asking for user name and password pops up. Fill out the user name and password and check the save authentication check box to stop the dialog from popping up in future usages.
 

4    Checkout versioned documents
4.1    Create a new directory, for example, versioned_docs.
4.2    In windows explore, go to the newly created directory.
4.3    Right click-> Svn checkout.
 
4.4    In the repository url address bar, paste the repository address. If you haven’t copied anything to clipboard after step 6, Ctrl+V should still work.
 

Click OK. Now the directory should contain a hidden .svn subdirectory and files checked out from svn repository. The new files should be associated with green check mark signs.
 

5    Work with versioned documents and commit changes.
5.1    Open a versioned document. In my case, Test1.doc.
5.2    Make some modification to the file and save.
5.3    In Windows explorer the modified file should be associated with red exclamation sign now.

 
5.4    right click on the changed file, click on Svn commit
 

      Click OK on the following two dialog boxes. Now the change is committed to the server. The sign that associated with the changed file should switch back to the green check mark again.

6    Revision of documents.
6.1    In windows explorer, right click on the file that needs to be revised. Choose Tortoise Svn-> Update to revision
 
6.2    In the pop up dialog box, choose the version you want to revise to, and click OK.
6.3    Now you can work on the revised document and do normal update and commit as shown in step 5.


Conclusion: I am pretty happy with the result. I am now able to do all kinds of changes to my documents withough the fear of losing any of the valuable works (as long as I remember to commit changes after important updates). Since SVN is a huge topic, it’s not possible for me to cover everything in this little blog entry. You can check the tortoise svn manual if interested.


 

Setting up Subtext on Softsyshosting server

The factor that Subtext’s creator, Phil Haack, is also the guy behind .Net mvc gives me a lot of confidence for picking it as the blog engine for my site. The installation guide on Subtext’s official site is precise but not tailored for every single individual Web Server. So, I was mostly on my own when tring to install Subtext to Softsyshosting web server. After a few trials by error, I was able to get Subtext up and running with Softsyshosting. Since David Mitchell’s blog helped me a great deal during the process, I thought I could do the same thing to help saving Softsyshosting users some headaches .

Step 1: Grab subtext from http://code.google.com/p/subtext/downloads/list. The version I used was 2.1.2 deployment.
Step 2: Unzip the zip file to your local drive. Mine was “E:\downloads\SubText-2.1.2”.
Step 3: Log into the DotNetPanel, and choose SQL Server 2008 option.


Step 4: In the database GUI, create a user, for example joe. Set a password, for example, WontForget.

Step 5: Create a database “std”, and set joe as it’s user.


Step 6: Open web.config file located at Subtext directory. In my case, E:\downloads\SubText-2.1.2\Subtext.Web. Look for the line containing “connectionString”, mine was line 33. Change the connection string to the form of connectionString="Server=72.18.156.74,1533;Database=s td;Uid=joe;Password=WontForget;”, The database name, Uid and Password may vary depend on your own database setting.

 Step 7: Login DotNetPanel again, click on FileManager


Step 8: In the FileManger GUI, create a new directory, say, blog. After done this step, your GUI should look like

 Step 9: Go to ftp accounts GUI by clicking the “Ftp Accounts” link on the left menu bar


Step 10: In Ftp Accounts GUI. Create a new ftp user, set its home folder to Root Folder/blog, and give the new user read and write privilege.



 Step 11: login the ftp server of Softsyshosting. Upload all contents under the subtext directory.

 Step 12: Go back to DotNetPanel, click on Web Sites 



 Step 13: In the Web Sites GUI, click on the link for your web site. Mine was wiiland.net


 Step 14: In your Web site GUI, click on the virtual dirs tab 



 Step 15: In the Virtual Dirs GUI, create a new virtual directory named blog, set it point to /blog/Subtext.Web physical directory.


WARNING: Set the virtual directory point to /blog won’t work. 


Step 16: In the Virtual Directory GUI, click on the link to your newly created virtual directory to enter properties GUI.

Step 17: In your virtual directory properties GUI, click on the Extensions tab.


 Step 18: Set the virtual directory extension property, in the drop down
list for Asp.Net, choose 2.0 Integrated pipeline.


Step 19: Now use another browser, open your web site at yourdomain/blog. Subtext will take care the rest of installation.
Step 20: That it. Enjoy your new blog site :)

PS: I didn’t realize that so many steps were involved in setting up a blog engine until started writing this little tutorial. I am grateful that I had a very detailed guide to start with. Since I have read David blog entry for so many times, I might unconsciously put statements from his blog to this entry without putting quotation marks. However, I have no intension to steal his credit. So, if you see anything good here, it’s from David and the official Subtext documentation; if you see anything bad, it’s from me.

开源,Subtext, 以及其他

到温哥华有一个半月了。 零零散散地做了不少事情。 用SubText架起这个博客,算是了了一个心愿。 知道Phil Haack 是因为关注.Net MVC, 继而才知道了SubText。 一直想对开源组织作一些自己的贡献,也给Rob Conery 的SubSonic提交过代码,但是总觉得好像都没有太多的参与进去。 这次用SubText架blog,至少能提供一些feedback外加一些文档吧。 温哥华这几天天气不好,风大雨大的,昨天雨伞都吹坏了。今天天气貌似要好一些,赶快出门买点东西吧。