View IteratorExample.java
import java.util.Iterator; | |
public class IteratorExample { | |
public static void main(String[] args) { | |
Iterable<Integer> iterable = () -> new Iterator() { | |
int i = 0; | |
final static int MAX = 10; | |
public boolean hasNext() { | |
return i < MAX; |
View UserAgentFetcher.swift
public final class UserAgentFetcher: NSObject { | |
private let webView: WKWebView = WKWebView(frame: .zero) | |
@objc | |
public func fetch() -> String { | |
dispatchPrecondition(condition: .onQueue(.main)) | |
var result: String? | |
View gitignore 기준으로 다시 트래킹 하기
git rm -r --cached . | |
git add . | |
git commit -am 'refresh git tracking' | |
git push |
View CachedClassifier.swift
class CachedClassifier { | |
private var sumCache = [Int: Int]() | |
func sumOfFactors(_ number: Int) -> Int { | |
if let cachedValue = sumCache[number] { | |
return cachedValue | |
} | |
let sum = aliquotSum(factors(number)) |
View EscapingClousureTest.swift
//: Playground - noun: a place where people can play | |
import UIKit | |
class TestClass { | |
deinit { | |
print("deinit \(self)") | |
} | |
View Emptiable+Extension.swift
// | |
// Emptiable+Extension.swift | |
// sieum | |
// | |
// Created by 홍성호 on 2018. 8. 8.. | |
// Copyright © 2018년 홍성호. All rights reserved. | |
// | |
// https://github.com/artsy/Emergence/blob/master/Emergence/Extensions/Apple/Occupyable%2BisNotEmpty.swift | |
// |
View SwiftExtensionForObjc.swift
@objc protocol AAA { | |
} | |
extension AAA { | |
var aa: Int { | |
return 0 | |
} | |
} |
NewerOlder