在 C++17 後要 sum type 可以這樣用:
#include<variant>
// data Solution = Surface Vector3 Double |
// Line Vector3 Vector3 || total 0 | |
| 0 drwxr-x--- 459 joblo staff 15606 15 fév 2015 Mac OS Games | |
| 0 drwxr-x--- 20 joblo staff 680 15 fév 2015 Mac OS Soft | |
| 0 -rw-r--r-- 1 joblo staff 0 16 déc 10:35 filelist.txt | |
| ./Mac OS Games: | |
| total 3011936 | |
| 570728 -rw-r----- 1 joblo staff 292211763 15 fév 2015 -Eve-PeterGabriel.img.sit | |
| 16 -rw-r----- 1 joblo staff 5632 15 fév 2015 00INDEX.TXT.bin | |
| 120 -rw-r----- 1 joblo staff 59075 15 fév 2015 1000.hqx |
| /** | |
| * Definition for singly-linked list. | |
| * struct ListNode { | |
| * int val; | |
| * ListNode *next; | |
| * ListNode() : val(0), next(nullptr) {} | |
| * ListNode(int x) : val(x), next(nullptr) {} | |
| * ListNode(int x, ListNode *next) : val(x), next(next) {} | |
| * }; | |
| */ |
| https://developer.apple.com/library/archive/documentation/mac/pdf/Text.pdf | |
| https://developer.apple.com/library/archive/documentation/mac/pdf/MoreMacintoshToolbox.pdf | |
| https://developer.apple.com/library/archive/documentation/mac/pdf/MacintoshToolboxEssentials.pdf | |
| https://developer.apple.com/library/archive/documentation/mac/pdf/ResEditReference.pdf | |
| https://developer.apple.com/library/archive/documentation/mac/pdf/ImagingWithQuickDraw.pdf | |
| https://developer.apple.com/library/archive/documentation/mac/pdf/MacOS_RT_Architectures.pdf | |
| https://developer.apple.com/library/archive/documentation/mac/pdf/Processes/Vertical_Retrace_Mgr.pdf | |
| https://developer.apple.com/library/archive/documentation/mac/pdf/Sound/Sound_Input_Manager.pdf | |
| https://developer.apple.com/library/archive/documentation/mac/pdf/Networking/DDP.pdf | |
| https://developer.apple.com/library/archive/documentation/mac/pdf/Operating_System_Utilities/PRAM_Utilities.pdf |
| const IDX = { | |
| VHS: { P2: 6, P3: 7, P4: 8, P5: 9, P6: 10 } | |
| } | |
| const nudgePoints = (elementIndexes) => assign((ctx, evt) => { | |
| const [x, y] = [evt.clientX, evt.clientY] | |
| const [sx, sy] = ctx.lastClientPoint | |
| const [dx, dy] = [x - sx, y - sy] | |
| const paths = elementIndexes.map(idx => [0, ctx.groupIndex, idx]) | |
| ctx.editorMethods.nudgeElementsAtPath(dx, dy, paths) | |
| return { ...ctx, lastClientPoint: [x, y] } |
| const pinchMachine = Machine({ | |
| id: 'pinch', | |
| initial: 'idle', | |
| context: { | |
| onPinch: () => {}, | |
| onPan: ([dx, dy]) => {}, | |
| finishPinch: () => {}, | |
| onSingleTouch: { | |
| touchStart: (currentPoint) => {}, | |
| touchMove: (currentPoint) => {}, |
| // Copyright (c) the JPEG XL Project | |
| // | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| const m = Machine({ | |
| id: 'websocket', | |
| context: { | |
| devices: [] | |
| }, | |
| initial: 'offline', | |
| states: { | |
| offline: { | |
| on: { | |
| CONNECT: 'trying' |
| // | |
| // main.swift | |
| // ShitWeb | |
| // | |
| // Created by Yung-Luen Lan on 2020/5/14. | |
| // Copyright © 2020 Yung-Luen Lan. All rights reserved. | |
| // | |
| import Foundation | |
| import Network |