Showing only posts ontech
ALL

iOS 12 和 watchOS 5

这周一 iOS 12 和 watchOS 5 终于算是和普罗大众见面了。大家都在说 iOS 12 更快了、更好用了,这确实没错。除此之外感觉有很多边边角角的东西很少有人关注。

Shortcuts

Shortcuts 是苹果官方支持的效率类应用,前身是 Workflow,可以将多个 action 串在一起,一键批量执行几十几百个动作。如果你在 iOS 12 之前没有用过 Workflow,新版本的 Shortcuts 应该对你的用处也不大。它的作用主要还是集中在两方面:一是可以让你把日常任务放到一个 shortcut 里,自动化流程;二是可以批量执行同样的动作(比如将 120 张照片裁剪成圆形并保存到相册),避免重复劳动。Shortcuts 现在在 iOS 12 里边增加了 Siri 整合,添加了一些系统级的控制元件,比如操作勿扰模式、飞行模式等等,但也没有太多的新鲜内容。

越是玩 Shortcuts 越是觉得这个东西令人困惑。任何允许第三方开发者接入的内容都显得非常难用,更多时候你甚至无法找到开发者设置的 action。我的 iPhone 里有 Shortcuts 支持的 app 包括 Day One、Working Copy、Overcast、Things 等等,但是似乎只有 Overcast 有着比较全面而系统的支持,所有能够进行的操作都直接列了出来。

但是 Things、Working Copy、Day One 这些 app 完全没有一个良好的支持。一些常见的操作比如 Things 的 “Add ‘Buy milk’” 是 Siri 发现你最近经常访问的事项,他会提示你有这么一个 action。这个动作可以将 “提醒我买牛奶” 这件事添加到 Things,不接受任何输入和修改。如果你需要添加 “提醒我买面包” 这件事,要整个绕回 Things app 创建一个新的、不可编辑的 action,再回到 Things 里添加内容。当然这也意味着 action 无法在一整套 shortcut 里接受任何别的 action 的输入。

这太蠢了。希望 iOS 12.5 或者 iOS 13 能够让开发者添加可以编辑的 action,现在基本上是一个屁用没有的状态。我希望是我弄错了,再玩两天试试。

当然开发者的支持还是有一些好处的——这些 action 在运行的时候并不需要在各个 app 之间跳转,显得干净利落很多。现在你可以直接从 Widget 里加速 Overcast 语速,或者选择打开/关闭声音增强,直接让 app 在后台运行,不影响前台别的 app 操作。不过这似乎是唯一的好处了。

“Hey Siri,那个是什么星星?”

iOS 12 中的 Sky Guide 通过支持 Siri Shortcuts,可以让你举起手机、用镜头对准天空中明星的大致方向,然后问 “What star is that”。Sky Guide 会自动查找前方最亮的星星 ,告诉你那是什么。这个真的很酷。

Hiking with watchOS 5

watchOS 5 添加了两个运动类的功能:支持登山运动(Hiking)、自动提醒你开始或者停止当前运动。

实话讲,过去两周 hiking 没觉得用 “Hiking” 和 “Walking” 这两种运动模式的统计信息有任何区别——卡路里消耗似乎是从心率、步速、海拔提升计算得出的,不管是用 Hiking 还是 Walking,两种模式的卡路里消耗等信息都没有什么区别。这当然是一件好事,说明之前苹果做的 “Walking” 模式一点都不呆傻,安全考虑了 “爬山” 这件事。

自动停止当前运动的提醒有些恼人。爬山的时候经常爬一段歇一段,每次一歇下来就会问你 “Do you want to stop the workout?” 如果你点击 Dismiss,这个提醒还会在接下来几个小时的 hiking 中出现无数次。

Overcast

watchOS 5 带来了播客 app,也让所有的原生应用终于能够后台播放音频内容了。如果你用 Overcast 5,你的节目会在后台传送到 Apple Watch 上,可以带着表出门跑步了。

Photos

Photos 的 redesign 非常棒。现在分享全分辨率的照片给好友再也不用走微信了(我发现关系好的朋友绝大多数都是 iPhone),iCloud 云端分享非常简单好用,而且能够直接添加照片到照片库,所有的时间和地点信息都会被记录下来。出去玩一次,Photos app 也会主动识别里边的人脸,推荐分享的朋友们。

