Skip to content

Instantly share code, notes, and snippets.

# kubectl -n orchard apply -f k8s-demo.yaml
# kubectl -n orchard edit configmap k8s-demo
apiVersion: v1
data:
index.html: |
<h1>Hello k8s</h1>
<p>This is a test page...</p>
kind: ConfigMap
metadata:
@eecsmap
eecsmap / demo_interactive_asyncio.py
Created May 28, 2024 21:50
simple demo of interactive usage of asyncio
# demo interactive mode in asyncio
import asyncio
count = 10
async def count_down():
while True:
global count
diff --git a/internal/command/create/vm.go b/internal/command/create/vm.go
index d9ef9dd..b025272 100644
--- a/internal/command/create/vm.go
+++ b/internal/command/create/vm.go
@@ -3,11 +3,12 @@ package create
import (
"errors"
"fmt"
+ "os"
+ "strings"
@eecsmap
eecsmap / FIFO_simple_interface.md
Last active December 30, 2023 19:02
Compare FIFO interfaces.
第三十四章 NP完全性
第一段:
另外,还有许多可以在多项式时间内解决的问题
应该改为:
另外,还有许多可以解决的问题
点评:这里的画蛇添足反而带来了错误的逻辑
本章第二页:
作为一名工程师,更好的办法就是花时间开发一种近似算法(见第35章)或解决某种易处理问题的特例
应该改为:
@eecsmap
eecsmap / Makefile
Created May 15, 2023 22:11
template_verilog_test
%.fst: %.vvp
vvp $< -fst
%.vvp: %.v
iverilog -g2012 -o $@ $<
clean:
rm -f *.vvp *.fst
@eecsmap
eecsmap / template_verilog_test.v
Last active May 15, 2023 22:11
tempate of verilog test
// 设定单位时间和解析精度
`timescale 1ns/1ns
// 后续的#1表明经过1个时间单位
// iverilog -g2012 -o demo.vvp demo.v
// vvp demo.vvp -fst
// gtkwave demo.fst
module test ();
#include <Windows.h>
#include <WinCrypt.h>
#include <iostream>
#pragma comment (lib, "Crypt32.lib")
bool InstallCertificate(const char* certificateFile, const char* certificateStore)
{
bool success = false;
module debouncer #(
parameter WIDTH = 1,
parameter SAMPLE_CNT_MAX = 62500,
parameter PULSE_CNT_MAX = 200,
parameter WRAPPING_CNT_WIDTH = $clog2(SAMPLE_CNT_MAX),
parameter SAT_CNT_WIDTH = $clog2(PULSE_CNT_MAX) + 1
) (
input clk,
input [WIDTH-1:0] glitchy_signal,
#include "quick_sort.h"
#include "utils.h"
#include <fstream>
typedef std::pair<uintV, uintV> intPair;
template <class E> struct ascendingF {
E operator()(const E &a, const E &b) const { return a > b; }
};