This file contains hidden or 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
/// Parses a csv string and returns a 2d array. | |
/// | |
/// Size of the array will be equal to the number of rows. | |
/// And Size of the subarray will be equal to the | |
/// number of fields. | |
/// | |
/// Note: Delimiter can be changed to a different character | |
/// like semicolon. | |
func parse(string: String, delimiter: Character = ",") -> [[String]]{ | |
let rows = string.split(separator: "\n") |
This file contains hidden or 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 | |
private let testSize = 100_000_000 | |
private var testTime:CFAbsoluteTime = 0 | |
private var optimisedTestTime:CFAbsoluteTime = 0 | |
class Test | |
{ | |
func testing2(var x : Int) -> Int | |
{ |
This file contains hidden or 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
private var privateGlobalFoo = 42 | |
class Foo { | |
class var foo: Int { | |
get { return privateGlobalFoo } | |
set(newVal) { privateGlobalFoo = newVal } | |
} | |
} | |
println(Foo.foo) |
This file contains hidden or 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
@interface UILabel (dynamicSizeMe) | |
-(float)resizeToFit; | |
-(float)expectedHeight; | |
-(void)resizeToStretch; | |
-(float)expectedWidth; | |
@end |