窗外

HoloLens SDK发布

上个月Build 2016那天,HoloLens开发者版出货了。因为申请只对北美开发者开放,3000美金也太贵,暂时是拿不到这货了。不过今天收到封邮件,是说HoloLens的SDK开放下载了,这货带有一个HoloLens模拟器,可以下载下来,在你的电脑上玩玩。我的感觉是,除了能了解一下HoloLens的开放模型之外,就没什么卵用了。

安装这个SDK和模拟器,需要Visual Studio 2015 Update 2,也是前两天刚出的更新。Windows 10不是必须,但有些工具可能没法在低版本Windows上跑。还有一个Unity HoloLens预览版,可以用Unity来开发。

我打算有空的时候玩玩,看看没有真机,只用模拟器能玩出点什么来不。

谁还需要移动硬盘?

项目里之前在Azure上搭了一个测试环境,跑着几台虚拟机。前阵子项目告一段落了,想着把这个Azure上的环境停掉,省点钱。又想着这几台虚拟机搭起来也费事,还是留个备份比较好,不如把它们的vhd全部下载下来,保存在移动硬盘上。

这几个vhd加起来大概需要800GB的磁盘空间。我就从家里翻出一块许久没用的WD MyPassport硬盘,USB3.0的接口,1TB的容量,大概是2013年买的,一直没怎么用过。我心说这次派上用场了。谁知插到电脑上一试,坏掉了,Windows可以认到硬盘,但不能mount,容量显示0。网上查了半天,没找到修复的方法。

同事知道了,把他的一块全新未开封的硬盘借给了我,说是称打折买的,一直也没用。他的这块硬盘到是好的,但是我发现,从Azure Storage上下载800GB的数据,所花的时间太长了,以后真要重建这个环境的话,还要花更长的时间上传,根本不划算。

最后,我根本没用移动硬盘,而是将这些vhd用AzCopy备份到另一个Azure Storage里面了。用AzCopy的异步拷贝,这样备份很快,以后要重建也很容易。关键是存储几乎是Azure里最便宜的服务,1GB每个月只要2.4美分,又没有数据丢失的风险,比下载下来备份到移动硬盘里安全多了。

我不禁想,这以后谁还需要移动硬盘呢?市面上已经有了各种云存储服务,普通用户足够用了,不用担心磁盘损坏或者换系统换机器时数据丢失,而且长远看云存储的价格会越来越低,移动硬盘快被淘汰了,可能连这个概念大概就快消失了吧?

Mini PC开箱

前一阵子偶尔看到Scooter Computer,觉得蛮有趣的。家里不缺路由器,到是正好缺台性能够用的电脑。之前我一直在看笔记本电脑,但是性能尚可的笔记本,价格至少过千新币。这Mini PC的配置看来正适合我的要求,就订了一台。等了两个星期,昨天货送到了。送货的周期有点长,但是免费的。

我订的是i7 + 8Gb Ram + 128GB SSD的版本,美金320多块。卖家还是蛮良心的,内存和MSSD用的都是单条,大厂品牌(三星的内存,东芝的SSD),还各留了一个插槽可供继续扩展。不像那些笔记本厂家,总是用小容量内存把所有插槽插满。你想扩展的时候,发现换下来的内存放着没用,扔了可惜。

我有一块闲置的240GB Intel 2.5″ SSD,装在SATA接口上正合适。趁着上个周末的IT Show,我还淘了一块性价比不错的Dell显示器,和一个BOSS SoundLink Mini II,搭配在一起正合适。经过这两天的测试,机器蛮不错的,所有驱动Windows 10自动识别安装,没有杂牌配件需要自己找驱动的情况。没有噪音,铝壳发热很低,也可能是上网听音乐,Load不重的关系,回头再试试视频播放的情况。WiFi模块带蓝牙,可以适配各种蓝牙设备。稍显美中不足的是,WiFi模块用的Broadcom的802.11n,单频不支持5GHz。不过看在价钱的份上,也很难要求更多了。综合起来,我还是相当满意的。

