Skip to content

Instantly share code, notes, and snippets.

View sailist's full-sized avatar
🏠
Working from home

Haozhe sailist

🏠
Working from home
  • Sophgo
View GitHub Profile
@sailist
sailist / online_softmax.py
Created November 30, 2023 07:35
online-softmax python demo
from functools import reduce
from dataclasses import dataclass
import torch
from math import exp
def ground_truth(x):
y = torch.softmax(x, dim=-1)
return y
@sailist
sailist / keepchatgpt.js
Created April 17, 2023 11:41
keepchatgpt 去掉高亮
// ==UserScript==
// @name KeepChatGPT
// @description 让我们在使用ChatGPT过程中更高效、更顺畅,完美解决ChatGPT网络错误,不再频繁地刷新网页,足足省去10个多余的步骤。还可以取消后台监管审计。解决了这几类报错: (1) NetworkError when attempting to fetch resource. (2) Something went wrong. If this issue persists please contact us through our help center at help.openai.com. (3) This content may violate our content policy. If you believe this to be in error, please submit your feedback — your input will aid our research in this area. (4) Conversation not found.
// @version 7.7
// @author xcanwin
// @namespace https://github.com/xcanwin/KeepChatGPT/
// @supportURL https://github.com/xcanwin/KeepChatGPT/
// @description:ar لنجعل استخدام ChatGPT لدينا أكثر كفاءة وسلاسة، من خلال تحسين الحل لأخطاء شبكة ChatGPT. وهذا يوفر لنا من تحديث صفحة الويب بشكل متكرر ويقضي على أكثر من 10 خطوات غير ضرورية. تم حل الأخطاء التالية: (1) NetworkError when attempting to fetch resource. (2) Something went wrong. If this issue persists please contact
version: '3.9'
services:
v2ray-hk:
image: v2fly/v2fly-core:latest
container_name: v2fly-hk
ports:
- 7889:1087
volumes:
- ./hk:/etc/v2ray/
entrypoint:
@sailist
sailist / CriticalSectionLock.cpp
Created March 13, 2021 12:50
Windows MultiThread code
#include <windows.h>
#include <iostream>
#define NAME_LINE 40
using namespace std;
// DataStructure passed in thread
typedef struct __THREAD_DATA
{
int nMaxNum;
char strThreadName[NAME_LINE];
@sailist
sailist / DefaultKeyBinding.dict
Created February 22, 2021 02:04 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@sailist
sailist / markdown_writer.py
Created April 16, 2020 02:10
Markdown Writter
"""
Copyright (C) 2020 Shandong University
This program is licensed under the GNU General Public License 3.0
(https://www.gnu.org/licenses/gpl-3.0.html).
Any derivative work obtained under this license must be licensed
under the GNU General Public License as published by the Free
Software Foundation, either Version 3 of the License, or (at your option)
any later version, if this derivative work is distributed to a third party.
@sailist
sailist / MARC21slim2RDFDC.xsl
Created March 28, 2020 11:36
读取MARC数据?
<xsl:stylesheet xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" exclude-result-prefixes="marc">
<xsl:import href="MARC21slimUtils.xsl"/>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="marc:record">
<xsl:variable name="leader" select="marc:leader"/>
@sailist
sailist / ace-editor.vue
Created March 27, 2020 04:57
ace-editor.vue
<template>
<div ref="root">
</div>
</template>
<script>
var ace = require("ace-builds")
require("ace-builds/webpack-resolver");
const PROPS = {
value: {},
@sailist
sailist / QLabel显示图片
Last active March 26, 2020 11:04
QT快速模板
def show_feature_imgage(self, fname, label):
image = QImage(fname)
label.setPixmap(QPixmap.fromImage(image))
@sailist
sailist / logwrapper.py
Created January 30, 2020 03:29
LogWrapper
import os
import time
from collections import Iterable, OrderedDict
from datetime import datetime
from typing import Any
class LogParam:
"""
meter = LogParam()