Fuzzy match uses Levenshtein Distance to calculate the similarity between two strings.
compare two strings directly
use “ ” as a separator to split the string. compare the strings in that list of separated strings. return the highest score.
use “ ” as a separator to split the string. sort the list before comparing.
use “ ” as a separator to split the string. convert to a set that removes duplication before comparing.
Number does not lie.
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.
private < fileprivate < internal (default) < public < open
Here note the things I learned along the way.
SwiftUI uses the @State property wrapper to allow us to modify values inside a struct, which would normally not be allowed because structs are value types.
id to mark it
as -> upcast
as? -> optional downcast
as! -> forced downcast
is -> type check
Any > AnyObject > NSObject
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
viewDidLoad -> viewWillAppear -> viewDidAppear -> viewWillDisappear -> viewDidDisappear
CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. It has over 80 thousand libraries and is used in over 3 million apps.
sudo gem install cocoapods
pod setup --verbose
in project directory
guard statements only run when certain conditions are not met.
A protocol defines a blueprint of methods, properties, and other requirements that suit a particular task or piece of functionality.
Closures are self-contained blocks of functionality
Extensions add new functionality to an existing class, structure, enumeration, or protocol type
reduce the code inside the class
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.
Cryptography + Proof of Work + Decentralized networks
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:
If I pick commit 234567 to new branch, I will…
This records things I learn about navigation component during a project.
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.
SafeArgs can pick up the argument and generate proper class that you can use in target fragment, i.e. FragmentB.