Apple Designs That Inspire / 吐槽苹果

列举一下我认为的苹果产品设计的经典。我并不是苹果的粉丝,也从来没有拥有过任何一代 iPhone 产品,from first generation iPhone, to latest iPhone XS。

iPhone Family

经典的 iPhone 5 / 5s

iPhone 5 / 5s

适合单手操作,体重适中,不打滑,有握持感。

新 iPhone 早已没有了新鲜感。全面屏,无线充电,双卡双待,屏下指纹识别,前后双屏 … 这些都已不再成为苹果的专利。

手机设计还是有很多潜力开发。还没走到尽头。In other words, 手机是现在最具创新和有最多创新的产品了。但苹果现在已经变得保守,中庸,不思进取了。

BTW,耳机 maybe 下一个智能产品竞争领域。Headphones 已经成为手机以外第二个人手必备的设备了。

iPad Mini 2 / 3 / 4

这是我在 October 23, 2012,the first generation iPad Mini was announced 时写的评论:

“It takes 30 months and 4 generatons since first release of iPad on April 3rd 2010, Apple finally gets the right size, right weight, right price, right design, right OS, right applications, right market niche, right balanced, almost no annoying public complainted issues, nearly all bugs been fixed iPad delivered”

iPad Mini 2 使用上 Retina Display. 至今仍然是轻便的不行,仍然流畅的不行。

新的“全”面屏 iPad Pro 本月要发布了。不明白“全”面屏在大屏幕设备上的意义。个人还是喜欢现在的 iPad pro 10.5. “全”面屏 iPad Pro 追求逼格,Bigger Than Bigger,牺牲掉 home button,少了一“键”钟情。

Why the hell MacBook has removed sleep light / 呼吸灯? Think about it after you have a look Transformers Mac light:

信仰灯

为甚 turn off 信仰灯,信仰的灯塔?有多少用户会在乎多费那么一点点用电。留下的只是深深的执念,蛋蛋的忧伤?

MagSafe

Magsafe 磁吸充电接口一直被认为是饱含创新和智慧设计。论安全性与便捷性还有什么比 MagSafe 做的更好?

Mac Mini

Why small is beautiful? 看看 Mac Mini 的结构。

Mac Mini structure

能把一个功能完整的 PC 主机,放进如此狭小的空间内,功耗低又安静,除了 brilliant 还能用什么来形容?

Mac Mini 已经好长时间没有更新换代。不知道苹果是否在考虑砍掉这个产品。

Serenity

近几年苹果的新产品设计是感觉在吃老本,going downhill. 好的设计没有继承发扬,反而在做减法被一一去掉。新产品亮相后总感觉缺少点什么。也许是一种精神,也许是一颗灵魂。

A Python script which implements Mantua Cipher

Run output from Console:

1
2
3
4
5
6
7
8
9
10
11
$ PycharmProjects/cipher/venv/bin/python PycharmProjects/cipher/src/cipher.py
[ 60 31 53 33 33 53 23 ] : blossom
[ 60 55 73 66 66 73 23 ] : blossom
[ 20 37 12 0 0 12 23 ] : blossom
[ 60 37 82 14 14 82 89 ] : blossom
[ 20 31 82 95 95 82 89 ] : blossom
[ 60 36 90 0 0 90 23 ] : blossom
[ 20 37 90 94 94 90 23 ] : blossom
[ 20 55 90 94 94 90 89 ] : blossom
[ 20 36 97 94 94 97 89 ] : blossom
[ 60 36 82 0 0 82 23 ] : blossom

Step by step resetting Bluetooth on Mac OS

Latest Mac OS High Sierra version 10.13.6.

  • Open Terminal and login as user “root”:
1
# rm /Library/Preferences/com.apple.Bluetooth.plist
  • Reset the Bluetooth Module with Option + Shift + click on bluetooth icon in taskbar. Click on Debug -> Reset the Bluetooth Module

Reset Bluetooth on Mac OS

Assumptions and Conditional Test execution, ignoring in JUnit

Sometime you want to ignore some test depends on environment settings. Now both JUnit 4 and JUnit 5 support the concept of assumptions.

Unit Test like this:

1
2
3
4
5
6
7
@Test
public void testRun() {

Assume.assumeTrue(BooleanUtils.toBoolean(System.getProperty("runtest")));

// Rest of testcase
}

