0%

1. What is event streaming?

Event streaming is the digital equivalent of the human body’s central nervous system. It is the technological foundation for the ‘always-on’ world where businesses are increasingly software-defined and automated, and where the user of software is more software.

事件流是人体中枢神经系统的数字等效物。它是”永远在线”世界的技术基础,在这个世界中,企业越来越多地由软件定义和自动化,并且软件的用户更多地是软件。

Technically speaking, event streaming is the practice of capturing data in real-time from event sources like databases, sensors, mobile devices, cloud services, and software applications in the form of streams of events; storing these event streams durably for later retrieval; manipulating, processing, and reacting to the event streams in real-time as well as retrospectively; and routing the event streams to different destination technologies as needed. Event streaming thus ensures a continuous flow and interpretation of data so that the right information is at the right place, at the right time.

从技术上讲,事件流是从事件源(如数据库、传感器、移动设备、云服务和软件应用程序)以事件流的形式实时捕获数据的实践;持久存储这些事件流以供以后检索;实时和回顾性地操作、处理和响应事件流;并根据需要将事件流路由到不同的目标技术。因此,事件流确保了数据的连续流动和解释,以便正确的信息在正确的时间出现在正确的位置。

Read more »

# Problems Difficulty Solutions
1 Two Sum Easy Two Sum
2 Add Two Sum Medium Add Two Number
3 Longest Substring Without Repeating Characters Medium Longest Substring Without Repeating Characters
4 Median of Two Sorted Arrays Hard Median of Two Sorted Arrays
5 Longest Palindromic Substring Medium Longest Palindromic Substring
10 Regular Expression Matching Hard Regular Expression Matching
12 Integer to Roman Medium Integer to Roman
22 Generate Parentheses Medium Generate Parentheses
39 Combination Sum Medium Combination Sum
42 Trapping Rain Water Hard Trapping Rain Water
90 Subsets II Medium Subsets II
94 Binary Tree Inorder Traversal Medium Binary Tree Inorder Traversal(简书)
108 Convert Sorted Array to Binary Search Tree Medium Convert Sorted Array to Binary Search Tree
122 Best Time to Buy and Sell Stock II Medium Best Time to Buy and Sell Stock II
136 Single Number Medium Single Number(简书)
144 Binary Tree Preorder Traversal Medium Binary Tree Preorder Traversal
167 Two Sum II - Input array is sorted Medium Two Sum II - Input array is sorted
238 Product of Array Except Self Medium Product of Array Except Self(简书)
260 Single Number III Medium Single Number III(简书)
268 Missing Number Medium Missing Number
309 Best Time to Buy and Sell Stock with Cooldown Medium Best Time to Buy and Sell Stock with Cooldown
318 Maximum Product of Word Lengths Medium Maximum Product of Word Lengths(简书)
319 Bulb Switcher Medium Bulb Switcher(简书)
338 Counting Bits Medium Counting Bits(简书)
343 Integer Break Medium Integer Break(简书)
347 Top K Frequent Elements Medium Top K Frequent Elements(简书)
357 Count Numbers with Unique Digits Medium Count Numbers with Unique Digits
377 Combination Sum IV Medium Combination Sum IV
492 Construct the Rectangle Easy Construct the Rectangle
530 Minimum Absolute Difference in BST Easy Minimum Absolute Difference in BST
535 Encode and Decode TinyURL Medium Encode and Decode TinyURL
599 Minimum Index Sum of Two Lists Easy Minimum Index Sum of Two lists
606 Construct String from Binary Tree Easy Construct String from Binary Tree
进度

Github

https://github.com/eazow/leetcode

作者

Eazow

版本

0.3.0.0

He put on his goggles, fitted them tight, tested the vacuum. His hands were shaking. Then he chose the biggest stone he could carry and slipped over the edge of the rock until half of him was in the cool, enclosing water and half in the hot sun. He looked up once at the empty sky, filled his lungs once, twice, and then sank fast to the bottom with the stone. He let it go and began to count. He took the edges of the hole in his hands and drew himself into it, wriggling his shoulders in sideways as he remembered he must, kicking himself along with his feet.

Soon he was clear inside. He was in a small rock-bound hole filled with yellowish-gray water. The water was pushing him up against the roof. The roof was sharp and pained his back. He pulled himself along with his hands — fast, fast — and used his legs as levers. His head knocked against something; a sharp pain dizzied him. Fifty, fifty-one, fifty-two… He was without light, and the water seemed to press upon him with the weight of rock. Seventy-one, seventy-two… There was no strain on his lungs. He felt like an inflated balloon, his lungs were so light and easy, but his head was pulsing.

