Skip to content

Instantly share code, notes, and snippets.

View tsukiyokai's full-sized avatar

shanshan tsukiyokai

View GitHub Profile
@tsukiyokai
tsukiyokai / pthread_join.c
Last active September 28, 2025 16:36
POSIX Threads Programming
#include <pthread.h>
#include <stdio.h>
void *thread(void *arg) {
printf("This is a thread and arg = %d.\n", *(int *)arg);
*(int *)arg = 0;
return arg;
}
int main(int argc, char *argv[]) {
@tsukiyokai
tsukiyokai / clex.cpp
Last active April 22, 2023 19:10
compiler
#include <fstream>
#include <iostream>
#include <string>
#include <unordered_set>
void scan(std::ifstream &input, std::ofstream &output) {
enum class State { START, IDENTIFIER, NUMBER, OPERATOR };
State state = State::START;
std::unordered_set<std::string> keywords = {
@tsukiyokai
tsukiyokai / eppath_find_rscgrpid.xml
Last active September 28, 2025 16:36
Gist from yEd-Live
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--Created by yFiles for HTML 2.5-->
<graphml xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml.html/2.0/ygraphml.xsd " xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:demostyle2="http://www.yworks.com/yFilesHTML/demos/FlatDemoStyle/2.0" xmlns:demostyle="http://www.yworks.com/yFilesHTML/demos/FlatDemoStyle/1.0" xmlns:icon-style="http://www.yworks.com/yed-live/icon-style/1.0" xmlns:bpmn="http://www.yworks.com/xml/yfiles-bpmn/2.0" xmlns:demotablestyle="http://www.yworks.com/yFilesHTML/demos/FlatDemoTableStyle/1.0" xmlns:uml="http://www.yworks.com/yFilesHTML/demos/UMLDemoStyle/1.0" xmlns:GraphvizNodeStyle="http://www.yworks.com/yFilesHTML/graphviz-node-style/1.0" xmlns:VuejsNodeStyle="http://www.yworks.com/demos/yfiles-vuejs-node-style/1.0" xmlns:explorer-style="http://www.yworks.com/data-explorer/1.0" xmlns:y="http://www.yworks.com/xml/yfiles-common/3.0" xmlns:x="http://www.yworks.com/xml/yfiles-common