自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(22)
  • 收藏
  • 关注

原创 MAC环境变量文件没有编辑权限

1 复制想要编辑的文本2 在终端用rm ~/.bash_profile 删除文件3 输入Y同意4 输入touch ~/.bash_profile 生成文件5 open ~/.bash_profile 粘贴之前的文本然后进行编辑6 source ~/.bash_profile

2021-11-28 09:12:52 634

原创 python线程

from multiprocessing import Process'''def test(i): print("我是子程序"+str(i))def main(): print("主程序开始") p=Process(target=test,args=(1,)) #args是参数元组,kwargs是子典参数 p.start() print("主程序结束")if __name__=="__main__": main()import

2021-11-15 10:39:29 73

原创 python进程

from multiprocessing import Process'''def test(i): print("我是子程序"+str(i))def main(): print("主程序开始") p=Process(target=test,args=(1,)) #args是参数元组,kwargs是子典参数 p.start() print("主程序结束")if __name__=="__main__": main()import

2021-11-14 16:53:31 667

原创 python对象类

'''class Geese: def __init__(self): print("fuck")wildgooes=Geese()class Goose: neck="long" leg="xi" wing="wu" def __init__(self,wing,mouth): #带参构造方法 print("fuck") print(wing+"big") print(mouth+"red"

2021-11-07 15:56:09 561

原创 python函数,lambda

'''def filterchar(string): "功能:过滤危险字" import re pattern=r'(黑客)|(抓包)|(监听)' sub=re.sub(pattern,"fuck",string) #替换 print(sub)about="我是黑客,喜欢监听和抓包."filterchar(about)def function_tips(): "每天输出一条励志文字" import datetime mot=[

2021-11-07 14:17:58 536

转载 python format用法

一、填充字符串位置print(“hello {0}, this is {1}.”.format(“world”, “python”)) # 根据位置下标进行填充print(“hello {}, this is {}.”.format(“world”, “python”)) # 根据顺序自动填充print(“hello {0}, this is {1}. {1} is a new language.”.format(“world”, “python”)) # 同一参数可以填充多次输出:h

2021-11-07 13:37:50 127

原创 javamap里compareTo和compare的实现方式

import java.util.*;class Student { private String name; private int age; public int getAge(){ return age; } public String getName(){ return name; } public void setName(String name){ this.name=name; }

2021-11-07 10:31:07 499

原创 java Treeset里compare的两种实现方式

import java.util.*;/*class Students implements Comparable<Students>{ private String id; private String name; Students(String id,String name){ this.id=id; this.name=name; } public String toString(){ return

2021-11-06 17:55:02 274

原创 python正则表达式

import re'''p=r'mr_\w+'string ='MR_SHOP'string1="我mr_shop"print(re.match(p,string,re.I))print(re.match(p,string1,re.I)) #不分大小写匹配string2='MR_SHOP mr_shop'm=re.match(p,string2,re.I)print(m.start())print(m.end())print(m.span())print(m.string)pr

2021-11-03 21:05:16 99

原创 python字符串

a="我自横刀向天笑"b=a.encode('GBK')print(b)c=b.decode('GBK')print(c)d="今朝有酒今朝醉"e=a+','+d #拼接字符串print(e)print(len(a)) #字符串长度print(len(a.encode())) #字符串占的字节数,一般一个汉字3个字节(或者4个)print(a[1]) #截断print(a[2:])print(a[:4])print(a[2:5:2])f=a.sp

2021-11-03 14:53:38 52

原创 python集合

a={"wo","ni","ta"}print(a)b=set(range(10,22,3)) #set()函数构建print(b)a.add(233) #添加函数print(a)'''a.remove("wo") #各种删除print(a)a.pop()print(a)a.clear()print(a)'''c={"wo","ta",444,666,233}print(a&c) #交集p

2021-11-02 09:11:35 44

原创 python字典

dictionary={"qq":"1050361","手机":"182865","邮箱":"cloud.com"}print(dictionary)a=[2,3,4]b=["ni","wo","ta"]c=dict(zip(a,b)) #用zip把两个列表创建为字典print(c)d=dict(wo ="niba",ta ="nima")print(d) #用键值对创建字典e=dict.fromkeys(b)

2021-11-02 08:51:35 58

原创 python元组

'''verse1=("xixixi",)verse2=("xixixi")print(type(verse1))print(type(verse2)) #类别print(tuple(range(10,20,2))) #元组函数tupleprint(list(range(10,20,2))) #列表函数listdel verse1 #删除verse1=(2,"2233",'abc',"草")print(verse1[0])print(verse

2021-11-01 11:33:38 71

原创 py列表学习

'''money=5.12+1312.123;money=int(money)print(money)money=input("请输入金额")print(money)a=48print(a<<2)a=int(input("输入一个数:"))if a>10: print("fuck you")a=int(input())b=a if a>0 else -aprint(b)string ='fuck you'print(string)for ch

2021-10-31 17:20:45 51

原创 模板 析构函数 重载

模板#include<iostream>using namespace std;template <class T>struct ab{ T a;};template <class T>class cd{ ab<T> b;public: void in(T a) { b.a = a; } T out() { return b.a; }};int main(){ cd<int> wode; wod

2021-06-01 22:16:07 341 1

原创 2021-05-19

template的使用函数模板的用法不好解释直接上代码,t可以说是一种未定义的类型下方代码是求绝对值#include<iostream>using namespace std;template <class t>t fun(t a){ return a > 0 ? a : -a;}int main(){ int a = 100; double b = 3.14; cout << fun(a) << endl; cout &

2021-05-19 23:32:15 45

原创 c++txt中文为乱码

找到txt,另存为时改成ANSI编码

2021-05-18 21:27:37 92

原创 2021-05-18

for数组int a,b[];for(a:b){}这是把b的值循环赋给ajava获取数组长度int a[]=new int[3];a.length

2021-05-18 12:18:26 44

原创 判断的缩写

b=a>0?a:-atrue 为值一flase 为值二

2021-05-17 18:21:43 193

原创 java数据转换

#java数据转换##隐式int x=50;float y=x;输出y=50.0##显式int a=(int)45.23a=45int b=(int)’d’b=100

2021-05-17 18:16:29 62

原创 malloc string输出

(char*)malloc(sizeof(char)) 头文件malloc.hList* A:A=new List;string 输出printf (“%s”,str.c_str());

2021-05-16 17:43:21 105

原创 5.14

本篇博客是记录md语句的首次运用以及今天学到的知识点md语句‘#’是用于标题的,几级标题对应几个‘#’列表感觉只有有序列表比较有用,用法为 数字加上英文的点 例如 1.引用是用 >,几级引用对应几个‘>’引用这句话是我说的华丽分割线 —代码单行用’ ’ 多行用’’’ ‘’’强调倾斜(* ) 强调(* **)删除 删除 (~~ ~~)学习内容友元函数#include <iostream

2021-05-14 20:05:40 47

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除