Using Subversion with Xcode 3.2
Posted: February 9th, 2010 under Computers, Mac.
Tags: Mac, Software Development, XCode
Comments: none
Posted: February 9th, 2010 under Computers, Mac.
Tags: Mac, Software Development, XCode
Comments: none
This is part II of the tutorial of using Subversion on XCode 3.2. Part I of the series can be found here.
We can now version control capability for HelloWorld project. We just need to enable this capability by 1) check out the project from the repository and 2) linking the project to the repository.
| 1. Quit and relaunch XCode without opening or creating a new project |
| 2. From the menu, select SCM > Repositories to launch the Repository browser. |
| 3. Select HelloWorld > trunk > HelloWorld. |
| 4. Click the Checkout icon from the toolbar. |
| 5. On the pop-up file browser, navigate to /Users/demo/src (Note: We are saving the HelloWorld directory into the source directory /Users/demo/src). |
![]() |
| 6. On the popup window, click the button to open the XCode project file. |
![]() |
| 7. Next, we want to link HelloWorld project to the repository. Select HelloWorld item on the left pane, right-click and select Get Info. |
![]() |
| 8. Click the Configure Roots & SCM… button on the top right corner of the Get Info window. |
![]() |
| 9. On the right column, select repository HelloWorld and click OK. |
![]() |
| Let’s test the system by editing a source file. Open main.m and insert comment “// This is a test.” |
![]() |
| Save the file. |
| The main.m file is now marked with the letter M on the left pane of the Project window. |
![]() |
| You can right-click on the modified file to compare or commit the changes to Subversion. |
| So far so good. Let’s build the project now. From the menu, select Build > Build. |
| From the Finder, you will find that /Users/demo/build/HelloWorld has now been created. |
Congratulations, you have completed the setup and enabled SCM on XCode.
Posted: February 9th, 2010 under Computers, Mac.
Tags: Cocoa, iPhone, Software Development, XCode
Comments: none
This tutorial is a variant of the official Apple tutorial on setting up Subversion with XCode 3. This tutorial explains how you can use Subversion without setting up a Subversion server and by directly manipulating the files. This setup is considerably simpler but this setup is only suitable for single user environment and security isn’t a concern. For a multi-user management, network access, and enhanced security, please read the official Apple tutorial.
It is assumed that you have the following apps installed and running on the Mac:
| The directory where subversion repository will reside | /Users/demo/repositories/HelloWorld |
| The directory where an XCode project is first created and then imported to a Subversion repository. This is a transient directory and can be deleted after its content has been successfully imported to Subversion | /Users/demo/Desktop/HelloWorld |
| The directory for the checked out XCode project. This is the final local directory where the project files are opened, modified, and saved. | /Users/demo/src/HelloWorld |
| The build directory containing the binaries and build intermediate files of the project. By default, the build subdirectory is created within a project directory. But for version control, we don’t want to check these files into a Subversion repository. We will relocate the build directory to a directory outside of the project directory. | /Users/demo/build/HelloWorld |
| The directory for creating the skeletal directories for creating a Subversion repository. | /tmp |
| 1. Create a new project. For this example, select > iPhone application > Navigation-based Application. |
![]() |
| 2. On the file browser sheet, navigate to /Users/Desktop/src/ to create a HelloWorld project there. Click Save when you are done. |
![]() |
| 1. While HelloWorld is selected, right-click and select Get Info. |
![]() |
| 2. You don’t need keep your build directory under version control. So move it out of the source directory. On the Get Info window, configure the build directory to a new path. For this example, we use /Users/demo/build/HelloWorld as the build directory. |
| 3. Close the Get Info window when you are done. |
![]() |
| 1. Configure XCode to recognize the a Subversion repository. From the XCode menu, select SCM > Configure SCM Repositories… From the window, click the + button (Add Repository) to add a new repository. |
![]() |
| 2. In the sheet that appears, enter HelloWorld as the name for the repository. |
![]() |
| 3. In the pop-up window, enter the URL as file:///Users/demp/repositories/HelloWorld (the path to the Subversion repository) and click OK. |
![]() |
| 1. On the Finder, remove the build subdirectory in the HelloWorld project. We don’t want the build directory to be imported to the repository later. |
| 2. In XCode, select SCM > Repositories. |
| 3. From the Repository browser that appears, select the trunk directory. |
![]() |
| 4. Click the Import icon on the toolbar. |
| 5. From the file browser sheet, navigate to /Users/demo/Desktop/HelloWorld and click the Import button. |
![]() |
| 6. Now that the code has been successfully imported to a Subversion repository, we don’t need the initial XCode project that we had created. Remove /Users/demo/Desktop/HelloWorld in the Finder. |
In part II of this series, we will finish the tutorial by looking at synchronizing XCode with Subversion and testing the new SCM capabilities on XCode.
Posted: February 8th, 2010 under Computers, Mac.
Tags: Cocoa, iPhone, Software Development, XCode
Comments: none
I personally love using URL shorteners. My favorite URL shorteners are bit.ly and j.mp, which is basically bit.ly with a 2-character shorter URL. Apart from cramming a long URL into a Twitter message of 140 characters long, I especially like the link tracking capabilities of a URL shortener. When I share my link, I like track it to know not just how many times it has been clicked but also where people are clicking from.
I was going to research and publish a list of URL shorteners. But Mike Koss has already done this work. So I am just going to post a link to his list instead. Here’s an excerpt of the list, only the top 10 URL shorteners (as of August 2009) are shown:
| Rank | URL Shortener | Tweets per Day |
| 1 | bit.ly | 1,710,720 |
| 2 | tinyurl.com | 237,600 |
| 3 | is.gd | 55,543 |
| 4 | tr.im | 41,929 |
| 5 | ow.ly | 37,848 |
| 6 | cli.gs | 37,190 |
| 7 | u.mavrev.com | 17,421 |
| 8 | twurl.nl | 17,005 |
| 9 | tiny.cc | 13,641 |
| 10 | digg.com | 12,579 |
Follow this link for an exhaustive list of URL shorteners.
Posted: January 18th, 2010 under Internet.
Tags: Internet, SocialMedia, Twitter
Comments: none
A recent Techcrunch article points out the obvious (at least to some Chinese speaking people), that Bing sounds like:
![]()
It pronounced bing (in 4th tone) in Hanyu Pinyi and it means disease or sick.
But depending on the tone (4 different tones for Mandatin Chinese), the sound bing could also mean:
meaning ice
meaning soldier
meaning biscuit
Translating English brand names to Chinese is always tricky – and I am sure it is the same with other languages too. But most phonetically-based English-to-Chinese translations have an unintended consequence. The translated Chinese symbol can be misinterpret with another similar-sounding negative character.
Nonetheless, I find it hard that a fortune cookie would have a slip with the Chinese symbol ? on it. It is a FORTUNE cookie after all. So is it a coincidence or a clever PR ploy?

