自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 redis

薪火相传哨兵模式集群缓存穿透缓存击穿缓存雪崩分布式锁

2022-03-25 14:25:15 1097

原创 springframework

1、什么是spring2、配置文件管理3、基于注解的di3.1component3.2repository service controller多注解项目分层3.3扫描多个包的方式3.4@value

2022-01-03 23:24:54 97

原创 spring

一、容器1、FileSystemXmlApplicationContext:该容器从 XML 文件中加载已被定义的 bean。在这里,你需要提供给构造器 XML 文件的完整路径。2、ClassPathXmlApplicationContext:该容器从 XML 文件中加载已被定义的 bean。在这里,你不需要提供 XML 文件的完整路径,只需正确配置 CLASSPATH 环境变量即可,因为,容器会从 CLASSPATH 中搜索 bean 配置文件。3、WebXmlApplicationConte

2022-01-03 16:24:33 97

原创 maven

1、2、3、6、7、8、10、11、12、13、14、

2021-12-26 23:27:18 221

原创 jquery文档处理

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>文档处理</title></head><body><input type="text" value="123"><input type="checkbox" name="hobby"><div id="outer"&g.

2020-10-04 23:34:12 71

原创 jquery操作元素(属性 CSS 和 文档处理)

$("p").text() //获取text值 $("p").html() //获取整个html值 $(":checkbox").val() $(".test").attr("alex") //获取alex的属性值 $(".test").attr("alex","sb") //设置alex这个属性的值胃sb $(".test").attr("checked","checked") $(":checkbox").removeAttr("checked") //移除att...

2020-10-04 16:04:32 61

原创 jquery筛选器

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>筛选器</title></head><body><div class="div1">hello1 <div class="div2">hello2 <div class="div3" id="te.

2020-10-03 17:43:46 104

原创 jquery选择器

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>选择器</title></head><body><div> hello div</div><div class="div1">hello div1 <ul> <li>.

2020-09-26 23:21:40 60

原创 监听函数的实现方法

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>onsubmit</title></head><body><form onsubmit="return check(event)"> 姓名: <input type="text" name="name"> .

2020-07-31 16:20:23 498

原创 history类

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>history1</title></head><body> <input type="button" value="前进" onclick="func1()"> <a href="history2.html">hi.

2020-05-25 15:21:19 155

原创 windows函数

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Window</title></head><body><input type="text" width="249px" id="clock"><input type="button" value="begin" onclick="b.

2020-05-25 11:55:51 258

原创 Math

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Math</title></head><body></body><script>alert(Math.random()); //返回[0,1)的任何一个随机数alert(Math.round(3.3));//四舍五入al.

2020-05-21 22:15:56 147

原创 RegExp

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>regexp</title></head><body></body><script> //第一种生成方式 var r1 = new RegExp("\d+","g"); alert(r1.test("1.

2020-05-20 23:13:58 162

原创 javascript -Array

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Array</title></head><body></body><script> //第一种生成方式 var a1 = [1, 'hello', 3]; //第二种生成方式 var a2=ne.

2020-05-20 11:24:30 173

