Tuesday 16 December 2014

大数据

(导读)科技的进步在很多的时候总会超出我们的想象,如果未来我们一个人拥有的电脑设备超过现在全球现在计算能力的总和,一个人产生的数据量超过现 在全球数据量的总和,甚至你的宠物小狗产生的信息量都超过现在全球数据量的总和,世界会发生什么呢?阅读本文,大数据(Big Data)会告诉你一个充满奇幻色彩的世界。

一、详解时髦词汇:大数据
似乎一夜之间,大数据(Big Data)变成一个IT行业中最时髦的词汇。
首先,大数据不是什么完完全全的新生事物,Google的搜索服务就是一个典型的大数据运用,根据客户的需求,Google实时从全球海量的数字资产(或 数字垃圾)中快速找出最可能的答案,呈现给你,就是一个最典型的大数据服务。只不过过去这样规模的数据量处理和有商业价值的应用太少,在IT行业没有形成 成型的概念。现在随着全球数字化、网络宽带化、互联网应用于各行各业,累积的数据量越来越大,越来越多企业、行业和国家发现,可以利用类似的技术更好地服 务客户、发现新商业机会、扩大新市场以及提升效率,才逐步形成大数据这个概念。
有一个有趣的故事是关于奢侈品营销的。PRADA在纽约的旗舰店中每件衣服上都有RFID码。每当一个顾客拿起一件PRADA进试衣间,RFID会被自动 识别。同时,数据会传至PRADA总部。每一件衣服在哪个城市哪个旗舰店什么时间被拿进试衣间停留多长时间,数据都被存储起来加以分析。如果有一件衣服销 量很低,以往的作法是直接干掉。但如果RFID传回的数据显示这件衣服虽然销量低,但进试衣间的次数多。那就能另外说明一些问题。也许这件衣服的下场就会 截然不同,也许在某个细节的微小改变就会重新创造出一件非常流行的产品。
从这个案例来看,大数据并不是很神奇的事情。就如同电影《永无止境》提出的问题:人类通常只使用了20%的大脑,如果剩余80%大脑潜能被激发出来,世界 会变得怎样?在企业、行业和国家的管理中,通常只有效使用了不到20%的数据(甚至更少),如果剩余80%数据的价值激发起来,世界会变得怎么样呢?特别 是随着海量数据的新摩尔定律,数据爆发式增长,然后数据又得到更有效应用,世界会怎么样呢?
单个的数据并没有价值,但越来越多的数据累加,量变就会引起质变,就好像一个人的意见并不重要,但1千人、1万人的意见就比较重要,上百万人就足以掀起巨大的波澜,上亿人足以改变一切。
中国的航班晚点非常多,相比之下美国航班准点情况好很多。这其中,美国航空管制机构一个的好做法发挥了积极的作用,说起来也非常简单,就是美国会公布每个 航空公司、每一班航空过去一年的晚点率和平均晚点时间,这样客户在购买机票的时候就很自然会选择准点率高的航班,从而通过市场手段牵引各航空公司努力提升 准点率。这个简单的方法比任何管理手段都直接和有效。
没有整合和挖掘的数据,价值也呈现不出来。《永无止境》中的库珀如果不能把海量信息围绕某个公司的股价整合起来、串联起来,这些信息就没有价值。
因此,海量数据的产生、获取、挖掘及整合,使之展现出巨大的商业价值,这就是我理解的大数据。在互联网对一切重构的今天,这些问题都不是问题。因为,大数 据是互联网深入发展的下一波应用,是互联网发展的自然延伸。目前,可以说大数据的发展到了一个临界点,因此才成为IT行业中最热门的词汇之一。
二、大数据将重构很多行业的商业思维和商业模式
我想以对未来汽车行业的狂野想象来展开这个题目。
在人的一生中,汽车是一项巨大的投资。以一部30万车、7年换车周期来算,每年折旧费4万多(这里还不算资金成本),加上停车、保险、油、维修、保养等各项费用,每年耗费应在6万左右。汽车产业也是一个很长产业链的龙头产业,这个方面只有房地产可以媲美。
但同时,汽车产业链是一个低效率、变化慢的产业。汽车一直以来就是四个轮子、一个方向盘、两排沙发(李书福语)。这么一个昂贵的东西,围绕车产生的数据却少的可怜,行业产业链之间几无任何数据传递。
我们在这里狂野地想象一番,如果将汽车全面数字化,都大数据了,会产生什么结果?
有些人说,汽车数字化,不就是加个MBB模块吗?不,这太小儿科了。在我理想中,数字化意味着汽车可以随时联上互联网,意味着汽车是一个大型计算系统加上 传统的轮子、方向盘和沙发,意味着可以数字化导航、自动驾驶,意味着你和汽车相关的每一个行动都数字化,包括每一次维修、每一次驾驶路线、每一次事故的录 像、每一天汽车关键部件的状态,甚至你的每一个驾驶习惯(如每一次的刹车和加速)都记录在案。这样,你的车每月甚至每周都可能产生T比特的数据。
好了,我们假设这些数据都可以存储并分享给相关的政府、行业和企业。这里不讨论隐私问题带来的影响,假设在隐私保护的前提下,数据可以自由分享。
那么,保险公司会怎么做呢?保险公司把你的所有数据拿过去建模分析,发现几个重要的事实:一是你开车主要只是上下班,南山到坂田这条线路是非繁华路线,红 绿灯很少,这条路线过去一年统计的事故率很低;你的车况(车的使用年限、车型)好,此车型在全深圳也是车祸率较低;甚至统计你的驾驶习惯,加油平均,临时 刹车少,超车少,和周围车保持了应有的车距,驾驶习惯好。最后结论是你车型好,车况好,驾驶习惯好,常走的线路事故率低,过去一年也没有出过车祸,因此可 以给予更大幅度的优惠折扣。这样保险公司就完全重构了它的商业模式了。在没有大数据支撑之前,保险公司只把车险客户做了简单的分类,一共分为四种客户,第 一种是连续两年没有出车祸的,第二种过去一年没有出车祸,第三种过去一年出了一次车祸,第四种是过去一年出了两次及以上车祸的,就四种类型。在大数据的支 持下,保险公司可以真正以客户为中心,把客户分为成千上万种,每个客户都有个性化的解决方案,这样保险公司经营就完全不同,对于风险低的客户敢于大胆折 扣,对于风险高的客户报高价甚至拒绝,一般的保险公司就完全难以和这样的保险公司竞争了。拥有大数据并使用大数据的保险公司比传统公司将拥有压倒性的竞争 优势,大数据将成为保险公司最核心的竞争力,因为保险就是一个基于概率评估的生意,大数据对于准确评估概率毫无疑问是最有利的武器,而且简直是量身定做的 武器。
在大数据的支持下,4S店的服务也完全不同了。车况信息会定期传递到4S店,4S店会根据情况及时提醒车主及时保养和维修,特别是对于可能危及安全的问题,在客户同意下甚至会采取远程干预措施,同时还可以提前备货,车主一到4S店就可以维修而不用等待。
对于驾驶者来说,不想开车的时候,在大数据和人工智能的支持下,车辆可以自动驾驶,并且对于你经常开的线路可以自学习自优化。谷歌的自动驾驶汽车,为了对 周围环境作出预测,每秒钟要收集差不多1GB的数据,没有大数据的支持,自动驾驶是不可想象的;在和周围车辆过近的时候,会及时提醒车主避让;上下班的时 候,会根据实时大数据情况,对于你经常开车的线路予以提醒,绕开拥堵点,帮你选择最合适的线路;到城市中心,寻找车位是一件很麻烦的事情,但未来你可以到 了商场门口后,让汽车自己去找停车位,等想要回程的时候,提前通知让汽车自己开过来接。
车辆是城市最大最活跃的移动物体,是拥堵的来源,也是最大的污染来源之一。数字化的车辆、大数据应用将带来很多的改变。红绿灯可以自动优化,根据不同道路 的拥堵情况自动进行调整,甚至在很多地方可以取消红绿灯;城市停车场也可以大幅度优化,根据大数据的情况优化城市停车位的设计,如果配合车辆的自动驾驶功 能,停车场可以革命性演变,可以设计专门为自动驾驶车辆的停车楼,地下、地上楼层可以高达几十层,停车楼层可以更矮,只要能高于车高度即可(或者把车竖起 来停),这样将对城市规划产生巨大的影响;政府还可以每年公布各类车型的实际排污量、税款、安全性等指标,鼓励民众买更节能、更安全的车。
电子商务和快递业也可能发生巨大的变化。运快递的车都可以自动驾驶,不用赶白天的拥堵的道路,晚上半夜开,在你家门口设计自动接收箱,通过密码开启自动投递进去,就好像过去报童投报一样。
这么想象下来,我认为,汽车数字化、互联网化、大数据应用、人工智能,将对汽车业及相关的长长的产业链产生难以想象的巨大变化和产业革命,具有无限的想象 空间,可能完全被重构。当然,要实现我所描述的场景,估计至少50年、100年之后的事情了,估计我这辈子是看不到的。
在这个章节的最后,我想总结一下自己对大数据的看法。
第一,大数据使企业真正有能力从以自我为中心改变为以客户为中心。企业是为客户而生,目的是为股东获得利润。只有服务好客户,才能获得利润。大数据的使用 能够使对企业的经营对象从客户的粗略归纳(就是所谓提炼归纳的“客户群”)还原成一个个活生生的客户,这样经营就有针对性,对客户的服务就更好,投资效率 就更高。
第二,大数据一定程度上将颠覆了企业的传统管理方式。现代企业的管理方式是来源于对军队的模仿,依赖于层层级级的组织和严格的流程,依赖信息的层层汇集、 收敛来制定正确的决策,再通过决策在组织的传递与分解,以及流程的规范,确保决策得到贯彻,确保每一次经营活动都有质量保证,也确保一定程度上对风险的规 避。
第三,大数据另外一个重大的作用是改变了商业逻辑,提供了从其他视角直达答案的可能性。现在人的思考或者是企业的决策,事实上都是一种逻辑的力量在主导起 作用。大数据给了我们其他的选择,就是利用数据的力量,直接获得答案。就好像我们学习数学,小时候学九九乘法表,中学学几何,大学还学微积分,碰到一道难 题,我们是利用了多年学习沉淀的经验来努力求解,但我们还有一种方法,在网上直接搜索是不是有这样的题目,如果有,直接抄答案就好了。很多人就会批评说, 这是抄袭,是作弊。但我们为什么要学习啊?不就是为了解决问题嘛。
第四,通过大数据,我们可能有全新的视角来发现新的商业机会和重构新的商业模式。我们现在看这个世界,比如分析家中食品腐败,主要就是依赖于我们的眼睛再 加上我们的经验,但如果我们有一台显微镜,我们一下就看到坏细菌,那么分析起来完全就不一样了。大数据就是我们的显微镜,它可以让我们从全新视角来发现新 的商业机会,并可能重构商业模型。我们的产品设计可能不一样了,很多事情不用猜了,客户的习惯和偏好一目了然,我们的设计就能轻易命中客户的心窝;我们的 营销也完全不同了,我们知道客户喜欢什么、讨厌什么,更有针对性。特别是显微镜再加上广角镜,我们就有更多全新的视野了。这个广角镜就是跨行业的数据流 动,使我们过去看不到的东西都能看到了。
最后一点,我想谈的是大数据发展对IT本身技术架构的革命性影响。大数据的根基是IT系统。我们现代企业的IT系统基本上是建立在IOE(IBM小型机、 Oracle数据库、EMC存储)+Cisco模型基础上的,这样的模型是Scale-UP型的架构,在解决既定模型下一定数据量的业务流程是适配的,但 如果是大数据时代,很快会面临成本、技术和商业模式的问题,大数据对IT的需求很快就会超越了现有厂商架构的技术顶点,超大数据增长将带来IT支出增长之 间的线性关系,使企业难以承受。因此,目前在行业中提出的去IOE趋势,利用Scale-out架构+开源软件对Scale-up架构+私有软件的取代, 本质是大数据业务模型所带来的,也就是说大数据将驱动IT产业新一轮的架构性变革。去IOE潮流中的所谓国家安全因素,完全是次要的。
所以,美国人说,大数据是资源,和大油田、大煤矿一样,可以源源不断挖出大财富。而且和一般资源不一样,它是可再生的,是越挖越多、越挖越值钱的,这是反自然规律的。对企业如此,对行业、对国家也是这样,对人同样如此。
三、新智慧生物的诞生?
自然语言的机器翻译,是长期以来人工智能研究的一个重要体现。人工智能从过去到未来都有清晰而巨大的商业前景,是以前IT业的热点,其热度一点不亚于现在的“互联网”和“大数据”。但是,人类过去在推进人工智能的研究遇到了巨大的障碍,最后几乎绝望。
当时人工智能就是模拟人的智能思考方式来构筑机器智能。以机器翻译来说,语言学家和语言专家必须不辞劳苦地编撰大型词典和与语法、句法、语义学有关的规 则,数十万词汇构成词库,语法规则高达数万条,考虑各种情景、各种语境,模拟人类翻译,计算机专家再构建复杂的程序。最后发现人类语言实在是太复杂了,穷 举式的做法根本达不到最基本的翻译质量。这条道路最后的结果是,1960年代后人工智能的技术研发停滞不前数年后,科学家痛苦地发现以“模拟人脑”、“重 建人脑”的方式来定义人工智能走入一条死胡同,这导致后来几乎所有的人工智能项目都进入了冷宫。
后来有人就想,机器为什么要向人学习逻辑呢,又难学又学不好,机器本身最强大的是计算能力和数据处理能力,为什么不扬长避短、另走一条道路呢?这条道路就 是IBM“深蓝”走过的道路。1997年5月11日,国际象棋大师卡斯帕罗夫在和IBM公司开发的计算机“深蓝”进行对弈时宣布失败,计算机“深蓝”因此 赢得了这场意义深远的“人机对抗”。
类似的逻辑在后续也用到了机器翻译上。谷歌、微软和IBM都走上了这条道路。就是主要采用匹配法,同时结合机器学习,依赖于海量的数据及其相关相关统计信息,不管语法和规则,将原文与互联网上的翻译数据对比,找到最相近、引用最频繁的翻译结果做为输出。
总而言之,利用这种技术,计算机教会自己从大数据中建立模式。有了足够大的信息量,你就能让机器学会做看上去有智能的事情,别管是导航、理解话语、翻译语言,还是识别人脸,或者模拟人类对话。
假设目前刚刚兴起的穿戴式计算设备取得巨大的进展。这种进展到什么程度呢?就是你家的宠物小狗身上也装上了各种传感器和穿戴式设备,比如有图像采集,有声 音采集,有嗅觉采集,有对小狗的健康进行监控的小型医疗设备,甚至还有电子药丸在小狗的胃中进行消化情况监控。小狗当然也联上网,也一样产生了巨大的数据 量。这时,我们假设基于这些大数据建模,能够模拟小狗的喜怒哀乐,然后还能够通过拟人化的处理进行语音表达,换句话说,就是模拟小狗说人话,比如主人回家 时,小狗摇尾巴,旺旺叫,那么这个附着于小狗身上的人工智能系统就会说,“主人,真高兴看到你回家”。不仅如此,你还可以和小狗的人工智能系统进行对话, 因为这个人工智能系统能基本理解你的意思,又能够代替小狗拟人化表达。
我们继续把这个故事来做延伸,把小狗换成未来的人,人在一生中产生大量的数据,根据这些数据建模可以直接推演出很多的结论,比如喜欢看什么样的电影啊,喜欢什么口味的菜啊,在遇到什么问题时会怎么采取什么行动啊。
这样的数据一直累积下来,直到这个人去世。我们有个大胆的想象,这些巨大的数据能否让这个人以某种方式继续存在下去呢?后代有什么问题需要寻求答案的时 候,比如在人生的关键抉择时,比如大学要上什么专业、该不该和某个姑娘结婚,可不可以问问这个虚拟的人(祖先)有什么建议呢?答案是当然可以。在这种情况 下,数字化生存不仅在人生前存在,也可以在人死后继续存在。人死了,可以在虚拟空间中继续存在。一辈子、一辈子的人故去,这些虚拟的智慧都可以继续存在, 假设很多年过去了,这些虚拟智慧的祖宗们太多太多了,活着的子孙们甚至可以组建一个“祖宗联席参谋委员会”,优选那些考得好的(比如中过状元),当过国家 高级公务员(比如太守)、当过企业高管(比如CEO)、当过教授、当过作家的等等当过成功人士的祖宗,专门用于后代的咨询、解惑。让这些祖宗死后还有竞 争,别死了就没有事情干了。
这些说明什么呢?就是随着大数据和机器学习的进一步进展,这个世界出现了新的智慧生物!大数据和机器学习在改变、重构和颠覆很多企业、行业和国家以后,终于到了改变人类自身的时候了!人类的演进出现了新的分支!
有科学家画了下面一张图,来描述这两者智慧生物。一种是基于生物性的,经过几百万年的进化而来;一种是基于IT技术,基于大数据和机 器学习,通过自模拟、自学习而来。前者更有逻辑性,更有丰富的情感,有创造力,但生命有限;后者没有很强的逻辑性,没有生物上的情感,但有很强的计算、建 模和搜索能力,理论上生命是无限的。
当然,这些事情要发生都会非常非常遥远。反正我们活着的时候是见不到了,死了也见不到,因为我们死的时候,我相信这种建立在大数据和机器学习之上的虚拟生命还不会存在。
四、结束语
我最后想说的是,我们对未来的认知,主要是基于常识和对未来的想象。根据统计,现在《纽约时报》一周的信息量比18世纪一个人一生所收到的资讯量更大,现 在18个月产生的信息比过去5000年的总和更多,现在我家一台5000元电脑的计算能力比我刚入大学时全校的计算能力更强大。科技的进步在很多的时候总 会超出我们的想象,试想如果未来我们一个人拥有的电脑设备超过现在全球现在计算能力的总和,一个人产生的数据量超过现在全球数据量的总和,甚至你的宠物小 狗产生的信息量都超过现在全球数据量的总和,世界会发生什么呢?那就取决于你的想象力了。

