No Runtime Error:
func == (l: Car, r: Car) -> Bool { return l.vin == r.vin }
struct Car { let vin: String }
protocol hasDriversLicense: class {
var car: Car? { get set }
}
class YoungPro: hasDriversLicense {
No Runtime Error:
func == (l: Car, r: Car) -> Bool { return l.vin == r.vin }
struct Car { let vin: String }
protocol hasDriversLicense: class {
var car: Car? { get set }
}
class YoungPro: hasDriversLicense {
// https://programmingpraxis.com/2011/08/30/hamming-numbers/ | |
// cosmin said | |
// October 30, 2012 at 7:14 PM | |
// Another solution based upon Dijkstra’s paper: | |
def hammingSeq(N): | |
h = [1] | |
i2, i3, i5 = 0, 0, 0 | |
for i in xrange(1, N): | |
x = min(2*h[i2], 3*h[i3], 5*h[i5]) |
If you use Spotify without cellular data, all you'll ever see for album art is a gray circle with a white musical note inside it.
I'm pretty familiar with spotify. Been a paid subscriber for a long time and visited Sweden, staying in the Jarl Birger hotel right under you guys. :)
Still, I never noticed how much I missed album art until one day I accidentally left cellular data on and chewed through a half gig of data.
I love album art. It's beautiful, connects me to the band, and I always want to see it.
enum Coin { | |
case heads | |
case tails | |
} | |
var result: Coin? | |
// You can pattern match against it like an optional: | |
switch result { | |
case .heads?: print("heads") | |
case .tails?: print("tails") |
// | |
// A definition for the kind of model objects this library can work on | |
// | |
import Foundation | |
public protocol CollieModel: Unboxable, WrapCustomizable, Hashable, CustomStringConvertible { | |
/// Configure the mapping between client and server property names. keys are client names and values are JSON names eg: "authorId: "author_id" | |
static var propertyMapping: [String: String]? { get } |
// | |
// ViewController.swift | |
// ios-mall-demo | |
// | |
// Created by Alexander Yngling on 26/10/15. | |
// Copyright © 2015 Waitress AB. All rights reserved. | |
// | |
import UIKit |
Add a _drafts
folder as a sibling of _posts
. You add posts inside it the same way. To preview drafts, start jekyll with jekyll s --wD
. The D
is for Drafts.
Jekyll only allows one category per post. You can apply the category by front matter or subfolder, but subfolder never gets forgotten so it's recommended. If you need more than one "something" per post, create a separate front matter field:
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { | |
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) | |
print("init nibName: \(self) \(unsafeAddressOf(self))") | |
} | |
required init?(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) | |
print("init coder: \(self) \(unsafeAddressOf(self))") | |
} | |
deinit { | |
print("deinit coder: \(self) \(unsafeAddressOf(self))") |
define( | |
[] | |
() -> | |
_analyticsSites = | |
DEMO: 1 | |
LOCALHOST: 2 | |
_libUrl = (server) -> | |
'js!' + server + '/js/piwik.js' |
$ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
$alphabet = 'abcdefghijklmnopqurstvwxyz' | |
# Get an index of an alphabetic letter based on the index and offset | |
def calculateOffset(index, offset) | |
index += offset | |
index -= 26 while index >= 26 # keep subtracting until we get to the right range | |
index | |
end |