然后搜索功能很棒。如果搜 “Trips” 可以看 Photos 监测到的之前所有的旅程。浪遍天涯的历史从此再也无处藏身了。

买还是不买 iPhone XS

前两天犹豫买不买 iPhone XS,毕竟 6s 已经三年了,最近电池似乎也不太行,总觉得到寿命了。但另一方面 iOS 12 又让他焕发了第二春,仿佛还能再战一年。

关于买还是不买的问题,我觉得有这么几件事挺值得关注的。

关于成像质量

读过的所有评测都对 iPhone XS 的成像效果赞不绝口。

John Gruber 在激动得充满脏话的评测里是这么写的:

Overall, I’m simply blown away by the iPhone XS’s results. Sometimes the difference is subtle but noticeable; sometimes the difference is between unusable and pretty good. The iPhone XS can capture still images and video that the iPhone X cannot […]

如果你没看过样张,iPhone X 拍出来的iPhone XS 拍出来的完全是两个世界,更不用说 6s 和 XS 的比较了。

还有一个评测来自 Austin Mann

Far and away the most significant camera update in the iPhone XS is its new Smart HDR capabilities. Powered by the A12 Bionic chip, in the picture above the iPhone XS is able to capture the dark shadows of the rock while maintaining strong detail in the sunlit clouds.

I’ve never worked with a camera that can balance light like this—not even close.

没有延迟的四帧实时 Smart HDR,基本上让摄影师后期处理很久的效果直接实时呈现在你的眼前。这种方便和快捷应该就是 Phil Schiller 所说 “Computational Photography” 最大的优势吧。

最后是来自钟文泽的视频评测,显然这个 Smart HDR 可以用在前、后摄像头的视频和照片功能上。所以你得到的不是一个简单的拍照效果提升,而是软件带来的整体镜头效果的升级。

关于价格

有 6s 的我心动了一秒,不过最近还是先找个工作再说吧。256GB + Apple Care + 12% 税 = $2,100 CAD。

其实想想,iPhone XS 虽然卖这么贵,现在反而是一部能用更久的手机。6s 已经服役三年了,也有不少人的 5s 能用五年。2100 块买一个用五年的 iPhone XS(当然要 256GB)比当时 1300 块钱买一个用三年的机器(iPhone 6s 64GB),似乎也不是那么亏。

先不买了。万一明年三月出一个新的 4.0 寸手机呢——我可喜欢小手机了。

30 刀的蓝牙耳机

在回加拿大前后俩月里克死了我的铁三角有线耳机和 BeatsX 蓝牙耳机。Beats 过了保修期两个月,Amazon 中国售价 880 元的耳机维修需要 612 元,我现在还记得当时对大望路苹果店 Genius 那个拒绝的笑容。

所以要买新的蓝牙耳机。心想既然售价 $179 的 BeatsX 都用不了一年,Amazon 的那些 $32.99 的潮流爆款是不是也值得一试呢?于是很快就收到了寄来的 Anker SoundBuds

不得不说,依赖于日益强大的中国制造,Anker 这支爆款蓝牙耳机确实很棒,做工没什么毛病,左右两个耳机磁力吸附带来的 “啪嗒” 一声莫名舒爽。当然这种价位的耳机往往不要对音质抱有太大的希望,作为一个非 audiophile 我也能听出来 Anker 这款耳机的低音有点太重了,只有出街或者跑步的时候戴着很舒服。由于没有 BeatsX 的芯片和技术,控制播放等操作的延迟比较明显,但是并不存在视频播放时的声画延迟问题。

我觉得最值得提的一点是它的蓝牙配对功能。由于支持蓝牙 4.2 标准,这款耳机在完成第一次配对之后无需在同一款设备里重新进到蓝牙菜单中取消匹配+重新配对,和用 BeatsX 的使用流程没啥区别—— iPhone 或 Apple Watch 上从底部呼出 Control Centre 就能控制 AirPlay 的目标了,非常好用。(垃圾苹果当时还宣传 BeatsX 配对方便,其实这是蓝牙 4.2 标准的自带功能。BeatsX 唯一的好处就是在别的设备上省掉你初次匹配的麻烦。)

如果你的耳机坏了,推荐试一下这个东西。出街还是挺棒的。

iOS 12 体验感受