10 Things To Do After Installing Ubuntu 14.04 Trusty Tahr To Get A Near Perfect Desktop

Note: This is from http://www.webupd8.org/2014/04/10-things-to-do-after-installing-ubuntu.html
 
Ubuntu 14.04 LTS (Trusty Tahr) will be released tomorrow and since many of you will install it as soon as it's released (or maybe you're already using Ubuntu 14.04), here's a list of 10 useful things to do to get a near perfect desktop.

Ubuntu 14.04 things to do

While the tweaks below are targeted at Unity, many of them also work with other Ubuntu flavors like Xubuntu, Kubuntu, Lubuntu or Ubuntu GNOME.

Update: the instructions / things to do below also apply for the latest Ubuntu 14.10 (Utopic Unicorn), except for:
  • 1.2 (Pidgin Indicator is no longer required because Pidgin now ships with a Unity integration plugin; you can still use Pidgin Indicator if you want though);
  • 3.1 (Firefox now supports H224 without any tweaks);
  • 4.1 (you can continue to use Pipelight for various web services that require Silverlight, but that's no longer required for Netflix - to use Netflix with HTML5, simply install Google Chrome and it should work without any additional tweaks - that's now also the case for Ubuntu 14.04).



1. Install Ubuntu AppIndicators (applets)


