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
// A simple quickref for Eigen. Add anything that's missing. | |
// Main author: Keir Mierle | |
#include <Eigen/Dense> | |
Matrix<double, 3, 3> A; // Fixed rows and cols. Same as Matrix3d. | |
Matrix<double, 3, Dynamic> B; // Fixed rows, dynamic cols. | |
Matrix<double, Dynamic, Dynamic> C; // Full dynamic. Same as MatrixXd. | |
Matrix<double, 3, 3, RowMajor> E; // Row major; default is column-major. | |
Matrix3f P, Q, R; // 3x3 float matrix. |
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 | |
extension UIImage { | |
subscript (x: Int, y: Int) -> UIColor? { | |
if x < 0 || x > Int(size.width) || y < 0 || y > Int(size.height) { | |
return nil | |
} |
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 Foundation | |
protocol Observer { | |
var id: String { get } | |
func update(_ string: String) | |
} | |
extension Observer { | |
func update(_ string: String) { | |
print("\(type(of: self)) に届いた新しい値は \(string) です。") |
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 Foundation | |
protocol Observer { | |
var id: String { get } | |
func update(_ string: String) | |
} | |
extension Observer { | |
func update(_ string: String) { | |
print("\(type(of: self)) に届いた新しい値は \(string) です。") |
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
// | |
// RW.swift | |
// Web | |
// | |
// Created by Mike Chirico on 10/15/15. | |
// Copyright © 2015 Mike Chirico. All rights reserved. | |
// | |
import UIKit |