1. 缩进问题，以及tab和空格混用（公司规范要求一次缩进为4个空格）
2. 一行限制120个字符，超过需要跨行显示
3. js中使用单引号
4. 变量定义或者赋值了却没有使用，需要去除，函数传参也同理。

1. HTML/CSS/JS Prettify
2. 根据扫出来的错误提示，手动去换行。
3. 无脑式的手动把双引号替换成单引号，由于js中存在dom元素的拼接，不能一键替换需要挨个检查。
4. 根据扫出来的结果手动去除，每次需要上传一遍svn，在jenkins上跑一边才能检验一遍，每次扫都是整个项目，比较费时。

1.安装eslint

2.初始化配置文件，生成默认的配置文件

3.检测文件

4.根据规范配置eslintHTML/CSS/JS Prettify

HTML/CSS/JS Prettify的配置，打开配置文件（js文件中右键--->HTML/CSS/JS Prettify --->set Prettify Preferences）

eslint 参考链接
sublime安装package control组件教程
sublime安装插件: Preferences--> Package Control -->输入需要安装的插件名称
sublime使用插件: Ctrl + shift + P --> 输入需要调用的插件名称

Eclipse Luna

### 方法

1. Window --> Navigator --> Show View
2. 在Navigator窗口，鼠标右键点击先要排除的文件夹，选择properties --> Resouurce，在Attributes区域选中Derived。

### 其他版本Eclipse

