《失控》读后感

 

由于许多IT大佬(比如微信之父张小龙)的倾力推荐,《失控》这本书在在中国互联网界颇为有名。他的作者凯文凯利(本文简称KK)在中国互联网界更是家喻户晓。虽然很多人都奉KK的话为圭臬,但是我相信真正读过这本书的人应当不多,因为这本书实在太晦涩和难懂了。很早之前我就尝试读过这本书,最后放弃了,最近才又重新捡起来。全书像是一个哲学家在自言自语,初读的时候你会觉得非常的凌乱,但是静下心来读,你就会被其中深邃的思想所折服。作为网络时代的启蒙者之一,KK在本书里面主要是探讨的是互联网及广义的信息技术对和人类的关系。但是,可以看出作者的思考并不只限于互联网,而是深入到生命的意义本身。

 

分布式系统

本书很大的篇幅都在讲分布式系统(也就是所谓的蜂群思维),分布式系统的特点是1. 没有强制性的中心控制,2. 次级单位具有自治的特质, 3. 次级单位之间彼此高度连接, 4. 点对点间的影响通过网络形成了非线性因果关系。KK毫无疑问是崇尚去中心化和分布式系统的,但是他也客观的总结了分布式系统和中心化系统各自的优缺点。总的来说,分布式系统适合多变的环境,而普遍来说中心化的系统通常有更高的效率,并且更容易预测和控制。KK承认没有一种模式可以包治百病,对于必须绝对控制的工作,仍然采用可靠的中心化系统,对于需要终极适应的系统,则需要失控的部件。

 

我在这里想谈谈日本90年代的没落和美国同期的复兴。经过二战,日本基本成为一片废墟。但是在战后短短三十年的时间内,日本就通过学习赶超的方式占领了汽车工业和电子工业。同期的美国经济则持续疲软,三大汽车公司濒临破产,电子工业颓败,很多人预测日本很快就会超过美国成为世界最强经济体。70年代末傅高义的《日本第一》的书深刻的反应了美国人对于日本的快速发展的错愕。但是,到了90年代末之后情况陡转。日本经济持续低迷,而美国则进入了黄金的十年。

 

很多人将日本的没落归咎于广场协议。但是在我看来,广场协议充其量只是一个诱因。真正的原因是日本所垄断的电子和汽车工业的饱和,以及日本错失了互联网带来的新一波技术革新浪潮。美国从来没有在电子工业和汽车工业找回优势。事实上,美国汽车工业持续衰败,昔日的汽车城底特律俨然已经成为一座死城。电子时代美国东部的电子中心——波士顿128公路园区——八十年代在日本公司的节节紧逼下接连破产,至今电子工业也没有回复到当年的水平。而西部的电子中心——硅谷——现在已经基本被互联网公司占领。使美国重新强大起来的不是这些存量产业,而是互联网和生物技术等增量产业。

 

日本人将中心化的控制做到了极致,这使得他们拥有更好的效率,可以以极低的成本生产质量优良的产品。但是这种效率的优势只存在于成熟产业,并且中心化的控制使得日本人缺乏产生创新的能力。日本在汽车产业和电子工业发力的时候,汽车已经被发明快一百年了,电子工业也有几十年的历史。然而,互联网是一个新兴的事物,日本倾向于大公司的产业结构和终身雇佣的工作传统无法适应互联网所带来的变化,这就是在前互联网时代,日本卓越企业林立,而在互联网时代,日本乏善可陈的重要原因。不说日本,就是美国东部的波士顿地区,也是因为比硅谷地区更加中心化而在互联网时代被抛下。硅谷的西部精神和个人主义的文化使得这一地区有着去中心化的历史传统,从而在创新为王的时代有了更大的优势。

 

连接

分布式系统的最关键的要素是连接。KK的主要观点是进化与连接相生相伴。进化具有一个普遍的层级规律:在每一个层级,简单的成分通过不断的连接,形成一个完整的生命系统,而这个新的生命系统则成为新的层级进化的基石。生命沿着这个规律不断进化,拾级而上,从简单到复杂,从无序走向有序。早期的生命是单细胞的原核生物,而后一些细胞进入另一些细胞,成为后者的组成部分(线粒体,高尔基体等),这些原核细胞的结合衍生了真核细胞。多个真核细胞进行融合,形成了多细胞的生物。生物又进一步构成了群落和物种。每一个物种可以看作另一种形式的生命,因为究其本质,生命不过是由若干有机部分和无机部分组成的有序模式。所有的物种都生活在生物圈中,自然选择在其中的对物种进行着筛选,使得物种得以进化。同样的,生物圈(地球)也可被看作一种生命,即所谓的盖亚。

 

世界大势,浩浩汤汤。作为一个进化层级,人类社会的进化也服从连接的普遍规律。坦荡的华北平原和平静的地中海使得早期的处于这些地区的人类可以较方便的进行连接,最终促成了秦帝国和罗马帝国这两个区域性中央帝国的形成。而航海技术的革新使得地球上所有的民族都在大航海时代都自觉或者不自觉的卷入了世界性的连接中。中国从闭关锁国,到门户开放;从毛泽东时代的隔离于世界,到邓小平时代的改革开放,趋势都是连接代替封闭。

 