Posted: December 29th, 2009 under Internet.
Tags: Humor, Internet, Language, Marketing
Comments: none
Wow, I can’t believe that it has been a year since I last blogged. This blog had been collecting dust all this time, abandoned and neglected by me without the proper care and updates. Since starting the job in Shanghai, I have been busy. Also, I found Twitter a more efficient tool to update my status, share my stream of consciousness, or babble senselessly about random stuff. Consequently, Twitter (or rather microblogging) became a substitute for this blog (or blogging). Lately, I feel a need of an outlet of sort to satisfy my propensity to express myself without being confined to 140 characters or less. So the obvious thing to do: start blogging again on this site once again. Stay tuned.
Posted: October 27th, 2009 under Blogging.
Comments: none
I didn’t know how much I miss Boston until I visited the city a few days ago. It was welcoming and refreshing walking on the streets without rubbing shoulders with someone else. Ah… personal space is great. Gradually I was stirred up by my stroll along the Charles and soon realized how much I miss the city where I lived the past 10+ years. Here are some of the things I really miss about Boston.
Posted: February 1st, 2009 under Personal.
Tags: Boston
Comments: none
As a pedestrian, I often get honked and sometimes even in danger of getting run over by a car or moped even if I am walking a crosswalk on a green signal. Don’t expect any vehicle in Shanghai to stop for pedestrians. In fact, some drivers or riders deliberately step on the accelerator as the pedestrians start to cross a road. Sadly, there is no concept of right of way for the pedestrian. Now that I gotten used to the traffic here, it hasn’t irk me as much. But nonetheless, one has to be careful when crossing a crosswalk in Shanghai where pedestrians should have right of way to cross.
Posted: January 25th, 2009 under China.
Tags: Shanghai, Traffic
Comments: none
One thing that I really like about Shanghai is mobile communication. I have been using my Apple iPhone without any glitch so far.
To use an Apple iPhone in China, the phone needs to be unlocked. In other words, the phone has to be capable of accepting a SIM of another mobile carrier. The Apple Store in Hong Kong actually sells the unlocked version of the iPhone, which you use it with any mobile carrier. Unfortunately, iPhone in the Hong Kong Apple Store cost twice as much as US iPhone.
Once you have your unlocked iPhone, you can purchase a SIM card from any mobile phone (also known as hand phone in China) operator in Shanghai. There are 3 main wireless carriers in China to choose from: China Mobile, China Unicom, and China Telecom. I picked China Mobile because it has arguably the largest coverage in the country. The company offers 2 types of SIM card: subscribed or pay-as-you-go. Each plan has its calling rates and features. Choosing a suitable plan really depends on your calling profile. Even though the calling rates for subscribed plan are more expensive, I ended picking the latter because I don’t use my mobile phone much in Shanghai. Also the pay-as-you-go plan is much easier to deal with administratively (no mail and bill payment to cope with). Buying a SIM card is a really simple process and there is no lengthy paperwork involved at all. In fact, you don’t even need to show identification if you purchase a pay-as-you-go SIM card.
Once you got your SIM card, just replace the SIM card in your iPhone with the new one. China Mobile pay-as-you-go SIM card even allows data communication in which you get charged for every Kb you use (I don’t have the exact rate, but check here for more information). To activate data communication, you need to go to Settings > General > Networks. Once there, select Cellular Data Network and then enter cmdata on APN. Once you do that, you can now receive emails and surf the web. But be warned, you need moderate your Internet usage. With the pay-as-go-plan, the more you use, the more expensive it gets.
So what do you are out of credits on your mobile number? There are many ways to add credits to it but I found the way to do this is to go to any China Mobile agent found all over Shanghai and pay the staff cash and your mobile phone number to add more credits to the account. Even if you don’t speak any Chinese, they will likely understand what you want. You will receive an SMS message indicating the amount you added after the transaction. In the message, it will also mention that you have 720 days to use your credits before they expire (which is a lot of time compared to other pay-as-you-go plans I have seen in other countries).
Posted: January 2nd, 2009 under China, Technology.
Tags: iPhone, Shanghai
Comments: 4
Personally, I find food in Shanghai to be way too salty. Worse, it is often packed with monosodium glutamate (MSG), to which I am intolerant. But eating out in Shanghai means that there is no escape from salt or MSG since every food available from restaurants and in the street is filled with them. I have often lost my appetite halfway through eating a meal because of the high salt content. This is why I can’t wait to move into an apartment and to get my hands on my personal kitchenware, which are in transit to Shanghai; that way I can start cooking and actually have a proper meal. However, I would be keen to hear from anyone who may know of any restaurants in Shanghai that serve meals low in salt and MSG content.
Posted: November 26th, 2008 under China, Food.
Tags: Food, Shanghai
Comments: none
cybersam.org is Digg proof thanks to caching by WP Super Cache