另外值得一提的,就是AliExpress了。这是我第一次在AliExpress上买东西,体验跟淘宝一致,很有希望做大啊。

Stack Overflow架构,2016版

Nick Craver在他的blog上发了一篇2016版的Stack Overflow架构,其中的几组数据,有其令人印象深刻:

网站的统计数据:

  • 209,420,973 (+61,336,090) HTTP requests to our load balancer
  • 66,294,789 (+30,199,477) of those were page loads
  • 1,240,266,346,053 (+406,273,363,426) bytes (1.24 TB) of HTTP traffic sent
  • 569,449,470,023 (+282,874,825,991) bytes (569 GB) total received
  • 3,084,303,599,266 (+1,958,311,041,954) bytes (3.08 TB) total sent
  • 504,816,843 (+170,244,740) SQL Queries (from HTTP requests alone)
  • 5,831,683,114 (+5,418,818,063) Redis hits
  • 17,158,874 (not tracked in 2013) Elastic searches
  • 3,661,134 (+57,716) Tag Engine requests
  • 607,073,066 (+48,848,481) ms (168 hours) spent running SQL queries
  • 10,396,073 (-88,950,843) ms (2.8 hours) spent on Redis hits
  • 147,018,571 (+14,634,512) ms (40.8 hours) spent on Tag Engine requests
  • 1,609,944,301 (-1,118,232,744) ms (447 hours) spent processing in ASP.Net
  • 22.71 (-5.29) ms average (19.12 ms in ASP.Net) for 49,180,275 question page renders
  • 11.80 (-53.2) ms average (8.81 ms in ASP.Net) for 6,370,076 home page renders

目前的架构:

  • 4 Microsoft SQL Servers (new hardware for 2 of them)
  • 11 IIS Web Servers (new hardware)
  • 2 Redis Servers (new hardware)
  • 3 Tag Engine servers (new hardware for 2 of the 3)
  • 3 Elasticsearch servers (same)
  • 4 HAProxy Load Balancers (added 2 to support CloudFlare)
  • 2 Networks (each a Nexus 5596 Core + 2232TM Fabric Extenders, upgraded to 10Gbps everywhere)
  • 2 Fortinet 800C Firewalls (replaced Cisco 5525-X ASAs)
  • 2 Cisco ASR-1001 Routers (replaced Cisco 3945 Routers)
  • 2 Cisco ASR-1001-x Routers (new!)

Nick说他会写一个系列,非常期待后续的详细介绍。

 

Remote Desktop for Linux VM on Azure

Usually you don’t need remote desktop or VNC on Linux servers running in the cloud. But as I wanted to try some scenarios with a Linux desktop and I actually don’t have a physical machine loaded with any Linux OS, I ended up setting up a Ubuntu server on Azure and enabling the remote desktop on it.

Obviously, I am not the first one who want to use remote desktop on servers running on cloud. There are plenty of posts on the internet talking about how to do it. Most of them are about using xrdp + xcfe4, including this one for Azure VMs. I am using Ubuntu 15.10 image. The only gotcha is that running the following command could uninstall the waagent service.

$sudo apt-get install ubuntu-desktop

This is a known issue that you can track on the github.com. To get waagent back, you have to reinstall it with the following:

$sudo apt-get install --reinstall walinuxagent

I ended up not installing the Ubuntu-desktop. Without it, you also avoid installing applications that you don’t need, such as those Office software.

Although xcfe4 is good enough as a lightweight window management system, I am more used to a GNOME like desktop environment. So I decided to try the MATE desktop. The configuration of it is very easy. Just run the following:

sudo apt-get install xrdp
sudo apt-get install mate-desktop-environment
echo mate-session >~/.xsession
sudo service xrdp restart

You may have to reboot the server after installing the desktop environment.

That’s all. I am using it now and so far so good.

Linux VM on Azure: A Mail Server