随着互联网的发明,人类社会正在进入一个连接的时代。丰富多样的连接使得所有人日益成为一个整体,生活在地球的人终将融合成为一个全新的生命体。和古代的连接方式相比,互联网的创新之处在于,它让信息的载体从实物变为光和电,信息传播的速度从普通物体运动的速度提升为光速。这使得地理位置的影响几近于无。从中国发一封电子邮件到美国,所需的时间比信号从眼球到大脑皮层的时间还要短。从这个意义上来说,人与人之间的连接的紧密程度,已经不亚于单个人各个器官之间的连接。

博尔赫斯的图书馆

KK不仅谈到了人与人之间的连接。他还谈到了人与信息之间的连接。人与信息的连接有两个方面。一是如何让人方便的找到信息;二是如何让信息自组织成为和人一样的智能。事实上这两个方面是息息相关的。

 

在《失控》中KK谈到博尔赫斯的图书馆。博尔赫斯是著名的阿根廷作家。在一个短篇小说中,他将宇宙描绘成为一个图书馆。这个图书馆由无数个六边形的小房间组成,存储了所有可能的模式。人们需要去做的是从中寻找到自己需要的模式。实际上博尔赫斯的图书馆就是万维网的原型。每一个网页就是一个小六边形的房间,而相邻的房间就是相互链接的网页。KK(或者说博尔赫斯)认为,宇宙的信息是由一种网状的结构存储的。KK还提到由于信息过多——也就是图书馆的房间太多,搜索的过程只能从一个房间到相邻的房间。其实这就是根据链接来进行搜索的思想。为了在网状的万维网中寻找信息,搜索引擎应运而生。《失控》写于1994年,那个时候,谷歌的创始人才刚刚进入斯坦福大学。

 

和现实的图书馆不同,博尔赫斯的图书馆存储了所有可能的模式,其中的许多都毫无意义。其中一部分已经为人所知,而另一些部分则等待人类的探寻。智能分为两个部分:对于既有知识的存储和对新知识的发现,用俗话来概括就是记性好和悟性高。从博尔赫斯的图书馆的例子,我们可以看出发现知识和搜索已有知识并无本质不同。

 

万维网存储了几乎所有人类已知的信息。而如今的搜索引擎技术在对于万维网的信息检索已经做得比较好了。按照《失控》的逻辑推断,科技发展的下一步便是实现在所有可能序列中搜寻新的有用序列,也即是实现有创造力的人工智能。确实,目前领先的搜索引擎如谷歌和百度都在致力于人工智能的开发, 可见KK的预见力。

 

结语

 

KK毕竟不是神,《失控》中也有许多观点被证明是不对的,比如KK相信网络的计费会像水电一样按比特收费,而加密将会使得这种计费方式可行。事实的网络上的主要收费方式是固定的接入费用加上广告或者增值收费。还有许多观点还有待时间检验,比如KK关于去中心化的电子货币成为主流的观点。智者千虑,或有一疏,尽管有这些争议性的部分,《失控》仍然堪称经典。事实上,《失控》影响了整整一代美国人,失控里的许多预言,都是被它的读者所实现的,这正应了一句流行语:最好的预言就是去实现预言。

 

二零一四年九月十日

王晶

Summary of “The Most Powerful Idea in the World: A Story of Steam, Industry, and Invention”