Ubuntu ships with just a few indicators by default because well, it can't guess what everybody needs. So here are some indicators you might find useful.

1.1 Calendar Indicator is one of my favorite Ubuntu indicators. This AppIndicator displays your 10 upcoming events in the indicator menu, can add new events (which of course, are synced with Google Calendar) and it has a complete calendar view where you can see all your Google Calendar events, edit or add new events, etc.

Google Calendar Indicator

To install Calendar Indicator in Ubuntu 14.04, use the following commands:
sudo add-apt-repository ppa:atareao/atareao
sudo apt-get update
sudo apt-get install calendar-indicator

1.2 Pidgin may not be the default IM client for a few Ubuntu releases, but it's still a very popular application. Pidgin uses a tray icon by default but you can now use an AppIndicator which is especially useful since the old Unity systray whitelist is no longer available.

Pindgin Indicator

Pidgin Indicator is not an part of Pidgin by default but it works great and you can install it in Ubuntu 14.04 by using the main WebUpd8 PPA:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install pidgin-indicator
Once installed, open Pidgin and from its menu select Tools > Plugins, then scroll down until you see a plugin called "Ubuntu Indicator" and enable this plugin.


1.3 Since Ubuntu doesn't ship with a weather indicator, I recommend My Weather Indicator, an appindicator that displays the current weather on the Unity top panel. The tool can also display a 5-day forecast (it depends on which Weather service you use), it comes with some very nice (optional) desktop widgets and more.

My Weather Indicator

To install it in Ubuntu 14.04, use the following commands:
sudo add-apt-repository ppa:atareao/atareao
sudo apt-get update
sudo apt-get install my-weather-indicator

1.4 Variety is more of a fully featured application than just a simple AppIndicator, but I'll add it here anyway since I'm sure many of you will love it.

Variety Wallpaper Changer

Variety is a wallpaper changer that automatically downloads and changes your wallpaper on a given interval. Using it, you'll get cool, fresh wallpapers each day. Or each hour. Or... well, it's up to you when the wallpaper changes. From the AppIndicator menu you can quickly switch to the next (random) wallpaper or copy the wallpaper to favorites, for later use.

To install Variety in Ubuntu, use the following commands:
sudo add-apt-repository ppa:peterlevi/ppa
sudo apt-get update
sudo apt-get install variety

1.5 Cpufreq Indicator is the equivalent of the old GNOME CPU frequency scaling applet which can be used for changing the CPU frequency on-the-fly. Install it in Ubuntu by clicking the button below:

Download for Ubuntu

Or install it from the command line:
sudo apt-get install indicator-cpufreq

Cpufreq indicator

Note that Cpufreq Indicator doesn't work with Intel P-State (see 8.2).

For more Ubuntu indicators, see our AppIndicator tag.


2. Tweak Unity


2.1 Some Unity settings are available in the Appearance settings, some in CCSM, some can only be accessed via Dconf and so on. With Unity Tweak Tool, you have access to almost all these settings in one place, using a very nice user interface.

Unity Tweak Tool

Unity Tweak Tool allows you to change various Unity settings, like auto-hide behavior, tweak the Dash, the Unity Launcher or HUD, change window snapping and hot corner settings, change the GTK and icon theme, access various font settings and more.

To install Unity Tweak Tool from the Ubuntu Software Center, click the button below:

Download for Ubuntu

Or, install it in Ubuntu 13.10 via command line:
sudo apt-get install unity-tweak-tool


2.2 Privacy

By default, Dash displays all the recently accessed files along with other files found on your system. But you can change this by selecting Security & Privacy from System Settings, and then tweak everything to suit your needs:

Ubuntu Privacy

On the Search tab, you can select to disable online search results from being displayed in Dash. However, you may want to use some scopes so instead of completely disabling this, you can open Dash and on the applications lens (the second lens) click "Filter results", then select "Dash plugins" - here, you can enable/disable any Dash plugin you want:

Ubuntu Dash Plugins

To disable a plugin, click it and then simply click "Disable":

Ubuntu Dash Plugins

If you want to disable the shopping suggestions, you can run the following command in a terminal:
gsettings set com.canonical.Unity.Lenses disabled-scopes "['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope', 'more_suggestions-populartracks.scope', 'music-musicstore.scope', 'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope', 'more_suggestions-skimlinks.scope']"


2.3 An option to enable minimize on click for the Unity Launcher was one of the most requested Ubuntu features and you can now enable this in Ubuntu 14.04.

Update: Unity Tweak Tool was updated with an option to enable minimize on click for the Unity Launcher.