I need a mail server which can serve emails with my own domains for a small group of users. I don’t want to go with Exchange server as it is too heavy. With some search on the internet, I decide to setup a small Linux node with Postfix on Azure. Such a small node only costs about $40/month which can be covered by my MSDN subscription, and it is good enough for the purpose.

I choose to setup the VM with Ubuntu server image. There are a lot of posts online about how to setup Postfix on Ubuntu. Particularly, I followed this one as I also need the virtual domain and virtual mailbox. It is quite clear and easy to follow, and I got the Postfix and Dovecot up and running by following it.

The missing parts of the above post are the anti-spam and anti-virus portion. Fortunately, Amavis-new + Spamassassin + Clamav make things a lot more easier. The Ubuntu help page here is good enough for the purpose.

With all these setup, I have a mail server which can send and receive emails. However, when I try to send emails to those big mailbox hosts like gmail or outlook, my emails are rejected as they don’t accept emails from dynamic IP range, which is unfortunately used by the public cloud vendors like Azure and AWS. So the only way to workaround it is to relay emails to a mail delivery service. With Azure, we can leverage SendGrid. SendGrid has a free plan for Azure accounts of which the quota is 25,000 / month. So I create a SendGrid account in Azure, and configure Postfix to relay emails to it. SendGrid has a short guide for it.

The only problem I encounter with the relay is that Amavis-new throws an error “TLS is required, but was not offered
by host”. With some search, I find the workaround here. After fixing it, the emails can be accepted by gmail and outlook happily.

新加坡反对党面面观

最近新加坡国会选举开跑了,忽然之间冒出了许多的反对党。平时新加坡给人一党独大的印象,不知这些反对党的存在,一到国会选举,他们就复活了。想知道新加坡有多少反对党,这里有一个维基页面可以参考。

这些反对党提出各式各样的候选人和五花八门的政见,希望在大选中分一杯羹。最近的报纸电视,社交媒体上充满了关于各政党的候选人们的言论和报道,其中不乏奇葩。

比如有个新成立的政党,叫做国人为先党。这个党的秘书长在2011年的时候,代表过一个什么党选议员,但没选上。紧接着他又出来选总统,还是没选上。这次自己组了这个国人为先党,要竞选两个集选区。这个党的候选人大部分是五六十岁的老头子,被记者问起为什么没有年轻候选人时,他们解释说,本来也有年轻人选,但他们的家长反对他们从政。我当时听了觉得惊讶,怎么这个党的年轻党员还不能为自己做决定?那怎么能期望他们为选民代言呢?

这个党的政策说来也到简单,就是给大家发钱。他们有一个所谓的60亿元社会安全网计划,要给大家发钱,增加社会福利,取消消费税。钱从哪里来呢?来自外汇储备,政府投资,和对企业主及富人加税。这个政策看起来很好,可它有一个致命的问题,就是如果政府外汇储备减少了,投资损失了,富人和企业主跑了,他们要怎么办呢?就像他们的一个候选人说,如果当选,要让大家的拥车成本降到每个月50到100元,这当然好了,可是他没说,当所有人都开车时,交通会不会堵?停车位够不够?还要不要继续在公共交通上投资?这些基础问题没解决就让所有人都拥车,新加坡只会变成下一个雅加达或吉隆坡罢了。

还有一个叫做革新党的,也很奇葩。这个党笼络了和李显龙打官司的那个博客作者和他的律师,明显是个临时拼凑的草台班子。他们的党主席通知记者说,要看发布会介绍候选人,地点选择熟食中心。可是记者们提前半小时到了,他竟然还没找到可以坐下来开发布会的桌子。记者问他,他说还在找。最后,还是记者们帮他找了个位子,发布会才开得成。他们提交的候选人资料表格竟然有错误,作为对手的PAP提醒他们,他们才发现,否则连参选的资格都有问题。更夸张的是,他们的候选人演讲的时候,一激动口误,竟然要大家把票投给PAP。这样的组织协调能力,让人怎么能相信他们能管理市镇会,怎么放心把票投给他们呢?根本不用看他们的政策主张了。

 

HoloLens到底怎么样?

