guiyumin 发布的文章

原文:http://michaelnthiessen.com/force-re-render/
标题: The correct way to force Vue to re-render a component

The best way to force Vue to re-render a component is to set a :key on the component. When you need the component to be re-rendered, you just change the value of the key and Vue will re-render the component.

  • The horrible way: reloading the entire page
  • The terrible way: using the v-if hack
  • The better way: using Vue’s built-in forceUpdate method
  • The best way: key-changing on your component

php -S localhost:8080 即可;如果要指定某个具体目录里的index.phpindex.html,需要加个-t选项,例如,php -S localhost:8080 -t public/

最近对PHP开始进行深入探索,第一次写原生PHP,没有任何框架,纯手动实现一切功能,还是有很多收获的。

首先,composer是个神器,其实composer已经不是原生PHP了, 但对于你想利用namespace这么一个重要的feature,还是非常重要的。

其次,PHPUnit,是每一个PHPer必须掌握的东西。一个能够让别人放心、让自己放心的库或者app,必须写测试。

第三,PHP Session需要了解东西还不少,以前无所谓,只是知道在server端存用户的信息,至于怎么玩的,深入机制不了解。比如,session data其实是存在某处,php.ini这个文件里有配置项;比如session_start()函数要在很多每一页面都开启,才能实现跨页面间session数据的共享,等等吧。

需要继续深入研究,考虑自己写一个库,我对机器人很感兴趣,有考虑自己写一个。

Content is where I expect much of the real money will be made on the Internet, just as it was in broadcasting.

The television revolution that began half a century ago spawned a number of industries, including the manufacturing of TV sets, but the long-term winners were those who used the medium to deliver information and entertainment.

When it comes to an interactive network such as the Internet, the definition of “content” becomes very wide. For example, computer software is a form of content-an extremely important one, and the one that for Microsoft will remain by far the most important.

But the broad opportunities for most companies involve supplying information or entertainment. No company is too small to participate.

One of the exciting things about the Internet is that anyone with a PC and a modem can publish whatever content they can create. In a sense, the Internet is the multimedia equivalent of the photocopier. It allows material to be duplicated at low cost, no matter the size of the audience.

The Internet also allows information to be distributed worldwide at basically zero marginal cost to the publisher. Opportunities are remarkable, and many companies are laying plans to create content for the Internet.

For example, the television network NBC and Microsoft recently agreed to enter the interactive news business together. Our companies will jointly own a cable news network, MSNBC, and an interactive news service on the Internet. NBC will maintain editorial control over the joint venture.

I expect societies will see intense competition-and ample failure as well as success-in all categories of popular content-not just software and news, but also games, entertainment, sports programming, directories, classified advertising, and on-line communities devoted to major interests.

Printed magazines have readerships that share common interests. It’s easy to imagine these communities being served by electronic online editions.

But to be successful online, a magazine can’t just take what it has in print and move it to the electronic realm. There isn’t enough depth or interactivity in print content to overcome the drawbacks of the online medium.

If people are to be expected to put up with turning on a computer to read a screen, they must be rewarded with deep and extremely up-to-date information that they can explore at will. They need to have audio, and possibly video. They need an opportunity for personal involvement that goes far beyond that offered through the letters-to-the-editor pages of print magazines.

A question on many minds is how often the same company that serves an interest group in print will succeed in serving it online. Even the very future of certain printed magazines is called into question by the Internet.

For example, the Internet is already revolutionizing the exchange of specialized scientific information. Printed scientific journals tend to have small circulations, making them high-priced. University libraries are a big part of the market. It’s been an awkward, slow, expensive way to distribute information to a specialized audience, but there hasn’t been an alternative.

Now some researchers are beginning to use the Internet to publish scientific findings. The practice challenges the future of some venerable printed journals.

Over time, the breadth of information on the Internet will be enormous, which will make it compelling. Although the gold rush atmosphere today is primarily confined to the United States, I expect it to sweep the world as communications costs come down and a critical mass of localized content becomes available in different countries.

For the Internet to thrive, content providers must be paid for their work. The long-term prospects are good, but I expect a lot of disappointment in the short-term as content companies struggle to make money through advertising or subscriptions. It isn’t working yet, and it may not for some time.

So far, at least, most of the money and effort put into interactive publishing is little more than a labor of love, or an effort to help promote products sold in the non-electronic world. Often these efforts are based on the belief that over time someone will figure out how to get revenue.

In the long run, advertising is promising. An advantage of interactive advertising is that an initial message needs only to attract attention rather than convey much information. A user can click on the ad to get additional information-and an advertiser can measure whether people are doing so.

But today the amount of subscription revenue or advertising revenue realized on the Internet is near zero-maybe $20 million or $30 million in total. Advertisers are always a little reluctant about a new medium, and the Internet is certainly new and different.

Some reluctance on the part of advertisers may be justified, because many Internet users are less-than-thrilled about seeing advertising. One reason is that many advertisers use big images that take a long time to download across a telephone dial-up connection. A magazine ad takes up space too, but a reader can flip a printed page rapidly.

As connections to the Internet get faster, the annoyance of waiting for an advertisement to load will diminish and then disappear. But that’s a few years off.

Some content companies are experimenting with subscriptions, often with the lure of some free content. It’s tricky, though, because as soon as an electronic community charges a subscription, the number of people who visit the site drops dramatically, reducing the value proposition to advertisers.

A major reason paying for content doesn’t work very well yet is that it’s not practical to charge small amounts. The cost and hassle of electronic transactions makes it impractical to charge less than a fairly high subscription rate.

But within a year the mechanisms will be in place that allow content providers to charge just a cent or a few cents for information. If you decide to visit a page that costs a nickel, you won’t be writing a check or getting a bill in the mail for a nickel. You’ll just click on what you want, knowing you’ll be charged a nickel on an aggregated basis.

This technology will liberate publishers to charge small amounts of money, in the hope of attracting wide audiences.

Those who succeed will propel the Internet forward as a marketplace of ideas, experiences, and products-a marketplace of content.

git log --pretty=format:"%cn made a commit %h on %ad - %s" --date=short

如果需要过滤,就可以用pipe符号|,然后后面用grep来匹配字符串。
关于grep,如果要反向匹配,就是说,不含有某个字符,用grep -v