Git Clone Specific Branch
git clone --branch Lesson4 https://github.com/chiahao/Memorize.git
git clone --branch Lesson4 https://github.com/chiahao/Memorize.git
git checkout -b Lesson4 origin/Lesson4
Escaping Closures A closure is said to escape a function when the closure is passed as an argument to the function, but is called after the function returns. As an example, many functions tha...
Clean the Code EmojiMemoryGame.swift typealias Card = MemoryGame<String>.Card private(set) var cards: Array<Card> ... cards = Array<Card>() cards = [] Computed Property ...
Displaying Dynamic Dates in Widgets let components = DateComponents(minute; 11, second: 14) let futureDate = Calendar.current.date(byAdding: components, to: Date())! Text(futureDate, style: .rela...
Associated Values enum productBarcode { case upc(Int, Int, Int, Int) case qrCode(String) } var productBarcode = .qrCode("ABCDEFG") switch productBarcode { case .upc(let numberSystem, let manu...
com.apple.dt.deviceprocesscontrolservice Code When Run Widget Probably because widget is bound to App, I need to rerun app first before run the editted widget.
Filter execution order: follow the order of filter-mapping Cannot apply different init-param to different servlet.
byte[] digest = MessageDigest.getInstance("MD5").digest("The String".getBytes(StandardCharsets.UTF_8)); StringBuilder sb = new StringBuilder(); // transform into hex for (byte b : digest) { sb...
Use escape when there are parenthesis in regex. @Test public void testRegexLongMatcher() { String user_agent = "Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Firefox/38.0"; boolean expRe...