邻近发布会了终于鼓足勇气装了 iOS 12,感受如下:

  1. iOS 12 速度是真的很快。iPhone 6s 锁屏界面左滑进相机真的是秒进,街拍从此不再慌张。其他方面也是流畅得很,从最早的开发者 beta 就感受到了—— 备用的 iPad mini 2 虽然谈不上宛如新生,但是一个 beta 1 能不比 iOS 11 卡已经说明了问题。

  2. iBooks 好看极了。几年之后突然出的新设计可以说基本上奠定了未来几年的设计方向。但另一方面也是不太明白苹果的思路,iBooks 看着虽然很领先,却和别的原生 app 长得差太多,不知道让一票独立开发者该怎么看齐。但总之感觉卡片式设计应该是苹果瞄准的下一个方向了。

  3. iPad 多任务手势只能用 “难用” 二字形容——已经俩月了我还没能100%激活多任务卡片,经常回到主屏幕。单指操作的手势比原来更容易误触,不知道啥时候突然捧着床上打个滚人家就回主屏幕了。

  4. 这也是史上最无聊的一届 beta。没啥别的新东西,iPhone 上连操作手势都没变,当真没啥新鲜的,有时甚至都不知道自己装了 beta。

  5. 暂时没有得到 Shortcuts 的内测。但是十分期待。

Making Sense of Blockchain

“What is a blockchain, and what problems does it solve?”

This is the question I’ve been confronted with for the past few months; it came up whenever I told friends or family I was working on blockchain apps. In fact, I am still in the phase of understanding this emerging technology, and in the process of refining my delivery of a proper answer. I thought I might as well write down an answer, as a way to systematically think about this question.

So what is a blockchain?

The blockchain is “an open, distributed ledger that can record transactions between two parties efficiently and in a verifiable and permanent way.”1

In other words, when you make a transaction, thousands of participants are doing work to verify the results, talk to each other for a consensus, and persist the results to disk. This is all done through cryptography, where participants use each other’s public keys to verify the confirmation.2

Blockchains have these properties in common:

  1. Permanent. Anything written with consensus is out there forever.
  2. Immutable. I can’t just say I have a million dollars on my account. In blockchain networks, I need to convince at least half of the nodes, which is virtually impossible.
  3. Private. Everyone knows everything happening on a certain wallet address. But there’s no way for other people to know that wallet belongs to me.

Over the years, the blockchain has evolved from currency-only Bitcoin era to a smart contract era with Ethereum. Not only can you store money in it, you can define a contract to handle settlements based on written rules.

And what problems does it solve?

Warrant trust

Imagine you are playing Warcraft, and for a little while you are having a hard time obtaining some rare weapons. You don’t just go around questioning if Blizzard is giving you a hard time; you believe they have better things to do; it’s bit too risky for a big game corp to rig the game and put their name in jeopardy.

Now imagine Warcraft is run by a small workshop, Shadyclub. If you are having a hard time getting a legendary artifact, you will probably start questioning: is the chance of getting that rare item really that 2% as Shadyclub claims? Are they stopping me from getting great things so I’ll crack and pay for that lucky charm for $9.99? After all, they haven’t built up their credit as a small workshop, and they do have the incentives to grab some money and run away.

However, if that game is run on blockchain, anyone can go verify if it’s honest. At its core, the decentralized property of blockchains makes it different than the way we process, store, and transmit data — anything running on the blockchain is transparent and verifiable. So when you publish a game, you can’t just add ten thousand gold to your account, because that line of backdoor code is visible to anyone. If this is a gambling game and you claim the odd is 1:4, anyone can go to your code and verify if it’s true.

Lending from the transparency, it is easy to warrant trust on the blockchain. More importantly, it is made possible for small teams to warrant trust to a group of players.

Lower fees of transactions

Low transaction fees is a cliché advantage of the blockchain. When you transfer some ether to another wallet, the fees3 are around 38¢ as of writing of this post. With possible infrastructures that offer higher TPS (transactions per second), the prospective fees of transactions will only go down.

A common fiat money transfer and payment solution is Stripe. It is an industry standard for many websites accepting payments, and the fees go as much as 2.9% + 30¢. Plus 1% for international credit cards. Plus another 1% for currency conversion. Plus fees the banks impose on customers for currency conversion (2.5-5% for my Canadian credit cards). Plus any conversion rate difference from Mastercard or Visa (around 1.5%). You don’t need a comparison to know which is more cost-efficient.

Microtransactions