HoloLens在一月份初次露面的时候,给人留下非常深刻的印象,前天在Build 2015第一天Keynotes的演示中,HoloLens的使用场景增加了,效果也更令人震撼了。可那毕竟还是on-stage的演示,仍然让许多人觉得不真实,还是有人嘲讽HoloLens会是下一个Google Glass。

好在微软为Build 2015准备了足够数量的HoloLens,让与会者参与体验,甚至有training教大家为HoloLens写应用。那么从开发者的角度,HoloLens到底怎么样呢?不妨来看看体验过的人怎么说。

As for the using the device: First off, it was awesome. Second off, it was awesome.

Air-tapping to select and open holograms in the air felt surprisingly natural, as did talking into the microphone. Using it in conjunction with a standard mouse/PC setup felt very natural, and it was extremely rewarding to see what we did on the computer reflected in the “real” world.

……

Where Google positioned Google Glass as an always-on, always-with-you Ultra Life Companion that was designed to be in your face and all your friends’ faces forever, HoloLens is very clearly aimed at Getting Things Done and Serious Business.

We tried Microsoft HoloLens: This is going to be much bigger than Google Glass

Real-world interaction was one of the most impressive things HoloLens does. The device, which is loaded with sensors, does real-time mapping of all the objects close by, and you can actually see it doing this since you can make the wireframes visible. There’s a little latency — as other people in the room moved, their wireframes took a second to catch up — but it was an extremely cool effect.

……

Once you accept the device’s limitations, you begin to unlock the possibilities within it. It’s not hard to imagine a developer creating a holographic version of video chat It’s not hard to imagine a developer creating a holographic version of video chat — with not just floating screens, but floating people, rendered in 3D. Building virtual pets that follow you around would be child’s play.

I created a hologram on Microsoft HoloLens

 

“This is better than Google Glass. This seems to genuinely match the potential your promotional materials convey. We are excited to see it develop further, and fall into the hands of enterprise, where it seems even a small amount of imagination and implementation will pay huge dividends. Please can we take one home? Oh, please?”

Be aware: nobody would tell us anything about the hardware in Microsoft HoloLens. Nothing about the specifications, the battery life, or the cost. Lips were sealed.

As with anything new, exciting and prototypical, there are still more questions than answers with HoloLens, but it’s a unique combination of tried-and-tested concepts, one or two new ones, and a savvy and robust coding solution. Even with our (very) limited Unity expertise, our imagination is running away.

In the hands of a talented end user, Microsoft HoloLens could be very special indeed.

Welcome to the real world: Hands-on with Microsoft HoloLens

Today’s demo obviously happened in a controlled environment, but it was nowhere as controlled as I expected. People moved around as four or five of us gathered around a table to look at our holograms and everything still worked really well.

At the end of the session, I came away very impressed. When I first heard about HoloLens, I thought this was a technology that was still very far away from being production-ready and I assumed that the demos Microsoft showed earlier this year were simply well-staged and had managed to pull the wool over the assembled tech press. Now, I wouldn’t be surprised if Microsoft started selling HoloLens within a year (the company, of course, won’t say when HoloLens will go on sale or at what price).

techcrunch.com/2015/04/

 

微软2015财年Q3财报

微软本季收入217亿美元,增长6%,每股收益0.61美元,超出分析师预期的210亿美元收入和每股0.51美元收益,推动微软股票盘后上涨超过3%。

微软本季净利润为50亿美元,较去年同期的56亿美元有所下滑。本季微软花费190亿美元,用以完成2014年确定的重组和整合诺基亚设备部门的计划。另外,微软本季花费75亿美元,用于股票回购和分红。本季美元对其他货币的强劲表现也影响了财报。如果去除汇率影响,本季收入和毛利增长将达到9%和4%。微软持有的现金及其等价物和短期投资总额,达到954亿美元。

