- 博客(28)
- 收藏
- 关注
原创 pytorch代码笔记
/watch?v=c36lUUr864M&t=936s基本操作import torchimport numpy as npdevice = torch.device("cpu")if torch.cuda.is_available(): device = torch.device("cuda")x = torch.ones(2,2,dtype=torch.double)x.size()x = torch.rand(2,2,requires_grad=True,devic
2022-03-16 18:30:17
1990
原创 饥荒 服务器 docker-compose
使用了大佬的代码https://github.com/Jamesits/docker-dst-server.git但是在我的使用过程中一些mod总会报错,所以尝试将base-image改为ubuntu并解决相应错误后解决,由于我服务器的特殊配置,所以不得不将用户改为root:DancingJoker/docker-dst-server我是使用的docker-compose up --build -d启动,在docker-compose volumes中配置存档位置,其他方式可以视情况使用..
2022-03-15 13:58:58
1742
原创 李宏毅【機器學習2021】笔记
文章目录預測本頻道觀看人數 (上) - 機器學習基本概念簡介什么是机器学习不同类型的函数How to find a function? A Case Study写一个新的函数,使得预测函数更加复杂更加符合实际(一周为周期)預測本頻道觀看人數 (下) - 深度學習基本概念簡介线性model太简单了Sigmoid Function重新定义一些符号。。。至此我们改进了前面提到的机器学习框架的第一步:Function with unknownLossBatchReLU实战效果多层神经网络实战效果此即深度学习为什么不
2022-03-15 11:38:16
1354
原创 CS224N NLP
文章目录AbbreviationLecture 1 - Introduction and Word VectorsNLPWord2vecUse two vector in one word: centor word context word.softmax functionTrain the model: gradient descentShow some achievement with code(5640-h0516)QALecture 2 Word Vectors,Word Senses,and Ne
2022-03-01 19:12:56
884
原创 C# cosmosdb
namespace AspNetCoreApi.Mapper{ public class CosmosDbRepository:ICosmosDbRepository { private static CosmosClient? client; private static Database? db; private static Container container; public CosmosDbRepository..
2022-01-19 19:02:02
251
原创 祝安好
我想在早 中 晚对你说早安 午安 晚安可我早已无处寻你就好像四季春天我见不到你 我只能带着初醒的梦 和每一朵花对话。夏天我见不到你 绿皮红瓤的季节 我只能剪一头短发 把蝉鸣收藏。秋天我见不到你 黄昏细雨里 我只能回忆起你熟悉的味道 让你感知我最澄澈的眷恋。冬天我见不到你 冬夜渐深 细碎过往已让回忆温柔很多 于是在漫天大雪里 绵延不绝的是我对你的祝福。我最喜欢的是夏夜的磅礴大雨从前我享受飘摇其中的感觉现在我想在其中撑起一把伞可我如何前去寻你绝望疯长恣肆无所忌惮寂寞而...
2022-01-18 14:03:31
315
原创 Azure Service Bus 实现定时器以及按序执行任务
using System;using System.Threading.Tasks;using Azure.Messaging.ServiceBus;using System.Collections;using Newtonsoft.Json.Linq;using System.Collections.Generic;namespace ServiceBusConsole{ internal class Program { // connection str.
2022-01-07 14:31:22
581
原创 fastapi nacos
import nacos_pyfrom fastapi import FastAPIimport yamlfrom munch import munchifyfrom starlette.requests import Requestfrom starlette.responses import Responseimport tracebackimport sysimport warningssys.tracebacklimit = 3 # 限制打印错误行数# 首先配置applic.
2022-01-06 14:18:57
1104
原创 python 操作mysql
之前写了mongo的,mentor说mysql会好一点。。python -m pip install mysql-connector-pythonimport mysql.connectorclass User: first_name = None last_name = None email = None password = None authority = None def __init__(self,Email,Password
2021-12-21 15:12:51
982
原创 python grpc
大佬教导我rpc比http更底层,效率更高,这是个大坑,用处也很多,暂时粘下使用方法,留待再研究:grpc会生成一套两个python类给客户端和服务端使用,首先生成下:编写文件qa.proto:syntax = "proto3";message QaRequest { string character=1; string query=2; string model_path=3;}message QaResponse {
2021-12-17 11:35:34
517
原创 python 利用azcopy 从azure storage 上下载内容
用了下LRUCachefrom LRUCache import LRUCacheimport subprocessdef get_model(model_path): print("get model") if model_path == "": return None; model = cache.get(model_path) if model!=-1: return model local_path = head+...
2021-12-17 11:21:20
813
转载 C# AES加盐加密 python AES加盐解密
C#static string encrypt(string clearText = "") { if (clearText == null) { clearText = ""; } string EncryptionKey = "Saturday"; byte[] clearBytes = Encoding.UTF8.GetBytes(clearText); using (...
2021-12-17 11:07:19
803
1
转载 C# python sha256 哈希加盐
C# public static string CreateSHA512Hash(string Password, string Salt) { try { byte[] bytes_password = Encoding.UTF8.GetBytes(Password); byte[] bytes_salt = Encoding.UTF8.GetBytes(Salt); HashAlgo...
2021-12-17 11:05:00
719
原创 lucene 删除所有索引
项目中dpr部分用到了lucene建立索引,在接入过程中涉及到了点相关操作:删除旧知识,添加新知识,但是大佬的代码是addDocument(doc),直接添加,所以查了查将其删除。self.index_write = index.IndexWriter(directory, config)self.index_write.deleteAll()self.index_write.commit()researcher的活一般轮不到我干,,,很感兴趣,留个锲子,看以后会不会有缘再见...
2021-12-17 10:56:27
283
转载 python LRUCache
懒的写了抄的大佬的代码,因为要存储的东西单个对象有几个G所以加了点gc:class LRUCache(collections.OrderedDict): def __init__(self, size=2): #print(self.size) self.size = size, print(self.size) self.cache = collections.OrderedDict() def get(self, k...
2021-12-17 10:46:39
176
原创 python fasiapi 获得请求参数
Post请求体内的参数及路径参数@app.post("/getlist/{query}")async def getlist(query:str,request:Request): data =await request.json()get路径参数及?后的参数:@app.get("/getlist/{query}")async def getPredict1(query:str):username = request.args.get("username")...
2021-12-17 10:35:50
678
原创 C# await sync
本人初学C#被这俩关键字困扰了好几天,一顿午觉醒来豁然开朗,说下自己的理解哈。首先要跳出C#:多线程和异步的概念:多线程旨在多件事可以同时执行,而异步则关注于代码的执行顺序,并在保证两个步骤的先后顺序的同时,主任务可以不因为等待从任务而卡死。然后进入C#:C#中将这两个概念结合起来,就有了关键字Await和sync,在查阅资料时,很多人都强调这两个关键字是异步的第三形态(第一形态是可见传入回调函数的原生写法,第二形态是Promise)可能是js是这样?带着这样的理解学习C#中的await和s
2021-09-18 14:53:39
769
原创 Java 动态代理
首先写下查找的对动态代理的定义:动态代理就是想办法,根据接口或目标对象,计算出代理类的字节码,然后再加载到JVM中使用。我的理解:动态代理旨在java运行时(涉及到的知识:编译时、运行时、构建时)动态加载目标类,在实现目标类方法的基础上,使用自己的方法(jdk用反射,cjlib则利用ASM机制继承目标类)将自己需要的增强代码插入其中,以达到不修改原代码,只新添自己的代码而增强原方法功能的目的,从查到的方法可以知道,增强的代理类已经不是目标类,是新的类,新的字节码,目标类未发生变动.首先写下涉
2021-07-11 21:09:54
131
原创 vue 动态绑定 点击事件(匿名函数)
遇到一个问题,一个点击方法在v-for里的一个元素上,由于该方法需要处理本次循环的数据并影响本次循环的其他元素,所以暂时没有想到可以把方法声明在vue的methods里的方法,所以就直接写在了元素上:<view @click="function(){if(order.createTime!=-1){order.createTime=-1;}else{order.createTime=1}}"> <view style="width: 50vw;" >回收物品</
2021-07-11 19:44:28
4594
原创 c++ 点滴 vector<int>& citations
没咋学过c++,尝试借leetcode的机会了解一下,今天的每日一题是 274. H 指数遇见个奇怪的东西:vector<int>&citations,感觉和Java的arrayList有点像?目前没有系统学习c++的欲望,只是想了解,所以只搜索可以解题的知识,绝不深究.这里citations[i]可以正常取值,排序方法如下:sort(vec.rbegin(), vec.rend());//正序sort(vec.rbegin(), vec.rend());//逆.
2021-07-11 19:41:42
119
原创 128陷阱
public class Main { public static void main(String[] args) { Integer a = 127; int b = 127; Integer c = 128; Integer d = 128; Integer e = new Integer(127); Integer f = new Integer(128); int g = 12.
2021-07-10 20:14:44
79
原创 静态块 构造块
代码如下:public class InitializeDemo { private static int k = 1; private static InitializeDemo t1 = new InitializeDemo("t1" ); private static InitializeDemo t2 = new InitializeDemo("t2" ); private static int i = print("i" ); private sta
2021-07-10 20:00:45
121
原创 js Promise牛刀小试
fuck:function(){this.timeOut().then(functionsuccess(value){console.log(value)})},timeOut:function(){returnnewPromise(function(resolve,reject){console.log("WTF")setTimeout(function(){...
2021-06-14 10:16:25
118
原创 ArrayList 中有空元素
今天在两个不同的地方遇到了一样的问题,,,以前从来没有遇到过,,由于有空元素所以进入循环操作会报错,上次是因为数组里只有一个元素,是空元素所以进入循环时判断第一个元素是否为空就可以了,这次是null元素散布在...
2021-06-04 17:25:06
617
原创 ArrayList size大于零,但 All elements are null
头回知道ArrayList中是可以加null的: List<User> users = new ArrayList<User>(); users.add(null); users.add(null); users.add(null);
2021-06-04 10:58:43
659
原创 synchronized关键字问题
代码如下 public class InterprocessLock { public static int a = 0; public static void main(String[] args) { //motate50 for (int i = 0; i < 1000000; i++) { new Thread(new TestThread(i)).start();
2021-06-03 17:58:19
95
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人