Recently I finished reading the book The Most Powerful Idea in the World: A Story of Steam, Industry, and Invention. The author’s key statement is that industrial revolution was first and foremost, a revolution in invention, and the industrial revolution took place in England because “its unique combination of law and circumstances.” Here are some interesting sentences from the book.

  1. Before the eighteenth century, inventions were either created by those wealthy enough to do so as a leisure activity (or to patronize artisans to do so on their behalf), or they were kept secret for as long as possible. In England, a unique combination of law and circumstance gave artisans the incentive to invent, and in return obliged them to share the knowledge of their inventions.
  2. Papin was an industrial scientist before there was an industry to employ him, which made him, in consequence, completely dependent on patronage.
  3. The most powerful pumps in use in seventeenth-century England were operated by waterwheels, but nothing obliged rivers and streams to be convenient to mines; finding an alternative machine that could overcome water’s tendency to seek the lowest level of any excavation meant that vacuum was no longer a purely philosophical concept.
  4. IN ITS ORIGINAL MEANING, the word “patent” had nothing to do with the rights of an inventor and everything to do with the monarch’s prerogative to grant exclusive rights to produce a particular good or service.
  5. In Darcy vs. Allein, Chief Justice Popham ruled that Darcy’s grant was forbidden on several grounds, all of which violated the common law. Crown could not grant a patent for the private benefit of a single individual who had shown no ability to improve the “mechanical trade of making cards,” because by doing so it barred those who did. In other words, the court recognized that the nation could not grant an exclusive franchise to an individual unless that individual had demonstrated some superior “mastery” of a particular trade.
  6. The term of the patent was not to exceed fourteen years, a figure that makes sense only in terms of the artisans for whom Coke was so solicitous. Since the traditional seventeenth-century apprenticeship lasted seven years, a term of fourteen years would allow at least two cycles of apprentices to have been trained in the new industry, and therefore a generation of artisans to demonstrate their mastery of the new art.
  7. The first, the so-called civil law tradition, is a direct successor to the jurisprudence of the Roman Empire, and it dominates most of the legal systems of continental Europe; the second is the institution known as the common law, used in Britain and its former colonies.
  8. As Coke put it, under the common law, every man’s house is his castle, not because it is defended by moats or walls, but because while the rain can enter, the king may not; under the civil law, the king is bound by nothing at all.
  9. Recognition of a property right in ideas was the critical ingredient in democratizing the act of invention. However imperfectly, Coke’s patent system, combined with Locke’s labor theory of value, offered a protected space for inventive activity. The protected space permitted, in turn, the free flow of newly discovered knowledge: the essence of Francis Bacon’s program. Once a generation of artisans discovered they could prosper from owning, even temporarily, the fruits of their mental labor, they began investing that labor where they saw the largest potential return. Most failed, of course, but that didn’t stop a trickle of inventors from becoming a flood
  10. An adult human is able to convert roughly 18 percent of the calories he consumes into work, while a big hayburner like a horse or ox is lucky to hit 10 percent—one of the reasons for the popularity of slavery throughout history.
  11. One can make a water mill more powerful, but one cannot, in any measurable way, reduce its operating expenses. The importance of this can scarcely be underestimated as a spur to the inventive explosion of the eighteenth century. So long as wind, water, and muscle drove a civilization’s machines, that civilization was under little pressure to innovate. Once those machines were driven by the product of a hundred million years of another sort of pressure, innovation was inevitable.
  12. It is almost irresistibly tempting to see Watt’s life as the embodiment of the entire Industrial Revolution. An improbable number of events in his life exemplify the great themes of British technological ascendancy. One, of course, was his early experience with the reactionary nature of a guild economy, whose raison d’être was the medieval belief that the acquisition of knowledge was a zero-sum game; put another way, the belief that expertise lost value whenever it was shared. Another, as we shall see, was his future as the world’s most prominent and articulate defender of the innovator’s property rights. But the most seductive of all was Watt’s simultaneous residence in the worlds of pure and applied science—of physics and engineering. The word “residence” is not used figuratively: The workshop that the university offered its new Mathematical Instrument Maker was in the university’s courtyard, on Glasgow’s High Street, a bare stone’s throw from the Department of Natural Philosophy.
  13. Like an ever-growing percentage of his countrymen in the newly United Kingdom, Watt had acquired the tools necessary for scientific invention—the hands of a master craftsman, and a brain schooled in mathematical reasoning—without the independent income that could put those tools to work exclusively for the betterment of mankind.
  14. Watt needed capital. Investment capital, however, wasn’t easy to find in 1765 Britain; and it was a lot harder than it had been fifty years earlier. The reason was one of the greatest financial bubbles in history, the collapse of the South Seas Company.
  15. Though the most famous inventors are associated in the popular imagination with a single invention—Watt and the separate condenser, Stephenson and Rocket—Watt was just as proud of the portable copying machine he invented in 1780 as he was of his steam engine; Stephenson was, in some circles, just as famous for the safety lamp he invented to prevent explosions in coal mines as for his locomotive.
  16. Inventors are significantly more thing-oriented than people-oriented, more detail-oriented than holistic. They are also likely to come from poorer families than non-inventors in the same professions. No surprise there; the eighteenth-century Swiss mathematician Daniel Bernoulli,11 who coined the term “human capital,” explained why innovation has always been a more attractive occupation to have-nots than to haves: not only do small successes seem larger, but they have considerably less to lose.
  17. If the most important invention of the Industrial Revolution was invention itself, the automation of precision has to be one of the top three.
  18. Micrometers, devices for measuring very small increments, were then only about thirty years old; James Watt himself had produced what was probably the world’s first in 1776, a horizontal scale marked with fine gradations and topped with two jaws, one fixed and the other moved horizontally by turning a screw.
  19. The availability of patent protection was, predictably, motivating inventors to make more inventions; it was also motivating them to frustrate competing inventions from anyone else.
  20. Nearly fifty years later, the first description of the spinning jenny (“jenny” is a dialect term for “engine” in Lancashire) appeared in the September 1807 issue of The Athenaeum, in which readers learned that the first one was made “almost wholly with a pocket knife.
  21. Prior to the introduction of the jenny, Britain’s spinning was performed largely by what we would call independent contractors: the original cottage industrialists, taking raw materials from manufacturers who “put out” for contract the production of finished fabric.
  22. One of the more obdurate rules of economics, however, is that, given their capital demands, factories are preferable to more flexibly “outsourced” labor only if they are more productive.
  23. A great artisan can make a family prosperous; a great inventor can enrich an entire nation.
  24. Smith argued that two conditions were necessary for labor to produce the maximum amount of wealth: perfect competition among sellers—everyone pursuing his or her selfish interest, the famous “invisible hand”—and the complete freedom of buyers to substitute one commodity for another.
  25. A family living alone grows its own wheat and bakes its own bread; it takes a village to support a baker, and a town to support a flour mill. Some critical mass of people was needed to provide enough customers to make it worthwhile to invest in ovens, or looms, or forges, and until population levels reached that critical level, overall growth was severely limited.
  26. Because knowledge is the sort of property that can be sold to multiple consumers without lowering the value to any of them—Romer termed it nonrivalrous.
  27. The remarkable growth of the Netherlands during the 1600s essentially stopped a century later, and the only persuasive reason is size, or rather scale. A small country can shelter the world’s largest banks, shipbuilders, and even textile manufacturers, but since it can protect inventors only from their own countrymen, growth that depends on the creation of new knowledge is fundamentally unsustainable, like a nuclear chain reaction with insufficient critical mass.
  28. that heat and motion are essentially the same thing. This was critical, and surprisingly slow in coming.
  29. Fitch’s steamboat was not, as many histories have it, the world’s first. In 1772, two ex–artillery officers in the French army, the Comte d’Auxiron and Charles Monnin de Follenai, received a fifteen-year exclusive license to run a steamboat along the Seine. Unfortunately, their first attempt, a marriage of a Newcomen engine to a Seine bâteau, was less than successful: the engine was so heavy it sank the boat. Slightly more successfully, in 1785, the Marquis de Jouffroy d’Abbans took a 140-foot boat mounting a Newcomen-style engine out on the Saône from Lyon. He did make it all the way back to the dock, where cheering crowds met it—just in time, before the engine’s vibrations destroyed the boat.
  30. Evans was a visionary and a pioneer. But despite his prediction that “the time will come, when people will travel in stages moved by steam engines from one city to another almost as fast as birds can fly,” his greatest contribution to the history of steam locomotion was almost incidental: his decision to share the design of his boiler and high-pressure steam engine with his compatriots in Britain.
  31. Fusible plug is a small lead cylinder inserted into a predrilled hole in the wall of the engine’s boiler—a hole that, in a properly operating engine, would always be underwater. If, however, the water level in the boiler were to fall low enough to become dangerous, the heat would melt the lead plug,Trevithick’s engine, the first driven by high-pressure steam, earned him a considerable claim on the title “father of railways,” but the birth of steam locomotion was still a decade or so in the future. More important, though less romantic, was another of Trevithick’s innovations, one that was nearly as large an improvement over the first high-pressure design as that had been over the Boulton & Watt separate condensing

