This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Так. немного информации для тех, кто сюда недавно попал | |
1) ICFP Contest - ежегодное соревнование приуроченное функциональному программированию | |
2) Несмотря на то, что оно приурочено и связано с конференцией по функциональному программированию, можно участвовать на любых языках программирования. | |
3) 72 часа без берерывов и выходных | |
4) Каждый год задание разное и разной степени интересности и сложности. Задания прошлых годов легко гуглятся. Лучшим заданием IMHO есть задание 2006 года http://users.livejournal.com/-adept-/24049.html . | |
5) Это немного не олимпиадного вида контекст. Но тут зависит от задания | |
6) Язык - Kotlin :slightly_smiling_face: В этом году мы пишем на котлине. Близкоскриптовый, компилируемый, надо меньшче писать чем в джаве, поддерживает всю джаву из коробки | |
7) Другие языки. В прошлом году мы попали на кейс, когда серверная часть писалась на другом языке, и часть команды, которая ее писала отвалилась после первого дня. (В принципе предупреждали, что так может быть, и люди делавшие эту часть пото |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -m timeit -n 1 -r 5 -s 'import os' \ | |
-s 'import shutil' \ | |
-s 'shutil.rmtree("LocalDerivedData", ignore_errors=True)' \ | |
-s 'os.system("xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme -derivedDataPath LocalDerivedData clean | xcpretty")' \ | |
'os.system("xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme -derivedDataPath LocalDerivedData build-for-testing | xcpretty")' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncrustify-0.66.1 | |
# | |
# General options | |
# | |
# The type of line endings. Default=Auto. | |
newlines = auto # auto/lf/crlf/cr | |
# The original size of tabs in the input. Default=8. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static func currentUser(inContext context: NSManagedObjectContext) -> User? { | |
guard let objectIdURL = UserDefaults.standard.url(forKey: userDefaultKeyUserURL) else { return nil } | |
guard let objectId = context.persistentStoreCoordinator?.managedObjectID(forURIRepresentation: objectIdURL) else { return nil } | |
var object: User? = nil | |
context.performAndWait { | |
object = context.object(with: objectId) as? User | |
} | |
return object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UICollectionViewListRenderer: ListRenderer { | |
private var ignoringUpdates: Bool = false | |
weak var collectionView: UICollectionView? | |
init(collectionView: UICollectionView?) { | |
self.collectionView = collectionView | |
} | |
func reloadData() { | |
collectionView?.reloadData() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FROM: | |
let callSpy1 = CallSpy.makeCallSpy(f2: testReduce) | |
let callSpy2 = CallSpy.makeCallSpy(f2: testReduce) | |
let store: Store<Int, IntegerArithmeticAction> = Store(state: 0, reducers: [callSpy1.1, callSpy2.1]) | |
store.consume(event: .increment) | |
store.consume(event: .decrement) | |
store.consume(event: .add(1)) | |
store.consume(event: .subtract(1)) | |
expect(callSpy1.0.callCount).to(equal(4)) | |
expect(callSpy2.0.callCount).to(equal(4)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public extension XCTestCase { | |
// We conform to LocalizedError in order to be able to output | |
// a nice error message. | |
private struct RequireError<T>: LocalizedError { | |
let file: StaticString | |
let line: UInt | |
// It's important to implement this property, otherwise we won't | |
// get a nice error message in the logs if our tests start to fail. | |
var errorDescription: String? { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol Updateable { | |
func updated(block: (inout Self) -> ()) -> Self | |
} | |
extension Updateable { | |
func updated(block: (inout Self) -> ()) -> Self { | |
var item = self | |
block(&item) | |
return item | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let a: Double? = 1.0 | |
let b: Double? = 2.0 | |
let c: Double? = 3.0 | |
let d: Double? = 4.0 | |
let e: Double? = 5.0 | |
let f: Double? = 6.0 | |
let g: Double? = 7.0 | |
extension Optional { | |
func `or`(_ value : Wrapped?) -> Optional { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
"---Cool?---".replacingOccurrences(of: "-", with: "_") | |
// swiftc -dump-ast example.swift |