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
{"uid":"c6f896ae99568183792cb037f95f272b","updateDate":"2023-03-19T10:33:00+09:00","titleText":"東京都\n3月19日 10:33 気象庁 発表","mainText":"。本州付近は、黄海に中心を持つ高気圧に覆われています。一方、伊豆諸島付近は気圧の谷となっています。。。東京地方は、晴れています。。。19日は、高気圧に覆われますが、気圧の谷や湿った空気の影響を受ける見込みです。このため、晴れで夜は曇りとなるでしょう。。。20日は、高気圧に覆われますが、気圧の谷や湿った空気の影響を受ける見込みです。このため、晴れで朝晩は曇りとなるでしょう。。【関東甲信地方】\n。関東甲信地方は、おおむね晴れとなっています。。。19日は、高気圧に覆われますが、気圧の谷や湿った空気の影響を受ける見込みです。このため、晴れや曇りで、伊豆諸島では昼過ぎまで雨の降る所があるでしょう。。。20日は、高気圧に覆われますが、気圧の谷や湿った空気の影響を受ける見込みです。このため、晴れや曇りで、伊豆諸島では夜遅く雨の降る所があるでしょう。。。関東地方と伊豆諸島の海上では、19日から20日にかけて、うねりを伴い、波が高いでしょう。船舶は高波に注意してください。"} |
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 | |
import MetalKit | |
class ViewController: UIViewController, MTKViewDelegate { | |
/// StoryBoardに配置済のMTKView | |
@IBOutlet weak var mtkView: MTKView! | |
/// edgeTessellationFactorの設定値 | |
var edgeFactor = Float(2) | |
/// insideTessellationFactorの設定値 |
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
sdfsdf |
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
aaaa |
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
hogehoge |
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
applications: | |
- name: アプリ名 | |
disk_quota: 1024M | |
memory: 256M | |
host: ホスト名 | |
domain: mybluemix.net | |
command: python ファイル名 | |
path: . | |
instances: 1 |
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
extension Data { | |
func CRC16() -> UInt16 { | |
let table: [UInt16] = [ | |
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, | |
0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, | |
0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, | |
0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, | |
0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, | |
0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, | |
0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, |
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
/// リトライする`Promise`を作成する | |
/// | |
/// - Parameters: | |
/// - maxRepeat: 最大リトライ回数。超えた場合は`RetryError`が`throw`される | |
/// - args: `task`を実行する時に渡す引数 | |
/// - task: 実行させたい非同期処理を指定する。`Promise`を返さないといけない | |
/// - preRetry: リトライ前に実行される処理を指定する。`false`を返すとリトライはされない | |
/// - Returns: `Promise`を返す | |
/// - Note: `RetryError`の定義が必要 | |
func retry<T, U>(maxRepeat: Int, args: U, task: @escaping (U) -> Promise<T>, preRetry: @escaping (Error) -> Bool) -> Promise<T> { |
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
extension String { | |
func rightTrimmingCharacters(in set: CharacterSet) -> String { | |
for c in characters.reversed().enumerated() { | |
let isMatch = c.element.unicodeScalars.contains { set.contains($0) } | |
if !isMatch { | |
return String(self[startIndex..<index(endIndex, offsetBy: -c.offset)]) | |
// swift4 | |
//return String(prefix(upTo: index(endIndex, offsetBy: -c.offset))) | |
} | |
} |
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
func write(url: URL, text: String) -> Bool { | |
guard let stream = OutputStream(url: url, append: true) else { | |
return false | |
} | |
stream.open() | |
defer { | |
stream.close() | |
} | |
NewerOlder