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 lldb | |
import re | |
import shlex | |
# This script allows Xcode to selectively ignore Obj-C exceptions | |
# based on any selector on the NSException instance | |
def getRegister(target): | |
if target.triple.startswith('x86_64'): | |
return "rdi" |
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
//useful to construct the elements of UI fast ,we always write these code in the interface for instance | |
/* | |
let label = UILabel() | |
label.translatesAutoresizingMaskIntoConstraints = false | |
label.adjustsFontSizeToFitWidth = adjustToFit | |
label.text = text | |
label.font = UIFont.preferredFont(forTextStyle: fontStyle) | |
label.textAlignment = .left | |
label.textColor = textColor |
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
struct BigInt { | |
var value:String | |
func multiply(right:BigInt) ->BigInt { | |
var a1 = value.characters.reverse().map {Int(String($0))!} | |
var a2 = right.value.characters.reverse().map {Int(String($0))!} | |
var product = [Int](count:a1.count + a2.count,repeatedValue:0) | |
for iterNumber1 in 0..<a1.count { | |
for iterNumber2 in 0..<a2.count{ | |
let idxIter = iterNumber1 + iterNumber2 |
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 UIKit | |
class Oven { | |
var _temperature:Temperature = Temperature() | |
var temperature :Temperature { | |
get {return _temperature} | |
set { _temperature = newValue.copy() } | |
} | |
} | |
class House { | |
var thermostat :Temperature? |
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 UIKit | |
struct Screen<A> { | |
let run: (A -> ()) -> UIViewController | |
} | |
struct Step<A> { | |
let build: (navigationController: UINavigationController, callback: A -> ()) -> UIViewController | |
} |