A tiny Playground for UIFont. Inspect title to visualize attributes.
Usage: clone this gist and rename the folder to Fonts.playground.
| # reversebinary.py | |
| def main(): | |
| '''Reverse numbers in binary. | |
| For instance, the binary representation of 13 is 1101, and reversing it | |
| gives 1011, which corresponds to the number 11. | |
| ''' | |
| decimal_in = read_input() |
| -=-=-=- Andrew and Skye's Awesome Adventures: -=-=-=- | |
| -=-=-=- Question 2: Counterfeit Coin Correctness -=-=-=- | |
| Loop invariant: | |
| At the beginning of each recursion, the real doubloon is either in pile | |
| A, B, or C. | |
| Initialization: |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "math/rand" | |
| "runtime" | |
| "strconv" | |
| "time" | |
| ) |
| // | |
| // SlingScene.m | |
| // | |
| // Demonstrates a simple slingshot mechanism. | |
| // | |
| // Created by Andrew Clissold on 5/3/14. | |
| // Copyright (c) 2014 Andrew Clissold. All rights reserved. | |
| // | |
| /* Contents of SlingScene.h: |
| div > .vimiumHintMarker { | |
| background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#eee)); | |
| border: 1px solid #ddd; | |
| text-shadow: none !important; | |
| box-shadow: none; | |
| } | |
| div > .vimiumHintMarker span { | |
| color: #a00; | |
| font-weight: bold; |
| #!/usr/bin/env python3 | |
| import sys | |
| keys = { | |
| 'C4': 'q', 'C#4': 'a', 'Db4': 'a', 'D4': 'z', | |
| 'G4': 'd', | |
| 'E5': 'h', | |
| 'C5': 't', | |
| 'G5': 'j', |
| // 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 |
| #!/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 | |
| ######### |
| class Letter { | |
| convenience init(filePath: String) { | |
| self.init() | |
| loadFromFile(filePath) | |
| } | |
| func loadFromFile(filePath: String) { | |
| println("loading \(filePath)") | |
| } | |
| } |