Thoughts about “The Box”

 

Recently I read the book The Box, which was recommended by Bill Gates in hiswebsite. Bill Gates stated that you “won’t look at a cargo ship in quite the same way again” after reading it. I couldn’t agree more. In the 1990s, Mr Gates was always plotted as an evil dictator of a software empire and as a tyrant who cracked down his enemies, like the Netscape, ruthlessly. I was also somehow influenced by those plots for a time. However, after getting more familiar with his experience, especially after reading some of his books and articles, I do think that those disesteems are unfair in many ways. Mr Gates is undoubtedly one of the most visionary and benevolent person in our planet.

I have read his book the road ahead before, which was an extraordinary book. In that book, Mr Gates pointed out a bright future of technology society. Many of his imaginations, such as portable PCs, wireless Internet, smart TVs, have already become reality, despite that Microsoft’s role in the process, sadly, is not as significant as it should be.

Rather than predicting the future, The box is talking about history, if that is long enough to be qualified for. Both books, however, give us tastes of how technology influenced an industry and people’s life. Here are some of my thoughts about this book on “boxes”.

Influence of Containerization

The paradigm of business is heavily influenced by transport costs. When transport costs are high, manufacturers’ main concern is to locate near their customers, even if this requires undesirably small plants or high operating costs. As transportation costs decline relative to other costs, manufacturers can relocate first domestically, and then internationally, to reduce other costs.

The immediate result of containerization is a sharp decline of international transport costs, which results in an unprecedented process of globalization.

Globalization is not a new phenomenon. The world economy became highly integrated in the nineteenth century, which caused by a variety of reasons. First, the Napoleonic wars united Europe, at least temporarily, and reduced tariffs and other trade barriers for many years. Second, due to the industrial revolution, in particular the steamship invented by Robert Fulton, the ocean freight rates fell 70 percents between 1840 and 1910. Third, new technologies also significantly reduced the time required for worldwide information exchange. For example, Telegraph, the nineteenth-center counterpart of the Internet, gave people in one location current information about prices in another. Traders found it easy to increase imports whenever domestic prices rose or domestic wages got out of hand.

The globalization caused by containership is quite different than its predecessor. While the globalization in the nineteenth century was mostly the globalization of final products, the globalization in the late twentieth century is the globalization of the production process itself. Because of this globalization process, a new type of industrial paradigm, so-called just-in-time manufacturing, becomes possible.

Asia, in particular East Asia, benefits the most from the just-in-time manufacturing, which partly contributes to the prosperity in the region. Now it is quite typical for American businesses to succeed without get their hand dirty at all by “low-level” hardware business. What they need to do is to design and innovate, and then send the specification to Original Equipment Manufacturers (OEMs) in East Asia. For example, when an American consumer purchases an iphone on the Apple’s official website, the iphone will be shipped from factories in China directly rather from some warehouse in the United States. It would not be possible if the shipping cost is high.

Why Asia? The most important reason is the abundance of cheap and skilled labors in this region. Technology companies in Silicon Valley are more inclined to outsource their labor-intensive departments, like hard-ware manufacturing departments, to China and Malaysia, than set up a factory in Rocky mountain states. The human labor in U.S. is just too expensive, plus that the transport cost between Rocky mountains and Silicon Valley is also higher than that between Shanghai and Silicon Valley.

Containerization has made geographical disadvantage a more serious problem. For those regions with geographical disadvantages, like inland cities, local business may survive in case that international transport cost is high because people in the coastal area don’t have much option. However, the life of those inland businesses becomes much hard as the container age comes. They can be easily replaced by competitors overseas. For developing countries, this situation is more serious because coastal cities will absorb all the foreign investment and markets.

