- 博客(190)
- 收藏
- 关注
原创 01 Prompt Enginering
摘要: Prompt工程是优化AI模型输入指令(Prompt)以获取理想输出的技术,其质量直接影响生成结果。Token是模型处理文本的基本单位,涉及计费、长度限制和推理效率。关键技术包括Zero-shot/Few-shot学习、思维链(CoT)推理、知识库整合和Prompt分片。应用场景涵盖Chat Completions、Function Calling、微调(Fine-tuning)及检索增强生成(RAG)。本地部署开源模型和AIOPS基础知识也是重要方向。核心在于通过结构化Prompt设计提升AI性能
2025-06-30 20:06:03
321
原创 python 面向对象
创建对象首先调用__new__创建一个空对象,然后通过这个init进行初始化操作。obj.x = 123 #调用set函数 del obj.x执行del函数。在创建了这个property的对象后,默认obj.x #执行这个getx。比如在enter中创建数据库连接句柄,在exit中关闭。类是一系列方法与属性的抽象封装的一个集合体。继承是一个子类继承父类的属性或者方法,但是。多态:同一个函数传入不同对象执行同一个方法。对象加括号会调用__call__方法。#加了__getitem__.
2023-05-15 10:05:33
492
原创 go chan简单使用
chan在go中是一个通道有可读可写的chan,也存在只读只写的chan,通过共享内存而实现通信chan 注意点:在关闭chan后再关闭chan 会出现panic关闭chan后可以继续进行取值,取完后可以再取但都是对应类型的0值。可以通过 v,ok:=<-ch 来判断是否取完了 取完了ok为false也可以通过for range 来取值for v:= range ch{ fmt.Printf("the data is %d",v)}for { v,ok:=<-ch i
2022-03-01 11:50:45
9448
原创 go语言切片 slice(深浅拷贝删除)
切片与map类似是引用 需要make进行初始化make([]int,size,cap)make 指定slice的长度以及容量func SliceTest5() { s1 := make([]int,10,20) fmt.Println(s1)}切片赋值 99为索引,给索引为99的slice赋值func SliceTest5() { s1 := []int{99: 1, 1, 2} fmt.Println(s1)}func main() { SliceTest5()}go
2022-01-09 21:08:16
916
原创 go map sync RWMutex
go map类似python字典delete(map,“key”)func main(){ m1 := make(map[string]string) m1["name"] = "wuyong" m1["password"]="123" delete(m1,"password") for k,v := range(m1){ fmt.Println(k,v) } value, ok := m1["password"] //ok是看当前key是否存在返回布尔,value返回对应ke
2021-12-26 22:12:25
644
原创 go语言初识
iota 类似累加器package mainimport "fmt"func main(){ const( z =iota z1 z2 ) fmt.Println(z,z1,z2)}0 1 2iota类似行号第一行为0以此类推package mainimport "fmt"func main(){ const( z1,z2 =iota+1,iota+2 //iota 为0 z3,z4=iota+1,iota+2 //iota 为1 ) fmt.
2021-12-26 21:55:26
156
原创 kubenetes调度NodeSeletctor,NodeAffinity PodAffnity toleration
kubernetes 集群总是希望资源充足的node上去,并将bind信息写入到etcd中去。调度分为预选 优选先预选,首先筛选出一批node作为候选优选 对预选的node进行打分,选优秀的NodeSelectorlabel是k8s中非常重要的概念,用户可以非常灵活的使用label来管理与限制资源,Pod可以调度到指定label的节点上去。比如如下pod会被调度到 打了 nodeSelector: disktype: ssd 标签的node上,然后在这些node里面选取一个最优的。给
2021-12-22 16:28:33
529
原创 kubectl configmap subpath(慎用)不会更新到挂载点
configMap 可以挂载文件到pod内部注意点是通过subpath挂载不会删除原本路径下的文件,但是你用kubectl edit cm application-demo 不会自动更新到挂载路径因此prometheus挂载的文件不用subpath,因为prometheus会监控cm更新实现动态软加载,这样更新会同步到挂在内部。kubectl create cm application-cm --from-file config.txtapiVersion: apps/v1Kind: Deplo
2021-12-02 16:32:07
1975
原创 kubernetes pod, deployment
first: pod is the smallest unit of the k8s(pod是k8s最小资源单位)pod can include servral containers the init container which provide the netwoprk environment for the other pod,it means the containers in the pod the network is interlinked(pod 内部有一个基础容器,提供类似docker
2021-08-27 16:13:28
369
原创 java 标准输入的坑nextInt后无法nextLine
在执行完s.nextInt();后必须要用String temp = s.nextLine();//接收回车是nextInt的输入的回车会被当做下一次nextLine的输入因此需要接收回车,类似C语言的scanfpackage com.company;import java.util.Scanner;public class SalaryTest { public static void main(String[] args) { while (true) {
2021-07-21 20:03:27
268
原创 java初识标准输入与标准输出Scanner(system.in)
java的标准输入输出标准输入import java.util.Scanner;标准输出System.out.println(“input ok\n”);导入类Scanner s = new Scanner(System.in); 新建对象String s1 = s.nextLine();获取输入的字符串String s2 = s.nextInt();获取输入的数字if(s1.euqals(“wuyong”)){System.out.println(“input ok\n”);}im
2021-07-21 15:26:56
373
原创 groovy 泛型
groovy 泛型就是鸭子类型。T类似go语言中的interface,可以是任意类型public class DictType{private T localt;}class Example { static void main(String[] args) { // Creating a generic List collection ListType<String> lststr = new ListType<>();
2021-06-10 13:49:36
557
原创 groovy面向对象继承多态 抽象类
groovy对象的继承通过关键字extends 基类名字,只能继承共有变量或者函数,private不能直接继承class Example{ static void main(String [] args){ Student st = new Student(); st.StudentID = 88; st.Marks1 = 100; st.name="wuyong"; println(st.name); }
2021-05-21 16:15:54
1438
原创 Groovy异常捕获
try{…}catch{}finally{}finally无论如何都会走class Example { static void main(String[] args) { try{ File file = new File("E://file.txt"); FileReader fr = new FileReader(file); }catch(Exception e2){ println("have so
2021-05-14 17:40:01
1385
原创 groovy 时间Date
Date是一个时间类,可以用它实例化出对象。class Yong { static void main(String [] args){ Date date = new Date("05/11/2021"); Date date1 = new Date("06/10/2021"); println(date.after(date1)) println(date.toString()); }}falseTue May 11 00:00:00 CST 2021after()测
2021-05-13 17:31:12
1758
原创 groovy map 映射
containsKey(String keyname) 判断是否包含某个keyget 通过key获取value. dic.get(“name”)dic.keySet()打印所有滴key值。put(Object key, Object value)class Test{ static void main(String[] args){ def dic = ["name":"wuyong","password":"123456"]; println(dic.containsKey("name"
2021-05-13 16:08:11
263
原创 Groovy列表
末尾追加size()数组长度class Example { static void main(String[] args) { def list1 = [] ; def list2 = [1,2,3,4]; list2.add(12); list2.add(12); println(list2.size()); println(list2); } }6[1, 2, 3, 4, 12, 12]contains 包含元素返回为
2021-05-13 15:37:17
1603
原创 groovy字符串操作
1.字符串的拼接类似python 就是使用 “+”class Test{static void main(String [] args){ String a = "hello"; String b = " world \n"; def c = a+b; println(c);}}字符串索引class Test{static void main(String [] args){ String a = "hello"; String b = " world"; def c =
2021-05-12 19:22:43
981
原创 groovy 数字转换比较min max
数字转换import java.io.Fileclass Example { static void main(String[] args) { def x = 211; println(x.intValue()); println(x.intValue()); def y=31.1; println(y.intValue()); println(y.byteValue()); }}数字比较转换y.comp
2021-05-12 11:16:45
979
原创 groovy读写文件删除文件,文件复制,目录创建
文件写入首先导入java.io.File package, new File object,append在文件末尾追加。import java.io.Fileclass Text{ static void main(String[] args){ def file = new File("test.txt"); file.append("hello guys"); }}文件写入覆盖式import java.io.Fileclass Text{ static void main
2021-05-11 18:01:15
1672
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人