Category Archives: study_note

My ownCloud service is online

When Google decided to shut off its Google Reader, I understand on thing. You should not rely on others, no matter how reliable they are. For now, Dropbox serves me very well. But it will be much better if I can handle my stuffs on my own server, then no one can ever shut it down without my permission.

ownCloud is a Dropbox-like service. The instructions of how to set it up is rather foolproof. You can either follow the Lifehacker’s article or the official one. The former is much easier to follow.

But there was still something unexpectedly happened. And it took me a very long time to solve this silly problem. If you decide to run the newest version of ownCloud (which we all do generally), then you should pay closely attention to the PHP version on your server. the ownCloud 6 (the newest one for now) requires PHP 5.3.3, but the official page doesn’t state it clearly. My VPS runs unbuntu 10.04 now, and by default you just cannot upgrade PHP to that version. So you should manually add a PPA to achieve that goal.

I spent five hours to find it out. I hope this post could help others who face the same problem, though it only a possible.


p.s.: What’s next? I consider to configure my own mail server. Gmail is great, but as I said above, things that under my control will be much better.

How to transfer WordPress to Linode

This post will be put here as a backup, in case the other days I forget how to deal with such problem.


What I got is the first thing I should state here. The answer is a complete backups of the previous wordpress fold and a .sql database file. O.K, let’s begin.

Step 1, go to the name server to point the domain name to my Linode IP address.

Step 2, configure name-based virtual hosts. Create a file in the /etc/apache2/sites-available/ directory for each virtual host that you want to set up. Name each file with the domain for which you want to provide virtual hosting. See the following example configurations for the hypothetical “example.com” domain.

File:/etc/apache2/sites-available/example.com

<VirtualHost *:80>
     ServerAdmin webmaster@example.com
     ServerName example.com
     ServerAlias www.example.com
     DocumentRoot /srv/www/example.com/public_html/
     ErrorLog /srv/www/example.com/logs/error.log
     CustomLog /srv/www/example.com/logs/access.log combined
</VirtualHost>

After you’ve set up your virtual hosts, issue the following commands:

a2ensite example.com

This command symbolically links your virtual host file from sites-available to the sites-enabled directory. Finally, before you can access your sites you must reload Apache with the following command:

/etc/init.d/apache2 reload

Step 3,change the config file to suit your current environment, the config file locates /srv/www/ducklington.org/public_html/wp-config.php

Step 4, import the .sql file to your mysql database. Issue the following commands:

mysql -u username -p database_name < file.sql

The username and database_name should be change to the other names according to the wp-config.php file.


For further information, pleas check Manage Web Content with WordPress and LAMP Server on Ubuntu 10.04 (Lucid).

(TED) Barry Schwartz: The paradox of choice

I found this video by coincidence. I was preparing my English lessons today and the text is somewhat related to Wal-Mart. And what Wal-Mart could remind me is a paragraph I happened read somewhere. So I searched online and found the quote goes like this:

“We want our kids to be happy living the life we envision for them—the banker who’s happy, the surgeon who’s happy,” Barry Schwartz, the Swarthmore social scientist, told me, even though those professions “might not actually make them happy.” At least for parents of a certain demographic (and if you’re reading this article, you’re likely among them), “we’re not so happy if our kids work at Walmart but show up each day with a smile on their faces,” Schwartz says. “They’re happy, but we’re not. Even though we say what we want most for our kids is their happiness, and we’ll do everything we can to help them achieve that, it’s unclear where parental happiness ends and our children’s happiness begins.”