原创 javascript--switch if for 及function

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>javascript</title></head><body></body><script>var x = 2;switch (x){ case 1:y="星期一"; break; case 2:y="星期.

2020-05-17 17:19:01 229

原创 查看linux的cpu

注意:总逻辑CPU数 = 物理CPU个数 * 每颗物理CPU的核数 * 超线程数查询CPU个数:cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l查询核数:cat /proc/cpuinfo| grep "cpu cores"| uniq查询逻辑CPU总数:cat /proc/cpuinfo| ...

2019-12-13 15:31:37 79

原创 xml处理

https://www.cnblogs.com/hupeng1234/p/7262371.import xml.etree.ElementTree as ETtree = ET.parse("D:\store.txt")root = tree.getroot()dataDict = {}for child in root: print(child.tag) tempL...

2019-09-07 23:20:19 49

原创 测试脚本1

import jsonwith open("D:\store.txt", "r", encoding="utf-8") as f: data = json.loads(f.read())print(len(data))dataDict = {}for item in data: tempList = [] tempList.append(item['comp...

2019-09-05 23:20:47 47

原创 Json中的几个方法

from rest_framework.renderers import JSONRendererfrom rest_framework.parsers import JSONParser1、JSONRenderer().render(serializer.data)将ReturnDict字典类型转换为字节流snippet = Snippet(owner=user,code='foo...

2019-08-23 09:37:55 528

原创 python的运算符

a = 76b = 10print(a/b) #7.6print(a%b) #6print(a//b) #7#这里的数值是以补码的形式表示的c = 1d = 11e = (-1)print(c&d) #1print(d&e) # 11print(c&e) #1f = 60g = 13print(f&g) #12print(~g) ...

2019-08-21 17:38:45 284

原创 生成器中的send

import timedef foo(): print("******start*****") print("this is the first line") r1 = yield 'r1' print("this is the second value:%s" % r1) r2 = yield 'r2' print("this is the...

2019-08-16 16:29:49 89

原创 深浅拷贝

# import copy# a=[[1, 2], 3, 4]# b=copy.copy(a)## print('浅拷贝浅拷贝浅拷贝')# print('a:%s'%id(a))# print('b:%s'%id(b))# print('a[0]%s'%id(a[0]))# print('b[0]%s'%id(b[0]))# print('a[0][0]%s'%id(a[0][...

2019-06-11 16:14:19 84

原创 __new__() __init__方法

__new__方法是用来生成实例的__new__主要用来定制化不可变类对象,#__new__的使用class Test: def __new__(cls): if not hasattr(cls, 'instance'): cls.instance=super(Test, cls).__new__(cls) retu...

2019-05-16 15:59:39 464

原创 算法题

from django.test import TestCase # Create your tests here.### a = '2'# b=True# l = [1,4,5]# s = {'a':6, 'b':7}# s1 = {'2','3'}#### def f(b):# b=False# print(b)## f(b)# print...

2019-05-08 00:08:21 76

原创 Django ORM

def show(req): #新增记录两种方式,create save # #-------------------create # models.Authors.objects.create(name='jiangqijun') # models.Authors.objects.create(**{'name':'xiaoming'}) # #----...

2019-05-06 23:40:55 96

原创 html1

<html><head><!--<meta http-equiv='Refresh' content="2;URL='https://www.baiu.com">--><link rel='icon' href='http://www.jd.com/favicon.ico'><title>form表单</tit...

2019-04-05 22:44:02 60

原创 subprocess

import subprocess#print(subprocess.check_output("mkdir test4", shell=True).decode('gbk')) #当执行结果为0的时候直接返回值,如果不为0则报错#print(subprocess.call('cd ..', shell=True))#执行成功返回0执行失败返回1#subprocess.Popen():...

2019-03-29 17:32:34 454

原创 time模块

import timeprint(time.time()) #时间戳1553828380.9501994print(time.localtime(1553828380.9501994))#time.struct_time(tm_year=2019, tm_mon=3, tm_mday=29, tm_hour=10, tm_min=59, tm_sec=40, tm_wday=4, tm_yda...

2019-03-29 15:02:22 329

原创 routers

一、视图集from rest_framework import viewsetsfrom snippets.models import Snippetfrom django.contrib.auth.models import Userfrom snippets.serializers import SnippetSerializer,UserSerializerfrom rest_...

2019-03-21 15:35:02 164

原创 HyperlinkedModelSerializer

一、序列化器,继承HyperlinkedModelSerializer,分别添加url以及highlighted字段,建立snippets = serializers.HyperlinkedRelatedField关系class SnippetSerializer(serializers.HyperlinkedModelSerializer): owner = serializers...

2019-03-21 11:39:23 1661

原创 permissions

1、在model表中添加用户userowner = models.ForeignKey('auth.User', related_name='snippets', on_delete=models.CASCADE)2、在序列化表中添加如下关联信息对应表owner = serializers.ReadOnlyField(source='owner.username')用户表...

2019-03-21 09:29:59 401

原创 ListCreateAPIView,RetrieveUpdateDestroyAPIView

from snippets.models import Snippetfrom snippets.serializers import SnippetSerializerfrom rest_framework import genericsclass SnippetList(generics.ListCreateAPIView): queryset = Snippet.obje...

2019-03-20 20:30:02 1318

原创 Djiango-restframwork-mixins

from snippets.models import Snippetfrom snippets.serializers import SnippetSerializerfrom rest_framework import mixinsfrom rest_framework import generics"""我们使用GenericAPIView构建了我们的视图,并且用上了ListM...

2019-03-20 20:21:24 179

原创 Djiangop-restframwork-APIView

# class Snippets_list(APIView):# def get(self, request, format=None):# snippet = Snippet.objects.all()# serializer = SnippetSerializer(snippet, many=True)# return Resp...

2019-03-20 19:37:26 191

原创 python3编码问题

"""编码问题在python3中只有两种数据类型1、str:编码形式是unicode,unicode任一字符编码都存在2、bytes:编码形式是十六进制"""#编码encoding#utf, gbk都只是一种编码规则,按照各自的规则进行编码,可以存在多种编码规则s = 'hello中国' #在内存中是以unicode编码存储的,这是unicode编码#str---&gt;&gt;...

2019-03-05 23:28:50 97

原创 Content-Type: multipart/form-data; boundary=33dde4791cfce43a7aa122d93ab066dc requests.post()

使用requests.post方法请求Content-Type: multipart/form-data格式的接口,今天试了很多次都跟实际接口的请求不一致,传入的数据格式对不上,主要原因是在headers头中不用再传入Content-Type: multipart/form-data,具体见例子1、传入的参数每个字段以元祖的格式保存parm2 ={ "occur_time": (...

2019-03-03 15:43:57 9868

原创 Exception

#__author__:jiangqijun#__date__:2019/2/24#__date__:2019/2/24class MyException(Exception): def __init__(self,message): self.message = message def __str__(self): return sel...

2019-02-24 13:01:41 123

原创 threading

一、线程的函数式定义,join setDaemon方法的使用import timefrom threading import Threadbegin =time.time()def foo(): print("this is foo1") time.sleep(2) print("end foo1")def bar(): print("this ...

2019-02-24 11:34:47 126

原创 pipenv 安装包遇到的坑

前两天晚上拉了项目下来安装虚拟环境包执行pipenv install 时一直报下面的错误Could not fetch URL https://pypi.python.org/simple/: connection error: HTTPSConnectionPool(host='pyp ② Could not find a version that satisfies the requi...

2019-02-19 10:00:24 4469 2

原创 类(二)

一、修饰符    公有成员    私有成员, __字段名        - 无法直接访问,只能间接访问class Foo:    __address = 'hunan'    def __init__(self, name):        self.name = name        self.__age =  18        #无法直接访问    @static...

2019-02-09 11:19:13 116

空空如也

空空如也

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

TA关注的人

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