He was being continually pressed against the sharp roof, which felt slimy as well as sharp. Again he thought of octopuses, and wondered if the tunnel might be filled with weed that could tangle him. He gave himself a panicky, convulsive kick forward, ducked his head, and swam. His feet and hands moved freely, as if in open water. The hole must have widened out. He thought he must be swimming fast, and he was frightened of banging his head if the tunnel narrowed.

A hundred, a hundred and one… The water paled. Victory filled him. His lungs were beginning to hurt. A few more strokes and he would be out. He was counting wildly; he said a hundred and fifteen and then, a long time later, a hundred and fifteen again. The water was a clear jewel-green all around him. Then he saw, above his head, a crack running up through the rock. Sunlight was falling through it, showing the clean dark rock of the tunnel, a single mussel shell, and darkness ahead.

He was at the end of what he could do. He looked up at the crack as if it were filled with air and not water, as if he could put his mouth to it to draw in air. A hundred and fifteen, he heard himself say inside his head — but he had said that long ago. He must go on into the blackness ahead, or he would drown. His head was swelling, his lungs cracking. A hundred and fifteen, a hundred and fifteen pounded through his head, and he feebly clutched at rocks in the dark, pulling himself forward, leaving the brief space of sunlit water behind. He felt he was dying. He was no longer quite conscious. He struggled on in the darkness between lapses into unconsciousness. An immense, swelling pain filled his head, and then the darkness cracked with an explosion of green light. His hands, groping forward, met nothing; and his feet, kicking back, propelled him out into the open sea.

How does the older investor differ in his approach to investment from the younger investor?

There is no shortage of tipsters around offering “get-rich-quick” opportunities.

But if you are a serious private investor, leave the Las Vegas mentality to those with money to fritter.

The serious investor needs a proper “portfolio“ - a well-planned selection of investments, with a definite structure and a clear aim.

But exactly how does a newcomer to the stock market go about achieving that?

Well, if you go to five reputable stockbrokers and ask them what you should do with your money, you’re likely to get five different answers, — even if you give all the relevant information about your age, family, finances and what you want from your investments.

Moral? There is no one “right” way to structure a portfolio.

However, there are undoubtedly some wrong ways, and you can be sure that none of our five advisers would have suggested sinking all (or perhaps any) of your money into Periwigs*.

So what should you do? We’ll assume that you have sorted out the basics — like mortgages, pensions, insurance and access to sufficient cash reserves.

You should then establish your own individual aims.

These are partly a matter of personal circumstances, partly a matter of psychology.

For instance, if you are older you have less time to recover from any major losses, and you may well wish to boost your pension income.

So preserving your capital and generating extra income are your main priorities.

In this case, you’d probably construct a portfolio with some shares (but not high risk ones), along with gilts, cash deposits, and perhaps convertibles or the income shares of split capital investment trusts.

If you are younger, and in a solid financial position, you may decide to take an aggressive approach — but only if you’re blessed with a sanguine disposition and won’t suffer sleepless nights over share prices.

If you recognize yourself in this description, you might include a couple of heady growth stocks in your portfolio, alongside your more pedestrian investments.

Once you have decided on your investment aims, you can then decide where to put your money.

The golden rule here is “spread your risk” — if you put all of your money into Periwigs International, you’re setting yourself up as a hostage to fortune.

“Periwigs” is the name of a fictitious company.

What is one of the features of modern camping where nationality is concerned?

Economy is one powerful motive for camping, since after the initial outlay upon equipment, or through hiring it, the total expense can be far less than the cost of hotels.

But, contrary to a popular assumption, it is far from being the only one, or even the greatest.

The man who manoeuvres carelessly into his twenty pounds’ worth of space at one of Europe’s myriad permanent sites may find himself bumping a Bentley.

More likely, Ford Escort will be hub to hub with Renault or Mercedes, but rarely with bicycles made for two.

That the equipment of modern camping becomes yearly more sophisticated is an entertaining paradox for the cynic, a brighter promise for the hopeful traveler who has sworn to get away from it all.

It also provides—and some student sociologist might care to base his thesis upon the phenomenon—an escape of another kind.

The modern traveller is often a man who dislikes the Splendide and the Bellavista, not because he cannot afford, or shuns their material comforts, but because he is affraid of them.

Affluent he may be, but he is by no means sure what to tip the doorman or the chambermaid.