If you look at the Guangdong and the Jiangxi provinces in a map of China, you will realize that the two provinces are adjacent to each other, despite that Guangdong is coastal while Jiangxi is completely landlocked. However, the GDP per capita of Guangdong is almost twice that of Jiangxi. Shipping cost is the key reason for the difference. As reported by the World Bank in 2002, transporting a container from a central city to a port cost three times as much as shipping it from the port to America. As a result, Guandong quickly joined the globalization process and became an essential part of the global supply chain. At the same time, Jiangxi couldn’t enjoy such benefits. I am afraid that this gap will still increase in the near future. The only way to reduce is gap is to increase the investment of land-based and inland waters-based logistic system, which hopefully will bring down the inland transport cost. Although some improvements have been made in the past years, there is still a long way to go. Only when shipping cost in inland regions is comparable than that of coastal regions, different regions in China can develop in a balanced way.

Influence of Deregulations

In the history of containerization, U.S. government played an interesting role.

According to U.S. laws, the Interstate Commerce Commission (ICC) regulated the rates and services of both trains and interstates trucks. The regulation of ICC made the market quite fragmented. To make it worse, laws also prohibited corporations to be involved in both land-based and sea-based transportations. The initial goals of these regulations was to prevent monopoly and ensure a fair price for consumers. However, the lawmakers wouldn’t image their goodwills turned out to be a huge obstacle for advancement.

When Malcom Mclean, the father of containership, decided to explore the idea of containerization. U.S. regulations would not allow a trucking company to own a ship line. As a result, 1955, McLean sold his trucking company for $25 million and purchased the Pan-Atlantic Steamship Company and the Gulf Florida Terminal Company from Waterman Steamship Corporation.

The basic concept of the container was that cargo could move seamlessly among trains, trucks and ships. However this goal was not achieved 20 years after McLean invented the first container. The main reason is the government regulations. Although the regulations successfully prevent monopolies, it also made the cooperation among shipping, railway and trucking companies very hard because they cannot develop a long-term contract and trust between each other.

Deregulation, which dates back to bankruptcy of the Penn Central railway, changed everything. In two separate laws passed in 1980, Congress freed interstate truckers to carry almost anything almost anywhere at whatever rates they could negotiate. The ICC lost its role approving rail rates, except for a few commodities. As a result, truck and railcars that had often been forced to return empty were able to be filled in in the return trip. Besides, railroads and their customers could negotiate long-term contracts setting rates. After deregulation, the biggest customers can enjoy larger discount. 41,021 contracts were signed in fives years after the deregulation and by 1988 U.S. shippers saved nearly one-sixth of their total land freight bill.

The ability to sign long-term contracts gave railroads incentive to adapt containership. On average, it costs four cents to ship one ton of containerized freight one mil by rail in 1982 and that cost dropped 40 percent over the next six years, adjusted for inflation.

This is an interesting case in which the goodwills of governments turned out to be harmful. The right way for a government to encourage competition is not to legislate laws, but to keep itself away from the market in most of the time. The key issue of governments is that they are usually too slow to adjust themselves to the market due to bureaucracy, so the best way is to let the market speaks itself. I don’t mean that the government is completely useless, but the role of should be kept minimal. In other words, we should apply the Occam’s Razor to governmental regulations—”Entities should not be multiplied unnecessarily.”

—-

Jing Conan Wang

Vim script to add user-defined words to spell file automatically

" A function to search for words after {marker_text} and add them to local
" spell file
function! AutoSpellGoodWords(marker_text)
    call cursor(1, 1)
    " let l:marker_text = '"%%  LocalWords:'
    let l:marker_text = a:marker_text

    let l:lines = []
    let l:goodwords_start = search(l:marker_text, 'cW')
    let l:line = getline(l:goodwords_start)
    let l:header = strpart(l:line, 0, strlen(l:marker_text))
    if l:header == l:marker_text
        call insert(l:lines, l:line)
    endif

    while l:goodwords_start > 0
        let l:goodwords_start = search(l:marker_text, 'W')
        if l:goodwords_start == 0
            break
        end
        let l:line = getline(l:goodwords_start)
        let l:header = strpart(l:line, 0, strlen(l:marker_text))
        if l:header == l:marker_text
            call insert(l:lines, l:line)
        endif
    endwhile

    let l:words = []
    for l:line in l:lines
        let l:line = strpart(l:line, strlen(l:marker_text) + 1)
        call extend(l:words, split(l:line))
    endfor
    for l:word in l:words
        silent execute ':spellgood! ' . l:word
    endfor
endfunction

autocmd FileType tex call AutoSpellGoodWords('%%  LocalWords:')

Tutorial to migrate from Bitbucket to Github

Install mercurial and hg-git

sudo apt-get install mercurial

sudo apt-get install mercurial-git

Note: The version of mercurial should be >= 2.8.

If the default version of mercurial in apt-get is < 2.8. You can install using pip

sudo pip install mercurial –upgrade

You need to create a repo on Github.com

Clone your bitbucket repo

hg clone https://hbhzwj@bitbucket.org/hbhzwj/sadit hg-repo

Convert hg repo to git repo

Hg-Git can also be used to convert a Mercurial repository to Git. You can use a local repository or a remote repository accessed via SSH, HTTP or HTTPS. Use the following commands to convert the repository

$ mkdir git-repo; cd git-repo; git init; cd ..
$ cd  hg-repo
$ hg bookmarks hg
$ hg push ../git-repo

