Java——永存、曲折、低谷、重生!

Java——永存、曲折、低谷、重生!
Java作为最流行的编程技术之一,带给软件产业深远影响,也改变了许多人的人生轨迹。值Java二十年之际,本期《程序员》邀请Java领域技术专家、知名图书作者从他们的角度谈谈Java的技术变迁以及在各个领域的技术实战。

安全曾让Java蒙羞,安全也让Java重获新生。在2014 Pwn20wn黑客大会上,Java成为唯一没有被攻破的平台。而在2015的会议中,Pwn20wn甚至没有把Java列在攻击名单上。

对于Oracle的接管,Gosling表达了自己的喜悦之情,“得知这个消息后,我感到非常惊喜。Oracle是个非常优秀的监护人并大大超出了我的期望。一开始我还担心它会不会成为第二个Solaris,现在看来我是多虑了。”

虽然很多人都曾预言Java将一蹶不振,但是现今在不少的重要项目中,Java仍扮演着极其重要的角色。
Purdy指出,没有Java,甚至不会有大数据的大发展,“Hadoop本身就是用Java编写的。当你需要在运行MapReduce的服务器集群上发布新功能时,你需要进行动态的部署,而这正是Java所擅长的。”
另一Java受惠者是Twitter。一开始Twitter是用Ruby on Rails编写的,但是随着用户数的增长RoR逐渐显得力不从心。Fail Whale(失败鲸)的宕机画面预示着瓶颈问题亟需解决。在2012年,Twitter从RoR转向了Java和Scala,而失败鲸从此灭绝了。

Link: http://m.csdn.net/article/2015-04-20/2824514-Java

ReSnap – A Smart Automated Photo Book Creation Platform

ReSnap – A Smart Automated Photo Book Creation Platform

ReSnap, a company that automatically creates a book of photographs from a range of sources, has announced an update for its beta platform, with a revamped platform that allows you to upload photos from local storage – it will then automatically pick the best images from the selection without you having to do anything.

http://thenextweb.com/insider/2015/04/23/resnap-expands-its-smart-automated-photo-book-creation-platform/ http://thenextweb.com/apps/2014/04/24/resnap-retools-print-demand-photo-book-platform-work-virtually-big-data-source/

Hello world on HomeKit

I just setup a HomeKit apps on my home, using Apple Siri to control my television.

First, need a smart home device, for example Sony Bravia TV which connected to a home WIFI. Second, requires a HomeKit Server talking HomeKit Protocol. This server will interact with other smart home device registered as accessories. Third, requires a HomeKit client installed on mobile, which talking to HomeKit Server, adding any accessories available from HomeKit server. In usual setup, HomeKit server can installed on Raspberry PI, but I don’t have, use my Mac to host it.

The following procedures will help to setup.

1) Get a Mac with Node JS installed. Get a Apple licensed developer program.

2) Download a HomeKit Demo Swift based project, run it on your mobile. Download at https://github.com/KhaosT/HomeKit-Demo.

3) Download a HomeKit Server, I am homebridge. It is a Node.JS based server. Download at https://github.com/nfarina/homebridge.

4) Download Bravia Controlled library which is also Node.JS based. Download at https://github.com/alanreid/bravia.

5) Follow instruction on how to control Bravia TV by using the library. And then, you may build a HTTP based interface around the Bravia library. And then, you may program HomeKit server apps, add a new accessories, and then send the command requests to Bravia Server via HTTP (Turn on/off TV). The last part is much more tricky, to setup HomeKit client talks to HomeKit server.

6) Important note, once you had HomeKit client installed, navigate to one of accessories, look for the service name, this is the name Siri will look and map into. Name it as “television”, or some fancy name, which you will tell Siri to look for and do the action.

7) After that, if everything goes well, you can turn on your Siri, and say “Siri, turn on television”. Then your television magically turned on. Enjoy.

The problems on installing node-ffi on Mac

I am installing NativeScript on my local Mac and requiring install node-ffi.

I am facing problem as could not recognize libtool -static during installation of node-ffi.

I found out that I had two version of libtool installed, one is for GNU libtool installed via brew install libtool (required by ARDrone3 SDK), and then another one in XCode developer tool. So I had to find way to switch into XCode developer tool.

On my Mac, I had to unlink or remove /usr/bin/libtool and /usr/local/bin/libtool, and then build symlink again as

ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool /usr/bin/libtool

Then rerun npm install -g ffi, finally, it succeeds.

This is the error screen.

node-ffi error screen

This is the success screen.

node-ffi success screen

This issue takes me 4 hours of findings, googling, uninstall / reinstall libtool, node-gyp and finally found the root cause. I even tried to install it in Cloud9, but found that Cloud9 is a Ubuntu and not Mac, so the installation result do not have Mac built binaries, so cannot just copy the result from Cloud9 to my Mac. Everything must be built well on the Mac.