Master in his own house, he has little idea of when to say boo to a maitre d’hotel.

From all such fears camping releases him.

Granted, a snobbery of camping itself, based upon equipment and techniques, already exists; but it is of a kind that, if he meets it, he can readily understand and deal with.

There is no superior ‘they’ in the shape of managements and hotel hierarchies to darken his holiday days.

To such motives, yet another must be added.

The contemporary phenomenon of car worship is to be explained not least by the sense of independence and freedom that ownership entails.

To this pleasure camping gives an exquisite refinement.

From one’s own front door to home or foreign hills or sands and back again, everything is to hand.

Not only are the means of arriving at the holiday paradise entirely within one’s own command and keeping, but the means of escape from holiday hell(if the beach proves too crowded, the local weather too inclement) are there, outside—or, as likely, part of—the tent.

Idealists have objected to the practice of camping, as to the package tour, that the traveller abroad thereby denies himself the opportunity of getting to know the people of the country visited.

Insularity and self-containment, it is argued, go hand in hand.

The opinion does not survive experience of a popular Continental camping place.

Holiday hotels tend to cater for one nationality of visitors especially, sometimes exclusively.

Camping sites, by contrast, are highly cosmopolitan.

Granted, a preponderance of Germans is a characteristic that seems common to most Mediterranean sites; but as yet there is no overwhelmingly specialized patronage.

Notices forbidding the open-air drying of clothes, or the use of water points for car washing, or those inviting “our camping friends” to a dance or a boat trip are printed not only in French or Italian or Spanish, but also in English, German and Dutch.

At meal times the odour of sauerkraut vies with that of garlic.

The Frenchman’s breakfast coffee competes with the Englishman’s bacon and eggs.

Whether the remarkable growth of organized camping means the eventual death of the more independent kind is hard to say.

Municipalities naturally want to secure the campers’ site fees and other custom.

Police are wary of itinerants who cannot be traced to a recognized camp boundary or to four walls.

But most probably it will all depend upon campers themselves: how many heath fires they cause; how much litter they leave; in short, whether or not they wholly alienate landowners and those who live in the countryside.

Only good scouting is likely to preserve the freedoms so dear to the heart of the eternal Boy Scout.

Who, according to the author, are ‘Fortune’s favoured children’?

A gifted American psychologist has said, ‘Worry is a spasm of the emotion; the mind catches hold of something and will not let it go.’

It is useless to argue with the mind in this condition.

The stronger the will, the more futile the task.

One can only gently insinuate something else into its convulsive grasp.

And if this something else is rightly chosen, if it really attended by the illumination of another field of interest, gradually, and often quite swiftly, the old undue grip relaxes and the process of recuperation and repair begins.

The cultivation of a hobby and new forms of interest is therefore a policy of the first importance to a public man.

But this is not a business that can be undertaken in a day or swiftly improvised by a mere command of the will.

The growth of alternative mental interests is a long process.

The seeds must be carefully chosen; they must fall on good ground; they must be sedulously tended, if the vivifying fruits are to be at hand when needed.

To be really happy and really safe, one ought to have at least two or three hobbies, and they must all be real.

It is no use starting late in life to say: “I will take an interest in this or that.”

Such an attempt only aggravates the strain of mental effort.

A man may acquire great knowledge of topics unconnected with his daily work, and yet get hardly any benefit or relief.

It is no use doing what you like; you have got to like what you do.

Broadly speaking, human beings may be divided into three classes: those who are toiled to death, those who are worried to death, and those who are bored to death.

It is no use offering the manual laborer, tired out with a hard week’s sweat and effort, the chance of playing a game of football or baseball on Saturday afternoon.

It is no use inviting the politician or the professional or business man, who has been working or worrying about serious things for six days, to work or worry about trifling things at the weekend.

As for the unfortunate people who can command everything they want, who can gratify every caprice and lay their hands on almost every object of desire—for them a new pleasure, a new excitement if only an additional satiation.

In vain they rush frantically round from place to place, trying to escape from avenging boredom by mere clatter and motion.

For them discipline in one form or another is the most hopeful path.

It may also be said that rational, industrious, useful human being are divided into two classes: first, those whose work is work and whose pleasure is pleasure; and secondly, those whose work and pleasure are one.

Of these the former are the majority.

They have their compensations.

The long hours in the office or the factory bring with them as their reward, not only the means of sustenance, but a keen appetite for pleasure even in its simplest and most modest forms.

But Fortune’s favoured children belong to the second class.

Their life is a natural harmony.

For them the working hours are never long enough.

