A tiny Playground for UIFont
. Inspect title
to visualize attributes
.
Usage: clone this gist and rename the folder to Fonts.playground
.
class OneClass {} | |
class AnotherClass {} | |
let one = OneClass() | |
let another = AnotherClass() | |
let crash = one as AnyObject as AnotherClass |
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
diff --git a/The Oakland Post/PostTableViewController.swift b/The Oakland Post/PostTableViewController.swift | |
index a2666ed..7f5c336 100644 | |
--- a/The Oakland Post/PostTableViewController.swift | |
+++ b/The Oakland Post/PostTableViewController.swift | |
@@ -17,7 +17,7 @@ class PostTableViewController: BugFixTableViewController, MWFeedParserDelegate, | |
} | |
var baseURL: String! | |
- var feedParser: FeedParser! | |
+ var feedParser: MWFeedParser! |
// MARK: NHBalancedFlowLayoutDelegate | |
func collectionView(collectionView: UICollectionView!, | |
layout collectionViewLayout: NHBalancedFlowLayout!, | |
preferredSizeForItemAtIndexPath indexPath: NSIndexPath!) -> CGSize { | |
if UIScreen.mainScreen().scale == 1.0 { | |
var size = photos[indexPath.item].size | |
size.width /= 2 | |
size.height /= 2 | |
return size |
let fruits = ["apple", "bananananana"] | |
/* | |
var s: String | |
if fruits.count == 1 { | |
s = "" | |
} else { | |
s = "s" | |
} |
#!/usr/bin/env python3 | |
from math import sqrt | |
def main(): | |
'''Display the probability of successfully capturing a Pokémon.''' | |
# Read in the formulae parameters. | |
max_hp = int(input('Max HP: ')) | |
hp = int(input('Remaining HP: ')) |
class Letter { | |
convenience init(filePath: String) { | |
self.init() | |
loadFromFile(filePath) | |
} | |
func loadFromFile(filePath: String) { | |
println("loading \(filePath)") | |
} | |
} |
#!/usr/bin/env python | |
from __future__ import print_function | |
import numpy as np | |
from sklearn.naive_bayes import GaussianNB | |
# Problem: | |
# https://www.dropbox.com/s/ta4sh8cld3sh7rj/Screenshot%202014-10-07%2002.28.13.png?dl=0 | |
######### |
// Computes an estimation of e^x using a Taylor series expansion with n terms. | |
// 1 + (x^1/1!) + (x^2/2!) + ... + (x^n/n!) | |
func exponential(x: Double, n: Double) -> Double { | |
var exponential: Double = 1 | |
for var y: Double = 1; y <= n; y++ { | |
var power: Double = 1 | |
var yFactorial: Double = 1 | |
for var i: Double = 1; i <= y; i++ { | |
yFactorial *= i |