High Level Introduction to Python

概述

Python 诞生自 1991 年,现已在数据科学、Web 开发和软件测试等领域有非常广泛的应用。可能有两方面的原因促使 Python 如此成功,一个是语法简单易于上手,另一个是丰富的第三方扩展包 (Package)。

Read More

Android 中使用 SVG 简介

概述

可缩放矢量图 (Scalable Vector Graph,以下简称 SVG),可以大大减小 Android app 中打包的图像资源大小,不用担心图片模糊的问题,很适合用于简单风格或者几何风格的图像。此外在 Android 中,SVG 极大的灵活性,远非其它 drawable 类型(shape,说的就是你)能比。

Read More

Network security basics

This post mentions elliptic curve for many times, check the post Elliptic curve cryptography basics for more information.

Read More

Elliptic curve cryptography basics

This is my first post about cryptography. Recently I learnt basics about public key encryption and the TLS handshake. But the key exhange in the TLS handshake inspected by Wireshark, i.e. ECDH(Elliptic-curve Diffie–Hellman) troubled me for a while. This this the first time I knew Elliptic curve. After some investigation, I’m recording those knowledges in case that I forget them.

Read More

Kotlin Summary

Table of Contents

  1. Before all

Read More

5 分钟提高 macOS 使用效率

前言

提起 macOS,大家可能会想到精致、广告少、软硬搭配极佳、Unix 等等,这些也是 macOS 逐渐在软件开发者、设计师、文字工作者等群里中成为「标配」的原因。然而总结我这几年的使用经验,我认为有许多工具和方法,可以在默认的 macOS 基础上,更进一步提高我们的效率。本文基于 macOS 10.14.6,不比较 macOS 和其它系统孰优孰劣,而是针对「所有用户」和「程序员」两个群体分别分享一些我的经验,欢迎讨论和交流。另外,本文推荐的几乎都是免费或者开源的工具,嗯,我就是这么为大家的钱包着想(我可不会说是因为我穷)。

Read More

给三星 tablet SM-T830 刷机

背景

前天公司发给我一部三星 tablet 作为测试机,是 Tab S4 wifi 版,具体型号是 SM-T830,虽然不是我期待的 Pixel 3 XL,但是配置也还不错,加上屏幕也比较大。但是坑就坑在,这是一部国行的机器,没有 Google Mobile Service (GMS) 不说,还充斥了不少国内生态的杂物,比如系统设置中的 device storage 界面,居然写着「powered by 360」,还有一些预装的国内应用。

Read More

再次将 hexo blog 放置到 Github Pages

插话

电脑换了后,我把 hexo blog 整个目录拷贝到新电脑,然后新电脑安装 node,安装 hexo,用 npm 安装主题所需的依赖,然后 generate 出来的网页文件样式有问题,最后回退到 node v10 才解决。似乎 node 对历史版本的兼容性不佳,也可能是用 npm 安装的一些依赖没适配最新的 node,神坑!

Read More

Android 自定义简易 PickerView

最近的做的一项 feature 中,需要使用类似于 iOS 的 UIPickerView 的控件,功能是通过滚动 item 来选择其中一个,也就是下图这样的:

Read More

一个不一样的 ANR

最近碰到一个 ANR 问题,拿到 traces 文件后,显示主线程的堆栈是下面这样的:

1
2
3
4
5
6
7
at android.os.MessageQueue.nativePollOnce(Native method)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke!(Native method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Read More