Each day is a holiday, and ordinary holidays, when they come, are grudged as enforced interruptions in an absorbing vocation.

Yet to both classes, the need of an alternative outlook, of a change of atmosphere, of a diversion of effort, is essential.

Indeed, it may well be that those whose work is their pleasure are those who most need the means of banishing it at intervals from their minds.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
Easter Egg
1
>>> import this

What does the computer industry thrive on apart from anarchy?

Technology trends may push Silicon Valley back to the future. Carver Mead, a pioneer in integrated circuits and a professor of computer science at the California Institute of Technology, notes there are now work-stations that enable engineers to design, test and produce chips right on their desks, much the way an editor creates a newsletter on a Macintosh. As the time and cost of making a chip drop to a few days and a few hundred dollars, engineers may soon be free to let their imaginations soar without being penalized by expensive failures. Mead predicts that inventors will be able to perfect powerful customized chips over a weekend at the office—spawning a new generation of garage start-ups and giving the U.S. a jump on its foreign rivals in getting new products to market fast. ‘We’re got more garages with smart people,’ Mead observes. ‘We really thrive on anarchy.’

And on Asians. Already, orientals and Asian Americans constitute the majority of the engineering staffs at many Valley firms. And Chinese, Korean, Filipino and Indian engineers are graduating in droves from California’s colleges. As the heads of next-generation start-ups, these Asian innovators can draw on customs and languages to forge righter links with crucial Pacific Rim markets. For instance, Alex Au, a Stanford Ph. D. from Hong Kong, has set up a Taiwan factory to challenge Japan’s near lock on the memory-chip market. India-born N.Damodar Reddy’s tiny California company reopened an AT & T chip plant in Kansas City last spring with financing from the state of Missouri. Before it becomes a retirement village, Silicon Valley may prove a classroom for building a global business.


文章结构

  • 第一段:低成本的芯片制造技术降低了创业门槛,”车库创业”文化让美国得以快速试错、快速创新。
  • 第二段:亚裔工程师成为硅谷工程团队的主力,凭借语言和文化优势连接环太平洋市场,是硅谷的另一大动力来源。

文化背景:Garage start-ups(车库创业)是硅谷传奇,苹果、惠普都起源于车库;Pacific Rim(环太平洋)指亚太经济圈;文中提到的内存芯片市场当时由日本主导。这篇文章写于20世纪末,预见了亚裔人才和全球化对硅谷的重要性。


逐句讲解

Technology trends may push Silicon Valley back to the future.
技术趋势可能会把硅谷推回到未来。—— “back to the future” 是双关,指用未来的技术回归早期车库创业的模式。

Carver Mead, a pioneer in integrated circuits and a professor of computer science at Caltech, notes there are now work-stations that enable engineers to design, test and produce chips right on their desks, much the way an editor creates a newsletter on a Macintosh.
卡弗·米德——集成电路先驱、加州理工计算机科学教授——指出,现在的工作站能让工程师在自己桌上设计、测试、生产芯片,就像编辑在苹果电脑上排版一样。—— enable sb to do sth = 使某人能做某事;much the way = 就像……的方式一样。

As the time and cost of making a chip drop to a few days and a few hundred dollars, engineers may soon be free to let their imaginations soar without being penalized by expensive failures.
随着造芯片的时间和成本降到几天、几百美元,工程师很快就能自由地放飞想象,而不用为高昂的失败付出代价。—— let imagination soar = 让想象力自由驰骋;be penalized by = 因……受罚。

Mead predicts that inventors will be able to perfect powerful customized chips over a weekend at the office—spawning a new generation of garage start-ups and giving the U.S. a jump on its foreign rivals in getting new products to market fast.
米德预测,发明家们能利用一个周末在办公室完善强大的定制芯片——催生新一代车库创业公司,让美国在把新产品快速推向市场这件事上领先于外国对手。—— spawning 是分词作结果状语;give sb a jump on = 使某人领先于。

‘We’ve got more garages with smart people,’ Mead observes. ‘We really thrive on anarchy.’
“我们有更多藏着聪明人的车库,”米德说,”我们就是靠这种无序状态茁壮成长的。”—— thrive on = 依靠……而繁荣;这里 anarchy 指宽松自由、不受束缚的创新环境。

And on Asians.
还依靠亚洲人。—— 省略句,补全是 We also thrive on Asians,承接上一句的 thrive on,简短有力。