The hg bookmark is necessary to prevent problems as otherwise hg-git pushes to the currently checked out branch confusing Git. This will create a branch named hg in the Git repository. To get the changes in master use the following command (only necessary in the first run, later just use git merge or rebase).

$ cd git-repo
$ git checkout -b master hg

Push the Git repo to Github Server

cd git-repo;

git remote add origin <github-url>;

git push -u origin master;

cd ..;

I also write a script to do this automatically.

 

《摩根财团》读后感 续

 

古人云:“观一叶落而知天下秋”, 摩根财团的历史就是整个现代金融业的这篇叶子。摩根财团长期是现代金融业的典范,学习摩根的历史就是回顾这个现代金融业的建立和完善过程。现代金融业伴随着铁路和电气工业的建立和建立, 在风云变幻的两次大战期间重组和洗牌, 然后在战后建立了以美国为中心的金融新秩序。 《摩根财团》毫无疑问是介绍这段历史的一本不可多得的巨著。作者 Ron Chernow 将摩根的历史分为三个时代:1 领主时代, 2 外交时代 和 3 赌场时代。 每个时代有它鲜明的特征。 从作者严谨的叙述中, 我们可以大略看出金融业的发展的三个大的趋势。 这篇读后感就围绕三个时代和三个趋势展开。

 

三个时代

领主时代(1838-1913)

 

第一个时代是“领主时代”,这一时代适逢铁路业和重工业的兴起,新兴产业所需要的资金远远超过了最富裕的个人或家庭的财力。然而面临如此巨大的资金需求,金融市场还限于当地。而且规模有限。银行家配置经济稀缺的信贷。只要有银行家的批准认可就可以是投资者消除疑虑,银行家深深的参与到公司的经营当中去。比如皮尔庞特利用银行资本,控制美国东部的铁路和钢铁行业。

 

由于对公司有这样的影响力,主要的银行家像接受雇民供奉的领主一样,养成了一种居高临下的作风。他们依照一整套惯例进行经营,后来吧这套惯例叫做绅士银行家准则。

 

外交时代 (1913-1948)

外交时代的国际环境发生了巨大的变化。两次大战的爆发瓦解了三百年的世界殖民体系并摧毁了日不落帝国。美国经济趁势成为了世界领头羊。在这嘈杂的三十多年里,欧洲动乱复兴,然后再动乱再复兴。在整个过程中, 美国的经济干预和援助至关重要,而私人银行充当了先锋。

 

杰克摩根温和的性格和改革银行的措施使得摩根财团适应了外交时代的需要。一支强有力的,有主见的合伙人队伍被组建起来去执行政府的使命。 起初摩根财团把英国的资本吸引到美国来,从而壮大了实力。 在外交时代,这一关系完全颠倒过来了, 伦敦的商人银行由于受到英国政府战后对外贷款的限制,活动范围很小。 相比之下,华尔街的触手伸向了世界各地。

 

一战导致了持续百年的金本位制度终结。参战各国滥发纸币进行战备,停止了黄金和本国货币的兑换。在1925年英国尝试恢复金本位。 不久之后,英国的煤炭纺织品,钢材等在国际市场上面失去了竞争力, 恢复金本位不但没有振兴英国, 反而加速了它的衰落。 1931年9月21日,英国再次告别了金本位。随后美国也放弃了金本位。金本位的问题以后还要经历多次反复,但是无数事实表明黄金已不再适合作为一种标准通货。事实上,现代社会可能根本就不需要什么标准通货。

 

当欧洲经济饱受战争蹂躏的时候,美国经济越过了竞争对手, 并实现了大量的贸易顺差,但是美国仍有一半人口生活在农村。二十世纪二十年代美国大牛市。 史无前例的货币流动性激增。 本斯特朗大幅度提高利率,造成了此后持续几年的紧缩性环境,货币大量涌向金融市场。 股票和债券市场大涨。 但是华尔街的繁荣对于农民来说是虚假的。农业和石油工业都很不乐观。而由于对于农业和石油部门贷款的坏帐, 小城镇的银行以每天两个的速度倒闭。与之相反,但是城市金融和房地产双临佳境。过剩的现金被看成是财富的象征,而不是生产性投资机会缩减的不详之兆。

 

随后1929年的大萧条导致了世界经济的大衰退。华尔街被认定为需要对此负责任。 罗斯福总统在1933年6月16日签署了《格拉斯–斯蒂格尔》法案。这部法案对于美国影响深远。 从这时起,银行或者从事贷款和接受存款,或者从事证券买卖,但不能同时从事两者。 1935年9月日,摩根财团正式分家。哈罗德斯坦利, 哈里摩根,和维摩尤因出来建立了摩根士丹利。

 

赌场时代(1948-1988)

这个时代的最主要特征是领主时代建立的绅士银行家法则开始崩溃。 关系银行业寿终正寝, 华尔街比前任何时候都更加冷酷,吝啬。在赌场时代, 蓝筹公司不再需要银行家为他们开健康证明, 他们的资信往往胜过他们的银行。投资银行无法保持与客户的长期排他性的合作关系,竞争性的招标成为了主流。

 