These words were so thought-provoking, so I got interested about the author. And then I found the video below. Barry Schwartz’s lecture style is so charming, I cannot help being attracted by him instantly. The book him wrote which also named “The paradox of choice” is now on my wish-list. I certainly will read it some day. It sounds classic, so I feel a little bit sorry to find it out so late, :-(

第二十五届“韩素音青年翻译奖”竞赛原文和译文

My wife(@freshpomelo) asked me to take part in this translation competition, so I agreed. Here’s my work.


The original (English to Chines):

Globalization

 

A fundamental shift is occurring in the world economy. We are moving rapidly away from a world in which national economies were relatively self-contained entities, isolated from each other by barriers to cross-border trade and investment; by distance, time zones, and language; and by national differences in government regulation, culture, and business systems. And we are moving toward a world in which barriers to cross-border trade and investment are tumbling; perceived distance is shrinking due to advances in transportation and telecommunications technology; material culture is starting to look similar the world over; and national economies are merging into an interdependent global economic system. The process by which this is occurring is commonly referred to as globalization.

 

Correspondent: Globalization has been one of the most important factors to affect business over the last twenty years. How is it different from what existed before? Companies used to export to other parts of the world from a base in their home country. Many of the connections between exporting and importing countries had a historical basis. Today, to be competitive, companies are looking for bigger markets and want to export to every country. They want to move into the global market. To do this many companies have set up local bases in different countries. Two chief executives will talk about how their companies dealt with going global. Percy Barnevik, one of the world’s most admired business leaders when he was Chairman of the international engineering group ABB and Dick Brown of telecommunications provider Cable & Wireless.

 

Cable & Wireless already operates in many countries and is well-placed to take advantage of the increasingly global market for telecommunications. For Dick Brown globalization involves the economies of countries being connected to each other and companies doing business in many countries and therefore having multinational accounts.

 

Dick Brown: The world is globalizing and the telecommunications industry is becoming more and more global, and so we feel we’re well-positioned in that market place. You see currency markets are more global tied, economies are globally connected, more so nowadays with expanded trade, more and more multinational accounts are doing business in many, many more countries. We’re a company at Cable & Wireless now, well-positioned to carry the traffic and to provide the services to more and more companies that now need to get to five countries or twelve countries, we’re often there.

 

Correspondent: When Percy Barnevik became head of the international engineering group ABB, his task was to make globalization work. He decided to divide the business into over a thousand smaller companies. In this way he believed the company could be both global and local. In answering the question “How do you make globalization work?”, Percy Barnevik describes the “global glue” that keeps the many different people in ABB together. He then looks at the need to manage the three contradictions of company: it is decentralized but centrally controlled, it is big and small at the same time and it is both global and local.

 

Percy Barnevik: We have now for ten years after our big merger created a “global glue” where people are tied together, where they don’t internally compete, but support each other, and you have global leaders with global responsibility and your local managers working with their profit centers, and if you have the right, so to say, agenda for these people and the right structure, you can use a scale of economy and your advantages of bigness but being small. We used to say you have three contradictions: decentralized and still centrally controlled, big and small, global and local, and, of course, to try to make these contradictions work together effectively, then I think you have a big organizational competitive edge.

 

Correspondent: Globalizations can bring advantage to a business, but how does a company go global? Dick Brown mentions three ways companies can achieve “globalness”. Firstly, companies can work together in alliances. Secondly, they can acquire or buy other companies, and thirdly they can grow organically by expanding from their existing base.

 

Dick Brown: Well, as you go global, and a handful or more of companies are going to really push out, in my view, to be truly global companies, and some of them, maybe all of them, will also work to be local. They’ll be local in chosen markets and global in their ability to carry their customers’ needs from continent A to continent B. We want to be one of the companies that’s both global and local. Alliances are one way to be global, it’s not the only way to be global; you can acquire your way to “globalness”, you can organically grow your way to “globalness”, you can have alliances which help you get global quicker, so you take your pick.

 

Percy Barnevik: You have to start from the top with local people who understand language, culture and so on, and I think in this global world where the East is coming up now, that’s a winning recipe.

 

Correspondent: ABB already found the winning recipe. Its theory of globalization has become the company’s working practice. So how do you make theory work in practice? Percy Barnevik believes that successful globalization involves getting people to work together, overcoming national, cultural barriers and making the organization customer-driven.

 

Percy Barnevik: You see the easy thing is to have the theory, but then to make the systems work, to make people really work together, to trust each other — Americans, Europeans, Asians, to get over these national cultural barriers and create a common glue, ABB, and then make them customer-driven. If you can achieve that, and create that culture deep down then I think you have an important competitive edge.

 

Correspondent: What Dick Brown and Percy Barnevik have shown is that there are different routes to globalization and that companies have to work hard to succeed in going global. Actually one of the disadvantages of the Global Strategy is that integrated competitive moves can lead to the sacrificing of revenues, profits, or competitive positions in individual countries — especially when the subsidiary in one country is told to attack a global competitor in order to convey a signal or divert that competitor’s resources from another nation. The challenges managers of transnational corporations face are to identify and exploit cross-border synergies and to balance local demands with the global vision for the corporation. Building an effective transnational organization requires a corporate culture that values global dissimilarities across cultures and markets.

My translation work:

全球化

世界经济正发生着根本性的变革。经济自给自足型的世界与我们渐行渐远,这种经济模式下的各个国家性经济实体因为各种原因而彼此孤立,这些原因包括对跨国交易和投资的限制;距离、时区和语言;各国之间不同的法律法规,文化和商业系统。现在我们正迈向一个新世界,在其中跨国交易和投资的壁垒渐渐被打破;我们所意识到距离感因为交通和通讯技术的突飞猛进而逐渐模糊;物质文化在全球范围内逐步趋同;各个国家经济体正合并为一个相互依赖的全球化经济体系。这一正在发生的进程一般被称之为全球化。

通讯记者:全球化已经成为过去二十年间影响商业贸易最重要的因素之一。全球化与其之前的体系有何不同?以前企业习惯于从本国基地向其他国家出口产品。许多出口国和进口国之间有着深深的历史渊源。如今,为了更具竞争力,企业着眼于寻找更大的市场并想向所有国家出口产品。他们希望融入国际市场。许多企业为了达成这个目标在不同的国家都设立了基地。两位首席执行官将就他们的公司如何处理全球化的问题展开论述。他们其中一位是Percy Barnevik,曾任国际工程公司ABB主席,是全球最受赞誉的商业领袖之一;而另一个是来自电信供应商Cable & Wireless的Dick Brown。

Cable & Wireless在多个国家开展业务,并已通过妥善地部署基地而在日益增长的电信业全球市场中取得了优势。对Dick Brown而言,全球化意味着不同国家的经济体相互关联,公司在不同的国家开展业务并因此形成了跨国企业。

Dick Brown:整个世界都在走向全球化,而电信产业也正变得越来越国际化,正因为此我们觉得自身在这一市场中拥有不错的优势。如你所见,货币和金融市场的国际关联越来越紧密,如今这些市场随着飞速膨胀的交易量而不断扩大,越来越多的跨国公司在无数不同国家间进行着商业往来。我们是Cable & Wireless旗下的一家公司,我们精心选址以为越来越多的其他公司提供带宽和服务,这些公司现在要和五个或十二个国家打交道,而这些国家中通常都有我们的身影。

通讯记者:当Percy Barnevik成为国际工程公司ABB的首席执行官时,他的任务即是梳理全球化工作。他决定将组织分为一千个多小公司。他相信籍此公司能同时实现全球化和本地化。在回答“如何开展全球化工作”的问题候,Percy Barnevik提及了“全球凝胶”的概念,即将ABB中数量庞大且各不相同的人们融合到一起。随后他开始关注如何协调公司三个矛盾焦点:公司去中心化的同时又能实现统一管理,公司既是统一的大公司又是分散的小公司,公司既是全球化的也是本地化的。

Percy Barnevik:我们至今已完成大合并十年之久,期间我们形成了“全球凝胶”的企业文化,在这团大凝胶中大家紧密合作,没有内部纷争,只有彼此支持。你既有为全球战略负责的国际领导,也有在创收部门供职的本地经理。如果你有正确的部署,我意思是,员工有恰当的工作计划且公司有合适的组织结构,这样你就能利用所形成规模经济,从公司大环境中受益,尽管你只是其中的小组织。我们通常说你会有三个矛盾焦点:去中心化的同时又仍然能实现统一管理,既是统一的大公司又是分散的小公司,既是全球化的也是本地化的。当然,如果你能试图让以上的冲突有效地共同协作,那么我觉得你在组织架构上拥有了一个巨大的优势。

通讯记者:全球化能给企业带来优势,但一个企业如何才能走向世界呢?Dick Brown提出了三条通往“全球化”之路。第一,公司之间以同盟形式共同工作。第二,可以合并和购买其他公司。第三,从已有的基地出发,进行有序的扩张。

Dick Brown:当你走向国际的同时,有一堆或者更多的公司也正冲向这个市场,在我看来要成为真正的国际化公司,他们中的一部分,也可能是他们中的全部都要进行本地化工作。他们要在选定的市场中进行本地化工作,同时又要在全球范围内通过自己的能力将客户的需求从A大洲带到B大洲。我们希望成为这种既具有全球视野又熟稔本地需求的公司之一。寻找合作伙伴是走向国际化的道路之一,但这不是唯一的途径;你还可以通过并购,又或者是通过逐步有序地扩张来实现“全球化”,通过合作伙伴可帮助你更快地达成走向国际的目标,所以这都取决于你自己的选择。

Percy Barnevik:公司高层必须先从和本地人接触,从而了解当地的语言、文化等。我认为这会是一个致胜的秘方,尤其是在当今这个东方社会正迎头赶上的国际化世界中。

通讯记者:ABB已经找到了这个致胜的秘方。它的全球化理论已经成为了该公司的工作中的行动准则。那么你是如果将理论融入实践的?Percy Barnevik认为成功的国际化进程包括让人们协同合作,消除国家和文化的隔阂并且建立起以用户需求为驱动的组织结构。

Percy Barnevik:你知道要拿出一套理论来并不难,但随之而来的问题是如何让系统运转起来,让人们真正齐心协力地工作,让美国人、欧洲人和亚洲人之间彼此信任,让国家和文化的隔阂消失并创建出一个共同的凝胶体,即ABB,然后还要将其打造成以用户需求为驱动的组织。如果你能做到这点,并让这种企业文化深入人心,那么一个相当重要的竞争优势已经为你所拥有了。

通讯记者:Dick Brown和Percy Barnevik向我们展示了通往全球化的不同途径,企业必须要励精图治以期在走向全球化的道路上获得成功。但事实上全球化策略有一个不足之处,经通盘考虑后的竞争决策会导致在个别国家中的子公司年收入、利润或竞争地位下降,尤其是为了向竞争对手示威或者将其资源从他国转移,而勒令某国的子公司对竞争对手发起商业冲击。国际公司经理们所面临的挑战在于识别和发挥跨国子公司间的协同合作效应,并在为公司全球化着想的同时兼顾本地需求。构建一个高效的跨国公司需要企业文化的支持,这种企业文化应尊重各国在文化和市场方面的不同之处。


The original (Chinese to English):

传统百货会否成为“消失的行业”

 

数据显示,2011年中国电子商务市场整体交易规模达到7万亿元,同比增长46.4%。电商营销取得的成绩,对传统百货行业的市场占有率是极大的挑战。越来越多的人去网购,在需求短期之内没有大幅变化的情况下也就意味着相应的百货商场客源流失。业内人士表示,近年来百货业销售下滑较大的品类也正是方便网络购买的品类,比如家电、IT产品和纺织品,甚至是奢侈品。

 

同时,一些传统百货商场还面临沦为电商“试衣间”的尴尬。不少人去实体店确定了衣服等物品的款式、尺寸之后到网上支付购买,由此诞生了“抄号族”、“偷拍党”。随着网购市场的日益庞大,服装、化妆品和家居用品等都已经纳入涉猎范围,消费者线下选货线上购买。

 

电商侵占市场之外,行业之内的激烈竞争也不容小觑。传统百货商场之间同质化较严重,造成同业之间竞争激烈,近年来全国多个城市都在大力建设购物中心等大型商场,使本来就竞争激烈的百货商场经营更加困难。走在城市的商业街区,几乎所有的百货商场在销售内容、店面设计和产品布局等方面大同小异。一博士生说,从北京走到福州,看到各个城市的商场几乎是一样的。

 

“内忧外患”之下,传统百货是否会成为下一个“消失的行业”?多位受访专家表示,传统百货行业面临较大的竞争压力,但并非没有机会。依靠线上线下一体,差异化竞争,商业模式创新等方式,百货行业或可成功“逆袭”。

 

据了解,目前“触电”的百货商场并不在少数。2012年以来,北京的大型百货都相继上线了自己的电子商务平台。天津百货大楼的电子商务正在筹划实施中。

 

同时,百货商场应该针对目标客户群体走错位经营、差异化营销的路子。一博士生导师强调,尽管最近几年百货商场面临的商业环境更加严峻,来自电商和大型商业综合体的竞争更加激烈,但对百货商场的客户群体只是分流了一部分。百货商场应该深耕目前所占有的客户群体,完善售后服务,探索针对客户的个性化服务。

 

另外,传统百货应该借助购物中心的发展势头趁机转型。据了解,零售业的业态构成与人均GDP水平存在一定的对应规律。人均GDP处于3000美元至5000美元,以大型综合超市为主,在5000美元至1万美元则以购物中心、专卖店、专业店、便利店为主。而2011年我国人均GDP已经超过5000美元,传统百货业可以趁机向购物中心等方向转变。

My translation work:

Will the traditional department stores become a “vanished business”

Statistics reveal that the scale of E-commerce in China has reached seventy trillion RMB in 2011, a year-on-year growth of 46.4%. This brilliant achievement makes it a great challenge for the traditional department stores to compete with the E-commerce vendors for competing the market share. More and more people would prefer online purchases, but meanwhile the needs of the customers remain the same in short term, so all these lead to the fact that the department stores have lost their customers respectively. Business insiders say, in recent years the traditional department stores have experienced a dramatically sale drop over those which are convenient for online purchase, such as appliances, IT products, textile and even luxuries.

In the meantime, it’s quite awkward that some traditional department stores have fallen to the category of “fitting rooms”, which only benefit the E-commerce vendors. Lots of people went to the real-estate stores to make sure of the proper style, size or something else, then went back home and bought online. For such reasons, they’re often be referred to “size-checker” and “sneak-photographer”. Now the market of online purchase has become bigger and bigger, clothes, cosmetics and housewares are all involved, customers choose to browse items in stores and pay them online.

The E-commerce vendors has stepped into the market and taken a big share of it. Besides that, business inside the traditional department stores also have vehement competitions, which are due to the serious homogeneous. In recent years, cities all over the country have made great effort to build up shopping malls, since the competition has already existed between the traditional department stores, those shopping malls have only made the already tough situation even worse. Walking along the urban business street districts, nearly all the department stores look alike, no matter the items for sale, the design for the shop or the layout of the products. A doctor once said, from Beijing to Fuzhou, the stores in all the cities are similar.

In such a dilemma, will the traditional department stores become a “vanished business”? Quite a few experts have given their opinions that though the traditional business of the department stores have experienced great pressure, there are still opportunities for them to reverse the adversity into success. What they should do is to integrate online and offline resources, show differentiated competitive capacity, figure out commercial innovation and so on.

It was learned the department stores which put their business online are not the minority. Since 2012, big department stores in Beijing, one after another, have set their E-commerce platforms online. Those in Tianjin are scheduled.

Also, the department stores should provide their customers with differentiated products and apply specified sale strategies for them. A Ph.D supervisor emphasizes that though the department stores have struggled in this tough commercial situation these years, the customers which they have lost were just a small part compare to the total clientèle. The department stores should now full-heartedly exploit the customers who they still hold, and then improve the after-sale service and provide personalize services for each customer.

In addition, the development of shopping malls provide a great opportunity for the traditional department stores to make transition. It was learned that there are certain rules between the constituion of retail business and GDP per capita. The supermarkets are dominant when GDP per capita between $3,000 to $5,000, while shopping malls, exclusive shops, professional stores and convenient stores prevail when GDP per capita hits between $5,000 and $10,000. In 2011 the GDP per capita has already exceed $5,000 in our country, the traditional department stores can now take the chance to transform to shopping mall and something alike.

Troubleshooting an Openvpn Error

Symptom: Connected the openvpn server, the openvpn client icon turned green, but cannot commute with any website.

Troubleshoot: I occasionally connected to wired network A and wireless network B, connected to two networks caused the problem. I disconnected one of the network and all turned out to be fine. So next time you openvpn goes weird, check this out.

the Power of Regex

Today I solved a problem during my work in help of vim and regex. Take a note here, in case I forget it someday.

There are two files(excel A and word B) for me to figure out whether the names in word B are also existed in excel A. Excel A and word B look like this:

Excel A:

From Drop Box

Word B:

From Drop Box

First of all, if I want to compare the two files, I should copy the names in word B to excel A and use the function vlookup, this suppose to be simple, so I don’t want to talk about this part. The main problem here is how to transform the names in word B to some other format, each name in a row actually. So, the objective is set, let’s begin to solve it.

  1. Copy the entire word B to gvim C, because vim is truly a word editor and it is where the regex can take full advantage of.
  2. There are two space between each name, we should turn them to one. It’s time for regex to roll out.

    :%s/ss/ /gc

    “s” means match a white space character, exactly a space and a tab.

  3. And some names contain two character, but they also have a space between them, we should eliminate these space.

    :%s/s(S)s/ 1/gc

    “S” means match anything that isn’t a space and a tab and “(…)” means making matched subtexts available in the replacement part of a substitute command, such as “1”.

  4. Replace every space to a carriage return, this one seems a piece of cake.

    :%s/s/r/gc

    “r” means a carriage return.

  5. Copy the entire contexts to excel A, and transfer the job to function vlookup. The contexts should look like this:
  6. From Drop Box

If the excel A and word B are some big files, we’ll save great amount of time using regex. In my case, they really are. And I think I did my job nice and easy.

the Ian Knot trick

The Ian Knot is a very efficient way to tie your shoes. For me, what more important is not it is simple and time-saving but rather cool and geeky. Though it’s not a hard trick to play, it still cost me a lot of time to learn. I suppose I’m not smart enough, that’s sad. Now I learnt the the Ian Knot and need more time to practice. Anyway, though It might take a few minutes to get right, but once you get used to it, you’ll be tying your shoes in two seconds flat.So it’s worthy to spend time learning that.

Configure Mutt on Ubuntu

Believe me, it’s more fun to install stuff from the cmd line.

This time I encountered a problem when I tried to configure Mutt, it threw an error like this:

configure: error: no curses library found

So don’t be worry, if you happened to encounter the same problem as I did, simply issue the following command as root to fix it:

apt-get install libncurses5-dev

Now you can continue to make and make install the source.

How to Embed Videoes in WordPress

As usual, this supposed to be an easy task, just copy the embed codes and all should work out fine. But in wordpress it didn’t… it turns out to be a bug or an error or anything you name it. Once you copy the embed codes into the HTML mode and switch to the normal edit mode, the codes simply disappeared. So it really a painful experience for me if I want embed any videos in my post, it seems that wordpress only accept certain kind of the embed codes. I resort to Google and found an easy way to fix the problem, though I don’t know exactly why it worked.

Find your theme’s function.php file. It usually located in your wordpress fold/themes/your theme/function.php or you can find it in your wordpress board, Appearance–Edit–function.php. Copy the following codes into this file, make sure to put  them in the right place, do not insert them to some functions.

function mytheme_tinymce_config( $init ) {
$valid_iframe = 'iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]';
if ( isset( $init['extended_valid_elements'] ) ) {
$init['extended_valid_elements'] .= ',' . $valid_iframe;
} else {
$init['extended_valid_elements'] = $valid_iframe;
}
return $init;
}
add_filter('tiny_mce_before_init', 'mytheme_tinymce_config');

Now, everything should be O.K.