Already, orientals and Asian Americans constitute the majority of the engineering staffs at many Valley firms. And Chinese, Korean, Filipino and Indian engineers are graduating in droves from California’s colleges.
东方人和亚裔美国人已经占了硅谷许多公司工程团队的大多数,中、韩、菲、印工程师正成批从加州高校毕业。—— orientals 是较老的说法,现在多用 Asians;in droves = 成群结队地。

As the heads of next-generation start-ups, these Asian innovators can draw on customs and languages to forge tighter links with crucial Pacific Rim markets.
作为下一代创业公司的领军人物,这些亚裔创新者能靠共通的习俗和语言,与至关重要的环太平洋市场建立更紧密的联系。—— draw on = 凭借、利用。

For instance, Alex Au, a Stanford Ph.D. from Hong Kong, has set up a Taiwan factory to challenge Japan’s near lock on the memory-chip market.
比如来自香港的斯坦福博士 Alex Au,在台湾建厂挑战日本对内存芯片市场近乎垄断的地位。

India-born N. Damodar Reddy’s tiny California company reopened an AT&T chip plant in Kansas City last spring with financing from the state of Missouri.
出生于印度的 N. Damodar Reddy 名下的加州小公司,去年春天靠密苏里州的资助,重新开办了 AT&T 在堪萨斯城的芯片厂。

Before it becomes a retirement village, Silicon Valley may prove a classroom for building a global business.
在变成”退休村”之前,硅谷或许能成为教全世界如何做全球生意的课堂。—— 暗含警示:不把握好人才和全球化机遇,硅谷也会衰落;反之则能成为典范。


核心词汇

词汇 词性 含义 用法/例句
thrive /θraɪv/ v. 茁壮成长、兴旺 thrive on sth(依靠……而繁荣);Some people thrive on pressure.
anarchy /ˈænərki/ n. 无政府状态、无序 文中指宽松自由的创新环境;形容词 anarchic
circuits /ˈsɜːrkɪts/ n. 电路 integrated circuits(集成电路)
soar /sɔːr/ v. 翱翔;激增 let imagination soar;Prices soared.
penalized /ˈpiːnəlaɪzd/ v. (过去分词) 惩罚 be penalized by/for
spawning /spɔːnɪŋ/ v. (现在分词) 催生、大量产生 原意鱼类产卵,引申为”引发一大批”
orientals /ˌɔːriˈentlz/ n. 东方人 现代英语中偏旧,多用 Asians
droves /droʊvz/ n. 群、大批 in droves(成群结队地)
crucial /ˈkruːʃl/ adj. 至关重要的 同义词 critical, vital, essential

What important thing did King Alfred learn when he penetrated the Danish camp of Guthrum?

Alfred the Great acted his own spy, visiting Danish camps disguised as a minstrel. In those days wandering minstrels were welcome everywhere. They were not fighting men, and their harp was their passport. Alfred had learned many of their ballads in his youth, and could vary his programme with acrobatic tricks and simple conjuring.

While Alfred’s little army slowly began to gather at Athelney, the king himself set out to penetrate the camp of Guthrum, the commander of the Danish invaders. There had settled down for the winter at Chippenham: thither Alfred went. He noticed at once that discipline was slack: the Danes had the self-confidence of conquerors, and their security precautions were casual. They lived well, on the proceeds of raids on neighbouring regions. There they collected women as well as food and drink, and a life of ease had made them soft.

Read more »

What makes trading between rich countries difficult?

Chickens slaughtered in the United States, claim officials in Brussels, are not fit to grace European tables. No, say the American: our fowl are fine, we simply clean them in a different way. These days, it is differences in national regulations, far more than tariffs, that put sand in the wheels of trade between rich countries. It is not just farmers who are complaining. An electric razor that meets the European Union’s safety standards must be approved by American testers before it can be sold in the United States, and an American-made dialysis machine needs the EU’s okay before is hits the market in Europe.

As it happens, a razor that is safe in Europe is unlikely to electrocute Americans. So, ask businesses on both sides of the Atlantic, why have two lots of tests where one would do? Politicians agree, in principle, so America and the EU have been trying to reach a deal which would eliminate the need to double-test many products. They hope to finish in time for a trade summit between America and the EU on May 28TH. Although negotiators are optimistic, the details are complex enough that they may be hard-pressed to get a deal at all.

Why? One difficulty is to construct the agreements. The Americans would happily reach one accord on standards for medical devices and then hammer out different pacts covering, say, electronic goods and drug manufacturing. The EU—following fine continental traditions—wants agreement on general principles, which could be applied to many types of products and perhaps extended to other countries.

Read more »