三星galaxy gear VR体验和使用总结

VR是最近非常流行的一个话题。适逢刚入手了galaxy s7 edge, 顺便就买了gear VR,也想体验一下VR的魅力。

gear VR不是一个完整的VR设备,它自己是不带显示屏幕的,需要把三星的手机嵌入到设备上,然后使用手机的屏幕、处理器来实现VR的功能。设备上有一个micro USB的接口,把手机的USB口直接扣上去,然后把手机固定好,就可以体验VR了。

1243321080365382725

原理

gear VR的原理很简单,就是在手机上运行软件,然后在屏幕的左右两块区域上显示出来每个眼睛需要看到的内容,然后在VR眼镜上让对应的眼睛看到相应的内容。VR眼镜实际上看的是屏幕上的一小块区域,VR眼镜上一块放大镜,使得眼睛看起来的屏幕很大。所以这个对手机屏幕的分辨率要求挺高的,现在s7e是2k的屏幕,但是在gear VR上看起来,分辨率还是很粗糙的。

1243321080446178629

软件

使用的VR的软件,都需要使用oculus home来安装和启动。当第一次把手机插入到gear VR的时候,会提示安装oculus home。oculus需要使用facebook相关的一些东西,并且自己也被国内屏蔽了,所以使用oculus home,安装和启动里面的软件的时候,很多时候需要打开VPN。

Oculus home是几乎所有软件的启动入口,所以最好熟悉一下它的使用。它是一个虚拟的房间,看起来还是蛮酷的。安装完之后,需要从Library打开自己的软件或者游戏。这个被翻译成“图书馆”,很容易造成歧义。

gear-vr-review-apps

这里有一个简单的教程:

https://product-guides.oculus.com/en-us/documentation/gear-vr/latest/concepts/ug-a-us-using-gear-vr/#ug-us-overview-tutorial

看视频

看视频最好的软件是samsung VR, 原来叫做milk VR, 在google play store和oculus home里都可以看到这个软件,但是两个地方的软件貌似不太一样。oculus home里安装的samsung vr, 需要在oculus home里启动;play store里下载的,可以不需要oculus home直接启动,可以在不连接眼镜的时候打开,方便下载和观看视频。另外,samsung VR原来的名字叫做milk VR, 现在改名了,所以大家看以往教程的时候要注意。

samsung VR本质是一个看在线视频的软件,但是也可以播本地的一些内容,包括2d, 3d, 和全景的视频。3d和全景的格式各异,可以给文件添加后缀,这样打开的时候就可以直接以合适的模式来播放视频;也可以在播放的时候,临时选择格式,但是在各个模式之间切换,是挺麻烦的事情。

GearVR_desktop_immersive_carousel_milkVR

这个是支持的所有的模式,以及后缀:

https://samsungvr.com/portal/content/faq_tech_gear_vr

When developing videos, the Samsung VR team would suggest using stereo sparingly as stereo effectively halves the resolution of your video.

Video Type Code
2D video “_2dp”
3D top bottom video (常见的上下分割的 3D视频) “_3dpv”
3D left right video (左右分割的3D视频) “_3dph”
Monoscopic 180 “180×180”
Monoscopic 180 16:9 “180×101”
Left right stereoscopic 180 16:9 “180x101_3dh”
Monoscopic 360 equirectangular projection (360度全景视频) “_mono360”
Top bottom stereoscopic 360 equirectangular projection “3dv” or “_tb”
Left right stereoscopic 360 equirectangular projection “3dh” or “_lr”
Monoscopic 360 cube projection “_cubemap “
Top bottom stereoscopic 360 cube projection “_cubemap_tb”
Left right stereoscopic 360 cube projection “_cubemap_lr​”
Monoscopic 360 octahedron projection “_octahedron”
Monoscopic 360 icosahedron projection “_icosahedron”
Top bottom stereoscopic 3D 180 “180x180_3dv”
Left right stereoscopic 3D 180 (有些小电影是这种格式的,代入感强烈) “180x180_3dh”
Left right stereo 3D 180 squished “180x180_squished_3dh”
Top bottom stereoscopic 3D 180×160 “180x160_3dv”
Two monoscopic 180 hemispheres “180hemispheres” or “180-hemispheres”
Top bottom 3D cylinder 2.25:1 “cylinder_slice_2x25_3dv”
Top bottom 3D cylinder 16:9 “cylinder_slice_16x9_3dv”
Top bottom 3D 360 no bottom “sib3d”
180 planetarium full dome “_planetarium” or “_fulldome”
V360 camera “_v360”
RTXP 360 cylindrical “_rtxp”

至于文件存储的位置,貌似samsung VR对此也没有特殊的要求,统一扔到/Movies目录里就成

也可以选择Oculus Video来看视频。