具体业务方面,本季设备与消费者部门收入增长8%到90亿美元。其中:

  • Office 365消费者订阅数增长35%,达到1240万。
  • Windows OEM Pro收入下降19%,主要是受去年同期Windows XP退役和PC市场下滑影响。
  • Bing在美国的搜索市场份额首次超过20%的里程碑,达到20.1%,较去年同期上升150个基点。搜索广告收入增长21%。
  • Xbox Live的使用度上升了30%。
  • Surface的销售收入增长了44%,达到7.13亿美元。这主要是靠Surface Pro 3的销售驱动的。
  • 手机方面,微软本季共售出860万部Lumia手机,销售收入14亿美元,亏损400万美元。

商业部门收入增长5%,达到128亿美元。其中:

  • 由Office 365, Azure和CRM Online驱动的商业云服务,收入增长106%,连续取得第七季3位数增长。以年化收益计算,达到63亿美元。
  • 服务器产品和服务收入增长12%。
  • Office商业产品和服务收入下滑2%,主要是受用户迁移到Office 365和PC市场下滑影响。
  • Windows volume licensing收入下滑2%。

参考:

FY15 Q3 – Press Releases

关于李光耀的趣事

发在这个问题下的答案。

随着这几天持续的悼念李光耀活动,了解了很多关于他的趣事,简录在此,与大家分享。

一、
李光耀1951年从剑桥毕业,取得律师资格后,回到新加坡,加入了当时比较有名的律师事务所,黎觉与王事务所,一开始是做英国人黎觉的法律助理,除了帮助黎觉处理法律事务,还帮助他精选议员。李光耀用了3年时间,就成为黎觉与王的合伙人。这一时期,他打的最出名的两场官司,是代表邮电制服工会和资方谈判,以及为“华惹”案中8名大学生辩护。这两场官司的胜利,使李光耀在新加坡法律界,声名鹊起。

二、
李光耀1954年联合林清祥的左翼势力,创立人民行动党,并在1955年大选中当选议员,而黎觉在选举中失败。随后黎觉要求李光耀从事务所辞职。于是李光耀和妻子柯玉芝,弟弟李金耀,一起创办了李及李律师事务所。开始的时候,没什么生意,李光耀甚至给地下钱庄做过“跑腿”(合法的催债),帮小商贩打一些小官司赚钱。李光耀在李及李工作到1959年,那一年他当选新加坡自治政府首任总理。

三、
1963年的“冷藏行动”之前,李光耀建议英国人,不要逮捕林清祥,而是给他一笔钱,并遣送他去印尼。英国人问他为什么要这么做,李回答说,这是中国人的传统,在老朋友变成失败的对手之后的对待方式。英国人不相信他,而是认为,李不想把林囚禁在新加坡,是担心林的声望和在华社的影响力。

四、
新加坡独立后,有一次去斯里兰卡首都科伦坡,对那里的市容和基础设施羡慕不已,对他手下的官员说,我们一定要把新加坡建设的像科伦坡这么美丽。于是,几十年后,新加坡成了东南亚最繁华的都市。

五、
宋楚瑜一开始做蒋经国的秘书的时候,随蒋经国接待的首位外国元首是李光耀。李光耀和蒋经国私交很好,因此蒋经国每次都会陪李光耀在台湾各地走访参观。蒋经国不会闽南话,李光耀普通话不好,但会说闽南话,能和台湾乡下的老百姓顺利交流。蒋经国看着一个外国元首和自己的百姓自由交谈,很受触动。宋楚瑜认为,这促使蒋经国开始加强和农村基层的接触。

六、
李光耀每次访问台湾,柯玉芝都会顺道在台湾买蜂蜜。宋楚瑜的夫人问柯,新加坡四季如春,为什么还要每次来台湾买蜂蜜?柯回答说,就因为新加坡四季如春,蜜蜂不需要采蜜储备过冬,没有什么蜂蜜产量。新加坡曾引进地中海的工蜂,刚开始蜂蜜产量大增,可一年之后,蜜蜂就“入乡随俗”了。

七、

李显龙说,李光耀和柯玉芝最喜欢的地方之一,是剑桥大学校园里的叹息桥。他们每次故地重游,都会拍照留念。