Fuzzy match uses Levenshtein Distance to calculate the similarity between two strings.

ratio

compare two strings directly

partial_ratio

use “ ” as a separator to split the string. compare the strings in that list of separated strings. return the highest score.

token_sort_ratio

use “ ” as a separator to split the string. sort the list before comparing.

token_set_ratio

use “ ” as a separator to split the string. convert to a set that removes duplication before comparing.

Speeder version of FuzzyWuzzy.

Number does not lie.


Section 21

Computed Properties

if only get is used, that variable can only be got.

Fairly usable if multiple variables are related to each other. No function for maintaining that relationship is needed. It makes the code easier to understand.

Observed Properties

Access Level

private < fileprivate < internal (default) < public < open

Struct vs Class

Structs

  • value type (store the actual data values. if copied, a new one is created.)
  • lives on the stack, FILO
  • have a default initializer
  • Deep copies
  • true immutability (Once a value inside a Struct is changed, a new struct is created with the changed value.)
  • no memory leaks
  • thread-safe

Classes

  • reference type…

Section 15

Constant and static keyword

UITableView

Customize UITableViewCell

Type Casting, as as? as! is

as -> upcast

as? -> optional downcast

as! -> forced downcast

is -> type check

Any > AnyObject > NSObject

current time

Date().timeIntervalSince1970

IQKeyboardManager

IQKeyboardManager allows you to prevent this issue of keyboard sliding up and covering UITextField/UITextView without needing you to write any code or make any additional setup

Hide NavigtaionBar at Welcome Screen

ViewController LifeCycle

viewDidLoad -> viewWillAppear -> viewDidAppear -> viewWillDisappear -> viewDidDisappear

Application LifeCycle

AppDelegate, ScreenDelegate…


Ethereum is the infrastructure/platform for running Dapps (Decentralized application), which is built on a decentralized network that combines a smart contract and a frontend user interface. Ether incentivizes people to run the Ethereum protocol on their computer. The author of dapp needs to pay the platform in Ether to deploy code and does not have control over the dapp after the deployment.

Smart Contracts

  • self-executing
  • letter strict
  • immutable
  • difficult to secure
  • code is law (in ethereum classic)

Blockchain Technology

Cryptography + Proof of Work + Decentralized networks

Proof of staking (in Ethereum 2.0)

  • deposit funds (Stake)on a network computer (Node)
  • Nodes compete for the opportunity to forge a…

Cherry pick is picking the whole file to the new branch.

If the commit you are picking has changes in one file, the whole file in the commit will be applied to current version of the file in the target branch. Thus, although some prior changes made to that file are not indicated in the commit, they will be included in this cherry pick.

history of git repo:

  1. Commit 123456 — make change A in File F (1st commit)
  2. Commit 234567 — make change B in File F (2nd commit)

If I pick commit 234567 to new branch, I will…


This records things I learn about navigation component during a project.

Pass arguments

Fragment A -> Fragment B

and pass data

Be notice that although the above code having the arguments declared in the action tag of the source fragment (FragmentA), i.e. @id/fragment_a_to_b. There is not a must to declare arguments passing from source to target fragment. You can simply declare the wanted arguments inside the target fragment tag. e.g.

<fragment
android:id="@+id/fragment_b"
android:name="com.jacky.testnavigationcomponent.FragmentB"
android:label="FragmentB"
tools:layout="@layout/fragment_b">
<argument
android:name="argString"
app:nullable="false" />
</fragment>

SafeArgs can pick up the argument and generate proper class that you can use in target fragment, i.e. FragmentB.

private val…

Jacky Tsang

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store