一个标志性的事件是IBM在1979年的融资。 当时IBM 需要融资10亿美金进行下一代计算机的研发, 要求摩根士丹利接受所罗门公司作为联合主干行来承担这笔业务。这对于具有悠久绅士银行家传统的摩根来说是不能接受的。 摩根要求获得独家发行权, 但是IBM不作丝毫的让步, 仍按计划由所罗门公司牵头这次发行。随后不久,一些投资银行边开始大肆强夺摩根士丹利的其他客户, 打破了绅士银行家的准则。 此后IBM的大部分业务都转向了所罗门公司。 而摩根士丹利则放下架子。同意与别的公司分担通用电器信贷公司, 杜邦公司以及坦尼可公司的债券发行业务。 在激烈的竞争下,摩根财团的三家衍生公司也开始分道扬镳。

 

80年代疯狂的杠杆收购和敌意兼并是这个时代最鲜明的注脚。数以千家的公司被兼并和收购, 被收购的公司往往担上沉重的负债, 而投资银行则可以拿到丰厚的酬劳。

 

三个趋势

信用体系的完善

现代金融业的第一个趋势是信用体系的完善。 在皮博迪和朱尼厄斯的时代,美国的处境和今天的中国有点类似,都是一个快速的崛起新兴的大国,但是仍缺乏健全的金融系统和信用体系。美国的经济发展高度依赖于英国的资本供给,1833年的一个议员曾说,“美国货币的晴雨表挂在伦敦证券交易大厅里面。”  今天的中国也是如此,绝大多数的高科技企业都是在美国上市,中国的经济发展很大程度上是依赖与美国资本市场来提供资本。皮博迪当时的主营业务是在英国经销美国债券,大概就相当与今天的承销中概股。但很有趣的是,那个时代的美国赖账情况很严重。当时皮博迪承销的主要是政府债券,议员为了竞选,通常会许诺减税,这样导致政府没有足够资金偿债,同时赖账还可以迎合排外势力,赢得部分的选票。最终的结果是,美国许多的州都赖账,这严重影响了美国债券承销商在国际上面的声誉。所以美国健全的信用体系也不是一天建成的。这和许多中概股在美国作假被停牌,影响中国公司的信誉是类似的。类似的问题在每一个发展中的经济中都会出现,也会随着金融体系的逐步完善而逐渐得到解决。

银行家对企业影响力的下降

随着时代的发展,摩根的金融权力不再那么耀眼。19世纪末的时候,摩根的融资额已经可以达到数亿美元,这个数目在当时可以控制整个美国经济。在皮博迪,朱尼厄斯的时代,摩根财团随着美国的上升而上升。皮尔庞特时代和杰克当政的初期摩根财团达到顶峰,垄断着美国金融业。皮尔庞特仅仅依靠个人的信用和关系就解决1907年的经济危机。随着《格拉斯–斯蒂格尔》法案的出台,摩根财团遭受沉重的打击,接着随着二战的结束,越来越多的竞争者加入,摩根的影响力着日渐式微。JP摩根成为一个老式的,弱小的商业银行。新的摩根士丹利则成为投资银行业务中的重要玩家。但是即使将他们重新合并,也不再具有皮尔庞特那样对美国金融业至关重要的影响力了。

 

摩根的衰落其实是整个银行影响力下降的趋势的写照。市场从资本稀缺时代进入了资本充裕时代。银行家不再像19世纪末那样凌驾与企业家之上,而转而成为了服务者的角色。同时,金融市场本身也逐渐变得开放,越来越多的竞争者进入金融业,摩根财团的影响力也随之被稀释了。

 

合伙人制度向现代公司转型

最后一个趋势是银行业逐渐从合伙人制度和家族企业制度走向了现代企业制度。早期的摩根各个公司都是合伙人制度,每个合伙人各自出资,承担无限的风险。二战初期,JP摩根完成了从私人合伙制度到公司化转变的最后历程。为什么早期银行业都是家族企业都是以家族姓氏命名的?这是因为在银行业,信用非常重要。一张债券或者票据,必须不论何时何地都可以立即兑现,否则别人难以放心的将钱交给银行家管理。在商业不健全的时代,信用不能用法律来维系,只能通过家族来维系。而随着信用体系的完善,银行不再需要家族关系进行背书,私人银行走向现代股份制便不可避免了。

 

事实上这个趋势不仅仅出来在银行业,也出现在工业中。十九世纪的工业发展造就了洛克菲勒家族,范德比尔特家族这样的家族性垄断巨头。但是到二十世纪五十年代,在美国的经济里, 家庭所有权的这种力量逐渐消失。 威廉范德比尔特曾经有纽约中央铁路的87%的股份, 但是他的后代哈罗德范德比尔特持有的股份,还不到剩余股份的1%。

2013-12-01

王晶

The Personal Analytics of My Evernotes

Jing Conan Wang

Aug. 09, 2013

I started to use Evernote since around 2011. Recently the number of notes in my Evernote account has surpassed 5000. To celebrate this milestone, I wrote some python scripts to visualize my evernotes.

The easiest way to get the Evernote data out is to use the official clients. Both the windows and the Mac Evernote official client can export data in ENEX format. Unfortunately, the development team of Evernote decides not to develop any linux client in the near future, which makes the data export in linux very hard. It may be possible to get the data out using the cloud APIs. But requesting an API key is too cumbersome for this small project.

Although it is the most convenient way, exporting data in ENEX format still has two pitfalls:

First, ENEX is a customized xml format, and it contains some characters, particularly ‘&nbsp’, that cannot be correctly recognized by lxml module in python. To address it, I wrote a script (XMLTOJson.py) to convert ENEX files to regular JSON files.