Oculus video对目录的要求比较严格:

On your phone's internal storage (Phone):
/DCIM/
/Movies/
/Oculus/Movies/

相应的使用指南: https://support.oculus.com/help/oculus/901894079905459/?ref=hc_fnav

玩游戏

VR里玩的游戏,只能在oculus home里安装和运行。安装好的游戏,在桌面上并不会出现图标,也不能直接运行。需要每次启动oculus,然后在里面运行。

现在有破解的游戏,下载完之后安装,但是因为是破解的,所以并不会出现在oculus home里,也不会在桌面上有图标。这时候,可以选择单独的程序管理器,把游戏打开,这时候会提示连接眼镜,再把眼镜装上去就成了。

推荐ES文件浏览器,可以看所有的app,

看全景图片

使用Oculus 360 Photo来看全景的照片。可以在oculus home里安装。

To view your own panoramic photos in Oculus 360 Photos: 

Create the folder "360Photos" under the Oculus folder
Create the folder "My images" under Oculus/360Photos folder
Load your photos into /Oculus/360Photos/My Images folder

使用指南:

https://support.oculus.com/help/oculus/169658330048676/?ref=hc_fnav

推荐的软件和游戏

VR现阶段能使用的软件和游戏还不多,大多是为了给人体验一下VR的效果。这里推荐一下一个免费应用: Jurassic World,可以直接在oculus home里安装。软件里面有一条大恐龙,慢慢走向你,然后抬起腿来吃草,效果还是震撼的!

 

 

2009年新疆恐怖事件后,法国到底做了什么事情惹怒了中国人?

2009年7月5日,新疆发生了暴力恐怖事件(乌鲁木齐七五事件)。在全中国人陷入巨大悲痛的时候,法国政府却发出了非常不负责任的声明。这个声明激怒了中国人,所以现在常常听到中国人民对法国发生恐怖事件的幸灾乐祸。这个不是中国人没有同情心,而是中国人曾经被深深伤害了!

法国对7.5事件的声明原文:

http://basedoc.diplomatie.gouv.fr/exl-doc/EPI00040432.pdf

Screen Shot 2016-07-16 at 14.40.34

中国在新疆地区发生事件的声明
贝尔纳·库什

法国外长声明

我们十分关注中国新疆地区最近两天发生的暴力冲突。我对人身损失深表遗憾。

同欧洲同盟国一起,我们重申对人权,尤其是言论自由和和平示威权利的重视。被拘押人员
的权利应该得到充分尊重。

RFI的报道:

http://www1.rfi.fr/actucn/articles/115/article_14735.asp

Screen Shot 2016-07-16 at 14.31.57

这就是法国如何对待中国的真相。这也是法国政府如何自作孽的证据。

Android里TextView中链接识别问题

假设你有一些文本内容,这些文本内容中可能会有一些URL。如果你希望用户在看这些文本内容的时候,同时可以方便的触发这些链接,该怎么做呢?

很多人会说,用Linkify, 简单的两句话就可以实现了:

textView.setText(content);
Linkify.addLinks(textView, Linkify.WEB_URLS);

但是Linkify除了可以指定识别链接的类型外,没有任何可以定制的内容。比如想单击链接打开浏览器,长按链接复制地址到剪贴板,就无法实现。

更重要的是,Linkify对链接的识别貌似非常粗糙,尤其是包含中文的内容。下面是Linkify识别结果的一个例子:

Screenshot_20160514-143339

尝试找各种解决方案,最后觉得Android-TextView-LinkBuilder是最好的一个方案。

