2つの要素に対して差分を求めるとは、何が変わっていないのか、何が追加されたのか、何が削除されたのか、求める行為である。
差分を計算するために、下記3つを計算する。
- 編集距離 (levenshtein distance)
- 2つの要素の差分を数値化したもの
- LCS (Longest Common Subsequence)
- 2つの要素 X と Y の最長共通部分列
$ curl -O ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz | |
$ tar -xzvf ncurses-5.9.tar.gz | |
$ cd ./ncurses-5.9 | |
$ ./configure --prefix=/usr/local \ | |
--without-cxx --without-cxx-binding --without-ada --without-progs --without-curses-h \ | |
--with-shared --without-debug \ | |
--enable-widec --enable-const --enable-ext-colors --enable-sigwinch --enable-wgetch-events \ | |
&& make | |
$ sudo make install |
package main | |
import ( | |
"context" | |
"fmt" | |
"net" | |
"net/http" | |
"os" | |
"os/exec" | |
"os/signal" |
import UIKit | |
typealias Constraint = (UIView, UIView) -> NSLayoutConstraint | |
func equal<L, Axis>(_ to: KeyPath<UIView, L>, constant: CGFloat = 0, priority: UILayoutPriority? = nil) -> Constraint where L: NSLayoutAnchor<Axis> { | |
return equal(to, to, constant: constant, priority: priority) | |
} | |
func equal<L, Axis>(_ from: KeyPath<UIView, L>, _ to: KeyPath<UIView, L>, constant: CGFloat = 0, priority: UILayoutPriority? = nil) -> Constraint where L: NSLayoutAnchor<Axis> { | |
return { view1, view2 in |
import Foundation | |
let intJson = #"{ "inUse": 1, "name": "Daiki Matsudate", "twitter": "d_date", "stars": 99999, "occupation": null}"# | |
let boolJson = #"{ "inUse": true, "name": "Daiki Matsudate", "twitter": "d_date", "stars": 99999, "occupation": null}"# | |
protocol Inherits { | |
associatedtype SuperType | |
var `super`: SuperType { get } | |
} |
If you work on a Swift project that follows the Model-View-ViewModel (MVVM) architecture or similar, you may want to jump to counterpart in Xcode from your view to your model, and then to your view model. (ie. by using Ctrl+Cmd+Up and Ctrl+Cmd+Down).
You can do this in recent versions of Xcode by setting a configuration default.
From a terminal, just type this command and press Enter:
defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View"
PRODUCT_NAME := Foo | |
SCHEME_NAME := ${PRODUCT_NAME} | |
WORKSPACE_NAME := ${PRODUCT_NAME}.xcworkspace | |
UI_TESTS_TARGET_NAME := ${PRODUCT_NAME}UITests | |
TEST_SDK := iphonesimulator | |
TEST_CONFIGURATION := Debug | |
TEST_PLATFORM := iOS Simulator | |
TEST_DEVICE ?= iPhone 11 Pro Max | |
TEST_OS ?= 13.3 |