To enable minimize on click for the Unity Launcher (Unity Tweak Tool doesn't support this yet), install CompizConfig Settings Manager. You can install it by clicking the button below:

Download for Ubuntu

Or, to install it via command line, use:
sudo apt-get install compizconfig-settings-manager

Then, open CompizConfig Settings Manager from Dash, click the "Ubuntu Unity Plugin" and on the Launcher tab, enable "Minimize single window applications (unsupported)":

CCSM

Note that this feature only works with single window applications.

2.4 Try the new locally integrated menus (LIM)

Ubuntu 14.04 ships with a new (non-default) type of menu called "LIM", or "locally integrated menu". Locally integrated menus are displayed in the window decorations for unmaximized windows, instead of the default Unity approach which is to display the menu on the top panel, and are displayed on mouse over.

Ubuntu locally integrated menus

Since the Unity global menu is not appreciated by everybody, maybe you'll find LIM better, so give it a try. To enable it, open System Settings > Appearance and on the Behavior tab, select to show the menus "in the window's title bar":

Ubuntu locally integrated menus


3. Fixes


3.1 Get Firefox to support H.264

The FFmpeg plugin for GStreamer 0.10 is not available in the official Ubuntu 14.04 repositories (because FFMpeg is not available either - libav is used instead) and because of this, Firefox doesn't support the H.264 codec.

Furthermore, without the FFmpeg plugin for GStreamer 0.10 package, KDE apps can't play H.264 videos in Kubuntu 14.04 if they use the GStreamer backend. Another issue with this is that Amarok can't play WMA files. There might also be other affected applications.

Before:

Firefox h.264

After:

Firefox h.264

To "fix" this, all you need is install the "gstreamer0.10-ffmpeg" package and its dependencies. If you've upgraded from an older Ubuntu version, this package might already be installed but if this is a fresh install, you can get the package from a PPA. Add the PPA and install it using the following commands:
sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg

3.2 Fix Skype not using the correct system theme on 64bit

On 64bit Ubuntu systems, Skype uses the Clearlooks theme instead of the default Ubuntu theme, Ambiance (this also happens with other themes).

This occurs because Skype is a 32bit application and the GTK2 theme engine (Murrine or Pixmap in most cases) is not installed for 32bit.

Before:

Skype broken theme 64bit Ubuntu

After:

Skype fixed theme 64bit Ubuntu

To fix this, you need to install the 32bit Murrine and Pixmap GTK2 engines:
sudo apt-get install gtk2-engines-murrine:i386 gtk2-engines-pixbuf:i386

3.3 Fix missing Skype tray icon / appindicator on Ubuntu 64bit


On 64bit, the required package to get a Skype tray / appindicator icon is not installed automatically. To fix this, use the following command:
sudo apt-get install sni-qt:i386
The Skype tray icon might disappear after you log in, but it should show up after a few seconds.


4. Web browser (Firefox, Google Chrome / Chromium) tweaks


4.1 Firefox, Google Chrome/Chromium: if you want to use services such as Netflix, Maxdome and others, you can use Pipelight. Pipelight lets you use Microsoft Silverlight, Widevine (the built-in Chrome Widevine doesn't work with many websites), and more with native Linux web browsers (Pipelight itself uses Wine).

Netflix Ubuntu

Before installing Pipelight, it's strongly recommended to close your web browser. Without doing this, the plugin may fail to install or crash the browser (you can copy the instructions below to a text editor).

To install Pipelight in Ubuntu 14.04, you can use its official PPA. Add the PPA and install Pipelight using the commands below:
sudo apt-add-repository ppa:pipelight/stable
sudo apt-get update
sudo apt-get install pipelight-multi

Then, install the Silverlight plugin using the following command:
sudo pipelight-plugin --enable silverlight

To install the Widevine plugin, use the command below:
sudo pipelight-plugin --enable widevine


A lot more about Pipelight, here: Pipelight: Use Silverlight In Your Linux Browser To Watch Netflix, Maxdome Videos And More


4.2 Chromium will soon stop using the Netscape Plugin API, and as a result, the Linux Adobe Flash will stop working. To get Flash working in Chromium, you can use the Pepper Flash Player installer (Pepper Flash is extracted from Google Chrome), which is available in the official Ubuntu 14.04 repositories. To install it, use the following commands:
sudo apt-get install pepperflashplugin-nonfree
sudo update-pepperflashplugin-nonfree --install

Chromium Pepper Flash Ubuntu

For more about this, see: Pepper Flash Player Installer For Chromium Available In The Ubuntu 14.04 Repositories

4.3 Firefox doesn't use native notifications under Linux. A work-around for this issue is to use GNotifier, a Firefox extension that makes the browser use native notifications on the Linux desktop. The extension currently supports GNOME (Shell), Unity, KDE and Xfce.

Firefox native notifications GNOME Shell

Firefox native notifications Unity

The extension is available HERE and doesn't require restarting the browser after it's installed.


5. LibreOffice tweaks


LibreOffice has 2 cool features (well, one of them isn't exactly a feature but anyway) that aren't enabled by default: a sidebar that enables quick access to document styles, formatting, etc. and a cool new monochrome icon set.

LibreOffice sifr

5.1 To enable the LibreOffice sidebar, simply select View > Sidebar from the LibreOffice menu.

5.2 To use the monochrome icon set, firstly install it by clicking the button below:

Download for Ubuntu

Or, install it via the command line using:
sudo apt-get install libreoffice-style-sifr

And then to activate it, from the LibreOffice menu select Tools > Options > LibreOffice > View and select "Sifr" under "Icon size and style":


6. Nautilus "tweaks"


The heading says "tweaks" in quotes because one of them is not exactly a tweak, but a replacement.


6.1 Use the search / type-ahead feature that suit your needs

In Ubuntu 14.04, Nautilus was patched to use type-ahead find instead of its default behavior for a few Nautilus releases, which is recursive search. However, there's a Dconf option you can use to switch between these two behaviors.

Type-ahead find allows to type the name of a directory or file in the file manager to select it without searching in the sub-folders while the recursive search is, like the name suggests, a search inside the current folder and all its sub-folders.

Nautilus recursive search
Recursive search

Nautilus type-ahead find
Type-ahead find

To switch to recursive search in Nautilus under Ubuntu 14.04, use the following command:
gsettings set org.gnome.nautilus.preferences enable-interactive-search false

If you want to switch back to type-ahead find ("interactive search"), use the command below:
gsettings set org.gnome.nautilus.preferences enable-interactive-search true

More info: Nautilus Type-Ahead Find Feature Enabled By Default In Ubuntu 14.04

6.2 If you don't like Nautilus 3.10, switch to Nemo

As you know, Ubuntu 14.04 uses Nautilus 3.10 as the default file manager. Nautilus is nice, but it lacks many features it once used to have, like the dual pane view (which was triggered using F3). You can get this back by using Nemo, which I patched to work properly under Unity and to get rid of the Cinnamon dependencies (the original patches were created by Jacob Zimmermann, I just updated them for a newer Nemo version and added some other patches for better desktop integration).

Nemo file manager

Since there are some quite a few things you should know before replacing Nautilus with Nemo in Ubuntu 14.04, I won't post the instructions here, but you can read all about it in an article I posted a while back: Install Nemo With Unity Patches (And Without Cinnamon Dependencies) In Ubuntu (it includes instructions for replacing Nautilus with Nemo, installing some Nemo extensions as well as how to revert the changes in case you want to go back to Nautilus as the default file manager).



7. Nvidia Optimus tweaks


Note for AMD hybrid graphics users: you can use fglrx-pxpress and AMD Indicator which are basically the equivalents of the tweaks below for AMD, but since my laptop uses Nvidia Optimus, it means I can't test this on AMD hybrid graphics so I won't post instructions here. See the Ubuntu wiki for more info.

7.1 Switch between Nvidia and Intel graphics

Installing nvidia-prime can get your system to boot in low graphics mode if it's not used properly so be careful. This should be considered an "expert" feature and should only be used by those who know how to fix their system in case something goes wrong!

It's also important to note that you need to use LightDM (so this won't work for Ubuntu GNOME users by default because it uses GDM - you'll need to switch to LightDM) and the proprietary Nvidia drivers!

In Ubuntu 14.04, you can switch between the Nvidia and Intel graphics from the Nvidia Settings. Firstly, install nvidia-prime:
sudo apt-get purge bumblebee*
sudo apt-get install nvidia-prime
(the first command makes sure all the Bumblebee packages were purged - without this, nvidia-prime won't work)

Then simply open Nvidia Settings, select "PRIME Profiles" on the left and select the graphics card you want to use:

Ubuntu Nvidia Settings Prime profiles

Note that switching between CPUs requires a logout so you can't for instance run the desktop using the Intel graphics while running a game using the Nvidia graphics under the same session. For that you can continue to use Bumblebee, but unfortunately you can't use both, so remove nvidia-prime if you want to use Bumblebee.

7.2 Prime Indicator (requires the nvidia-prime package, see 7.1)

Ubuntu Prime indicator

To quickly switch between the Intel and Nvidia graphics or see which graphics card is currently in use, you can use Prime Indicator. You can install it in Ubuntu 14.04 using the following commands:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install prime-indicator


8. Laptop tweaks


8.1 Improve battery life

There are various tweaks that you can apply to your laptop to save battery power, but many of them depend on the hardware, Linux distribution, some are outdated or too hard to apply for regular users and so on.

TLP is an advanced power management command line tool for Linux that tries to apply these settings / tweaks for you automatically, depending on your Linux distribution and hardware.

To install TLP in Ubuntu 14.04, use the commands below:
sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get install tlp tlp-rdw
sudo tlp start
Important: make sure laptop-mode-tools is not installed (simply run "sudo apt-get remove laptop-mode-tools" and it will be removed if it's installed), as it conflicts with TLP.

For more information, see our article on TLP.


8.2 Thermald + Intel P-State

While some users have reported that their laptops actually get a bit hotter using this, but that they get better performance with Thermald + Intel P-State (see the comments), for my laptop, this has done wonders and I can say that my now quite old laptop was never cooler. That of course might not be the case for you (since it depends on your hardware), but you can give it a try and see for yourself.

Since the instructions are pretty long, I won't post them here. Instead, see our Thermald + Intel P-State article.


9. Install codecs, Java and encrypted DVD playback


9.1 To be able to play most audio and video formats, install Ubuntu Restricted Extras by clicking the button below:

Download for Ubuntu

Or install it using the following command:
sudo apt-get install ubuntu-restricted-extras

9.2 I suggest to also install the unrestricted version of libavcodec so you don't encounter issues with missing codecs when trying to use some video editors or transcoders - install them by clicking the button below:

Download for Ubuntu

Or by using the following command:
sudo apt-get install libavcodec-extra

9.3 You may also need Java, but you must figure out what you need. Most users will only need OpenJRE and the Java browser plugin which you can install by clicking the button below:

Download for Ubuntu

Or by using the following command:
sudo apt-get install icedtea-7-plugin openjdk-7-jre

For development, you'll also want OpenJDK which you can install by using the button below:

Download for Ubuntu

Or by using the following command:
sudo apt-get install openjdk-7-jdk

If for various reasons, you need Oracle Java (the package includes JDK, JRE and the browser plugin), you can install Oracle Java 7 by using the following commands:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

9.4 Encrypted DVD playback: the Medibuntu repository no longer exists and while most packages in the Medibuntu archive are obsolete or unnecessary because most are now in the official Ubuntu repositories or have better equivalents, livdvdcss is still required for playing encrypted DVDs. 

You can enable encrypted DVD playback in Ubuntu 14.04 by using the following commands:
sudo apt-get install libdvdread4
sudo /usr/share/doc/libdvdread4/install-css.sh


10. Other tweaks / things to install


10.1 As you probably know by now, Ubuntu One will be shut down. If you were using this cloud storage service, there are many alternatives you can use, which work under Linux. Dropbox is probably the most popular, but you can also use Google Drive, which is getting better and better and it's cheap too if you want some extra space (you also get 15GB of free storage).

Ubuntu Google Drive

There's no official Google Drive client for Linux (yet), but you can use a tool like Insync (paid), or Google Drive Ocamlfuse, a tool that lets you mount Google Drive in Linux. To install Google Drive Ocamlfuse in Ubuntu 14.04, use the following commands:
sudo add-apt-repository ppa:alessandro-strada/ppa
sudo apt-get update
sudo apt-get install google-drive-ocamlfuse

Once it's installed, you'll firstly need to authorize it with Google, by running the following command:
google-drive-ocamlfuse
This should open a tab in your default web browser, asking to allow google-drive-ocamlfuse to access your Google Drive. Click "Allow", wait a few seconds for google-drive-ocamlfuse to retrieve the authorization code and you're done.

Now let's mount Google Drive. Create a folder in your home directory, let's call it "gdrive":
mkdir ~/gdrive

And mount Goole Drive using the command below:
google-drive-ocamlfuse ~/gdrive

That's it.

More info: Mount Google Drive In Linux With google-drive-ocamlfuse

10.2 If you're constantly getting crash report popups, disable Apport

Apport is disabled by default in stable released according to THIS (thanks Silviu!) however, it's not disabled if you've installed an alpha, beta or daily build.

Reporting bugs is important for Ubuntu, but if you get a large number of crash reports and nothing is actually crashing, you can disable error reporting. To do this, you need to edit "/etc/default/apport" with a text editor such as Gedit (as root):
gksu gedit /etc/default/apport
and change "enabled" from "1" to "0", then save the file.

After completing the steps above, Apport won't be started at boot any more, but let's stop the running Apport process too, so you don't have to wait until you restart your computer:
sudo service apport stop

More info: How To Get Rid Of Internal System Error Apport Popups In Ubuntu


10.3 Unity global menu & HUD support for Java swing applications

Unity global menu java swing applications

Unity HUD java swing applications


By default, Java Swing applications (IntelliJ IDEA, Android Studio, jDownloader and others) don't support Unity global menu (AppMenu) / HUD. You can get these features though, by using JAyatana, which you can install in Ubuntu 14.04 by using the following commands:
sudo add-apt-repository ppa:danjaredg/jayatana
sudo apt-get update
sudo apt-get install jayatana
Once installed, log out and log back in.

More info: Get Unity Global Menu / HUD Support For Java Swing Applications With JAyatana

10.4 Adobe Flash Player (YouTube and a few other websites only, it seems) hardware acceleration with Intel graphics

libvdpau-va-gl is a VDPAU driver that uses OpenGL under the hood to accelerate drawing and scaling, and VA-API (if available) to accelerate video decoding.

Using it, you can get hardware acceleration on some Intel graphics cards for Mplayer (well, we already have mplayer-vaapi but it hasn't been merged) and even Adobe Flash Player. That means a lot less CPU usage.

For instance, in my test, a full-screen 1080p flash YouTube video used around 160-170% CPU without libvdpau-va-gl and about 14-17% CPU when using libvdpau-va-gl:

libvdpau-va-gl1

Since there are a few things you should know and the instructions include 2 use cases, I won't post the instructions here and instead, I'll add a link to our libvdpau-va-gl article: Adobe Flash Player Hardware Acceleration on Intel Graphics Cards

Skype doesn't show up on ubuntu upper panel

If you also find your skype doesn't show up on ubuntu upper panel, 
here is the way to get it back. 
 
 
$ sudo apt-get install sni-qt:i386

Friday 21 November 2014

Obama行政命令的中文版,移民问责行政命令。

移民问责行政命令
白宫 新闻秘书办公室 2014年11月20日

总统的移民行政命令将帮助保障边界安全,让500万无证移民承担责任,保证每个人都遵守同样的法律。总统在他的权力范围内采取这一重要行动,用以补救我们失效的移民制度。
这一行政命令打击边境的非法移民,将遣返的重点放在罪犯而不是家庭成员上,要求某些无证移民通过犯罪背景调查,补税,在美国进行临时登记而不用害怕遭到遣返。
这些是符合常识的步骤,但只有国会才能完成这项工作。在总统采取行动之后,他将继续与国会合作,推出一个完整的、得到两党支持的法案,类似与参议院一年之前通过的法案。这个新法案能够代替总统的命令,并修补好整个系统。
总统行政命令的三个关键要点:
• 打击边境非法移民:总统的命令增加了逮捕试图非法越境者并将他们遣返的机会。继续增加力量,像今年夏天那样有效地减少非法单独入境的儿童。总统的命令将把边境安全指挥与控制系统集中起来,继续打击非法移民。
• 遣返罪犯,而非家庭成员:总统的命令聚焦在遣返那些威胁国家与公共安全的人。他已经指示移民执法机构去将下列这些人放在首先遣返的名单上,包括恐怖嫌疑分子、暴力罪犯、犯罪团伙成员、以及最近非法越境的人。
• 问责——犯罪背景调查与纳税:总统也将让那些在美国境内居住了五年以上、而且子女为美国公民或者合法永久居民的无证移民为自己负责。在登记并通过犯罪与国家安全背景调查之后,数百万无证移民将开始合理纳税,并且能够临时居住在美国,每期三年,无需担心被遣返。
总统的命令也会简化合法移民手续,以刺激经济并鼓励那些合格的人归化为美国公民。
在半个多世纪里,每位总统,无论是民主党人还是共和党人,都使用过他的合法权力处理移民事务。奥巴马总统如今也采取了符合常识的步骤。当行政当局采 取这些行动的时候,国会应该完成自己的工作,通过一个类似于参议院有两党支持的议案:增加两万名边境巡逻警察,加强边境安全;打击雇用无证移民的企业;开 辟出一条无证移民可以成为公民的通道,这些无证移民必须合法纳税并缴纳罚款、通过背景调查、学习英文、重新排队等待移民;减少繁文缛节、简化移民程序,以 刺激经济,保证家庭团聚。
在边境阻止非法移民进入
奥巴马政府的国土安全部用于西南部边界安全的资源达到了历史最高水平。目前我们在西南边界增加了3000名边界巡逻人员;我们的边界围栏、无人驾驶 飞行监视体系和地面监视体系自2008年都增加了一倍以上。总的来说,我们过去六年增加的地面人员、技术,以及资源体现了比我们国家历史上任何时候都更 大、更有持续性的维护边境安全的努力,使非法越境活动减少一半以上。
这些措施产生了效果。1990年到2007年,美国的非法移民人口从350万增加到了1100万。此后,非法移民人口几十年来第一次没有再继续增 长。边界安全的重要指标之一-- 边界拘捕率降到了1970年代以来的最低水平。今年夏天,总统与行政当局针对大批未成年人涌入美国采取了大胆、协调的联邦行动,重点放在加强阻吓,加强执 法,国际合作,增强联邦机构的能力,以确保边境安全。结果,企图越过西南边界进入美国的未成年人大幅减少,政府继续投入力量,避免今后再出现这种情况。
为了在这些努力的基础上继续发展,确保有效利用我们有限的执法力量,总统宣布了如下措施:
• 将资源转用于边界和近期越境者。今年夏天,国土安全部派遣了数百名边界巡逻人员和美国移民与海关执法人员到西南部边界。同时,司法部再次下令移民法庭优先 处理递解近期越境者出境的案件。这项持续努力将有助于维护我们的边界安全。此外,约翰逊部长将宣布一项新的《南部边界运动计划》,该计划将加强那些维护边 界安全的相关部门的工作。通过建立更为清晰的内部执法重点,国土安全部增强了抓捕并遣返企图非法越境者的可能性。
• 简化移民法庭程序。司法部还宣布了一套移民法庭改革方案。通过与国土安全部合作,更快地裁决那些符合新的国土安全部执法重点的个人案件,结束那些属于非重 点的个人案件,以便解决未处理案件积压问题。司法部还将制定规定,采纳最佳法庭系统工作方式,尽可能有效利用有限的法庭审理时间。
• 护犯罪和人口贩运的受害者以及劳工。劳工部将扩大并加强那些配合政府调查的犯罪受害者(U签证)和人口贩运受害者(T签证)的移民选择。一个跨部门工作组还将找寻方法,确保劳工获得他们的劳动和雇佣权益而无需担心遭受报复。
递解罪犯出境,而不是家庭成员
通过设定当务之急,集中使用执法力量,奥巴马政府递解出境的罪犯已经增加80%以上。这些行动通过如下措施取得了有力的成绩:
• 集中力量消除对于国家安全、边界安全和公共安全的威胁。为了更好地集中力量处理重要的当务之急,约翰逊部长向整个国土安全部发出新的备忘录,明确要求政府 的执法活动应该集中对付国家安全威胁、重罪犯和最近偷越国界的人。国土安全部将使用所有执法力量争取消除这些最大的威胁。
• 实施一项新的当务之急执法计划。有效识别和递解在各州和地方监狱中的罪犯是一项重要目标,但是实现这个目标的途径必须取得社区的信任。为了消除那些影响与 国土安全部合作的各个州长、市长、执法部门和社区领袖们的担忧,约翰逊部长使用一项新的《当务之急执法计划》取代现行的《安全社区计划》,以便递解刑事 犯。国土安全部将继续依靠生物识别数据确认重点执法对象,并且会同司法部监狱局合作,尽快识别和递解正在服刑的联邦罪犯。
问责—犯罪背景调查和纳税
自艾森豪威尔总统以来,每一位民主党人或者共和党人总统都对移民事务颁发过行政命令。与这种长期传统相一致,国土安全部将扩大现行的《童年来美暂缓 递解行动》,将更多抵达美国时还是儿童的移民包括进来。国土安全部还将制定一个新的延迟采取行动计划,对象是美国公民或者合法永久居民的父母、而且在美国 生活了5年以上的人,条件是他们登记,通过背景调查,并且纳税。
奥巴马总统正在采取如下行动来对一些无证移民进行问责:
• 创建一套机制,规定一些非法移民需要通过背景调查,以确保他们开始缴纳他们应缴的税款。为了促进公众安全,国土安全部正在为美国公民或者合法永久居民的父 母、而且在美国居住的时间超过5年、不是执法重点的人建立一套新的延迟采取行动方案。他们如果登记,提交生物识别数据,通过背景调查,缴费,并证明他们的 子女是在本声明发出以前出生的,就有机会申请每期三年的暂缓递解和工作许可。通过为个人提供走出阴影,合法工作的机会,也将有助于帮助打击雇佣无证员工的 公司。这样做损害所有工人的工资。我们也可以确保这些人遵规守矩,缴纳他们应缴纳的税款。
• 扩大《童年来美暂缓递解行动》(DACA ),以覆盖更多的《梦想法案》受益者。根据最初的《童年来美暂缓递解行动》项目,童年时来美、在美国居住至少5年,满足特定教育和公众安全标准的人有资格 申请暂缓递解,前提是他们在1981年之后出生,2007年6月15日前来到美国。国土安全部正在扩大《童年来美暂缓递解行动》项目,使那些童年时被带到 美国,2010年1月1日前进入美国的人均可申请,不论他们现在是多大年纪。《童年来美暂缓递解行动》暂缓项目的时效同样为三年。
奥巴马总统还将通过如下手段简化合法移民程序,促进我们的经济并推动公民归化入籍:
• 为等候合法永久居民身份的高技能工人和他们的配偶提供便捷式工作许可。在现行制度下,永久居民申请获得批准的雇员通常要等待多年才能拿到签证。国土安全部 将改变规定,使这些员工可以更容易地更换工作。国土安全部正在最后完成制定新规定,赋予一些持有H-1B签证的员工的配偶工作许可,前提是这些配偶的合法 永久居民申请已经获得批准。
• 增强外国企业家的选择。国土安全部将为符合标准的外国企业家扩大移民选择。这些标准包括在美国创造就业机会、吸引投资、产生收入,以便确保我们的制度鼓励 他们发展美国经济。这个标准将包含收入门槛限制,使这些人没有资格获得某些《可负担健保法案》所规定的公众福利或者税收减免等等。
• 加强并扩大对美国大学科技工数毕业生的在职培训。为了加强那些在美国大学学习科学、技术、工程和数学的外国学生的教育经历,国土安全部将提出改善建议,扩大现有的实习培训项目(OPT),规定加强毕业后实习培训项目(OPT)学生与就读大学之间的联系。
• 在保护美国员工的同时,简化外籍员工及其雇主的程序。国土安全部将明确有关外籍员工从公司在国外的办事处调往在美国的办事处工作时临时工作签证(L-1) 的规定。劳工部将制定法规,使保荐外籍员工申请移民签证的雇主按规定必须进行的劳动市场测试现代化,同时确保美国员工得到保护。
• 减少那些正在等待获得合法永久居民身份的人与家人的分离。由于我们移民制度中所设的障碍,美国公民和合法永久居民常常在其直系亲属等待合法永久居民身份的 过程中要与他们分离多年。为了减少这些人分离的时间,国土安全部将允许某些人先为某些违反移民法规的情况申请临时豁免,之后再离开美国去接受签证面谈。
• 确保拥有合法身份的个人能够前往他们的来源国旅行。国土安全部将出台明确的指南,为正在申请合法永久居民或者拥有某类临时身份许可的个人在境外旅行前得到事先许可(预先豁免)提供更大的保障。
• 发布有关签证现代化的总统备忘录。有许多方式可以使我们的合法移民制度现代化,减少政府开支,消除重叠系统,减轻雇主和家庭的负担,并消除欺诈。总统将发布备忘录,要求一个跨部门小组提出需要改进的方面。
• 成立“新美国人白宫特别工作组”。总统将建立“新美国人白宫特别工作组”,负责制定有关促进移民融合的联邦策略。
• 促进公众的公民意识。国土安全部将在10个州发起全面的公民意识媒体活动。75%的合法永久居民生活在这10个州。美国公民和移民服务局(USCIS)也将增加入籍费用的支付方式,并探索其他方式,包括研究对符合要求的个人实行部分费用豁免的可能性。
• 确保美国公民为国服务。为了满足我们的军队需求和支持募兵工作,国土安全部扩大一项现行政策,为那些争取到军队服役的美国公民的配偶和子女提供方便,与国防部提出的请求相符。(完)

Tuesday 21 October 2014

Create new user in MySQL and give it full access to one database


GRANT ALL PRIVILEGES ON dbTest.* To 'user'@'hostname' IDENTIFIED BY 'password';
 
If you are running the code/site accessing MySQL on the same machine, hostname would be localhost.

Now, the break down.
  1. GRANT - This is the command used to create users and grant rights to databases, tables, etc.
  2. ALL PRIVILEGES - This tells it the user will have all standard privileges. This does not include the privilege to use the GRANT command however.
  3. dbtest.* - This instructions MySQL to apply these rights for the use onto the full dbtest database. You can replace the * with specific table names or store routines if you wish.
  4. TO 'user'@'hostname' - 'user' is the of the user account you are creating. Note: You must have the single quotes in there. 'hostname' tells MySQL what hosts the user can connect from. If you only want it from the same machine, use localhost
  5. IDENTIFIED BY 'password' - As you would have guessed, this sets the password for that user.

Wednesday 15 October 2014

A Car Hit a Curb

Mechanics hear the car hit a curb story from drivers often. It happens to even the best drivers. Although more common in the winter months when drivers are dealing with ice and snow the reality is it can happen anytime.
The questions will be do you have front end damage and what to do about it. This article will talk about how to evaluate the situation and determine the best course of action for your scenario.
Not all curb hits are created equal. Two things to consider would be the speed at which the vehicle was traveling when it hit the curb and the second thing is the overall height of the curb itself. As an example if you were traveling 50 mph and hit a curb that was higher than six inches chances are there is extensive front end damage.
On the other hand if you hit a 3 inch curb traveling below 5 mph then chances are you have no damage at all depending on the vehicle construction of course. As an opinionated quick rule of thumb the cheaper the automobile the more damage occurs.
Seriously consider the impact event when determining what to do next. When in doubt take your vehicle to a trusted mechanic for inspection of the vehicle. There's a few things you can do to get an idea of what the auto repair shop might find before you go.

Front End Damage After a Curb Hit

I start by inspecting the wheel and tire that made contact with the curb, usually the right front tire in the United States. When it comes to tire construction the tread is stronger than the side wall and much thicker.
Often you will see chunks taken out of the side wall of the tire on top of any wheel damage, usually found on the edge out towards the sealing bead. This kind of damage should be repaired or at least inspected immediately. If the wheel and tire look okay or only have minor damage such as scuffs the next step would be to drive the car.

On this diagnostic road-test we can make an attempt at determining if the wheel alignment was affected in any way by the impact event.
Just because a car hit a curb does not mean that it automatically needs a front wheel alignment. Although the guy who owns an alignment rack might tell you a different story.
In fact after the alignment is set at the Factory the adjustments are locked down and are designed to hold in place under harsh road conditions such as slamming potholes. If the car hit a curb hard enough it is possible however for the alignment to be affected. There are things that you can look for on the road test after the curb contact.
I recommend going to an empty parking lot to do so then driving the car slowly in a straight line and compare this with the position of the steering wheel. If there has been serious damage to the front end the steering wheel will probably no longer be in the same straight ahead position you remembered prior to the accident.
Another sign that may indicate a bent wheel would be a back-and-forth wobbling of the steering wheel at low speeds. At higher speeds this might turn into what feels like a vibration. If the car slams the curb real hard chances are that front end parts will be bent.
This can cause not only the steering wheel to be off-center but also a hard pulling condition towards the side of the impact. If a car hit a curb with the right front wheel and bent the control arm back this would cause a negative caster setting and the automobile will pull to the right side.

Common Problems After a Car Hits a Curb
I should mention that in most cases a mechanic can put a vehicle up in the air and inspect the front end and the attaching parts to detect any damage. There are situations where the only way to detect the damage is to set the vehicle up on an alignment rack and take measurements of the alignment settings.
In some cases car insurance companies may require a print out of these readings after a car hits a curb to verify repairs are needed. When I was turning a wrench in New Jersey we saw quite a lot of these curb hit situations during the winter months.

Back in the old days when a car hit a curb we would find damage to the ball joint area and sometimes the tie rod ends (weakest link). But with modern sub-frame construction it is really more common to find bent control arms. You know the old saying, they don't make them like they use to.

Saturday 11 October 2014

汽车为什么要预热

  首先我们要对汽车做个简单的了解,我们都知道发动机的零件都是金属制造的,金属有个物理特性就是“热胀冷缩”,而发动机是在热态下工作的,所以发动机所有运转的零件之间都必须预留间隙,这个间隙就是留给零件膨胀的空间,(例如:曲轴与轴瓦之间,缸套与活塞之间等),这个间隙也是润滑油流动的空间。如果没有间隙发动机就会“受热抱死”。

  我们都知道任何设备的运转零件之间间隙越大,磨损越快,间隙使机件游动产生敲击,所以磨损加剧,所以要使设备寿命长,就要控制早期磨损,如果磨损间隙越来越大,最终就没法控制了。所以汽车的70%以上的磨损发生在冷启动阶段就是这个道理。换言之控制了冷启动磨损就等于延长了发动机的寿命。

  早上汽车启动后,噪音会很大,原因之一就是机油没有完全到达摩擦表面,第二就是间隙大零件敲击,第三是怠速转速过高。

  因为气温低会使启动困难,所以发动机电脑会根据气温调整怠速,气温越低怠速越高。

  此时混合气浓度也较高,由于氧传感器温度低,不能马上工作,所以发动机此时为开环工作状态,废气排放状态最差(冷启动后尾气味道很大),发动机此时为最恶劣的状态。

  冷启动的恶劣情况有以下几点:

  1.发动机机件之间间隙大,易发生敲击磨损。

  2.润滑油未及时到达零件之间,发生干摩擦现象。

  3.怠速较高,使敲击频率增高,使磨损加剧。

  4.混合气较浓,进气管,气门背面易产生积碳。

  5.发动机开环工作,废气排放恶化,缩短三元催化器寿命。

  那么怎样才能控制这些恶劣现象呢?怎样做才是正确的呢?

  1.使用低温粘度低的润滑油,例如5W30或5W40的润滑油,这种机油会迅速进入摩擦表面,将机件隔离,由于进入较快,就缩短了干摩擦的时间。

  2.使用正厂的机油滤清器,滤清器的透过流量决定了机油进入摩擦表面的速度,劣质的机油滤清器透过性较差,低温时机油粘度高,会延长流动的速度。优质滤清器会使机油快速通过,迅速进入摩擦表面,就快速控制了磨损。

  3.将预热过程分为两段:怠速预热+行走预热。怠速的发动机转速很高,混合气很浓,我们无法控制,但可以控制怠速预热时间,怠速预热时间是给润滑油充分润滑的时间,其后是行走预热时间,行走预热可以使发动机快速升温,进入闭环工作状态,快速补偿间隙,待水温达到正常,发动机才进入正常的工作状态,行走预热过程也宣告结束。

  4.控制怠速预热时间,请记住这个公式:以一分钟(60秒)为基数加减环境气温。

  气温在零度以上:用60减去气温,例如:气温30℃,60-30=30秒(预热时间)

  气温在零度以下:用60加上气温,例如:气温-30℃,60+30=90秒(预热时间)

  顺便提醒一下:水温未达到正常值,在行走预热阶段,发动机转速控制在3000转以下,将会大大延长发动机的寿命。地下停车场热车,千万不能有一点水温就走。因为从地下车库出来,基本上都要上一个较陡的斜坡,这时发动机还未达到正常工作的温度,硬着头皮上只能让车子磨损更大。


所以对于汽车发动立马要上陡坡的情况,建议 夏天热车3分钟 冬天热车5分钟。 

Tuesday 7 October 2014

Highlander SE vs. Land Cruiser

Highlander SE vs. Land Cruiser

2011 Toyota Land Cruiser
9.7

starting from

$69,730

Reasons to buy the Toyota Land Cruiser

Badge
Quite powerful
381 HP @ 5,600 RPM
Badge
Good ground clearance for rough terrain
8.9"
Badge
Rear air conditioning
Standard
Badge
Passenger power seats
Standard
2011 Toyota Highlander SE
9.5

starting from

$36,110

Reasons to buy the Toyota Highlander SE

Badge
Good cargo space
95.4 ft3
Badge
Very inexpensive
$36,110
Badge
Better suspension
Independent
Badge
Average city fuel efficiency
17 mpg


Entertainment System 7.6 vs 10.0
2011 Toyota Land Cruiser Winner: Land Cruiser
[details]

  • The Land Cruiser has 8 more speakers, providing a better entertainment experience, 14 vs 6
  • The Land Cruiser 's subwoofer accurately reproduces deep bass notes in music
  • It'll cost you to get an entertainment system on the Land Cruiser ; but it's not available at all on the Highlander SE


Cost 10.0 vs 8.2
2011 Toyota Highlander SE Winner: Highlander SE
[details]

  • The best price we've seen is $33,620 cheaper (around 50% less), $36,110 vs $69,730
  • Gets more than 30% more miles per gallon in the city, 17 mpg vs 13 mpg


Safety Features 9.4 vs 10.0
2011 Toyota Land Cruiser Winner: Land Cruiser
[details]

  • The Land Cruiser has 1 more airbag (including Rear Side), 7 vs 6


Performance 9.8 vs 10.0
2011 Toyota Land Cruiser Winner: Land Cruiser
[details]

  • More than 40% more powerful, 381 HP @ 5,600 RPM vs 270 HP @ 6,200 RPM
  • The Land Cruiser has 1 more gear, which can improve performance, 6 vs 5
  • Almost the same, 15.1 lb/hp vs 15.8 lb/hp


Practicality 10.0 vs 9.8
2011 Toyota Highlander SE Winner: Highlander SE
[details]

  • Room for around 20% more stuff, 95.4 ft3 vs 81.7 ft3
  • Almost the same, 59.3 ft3 vs 58.0 ft3
  • The Highlander SE can carry more than 10% more weight, 1734 lb vs 1510 lb


Luxury Features 10.0 vs 10.0


Too close to call
[details]

  • Both come standard with sun roofs
  • Both come standard with leather interiors
  • Both have power seats


Crash Test Ratings 10.0 vs -


Missing information
[details]


Road Tests 10.0 vs -


Missing information
[details]

Overall 9.5 vs 9.7

Entertainment System


Toyota
Highlander SE

2011 Toyota Highlander SE

2011 Toyota Land Cruiser
Toyota
Land Cruiser
Help
Number of speakers 6 vs 14 The Land Cruiser has an extraordinary amount of speakers, but the Highlander SE has very few
Help
Has speed sensitive volume Yes vs No The Highlander SE's stereo cranks the volume to compensate for road noise, but the Land Cruiser does not
Help
CD player Standard vs Standard CD player comes standard
Help
premium radio Optional vs Standard Have your pick of music from around the world with the Land Cruiser 's satellite radio; in the Highlander SE, too, but it'll cost
Help
Has auxiliary audio input Yes vs Yes Both have an audio-in jack so you can plug in your own MP3 player to the stereo
Help
Has subwoofer No vs Yes The Land Cruiser has a subwoofer to accurately produce deep bass frequencies in music
Help
entertainment system Not Available vs Optional It'll cost you to get an entertainment system on the Land Cruiser ; but it's not available at all on the Highlander SE

Cost


Toyota
Highlander SE

2011 Toyota Highlander SE

2011 Toyota Land Cruiser
Toyota
Land Cruiser
Help
MSRP $36,110 vs $69,730 The Highlander SE has a reasonable price, while the Land Cruiser is very expensive
Help
In-city gas mileage 17 mpg vs 13 mpg The Highlander SE has OK city mileage, while the Land Cruiser is very inefficient
Help
basic warranty miles 36,000 mile vs 36,000 mile Shorter basic warranty
Help
basic warranty years 3 year vs 3 year Shorter-lasting basic warranty

Safety Features


Toyota
Highlander SE

2011 Toyota Highlander SE

2011 Toyota Land Cruiser
Toyota
Land Cruiser
Help
antilock brakes Standard vs Standard Both come standard with ABS brakes
Help
Stability control system Yes vs Yes Both have electronic stability control
Help
Airbags 6 vs 7 Both have good airbag coverage
Help
Rear brakes Disc vs Disc Both have the usual brakes for this class of vehicle
Help
child door locks Standard vs Standard Child door locks come standard
Help
Roadside assistance system None vs SafetyConnect

Performance


Toyota
Highlander SE

2011 Toyota Highlander SE

2011 Toyota Land Cruiser
Toyota
Land Cruiser
Help
Horsepower 270 HP @ 6,200 RPM vs 381 HP @ 5,600 RPM The Land Cruiser is very powerful, while the Highlander SE is only of average power
Help
Number of gears 5 vs 6 The Land Cruiser has more gears and the Highlander SE is OK, too
Help
Transmission Semi-automatic transmission vs Automatic transmission The Highlander SE's semi-automatic transmission is rare for this class of vehicle
Help
paddle shifters Not Available vs Not Available Neither offers paddle shifters
Help
Air compressor None vs None Neither has an air compressor for increased power output
Help
Power-to-weight ratio 15.8 lb/hp vs 15.1 lb/hp Both provide sporty handling
Help
Drivetrain type four-wheel drive vs four-wheel drive Both will do well in poor weather or off-road conditions
Help
Curb-to-curb turning radius 38.7 ft vs 38.7 ft Both cars corner comparably to other vehicles in their class

Practicality


Toyota
Highlander SE

2011 Toyota Highlander SE

2011 Toyota Land Cruiser
Toyota
Land Cruiser
Help
Passengers 7 vs 8 People mover
Help
Cargo space 95.4 ft3 vs 81.7 ft3 The Highlander SE has lots of cargo room and the Land Cruiser is pretty good
Help
front seats 59.3 ft3 vs 58.0 ft3 Both average size front seats
Help
Base payload capacity 1734 lb vs 1510 lb Average towing capacity
Help
folding rear seats Standard vs Standard Both have a rear seat that folds down for extra storage space
Help
power outlets Standard vs Standard Both have power outlets
Help
navigation system Optional vs Optional Both offer an upgrade to a navigation system
Help
Cupholders 10 vs 12 Both have a good number of cupholders but the Land Cruiser is particularly good
Help
front air conditioning Standard vs Standard A/C for hot summer days comes standard

Luxury Features


Toyota
Highlander SE

2011 Toyota Highlander SE

2011 Toyota Land Cruiser
Toyota
Land Cruiser
Help
moon roof Standard vs Standard Both come standard with sun roofs
Help
power seats Standard vs Standard Both have power seats
Help
keyless entry Standard vs Standard Both have keyless entry
Help
leather Standard vs Standard Both come standard with leather interiors

Crash Test Ratings


Toyota
Highlander SE

2011 Toyota Highlander SE

2011 Toyota Land Cruiser
Toyota
Land Cruiser
Help
Rollover resistance 4 stars vs Unknown
Help
Front driver crash test 4 stars vs Unknown
Help
Driver side crash test 5 stars vs Unknown

Road Tests


Toyota
Highlander SE

2011 Toyota Highlander SE

2011 Toyota Land Cruiser
Toyota
Land Cruiser
Help
0-60 mph 8.0 seconds vs 7.3 seconds The Land Cruiser has a good 0-60 time, but the Highlander SE is just average
Help
Braking distance at 60mph 139 ft vs 140 ft Both have average braking ability for this class of vehicle
Help
1/4 mile 16.4 s @ 87 mph vs 15.7 s @ 92 mph The Land Cruiser 's 1/4 mile time is zippy, but the Highlander SE's is just OK
Help
Lateral acceleration 0.74 g vs Unknown
Help
Top speed 114 mph vs Unknown