Jun
13
What’s new in Swift 4.2?
Published 12:06 Jun 13, 2018 by @ezra.
#Programming# Swift 4.2 is the second minor release of Swift 4, and brings with it another raft of awesome improve...
Jun
11
Swift struct type recursion
Published 12:06 Jun 11, 2018 by @ezra.
#Programming# the enums in Swift support recursive types using the indirect keyword so you can do something like:
...
May
17
Dart Primer 001 : Hello, world!
Published 12:05 May 17, 2018 by @ezra.
#Programming# 今天开始一起来学习一下 Dart 语言。
安装
首先第一步来 安装 Dart, 以 macOS 为例:
homebrew
先来安装 homebrew, 然后执行:
$ brew tap dart-la...
May
17
Dart Primer 002 : 数据类型概述
Published 12:05 May 17, 2018 by @ezra.
#Programming# 在 Dart 中一切实例都是对象, 它们集成自 Object 且默认均为 null。
数据类型
Dart 中主要的数据类型有:
Numbers => 数值
Strings => 字符串
...
May
17
Dart Primer 003 : 函数
Published 12:05 May 17, 2018 by @ezra.
#Programming# 首先, 如前面所讲, Dart 中函数也是对象的一种。当一个函数没有指定返回值时, 返回 null。
函数定义
定义一个函数的格式是:
返回值 函数名(参数类型 参数名1, 参数类型 参数名2, .....
May
17
Dart Primer 004 : 操作符与流程控制
Published 12:05 May 17, 2018 by @ezra.
#Programming# Dart 语言整体上与 C++、Java 类似, 当然也有一些细节需要注意区分。
操作符
取整
操作符 ~/ 应该是很少见的一种写法:
int a = 3;
int b = 2;
print(a ~/...
May
17
Dart Primer 005 : 类
Published 12:05 May 17, 2018 by @ezra.
#Programming# Dart 是一门使用类单继承的语言, 所有对象都是类的实例, 且所有类都是 Object 类的子类。
定义类
类的定义使用 class 关键字。
class Point {
num x;
nu...
Mar
05
Whiptail Cheatsheet
Published 15:03 Mar 05, 2018 by @ezra.
#Programming# Whiptail is a program that allows shell scripts to display dialog boxes to the user for informationa...
Mar
05
Swift: Codable not decoding properties with subclasses
Published 12:03 Mar 05, 2018 by @ezra.
#Programming# In this code, the groceries properties is not deserialised from JSON. The name property is, but not ...
Jan
21
Tkinter Cheatsheet
Published 10:01 Jan 21, 2018 by @ezra.
#Programming# Hello World
We always need to follow two steps no matter how big the application is, there is always...
Jan
06
CSS Selectors Cheatsheet
Published 17:01 Jan 06, 2018 by @ezra.
#Programming#
Selector
Example
Example description
.class
.intro
Selects all elements with class="i...
Jan
05
Swift: Return instancetype
Published 12:01 Jan 05, 2018 by @ezra.
#Programming# To return instancetype in Swift, you can define a generic helper method which infers the type of sel...