Skip to content

Instantly share code, notes, and snippets.

View jasonren0403's full-sized avatar
💭
I may be slow to respond.

Jason Ren jasonren0403

💭
I may be slow to respond.
View GitHub Profile
@jasonren0403
jasonren0403 / src_composables.ts
Last active November 29, 2022 15:51
el-carousel item dark mode issue
import { useDark, useToggle } from '@vueuse/core'
export const isDark = useDark()
export const toggleDark = useToggle(isDark)
@jasonren0403
jasonren0403 / OS_Practice.md
Last active October 21, 2022 08:51
Some Operating System Excercises

《计算机操作系统》部分习题参考作答

适用于汤小丹、梁红兵第4版,ISBN为978-7-5606-3350-3。

不是标准答案!是我自己写的解答!仅供参考!

第二章 进程的描述与控制

2-3 为什么程序并发执行会产生间断性特征?

答:程序在并发执行时,由于它们共享系统资源,由于它们共享系统资源,以及为完成同一项任务而相互合作,致使在这些并发执行的程序之间形成了相互制约的关系。

2-4 程序并发执行时为什么会失去封闭性和可再现性?

答:当系统中存在着多个可以并发执行的程序时,系统中的资源将为它们所共享,而这些资源的状态也由这些程序来改变,致使其中一个程序在运行时,其环境都必然会受到其他程序的影响。

@jasonren0403
jasonren0403 / add_hyperV.cmd
Created September 26, 2022 10:03
Add HyperV to win11
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL
@jasonren0403
jasonren0403 / arcaea-connect.test.js
Created March 15, 2022 10:23
[Legacy] A relay-api for crawling lowest.world, once the activity before unlocking Tempestissimo
describe("Arcaea", function () {
context('Public interface', function () {
it("connect", async () => {
await chai.request(app)
.get(`${API_PREFIX}/arc/connect`)
.then((res) => {
expect(res).to.have.status(200)
expect(res.body).to.have.property("success")
.that.is.true
expect(res.body).to.have.property("code")
@jasonren0403
jasonren0403 / sha1.cpp
Created November 1, 2021 08:48
A simple OpenSSL program to calculate SHA-1 of a file.
#pragma comment(lib, "libeay32.lib")
#pragma comment(lib, "ssleay32.lib")
#include <openssl/sha.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void GetFileSHA1(char *);
void test();
int main(int argc,char * argv[]){
char filename[100];
@jasonren0403
jasonren0403 / renaming.py
Created October 25, 2021 01:25
batch renaming files
import os
path=os.path.dirname(os.path.abspath(__file__))
old_list=os.listdir(path)
n=0
#print(old_list)
for file in old_list:
old_name=file
if '.html' not in old_name or not '_c#' in old_name: # if old_name=='rename.py' or not '_cs' in old_name
continue
@jasonren0403
jasonren0403 / switchmode.sql
Created October 15, 2021 10:00
transfer single user mode to multi user mode
USE master;
GO
DECLARE @SQL VARCHAR(MAX);
SET @SQL=''
SELECT @SQL=@SQL+'; KILL '+RTRIM(SPID)
FROM master..sysprocesses
WHERE dbid=DB_ID('CourseTable'); --CourseTable can change to other DB name
EXEC(@SQL);
ALTER DATABASE CourseTable SET MULTI_USER; --CourseTable can change to other DB name

Keybase proof

I hereby claim:

  • I am jasonren0403 on github.
  • I am jason_ren0403 (https://keybase.io/jason_ren0403) on keybase.
  • I have a public key whose fingerprint is 6ECC 6B92 EF1F 8B99 422F 0381 7D0E EDC6 4970 E959

To claim this, I am signing this object:

@jasonren0403
jasonren0403 / digital_sec_labcode.m
Created September 28, 2021 04:46
Digital Security Lab codes(matlab) | 数字内容安全实验代码
% Lab 1 Image Processing Basics
img=imread('lena_256.tiff');
imshow(img1);
fileinfo=imfinfo('lena_256.tiff');
imwrite(img1,'lena.bmp','bmp');
imwrite(img1,'lena.png','png');
imshow('lena.bmp');
imshow('lena.png');
clear; clc;
@jasonren0403
jasonren0403 / fixNetwork2.reg
Created September 18, 2021 08:48
修复win10右下角连接显示错误问题解决方法2
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet]
"EnableActiveProbing"=dword:00000000