現任職於博智雲端科技用python寫web app,下班後的身份是台灣城市單車聯盟理事、Cocoaheads Taipei發起人、業餘macOS/iOS開發者。 上一個生涯目標是推廣熱愛的蘋果,已達成。接下來的生涯目標是推廣熱愛的單車多元文化,用單車來改變城市。 曾主辦「沈默的騎行」呼籲重視交通安全,以及「台北裸騎」。
This file contains hidden or 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
// 特殊的數字我沒處理,會 fail。例如 subnormal 或者 NaN | |
// 用法: 0.94.exact() // "0.939999999999999946709294817992486059665679931640625" | |
// | |
// main.swift | |
// FloatingPoint | |
// | |
// Created by Yung-Luen Lan on 2019/8/27. | |
// Copyright © 2019 yllan. All rights reserved. | |
// |
This file contains hidden or 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
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP2dNTRrLtCSzxQ8WpSrTngstjOLQ3xxFpdKcdYZN3YD [email protected] |
This file contains hidden or 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
func encode(line: MKPolyline) -> Data { | |
return Data(buffer: UnsafeBufferPointer(start: line.points(), count: line.pointCount)) | |
} | |
func decode(data: Data) -> MKPolyline { | |
let buf = UnsafeMutableBufferPointer<MKMapPoint>.allocate(capacity: data.count / MemoryLayout<MKMapPoint>.size) | |
data.copyBytes(to: buf) | |
return MKPolyline(points: buf.baseAddress!, count: buf.count) | |
} |
This file contains hidden or 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 MapKit | |
extension MKPolyline: Encodable { | |
public func encode(to encoder: Encoder) throws { | |
var container = encoder.unkeyedContainer() | |
for idx in 0..<self.pointCount { | |
let p = self.points()[idx] | |
try container.encode(p.x) | |
try container.encode(p.y) | |
} | |
} |
This file contains hidden or 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 MapKit | |
extension MKPolyline: Encodable { | |
public func encode(to encoder: Encoder) throws { | |
var container = encoder.unkeyedContainer() | |
for idx in 0..<self.pointCount { | |
let p = self.points()[idx] | |
try container.encode(p.x) | |
try container.encode(p.y) | |
} | |
} |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="zh-TW"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>眠豆腐 Sleepy Tofu :: 手工床墊專門製造所</title> | |
</head> | |
<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" style="padding: 0;"> | |
<div id="wrapper" dir="ltr" style="background-color: #f7f7f7; margin: 0; padding: 70px 0 70px 0; width: 100%; -webkit-text-size-adjust: none;"> | |
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%"><tr> | |
<td align="center" valign="top"> |
This file contains hidden or 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
1, 4, 12, 2, 3, 6, 8, 9, 5, 7, 10, 11, | |
1, 4, 12, 2, 3, 8, 6, 9, 7, 5, 10, 11, | |
1, 4, 12, 2, 3, 8, 6, 9, 7, 10, 5, 11, | |
1, 4, 12, 2, 3, 8, 6, 11, 5, 10, 7, 9, | |
1, 4, 12, 2, 3, 8, 11, 6, 5, 10, 7, 9, | |
1, 4, 12, 2, 3, 11, 8, 5, 9, 7, 6, 10, | |
1, 4, 12, 2, 3, 11, 8, 9, 5, 7, 10, 6, | |
1, 4, 12, 2, 8, 3, 6, 9, 7, 5, 10, 11, | |
1, 4, 12, 2, 8, 3, 6, 9, 7, 10, 5, 11, | |
1, 4, 12, 2, 8, 3, 6, 11, 5, 10, 7, 9, |
This file contains hidden or 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
Process: Xcode [4673] | |
Path: /Applications/Xcode.app/Contents/MacOS/Xcode | |
Identifier: Xcode | |
Version: 10.0 (14320.25) | |
App Item ID: 497799835 | |
App External ID: 828536089 | |
Code Type: X86-64 (Native) | |
Parent Process: ??? [1] | |
Responsible: Xcode [4673] | |
User ID: 501 |
This file contains hidden or 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
// | |
// Signer.swift | |
// Sign | |
// | |
// Created by Yung-Luen Lan on 2018/8/17. | |
// Copyright © 2018 yllan. All rights reserved. | |
// | |
import Foundation |