Another advantage in transaction system is, Ethereum is not plagued by the precision issue of traditional bank accounts. Normally, any transaction in US Dollars is precise to 0.01 unit. It is good enough. Ethereum supports 10e-18 precisions — 17 zeroes. With this precision, business models relying on microtransactions4 may be made possible. Business models of, say, donation based readership where I have 100 articles read by 1,200 people monthly. You can ask people to set aside $1 each month to support the authors of articles they read, and that $1 is divisible into a few thousand shares.

And what are its limitations?

Difficulty of adoption

It is not (yet) easy for anyone to adopt blockchain transactions. For the current setup with Ethereum, a new user has to:

  1. Download MetaMask (after getting Chrome first), Trust, or some other form of crypto-wallet.
  2. Set up a wallet, which is a string of confusing button-clicking.
  3. Hopefully, back up the wallet, which may include writing down 12 random words, or making a digital copy.
  4. Sign up for an exchange account, probably after Googling “the best ETH exchange” and reading a little disturbing news on people getting scammed.
  5. Buy some Ether with a credit card.
  6. Transfer the money to the wallet (and wait for some 2 to 40 minutes for the transfer to go through).
  7. Actually start using the wallet.

The overall experience is confusing and inconsistent. No single party has yet controlled all of the steps above and wrapped them in a user-friendly fashion. Hopefully a better solution is put forward soon.

Cost of use

Any calculation on the Ethereum network asks for “gas,” a small amount of money you pay the thousands of nodes to do work.

Although it is much cheaper to make money transfers on the blockchain than on a fiat-money network, it is still too much of a cost for anything that’s deemed free in the real world. Imagine an idle game that costs you a dime each time you click a button — it’s not easy to get a huge audience. To make matters worse, the money you pay is not taken by the developer; it pays the thousands of nodes in the network to do the calculation so that the majority can reach a consensus on the computation results. Therefore, the developer cannot axe that cost for you.

On the bright side, there already are endeavors to solve the issue. Among them, Loom aims to eliminate most fees by running low security level transactions off of main net for better throughput rates. I am expecting more solutions to come in the near future.

Barebone features

Currently, you can add, substract, multiply and devide in Solidity, Ethereum’s programming environment. There is no built-in Float types, let alone Double for you to use. Anything more than that you have to write yourself. Want pow(base, power) where parameter power can be a float? Good luck with that!

And even if you cracked the theoretical coding problem, you still have precision to think about, since results of each division is rounded down to the nearest integer. Then there’s cost to run — do multiplication 100 times and the gas fees will skyrocket. The game will be too costly to attract enough audience and will have a hard time taking off.

Un-update-ability

Since code is law on the blockchain, it is not easy to update a game for a new economy, a new feature, or some fine-tunes of the economic parameters.

For example, when I decide that players level too quickly in my game and I want to change that, I may need to change EXP gain rate. Fortunately this is done by issues a transaction and alter a variable within the contract. The catch is, you need to have a forward looking vision and expect some fine-tunes at the beginning of the design process. You may need to plug in a “master EXP gain ratio” and use it to change EXP gain rate in the future.

Many other things are not easily changed. If I want fire, water and grass properties on players’ weapons, there’s no easy way to do that — the scope of change is larger than a few variables; it’s about some new functions. For that, a new contract has to be issued. I would need to migrate user data from the old contract to the new one as necessary — another costly move on the blockchain. After all, you are asking each and every node on the network to set aside some precious disk space and write new data for you. They would also have to talk to each other and reach a consensus. It’s a chore, both economically and physically.

It goes without saying that everything you do, you handle with extra care. It is 100 times more so on the blockchain.

Disconnection from the outside

You can trust transactions all you want within the blockchain network, but you can’t escape connecting to the outside. You don’t just say “I want to buy a coffee for 0.008 Ethers” and expect that get done automatically — you still need a barista verifying that transaction, and you acknowledging the receipt of the coffee physically.

  1. From The Truth About Blockchain 

  2. For a more thorough explanation on public and private key pair encryptions, I recommend this video. In a nutshell, messages encrypted with my private key (hidden from public, hence the name) can be decrypted with my public key. I publicly announce my private key. If you can decrypt a message with my public key, it’s proof the message came from me and nobody else. 

  3. The fees are variable and in high times, it spiked up to a few US dollars in January 2018. But that only lasted for about a week. 

  4. I was going for “nanotransactions” since microtransactions is overused for those $0.99 diamonds your kids buy on their iPhones.