contentView.setText(content);
LinkBuilder.on(contentView).addLinks(getPostSupportedLinks()).build();
    public static void openLink(String link, Activity activity) {
        Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(link));
        try {
            activity.startActivity(browserIntent);
        } catch(ActivityNotFoundException e) {
            Toast.makeText(activity, "链接打开错误:" + e.toString(), Toast.LENGTH_LONG).show();
        }
    }

    public static void sendEmail(String link, Activity activity) {
        /* Create the Intent */
        final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);

        /* Fill it with Data */
        emailIntent.setType("plain/text");
        emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{link});
        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "");
        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, " \n \n \n \n--\n来自zSMTH的邮件\n");

        try {
            activity.startActivity(Intent.createChooser(emailIntent, "发邮件..."));
        } catch(ActivityNotFoundException e) {
            Toast.makeText(activity, "链接打开错误:" + e.toString(), Toast.LENGTH_LONG).show();
        }
    }

    // this will be called in PostRecyclerViewAdapter & MailContentActivity
    public static List<Link> getPostSupportedLinks(final Activity activity) {
        List<Link> links = new ArrayList<>();

        // web URL link
        Link weburl = new Link(Regex.WEB_URL_PATTERN);
        weburl.setTextColor(Color.parseColor("#00BCD4"));
        weburl.setHighlightAlpha(.4f);
        weburl.setOnClickListener(new Link.OnClickListener() {
            @Override
            public void onClick(String clickedText) {
                ActivityUtils.openLink(clickedText, activity);
            }
        });
        weburl.setOnLongClickListener(new Link.OnLongClickListener() {
            @Override
            public void onLongClick(String clickedText) {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                    final android.content.ClipboardManager clipboardManager = (android.content.ClipboardManager)
                            activity.getSystemService(Context.CLIPBOARD_SERVICE);
                    final android.content.ClipData clipData = android.content.ClipData.newPlainText("PostContent", clickedText);
                    clipboardManager.setPrimaryClip(clipData);
                } else {
                    final android.text.ClipboardManager clipboardManager = (android.text.ClipboardManager)activity.getSystemService(Context.CLIPBOARD_SERVICE);
                    clipboardManager.setText(clickedText);
                }
                Toast.makeText(SMTHApplication.getAppContext(), "链接已复制到剪贴板", Toast.LENGTH_SHORT).show();
            }
        });

        // email link
        Link emaillink = new Link(Regex.EMAIL_ADDRESS_PATTERN);
        emaillink.setTextColor(Color.parseColor("#00BCD4"));
        emaillink.setHighlightAlpha(.4f);
        emaillink.setOnClickListener(new Link.OnClickListener() {
            @Override
            public void onClick(String clickedText) {
                ActivityUtils.sendEmail(clickedText, activity);
            }
        });

        links.add(weburl);
        links.add(emaillink);

        return links;
    }

这样就可以完全由自己去控制需要识别的内容,然后对单击、长按动作采用合适的操作了。

https://github.com/klinker24/Android-TextView-LinkBuilder

RxJava的学习教程

读完下面的三篇文章,基本上就知道怎么用了

1.给 Android 开发者的 RxJava 详解

http://gank.io/post/560e15be2dca930e00da1083

2.RxJava学习总结

http://wangxinghe.me/blog/2016-03-27/rxjava-basis/

3. RxJava使用场景小结

http://blog.csdn.net/lzyzsd/article/details/50120801

在Mac里安装单独的python

mac已经自带了python了,版本也还比较新。如果想自己控制python的版本的话,可以用brew来安装单独的python.

brew install python

brew安装的命令会在/usr/local/bin里面,如果系统自带了一些工具在/usr/bin里,那么brew安装的可能无法被使用到。所以需要将/usr/local/bin放到 /usr/bin前面去

brew doctor会提供修复的命令:

Consider setting your PATH so that /usr/local/bin
occurs before /usr/bin. Here is a one-liner:
    echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrc

修改之后source ~/.zshrc就可以使用最新版的python了

➜  python --version
Python 2.7.11
➜  which python
/usr/local/bin/python

 

 

enable xtrafinder to work under OS X 10.11 El Capitan

据说是OSX 10.11开启了一个System Integrity Protection的功能,所以Xtrafinder就无法正常工作了。

解决的方法,就是部分关闭SIP的功能,具体看:

How to modify System Integrity Protection

You must boot into the Recovery OS. You do this by restarting your machine, and holding COMMAND + R until the Apple logo appears.

Then select Terminal from the Utilities menu. It looks like this:

In the window that opens, type csrutil enable --without debug and press return.

This turns off the part of SIP that XtraFinder needs to run, and OS X complains that it is an unsupported configuration.

Now type reboot and press return to restart your machine.

 

如何有效的开团队会议

最近review了一下公司里不同团队的时间开销,发现各种各样的会议占据了工程师团队的很大一部分的时间。怎么有效的开团队会议(>= 3 人)呢?Andy同学做了一个很好的training, 把里面的一些内容拿出来跟大家分享一下:

0. 开会或者不开会,这是一个问题

还有其他的方式,比如email、skype,组织一个会议是必要的么?

1. 会议组织者,要提前做好准备

Why – Objectives

Who – Required/Optional

What – Agenda/Background

Where – Meeting room

When – Invite in advance, time slot

How – Facilities

2. 参会者,要提前做好准备工作

Prepare yourself

  • Confirm the purpose of the meeting
  • Know your role
  • Background, feedback, comments and questions

Response

  • Accept
  • Decline
  • Tentative
  • Propose new time

3.开会时,要有leadership

Be on time (Arrive 5 minutes earlier if possible)
Let everyone know who is in the meeting
Make sure someone is taking notes
Let everyone know the goal/objective of the meeting
Control the meeting

  • Stick to the agenda, don’t go too far, don’t let the meeting hijacked
  • If someone starts to dominate, bring the person under control
  • Make sure we reach the meeting objectives
  • Decisions, Agreements, Plans, Schedules, etc.
  • Time Keeper