With Gradle, pass in parameter like this:

1
$ gradle test -Pruntest=false

References

Making VSCode like IntelliJ after line commented the cursor automatically moved to next line

Want to make VSCode key bindings as closed as IntelliJ key bindings like.

Firstly, install VSCode extension macros.

macros

Open Code -> Preferences -> Settings. Add following configuration into User Settings.

1
2
3
4
5
6
"macros": {
"commentLine": [
"editor.action.commentLine",
"cursorDown"
]
}

User Settings

Open Code -> Preferences -> Keyboard Shortcuts. Add following configuration into keybindings.json file.

1
2
3
4
5
6
7
8
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+/",
"command": "macros.commentLine",
"when": "editorTextFocus && !editorReadonly"
}
]

keybindings.json

That’s newly added Toggle Line Comment looks like after the change:

Toggle Line Comment

Take over Mac OS X Bluetooth Control

Bluetooth on Mac OS X

Quite annoying when Bluetooth on Mac OS X is off, you can’t turn it on manually via Systme Preferences interface. Now you can install blueutil from https://github.com/toy/blueutil to solve this issue.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
igloo:cheatsheets root# blueutil --help
blueutil v2.1.0

Usage:
blueutil [options]

Without options outputs current state

-p, --power output power state as 1 or 0
-p, --power STATE set power state
-d, --discoverable output discoverable state as 1 or 0
-d, --discoverable STATE set discoverable state

-h, --help this help
-v, --version show version

STATE can be one of: 1, on, 0, off, toggle

Firstly, turn off Bluetooth service via command line:

1
2
igloo:cheatsheets root# blueutil -p 0
igloo:cheatsheets root# blueutil -d 0

Then turn on Bluetooth service via command line:

1
2
igloo:cheatsheets root# blueutil -d 1
igloo:cheatsheets root# blueutil -p 1

Setup and run DEVHINTS.IO cheatsheets on localhost

This is a static website based on Jekyll framework https://jekyllrb.com/. Need install Jekyll and .

Login as user “root” due to write permission required into /Library/Ruby/Gems directory. Install bundler and Jekyll at first:

1
igloo:cheatsheets root# gem install bundler jekyll

Then install all this application dependent libraries:

1
igloo:cheatsheets root# bundler install

Start up Jekyll website on localhost, with user “terrence” this time:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
terrence@igloo ~/Projects/cheatsheets (master ☡=)
17:28:56 𝜆 bundle exec jekyll serve --incremental
Configuration file: /Users/terrence/Projects/cheatsheets/_config.yml
Source: /Users/terrence/Projects/cheatsheets
Destination: /Users/terrence/Projects/cheatsheets/_site
Incremental build: enabled
Generating...
DEPRECATION WARNING on line 83, column 12 of /Users/terrence/Projects/cheatsheets/_sass/vendor/modularscale/_modularscale.scss:
Unescaped multiline strings are deprecated and will be removed in a future version of Sass.
To include a newline in a string, use "\a" or "\a " as in CSS.

done in 3.163 seconds.
Auto-regeneration: enabled for '/Users/terrence/Projects/cheatsheets'
Server address: http://127.0.0.1:4000
Server running... press ctrl-c to stop.

Go to URL: http://127.0.0.1:4000 start searching and using cheatsheets in localhost environment:

DEVHINTS.IO - cheatsheets

DEVHINTS.IO - cheatsheets

To generate static web content ONLY:

1
2
3
4
5
6
7
8
9
10
11
12
13
terrence@igloo ~/Projects/cheatsheets (master ☡=)
17:28:56 𝜆 bundle exec jekyll build
Configuration file: /Users/terrence/Projects/cheatsheets/_config.yml
Source: /Users/terrence/Projects/cheatsheets
Destination: ../terrencemiao.github.io/cheatsheets
Incremental build: disabled. Enable with --incremental
Generating...
DEPRECATION WARNING on line 83, column 12 of /Users/terrence/Projects/cheatsheets/_sass/vendor/modularscale/_modularscale.scss:
Unescaped multiline strings are deprecated and will be removed in a future version of Sass.
To include a newline in a string, use "\a" or "\a " as in CSS.

done in 43.269 seconds.
Auto-regeneration: disabled. Use --watch to enable.

Then can upload published website content from ../terrencemiao.github.io/cheatsheets directory to https://terrencemiao.github.io.