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
@startuml go_channel | |
title チャネル利用例 | |
hide footbox | |
participant ゴルーチンA as rA | |
participant ゴルーチンB as rB | |
rA -> rA : チャネル生成 | |
rA -> rB ** : チャネル |
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
package main | |
import ( | |
"fmt" | |
"math/big" | |
) | |
// コンウェイのチェーン表記で a -> b -> c を計算する。 | |
func chain(a big.Int, b big.Int, c big.Int) big.Int { | |
if b.Cmp(big.NewInt(1)) == 0 { // b == 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
@startuml | |
actor 息子 as son | |
actor パパ as papa | |
actor ママ as mama | |
actor おじいちゃん as grandpa | |
activate son | |
son -> papa ++ : アイス食べたい! | |
papa --> son -- : 今日は甘い物たくさん食べたからまた明日ね |
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
@startuml | |
actor You as you | |
box ServerA | |
participant "main-A Go routine" as main_a | |
participant "server A Go routine" as server_a | |
participant "RPC handler A Go routine" as handler_a | |
end box | |
box ServerB | |
participant "main-B Go routine" as main_b |
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
#include "stdio.h" | |
#include "pthread.h" | |
void *TestRoutine(void *p) { | |
int testVar = 123; | |
printf("TestRoutine - testVar:%d\n", testVar); | |
int *ip = (int *)p; | |
ip = &testVar; | |
} |
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
package main | |
import "fmt" | |
func TestRoutine(ch chan *int) { | |
var testVar int = 123 | |
defer func() { ch <- &testVar }() | |
fmt.Printf("TestRoutine - testVar:%v\n", testVar) | |
} |
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
# GitHubにあるリポジトリから、特定のフォルダ以下のファイルを、ダウンロード容量を節約しつつ取得するPowerShellスクリプトのサンプル。 | |
$userName = "kusa-mochi" | |
$repoName = "image-tracer" | |
$targetFolderPath = "ImageTracer/ViewModels/" | |
$repoUrl = "https://github.com/${userName}/${repoName}.git" | |
set-location ../ | |
remove-item $repoName -Recurse -Force |
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
@startuml 米炊き | |
actor 太郎 | |
box キッチン | |
participant 米びつ | |
participant 水道 | |
participant 炊飯器 | |
end box | |
太郎 -> 米びつ : お米を計量する |
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
@startuml 米炊き | |
actor 太郎 | |
box キッチン | |
participant 米びつ | |
participant 水道 | |
participant 炊飯器 | |
end box | |
太郎 -> 米びつ : お米を計量する |
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
#include <stdio.h> | |
// エントリポイント | |
int main() { | |
printf("てすてす"); | |
return 0; | |
} |
NewerOlder