Make sure action items are specific enough

  • What, Who, When

4. 会后,有会议记录和行动点跟踪

Send out meeting minutes with summary, action items in time

Keep track the work items if necessary

最后,一张图总结一下:

Screen Shot 2015-07-27 at 09.23.35

 

BTW: 看到一篇关于如何开会的文章, 《极限会议: 原则与实践》,有兴趣的可以瞅瞅

极限会议: 原则与实践

联通的DNS真是没有节操

家里使用的是联通的宽带,一直使用的也是联通的DNS.

最近在chrome里搜索,无论搜索什么东西,都会弹出这么一个东西出来:

Did you mean to go to 一个乱七八糟的网址。点击进去之后,是联通的一个网页导航的网站。

Screen Shot 2014-12-28 at 21.35.12研究了半天,原来是chrome的一个机制,被联通给没有节操的利用了,导致每次都出来这么一个弹出条。

下面这个连接有详细的解释:

https://productforums.google.com/forum/#!topic/chrome/LGepU6tPPWs

It's not really Chrome's fault. Chrome is just looking up what you typed in the address bar as though it were the name of a server, and if it finds something, it offers to take you there. If not for this feature, there would be no way to access the host named "tubes" (for example) on your local network. 

The problem is that your ISP is running a domain "helper" that responds in the affirmative to every server it's asked about. So when Chrome asks if 'tubes' exists, your ISP is saying, yes, I've got that right here. If you click on the omnibox, I strongly suspect that you'll be taken to a landing page owned by your ISP. 

If you don't like this behavior, you can sometimes turn it off with a control panel somewhere in your ISP's settings (on Comcast, for example, there's a link from the landing page). You can also configure your computer to use Google's public DNS, avoiding your ISP's DNS games entirely: http://code.google.com/speed/public-dns/docs/using.html

把路由器上缺省的DNS改成了114.114.114.114 和阿里的223.6.6.6,问题就解决了

Career paths: Silicon Valley vs. traditional technology companies

https://medium.com/management-the-art-and-the-science/career-paths-silicon-valley-vs-traditional-technology-companies-e1f14edb864d

A recent tweet by Hunter Walk made me revisit something I’ve been thinking about for a while–something I wish people had told me when I was starting my career in Silicon Valley.

Optimize for working w smart folks early in career. Today hung w peeps i met 2001, 2005, 2007. All doing amazing stuff.

I started by working in two big companies, Xerox (at PARC) and HP (at HP Labs). The career path for a software engineer at a large tech company like HP, IBM, Intel, etc., looks something like this:

Software Engineer
Senior Software Engineer
Staff Software Engineer
Senior Staff Software Engineer
Principal Software Engineer
Master Software Engineer
Software Architect
Chief Software Architect
Fellow
CTO

There are similar progressions for other types of engineering as well. Typically, there’s a parallel track for management that diverges at some point, and leads to positions such as:

Engineering Manager
Senior Engineering Manager
Director of Software Engineering
Senior Director of Software Engineering
Vice President of Software Engineering
Senior Vice President of Software Engineering
Executive Vice President of Software Engineering

In both cases, you’re “working your way up” (my list is upside down), the way that people in the U.S. have thought about career advancement since at least WWII.

After living and working in both worlds, I now understand that the Silicon Valley startup career path looks a little different:

Company A
Company B
Company C
Company D
Company E

Here’s the key difference: In the traditional path, your career success is defined mostly by your individual advancement. In the Silicon Valley path, however, you may have different positions at each company, depending on what you like to do, but your career success, especially in financial terms, will likely be dominated by the overall success of the companies. Ask any of the first 1,000 employees at Google, no matter what their title. Therefore, it’s vitally important for you to work with the people who are most likely to succeed, and maximize the opportunities for doing so. If you work at Company B with an outstanding team, but the concept didn’t quite make it, your chances at Company D will be much better if you can work with some of them again.

Furthermore, your opportunities at subsequent companies will come from the people at the previous ones. Otherwise, your fate is in the hands of recruiters and HR departments. If the all-star team from Company B is reassembling for another try, you want them to be thinking of you.

This can also apply to projects—within companies, or open-source, for example. Even if you’re not switching companies, look for projects with great people. I certainly met some at both PARC and HP Labs, and did end up working with some of them later on. I just wish I had known how important that was going to be.

Lessons

Do everything you can to work with great people.

Figure out who’s on your team.

Go where the great people are. (They may not be where you think.)

If there aren’t great people where you are, leave.

Your future depends on it.

码农专用的字体

http://www.slant.co/topics/67/~what-are-the-best-programming-font

“source code pro”高举榜首,微软的Consolas得票也不少。个人感觉Consolas更好看一点,没有source code pro那么宽。字体宽一行放的内容就少了.