Second, ENEX file doesn’t provide information about the notebook a note belongs to. Fortunately, the Windows client provides a command-line program ENScript.exe that can export notebooks separately. I wrote a powershell script (export_evernote.ps1) to export the notebooks into a folder, in which each ENEX file corresponds to a notebook. Again I used XMLTOJson.py to convert the ENEX files in the folder into JSON files.

Each note is associated with two timestamps–1. the ‘Created’ time and 2. the last ‘Updated’ time.

Here is a plot of the number of notes I created in each year. Considering that only 7 months is covered, the total number for 2013 should be around 2000. From the plot, I was the most addicted to Evernote in 2012, during which I created over 2500 notes.

The following plot is the number of evernotes I updated in each year. The number of ‘updated’ notes was high in 2011, whereas the number is decreasing over the past two years. In 2011 and the first half of 2012,  I used a Mac Evernote client in my Macbook pro. After that, I switched to a Thinkpad x230 with Ubuntu 12.04, in which the only usable option is the web application (www.evernote.com). Updating notes using Mac client is much easier than the web application, which may explain my decrease of note updates.

 

The following plot visualizes the number of notes I created in every month. There is a welcome note whose ‘created’ timestamp is Oct. 19, 2009. However, I signed up Evernote in Jan. 7, 2011. Why the ‘created’ time for this welcome note is Oct. 19, 2009? I guess this date is the birthdate of Evernote, and the ‘created’ timestamp was deliberately set as the birthdate of Evernote.

The following figure is the number of ‘updated’ notes in every month. Obviously, I suddenly stopped to update notes from May 2015, which matches the time I switched from Mac to Ubuntu. The updates were somewhat recovered since Mar. 2013, because I began to use Evernote as my GTD engines. I need to update my task lists and checklists.

The following two plots visualize the ‘created’ notes and ‘updated’ notes in week level. The number of ‘created’ and ‘updated’ notes during the 12th-14th weeks of 2012 are soaring.  During this time, I was busily preparing for the application of Google Summer of Code 2012. The efforts paid off, I was finally selected into Google Summer of Code 2012 in which I had a very wonderful experience.

Evernote provides a feature to tag notes. For each note, you can add as many tags as you like. Usually I don’t use this feature manually, but when I clip notes from my mobile phone and RSS reader, which I often do, tags will be added automatically. The following figure shows the time of tagged notes. The x-axis is the ‘created’ time and each y-coordinate corresponds to a tag.

I was heavily addicted to Google Reader (GR) when it was alive. In 2011, I often read GR in my iphone using MobileRSS, which added ‘MobileRSS’ tags when I clipped articles. Later, I was irritated when the app asked me to pay the second time after I upgraded to a newer IOS, ignoring that I had already purchased a pro version. As a result, I switched to Newsfy, which does not add tags automatically. After GR was shutted down in July, I switched to feedly together with many other disappointed GR users.

From 2012, I started to add tags manually. One missing feature in Evernote is to assign importance to each note like gmail. I emulated this feature by tag notes with @TOREAD, @✭ and @✭✭.

In Evernote, a notebook is a collection of individual notes. The following figure shows a stacked area graph of numbers of noted I created in each month. I started to use notebook feature systematically after April 2012. Before April, 2012, I mostly used evernote as an archive of web pages and dump most of notes into one notebook.  ‘Programming’ is one of the first notebooks I created, which was divided into more sophisticated categories later.

The ‘cybersecurity’ notebook, which is related to my research, dominated in May and the beginning of June of 2012. From May, 2012 to Aug 2012, my focus shifted to ‘GSOC’ , ‘Programming’ and ‘Python’, which dued to my participation of Google Summer of Code 2012.

There is a visible gap in Sep, 2012 when I had a vacation to recover from demanding work in the summer (that summer was very busy for me). I am a fan of classical music. Even in this busy summer, there were still a considerably large number of ‘Music’ notes. The ‘GSOC’ notebook disappeared after the google summer of code officially ended at Sep. 2012. Considering the number of created notes, the four notebooks I used the most are ‘Python’, ‘Linux’, ‘Music’, and ‘others’. The ‘others’ notebook was created in June, 2013 to store miscellaneous notes.

The following figure shows the number of ‘updated’ notes in every month for each notebook. An interesting observation is that few notes in the ‘others’ notebook is updated despite its considerable large size. This observation indicates that I rarely review the notes in ‘others’ notebook. This bad habit should be improved in the future.

The following two figures show the number of ‘created’ and ‘updated’ notes in every week for each notebook. For most notebooks, although the number of ‘created’ notes doesn’t change significantly, the number of ‘updated’ notes increased rapidly in the 12th week of 2013. The reason is that I categorized many notes manually in that week.

The blog is inspired by Stephen Wolfram’s blog: The Personal Analytics of My Life.

I fully agree with Mr. Wolfram that personal data is very useful and everyone should log their own life as much as possible. Evernote is a good tool to achieve this goal.

Surely there is more information I can dig out. But the information in this article provides a good starting point.  The source code of this project is available at:

https://github.com/hbhzwj/VizEvernote

If you are interested, you can try to analyze your Evernote data using these codes. Any suggestion, bugfix or improvement is welcomed.

Follow

Get every new post delivered to your Inbox.

Join 34 other followers