- WASD
- add office
- add worker
- add IT
- add office
- add elevator shaft
- 5 worker
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
r""" | |
>>> f(''' | |
... [variables] | |
... c = 1 | |
... d.e = 1 | |
... f = ['{g}'] | |
... g = ['{gg}'] | |
... gg = 1 | |
... | |
... [a] |
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
""" | |
The alternative of entry point from `robot`, aims to disable output | |
capturing in order to make it display everything as usual, while we | |
usually run single FPGA emulation rather than multiple. | |
Following are included in this entry point. | |
0. Implicitly export Python library search path for `Library`. | |
1. Disable `robot` logger handler "inception" and output capturer | |
by monkey patching. |
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 <stdlib.h> | |
#include <string.h> | |
static void update(int* buffer, size_t last) { | |
buffer[last] = 1; | |
for (size_t k = 1; k < last; k++) | |
buffer[last-k] += buffer[last-k-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
import subprocess as sp | |
import textwrap | |
cmd = 'squeue --cluster=testbed --Format=jobid:10,partition:15,username:15,account:8,timeused:15,nodelist:15,name:50' | |
cmd = 'env | grep -i VENV' | |
cmd = 'python -c \'import sys; sys.stdout.write("stdout\\n"); sys.stderr.write("stderr\\n")\'' | |
cmd = 'echo -e ""; sleep 1 && echo -e \'fal\\nse\' && false' | |
#sp.run(cmd, shell=1) |
命題: https://x.com/pipichih/status/1709248514033909778
from functools import partial
from inspect import signature
from os.path import join
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 logging | |
import os | |
class ColoredFormatter(logging.Formatter): | |
def __init__(self, coloring=True, fmt='%(L)s{asctime} {levelname:<%(T)s} {name}%(R)s {message}', | |
datefmt = '%Y-%m-%dT%H:%M:%SZ', style = '{', *args, **kwargs): | |
if coloring: | |
L, R = map('\033[90m{}\033[m'.format, '[]') | |
T = 15 |
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
#!/usr/bin/env bash | |
set -eu | |
# Parse arguments | |
# =============== | |
parse_args() { | |
local args=`mktemp` parser=$1; shift | |
python3 -c "$parser" $@ 3>$args |
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
<script type="module"> | |
window.addEventListener('message', async(event) => { | |
if (event.origin.match(/jenkins.internal.sifive.com/)) return; | |
if (! event.origin.match(/^http:\/\/localhost:|internal.sifive.com/)) return; | |
const path = event.data; | |
const resp = await fetch(path); | |
const json_data = await resp.json(); | |
window.parent.postMessage(json_data, event.origin); | |
}); |
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
/* | |
* The main purpose of code structure is | |
* (1) to handle different upstream with different strategies, and | |
* (2) to dispatch groups to build and test | |
* (3) with common essential information delivered from upstream. | |
*/ | |
def build_only(kwargs) { | |
build(job: params.DOWNSTREAM_JOB, propagate: false, wait: false, parameters: [ | |
/* Common parameters */ |
NewerOlder