1. Right-click on your project and select Properties.
2. Choose Validation from the left-nav menu.
3. If it is not already selected choose "Enable project specific settings".
4. Find the validator that is relevant for what you want to exclude and click the "..." in the Settings column.
5. Highlight the Exclude Group and click Add Rule. (If you don't have any existing exclusions you may have to add an Exclude Group.)
6. Select Folder or file name as the Filter Type.
7. Click Next.
8. Select Browse Folder and find the folder you want to exclude.

### Reference

Exclude directories & subdirectories from validation in Eclipse

### 页面停留时间

#### 离开具体指代的事件

• PC端浏览器

• 页面消失
• 点击某个离开页面的链接
• 在地址栏中键入了新的URL
• 使用前进或后退按钮
• 关闭浏览器
• 重新加载页面
• 页面不消失

• 最小化浏览器
• 切换到别的tab页
• 移动端浏览器/APP（ios/android）

• 页面消失

• 点击某个离开页面的链接
• 在地址栏中键入了新的URL
• 使用前进或后退按钮
• 关闭浏览器/APP   * 重新加载页面(ios/android表现不同)
• 页面不消失

• 浏览器/APP切换到后台
• 切换到别的tab页

#### 一、捕捉离开页面的瞬间

• 各个浏览器事件不一定相同
• 相同的事件不一定不支持
• 绑定事件的方法不一定相同 -->常说的浏览器兼容分cssjs方面的，这个就是js兼容性中一些情况
##### 找到对应的事件
###### PC端

3. visibilitychange 切换tab页时，如果是离开时间-进入页面时间，停留时间就会不准确，因此监听切换tab页的事件（visibilitychange）来刨去中间的时间

_utma （用来识别唯一身份访客）
_utma = 127635166.1360367272.1264374807.1264374807.1264374807.1

• 第二组数字是一个随机产生的唯一ID。
• 第三，四，五组数字是时间戳，其中第三组数字表示初次访问的时间。第四组数字表示上一次访问的时间，第五组数字表示本次访问开始的时间。
• 第六组数字是访问次数计数器。这个数字随着访问次数的增加而增加。 如果是第一次访问，第三四五组时间戳都是相同的。

###### 手机端

优点：使用Hybrid开发方法，就能集Native 和web两者之所长。一方面，Native 让开发者可以充分利用现代移动设备所提供的全部不同的特性和功能。另一方面，使用 Web 语言编写的所有代码都可以在不同的移动平台之间共享，使得开发和日常维护过程变得集中式、更简短、更经济高效。

缺点：还不成熟，支持程度并不理想

ios和android支持pageshow，但是完全不支持pagehide，导致没法探知应用被关闭/切换到后台的状态。正常的做法是，写好app隐藏或者关闭的回调函数，当native层探知事件发生，去调用JS回调函数。

更改方案：
定时向后台发送字段，后面的覆盖前面的。

• 试验的时候是每秒向服务器请求一次，但是各个平台下机制不同，IOS下应用切换到后台，js会立即停止运行，但是android的机制是如果应用大概30s左右还不切换到前台，js就会停止运行，这样导致计时的不准确。

• 也有人说实践过用裴波那契数列（1、1、2、3、5、8、13、21、34、……）的形式向后台发请求，这样对后台压力相对小一些。假设上一次用户在页面上待了2s，那他继续待3s的概率就更大，以此类推。

此方案在用户基数很大的时候对服务器造成的压力太大，因此也放弃了。

#### 二、在离开页面的瞬间发送数据

尽量减缓刷新这个过程

• 动态新建img，通过src属性向后台请求一张1*1的gif图片，请求的同时把收集到的数据带过去。
• for循环 + ajax
• navigator.sendBeacon

Highcharts Error #22是说地图不支持经纬度转换成图上坐标，但是我的地图数据确实是从官方下来的，且是1.1.0版本以上的。

"lcc","18","24","21",..."WGS72"这几个参数的后面都有空格，而proj4js都没有做trim处理，导致报错。

## How to Start a Conversation with Absolutely Anyone

Did you know that public speaking is often rated the number one thing people are afraid of? But while getting up on a stage in front of an audience can definitely be nerve wracking, many people find striking up a conversation one-on-one just as intimidating.

Maybe it’s the CEO of your company, a new colleague, the guy in the mail room, the girl from IT, or a stranger in the street. Whomever you want to talk to, there’s a way to strike up a conversation. And the best news is that it gets easier with practice.

Try these conversation starters to talk to absolutely anybody:

• Skip the small talk.
不要再用这些衰招了。
“What’s up with this weather?” and “How ‘bout them [insert local sports team]?” are as bad as cheesy pick-up lines when it comes to starting a conversation. Avoid tired topics. Every situation is unique, so you should be able to find a unique conversation starter.
搭讪时，“今天天气怎样？”以及“【当地球队】打得怎么样？”已经是陈芝麻烂豆了。避免乏味的话题。不同的情景需要不同的话来搭讪。

征求意见。
Everyone has one! For someone you don’t know well, start with light subjects like the food, the music, the atmosphere, etc. “Do you like your Margaritas with salt or without? Do you watch horror movies? Do you like this song?” It’s probably best to stay away from really sticky subjects like politics unless you already know the person very well.
每个人都有自己的喜好。对于你不了解的人，你可以从一些轻松的话题切入，比如音乐，氛围等。“你的玛格丽特酒要加点盐吗？你看恐怖电影吗？你喜欢这首歌吗？”最好远离艰涩的话题如政治，除非你很了解你谈话的人。

征求建议。
This works very well when commenting on someone’s outfit or accessories, as in “What a great tie! Where did you get it?” or on the food, as in, “Everything looks good. What are you having?”
当谈论某人的服装或配饰是这一招很受用，如“你的领结真好看！你在哪儿买的？”或者关于食物，“所有的看起来都很好吃，你要吃什么？”

提问题——问题要容易回答。
This is great when you know or find out that a person has expertise in a particular field. If you’re talking to your company’s IT guy, for example, you could ask him whether he’s the guy who installs hardware or software. But avoid asking anyone to explain something super complex or involved; if that’s where the conversation leads, great, but asking a really complicated question up front can feel demanding.
这一招很适合在你知道或发现某人在某个领域有专长的时候用。例如，如果你和公司的IT男/女交谈，你可以问他擅长软件还是硬件。但不要问特别复杂的问题，如果实在避免不了，那就这能这样了。但记住，问复杂的问题会让人觉得被命令回答一样。

• Comment on the environment.
评价一下环境。
No matter where you are, there are things to comment on: the music, the food, the lights, the guests, and so on. Even if you are stuck in an elevator with someone, you can comment on the music, the speed, the crowdedness, etc.
不管你在哪儿，总有东西能让你评价：音乐、食物、灯饰和宾客等。即使你和别人挤在一个电梯里，你也可以评价音乐，电梯的速度和电梯的拥挤等。

询问进展。
If you know someone a little or know them by reputation, ask for an update on something you know they’ve been doing, for example, “Oh, Mary mentioned you were taking swing dance classes. How’s that going?”
如果你对某人略知一二或只是听说过他，问一下他正在做的事，有什么进展。比如，“Mary说你报了班学摇摆舞，学的怎么样了？”

• Ask open-ended questions whenever possible.
什么时候都要问发散式的问题。
If your question can be answered with a simple yes or no, don’t be surprised if that’s what you get. Having follow-up questions ready can also help the conversation flow. If you are asking what kind of food they’re having, for example, you might follow up with, “That sounds good. Do you know what kind of wine would go well with that?” Almost everything can be followed up with, “Why?” (Just don’t ask it too many times and end up sounding like a three-year-old!)
如果你的问题可以用简单的是或否来回答，得到这样的回答你也不要觉得奇怪了。想好接下来要问什么也能让对话持续下去。比如，你问人家在吃什么，可能会接着问，“好像很不错。你知道吃这个该搭配什么样的酒吗？”几乎所有的对话都可以用“为什么”来承接（只是不要问太多次，这样会让人觉得你是三岁毛孩）。

问假设性的问题。
These can be great conversation starters, but try to tie them into something happening at the event or in current events to avoid seeming too random. You might say something like, “I just saw this movie where all the laws were revoked for one day. What would you do if there were no laws for a day?”
这可以作为很好的搭讪方式，尽量与当下发生的事联系起来，这样不会显得很随意。你可以这样说，“我刚看了一部电影，讲述的是有一天，所有的法律都不存在了。如果是你，这一天你会做什么？”

询问孩子，宠物或爱好。
People love to talk about the things that are important to them. If you know that your boss loves to sail, asking him about his latest trip is a surefire way to get him talking.
人们喜欢谈论对他们重要的事物。如果你知道你的老板喜欢航行，问他最近的旅行他肯定会和你侃侃而谈的。

What kind of girl will you be ten years later?
You girls who are in your twenties, have you ever think about what kind of girl you'll be ten years later?

While chatting with my sister, I notice that her status has changed. It goes, 'Time is the knife of a butcher’. I ask her why. She doesn't answer but sends me a picture. It is a woman with a baby in her arms. The woman is fat and jowly with casually short hair. Her jeans go tightly with her fleshly legs and bulging belly. Her light beige coat is a common one, but her smile, which would appear on the face of any mother, tells her happiness. 'Do you still remember Tingting?’ my sister asked. I'm shocked. How can I forget? Tingting is my sister's schoolmate in high school. In my memory, she was thin and tall with dark skin and short hair, too. But she looked cool and shiny then. Now she is twice or more fatter than she was. Sister sends me another picture. This time, it is a woman with plain curl hair, a little fat body, sitting on the bed with a plush toy in arms and smiling. You can't deny her beauty. However, it is true that she is the kind of woman who has lost her bloom and would not catch any attention in crowd. 'She is Seagull.' my sister surprises me again. My sister is four years older than me. I was in middle school when she was in high school. But I was quite familiar with her classmates. At that time, I think Seagull was the most beautiful one of my sister's friends. She kept long hair and sometimes bound it up into two. She was thin and looked pretty in dress, just like Sailor Moon. Years passed away. I didn't meet my sister's classmates any more. But beyond my expectation, they've changed so much even when they're younger than 30. 'Now you can understand the meaning of my status.' said my sister. Yes! I smiled to accept the shortness of women's youth. Now I understand why nowadays more and more women would like to say to The Third Woman that we all had youth and charm before.

All of the characteristics HR looks for in a job candidate are the polar opposite of what enlightened leaders seek in new talent. While HR is tediously focused on making certain that candidates "play well in the sandbox," strong managers want those who don't venture near the proverbial box. Which creates a conundrum and a paradox:to get to the latter you need to lie to the former. As well you should. Why be held hostage to a broken system?
HR看重的应聘者特质和有眼光的领导需要的特质有着天壤之别。HR一味得关注“良好的团队合作精神”，领导需要的却是不走寻常路。这就带来了一个难题和悖论：要想一面到底就必须对HR说谎。你也应该说谎，我们没必要跟败坏的系统作对。

Case in point: the HR person will likely ask you if you work well with others? Well, many of the smartest and most innovative people on the planet simply don't. Not that they are trouble makers or in any way venal but they simply prefer to work alone, creating marvels of software, mathematical formulas or extraordinary feats of creativity. But can they tell HR:

"No. I don't really like working with others. I guess you can say I do my best work by myself. My professors at MIT used to call me a 'loner.'"
“不，我不喜欢和别人合作。我想我独自一人工作时表现最好。我在MIT时，我的导师叫我独行侠。”

HR's universal reaction to this honest response would be "Next." Einstein and Newton would have failed their test.

For years, my firm worked with a hedge fund that invests capital based on quantitative strategies, developed by their team of math and physics brainiacs. None even pretend to enjoy the social aspects of the work environment. For them, it is all about hibernation, concentration and introspection. They never stepped into a a sandbox as kids and they aren't about to start now.

Over the course of an intense year when we examined and adjusted many of the practices of the fund, management came to recognize that the caliber of the candidates coming to them for second-stage interviews was way down below the quality hierarchy. On closer examination, we discovered the HR filter was turning the best and the brightest away before they could be seen by senior fund managers -- all geeks and loners in their own right. The solution was simple: HR was limited to managing the fund's employee benefits and policies and completely removed from the hiring process.

Another HR question that demands a lie goes like this:

"So tell me why you want to work for our company."
“谈一谈为什么你想加入我们公司。”

In many cases, the honest answer would be:

"I think this is the best place to make a fortune before I'm 35. I really want a chunk of those stock options."
”我觉得这是我35岁之前赚大钱最好的去处。我真的很想要股票和期权。”

But to the HR paint-by-numbers gang, that would lead to a fast dismissal out the fire exit. To get to the next-stage interview you have to lie, waxing poetic about the company's innovative culture or lionizing it's irreverent founder (who, by the way, is eager to have brilliant wealth-seeking hot shots on the team).

The old adage "Just be yourself," is a fool's game when it comes to the hiring process. Instead, at the outset, you need to be what HR wants you to be. And in most cases, you need to (and very well should) lie to win a pass to see the real players in the company. The ones with a 180 degree different (from HR) perspective on life/business/success and how to get what you want in your career.

Look, I don't believe in making lying a way of life--in fact, I appreciate blunt and honest people and think of myself in this way. But when a system is stacked against the truth, dance around it.

---by William Butler Yeats

When you are old and grey and full of sleep,

And nodding by the fire, take down this book,

And slowly read, and dream of the soft look,

And loved your beauty with love false or true,

But one man loved the pilgrim Soul in you,

And loved the sorrows of your changing face;

And bending down beside the glowing bars,

Murmur, a little sadly, how Love fled,

And paced upon the mountains overhead,

And hid his face amid a crowd of stars.

### 当你老了（冰心译）

Personal branding through social media may help you build your professional network, but there will never be a replacement for a charismatic personality.

Napoleon Hill, author of "Think and Grow Rich" — one of the top-selling books of all time — wrote about the habits of the most likable people in his essay "Develop A Pleasing Personality," published in the forthcoming collection "The Science of Success."

He introduced his steps to having a "million-dollar personality" by explaining it was steel magnate Charles M. Schwab's charming demeanor that in the late 19th century elevated him from day laborer to an executive with a \$75,000 salary and a frequent million-dollar bonus (astronomical numbers for the time).

Schwab's boss, the legendary industrialist Andrew Carnegie said "the yearly salary was for the work Schwab performed, but the bonus was for what Schwab, with his pleasing personality, could get others to do," Hill writes.

Here are Hill's 14 habits of people who are so likable that others go out of their way to help them:

1. They develop a positive mental attitude and let it be seen and felt by others.
他们总是积极向上，并让他人看到和感受到。
It's often easier to give into cynicism, but those who choose to be positive set themselves up for success and have better reputations.
通常，一个人变得愤世嫉俗很容易，但有些人却选择了积极追求成功，并且获得了更好的声望。

2. They always speak in a carefully disciplined, friendly tone.
他们说话总是严谨并且友好
The best communicators speak deliberately and confidently, which gives their voice a pleasing sound.
最善于沟通的人说话总是经过深思熟虑并且很有自信，给人以愉悦的感觉。

3. They pay close attention to someone speaking to them.
他们密切关注跟他们交谈的人
Using a conversation as an opportunity to lecture someone "may feed the ego, but it never attracts people or makes friends," Hill says.
希尔说：“通过对话来教育他人可能会满足一下你的自尊心，但是绝不会吸引人或是成为朋友。”

4. They are able to maintain their composure in all circumstances.
他们总能够在任何场合保持冷静
An overreaction to something either positive or negative can give people a poor impression. In the latter case, says Hill, "Remember that silence may be much more effective than your angry words."
积极抑或是消极的过度反应会给人留下坏印象。如果是后者，希尔说：“记得沉默比愤怒的言辞更有效。”

5. They are patient.
他们都是有耐心的人。
"Remember that proper timing of your words and acts may give you a big advantage over impatient people," Hill writes.
希尔写到：“记得，和没耐心的人比等待合适的时机说话或行动将会是你的一大优势。”

6. They keep an open mind.
他们态度开明
Those who close themselves off from certain ideas and associate only with like-minded people are missing out on not only personal growth but also opportunities for advancing their careers.
思想闭塞和只凭自己喜好结交朋友的人不仅错失了个人的成长，更错失了事业前进的大好机会。

7. They smile when speaking with others.
和别人交谈时，他们总是面带微笑
Hill says that president Franklin D. Roosevelt's greatest asset was his "million-dollar smile," which allowed people to lower their guards during conversation.
希尔说罗斯福总统最大的遗赠是他价值百万的微笑，微笑使人在对话中放松警惕。

8. They know that not all their thoughts need to be expressed.
他们深知不是所有的想法都需要表达出来
The most likable people know that it's not worth offending people by expressing all their thoughts, even if they happen to be true.
人见人爱者知道，为了表达自己所有的想法而去得罪一个人是不值得的，即使你的想法是正确的。

9. They don't procrastinate.
他们办事从不拖沓
Procrastination communicates to people that you're afraid of taking action, Hill says, and are therefore ineffective.
拖延让人觉得你畏惧采取行动，希尔说，从而让人觉得你办事没效率。

10. They engage in at least one good deed a day.
他们坚持每天至少做一件好事
The best networkers help other people out without expecting anything in return.
最擅长社交的人总会不计回报的帮助他人。

11. They find a lesson in failure rather than brood over it.
面对失败他们吸取教训而不是一味懊丧
People admire those who grow from failure rather than wallow in it. "Express your gratitude for having gained a measure of wisdom, which would not have come without defeat," Hill says.
面对失败迎难而上而不是一蹶不振的人令人敬佩。“吃一堑，长一智，我们应该感谢失败”，希尔说。

12. They act as if the person they are speaking to is the most important person in the world.
谈话时，他们表现得好像在跟世界上最重要的人讲话。
The most likable people use conversations as an opportunity to learn about another person and give them time to talk.
人见人爱者总是把谈话当作了解一个人的机会并细细聆听。

13. They praise others in a genuine way without being excessive.
他们真诚且毫不夸张的赞美他人
"Praise the good traits of others, but don't rub it on where it is not deserved or spread it too thickly," Hill says.
“赞美别人的优点和值得赞美之处，切忌过分赞美，”希尔说。

14. They have someone they trust point out their flaws.
他们有信任的人为他们指出错误
Successful people don't pretend to be likable; they are likable because they care about their conduct and reputation. Having a confidant who can be completely honest with them allows them to continue growing
成功的人不会刻意去让人喜欢；受人喜欢是因为他们注意自己的行为和名声。他们有绝对诚实的密友敦促他们进步。