自定义博客皮肤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)
  • 收藏
  • 关注

原创 python多线程:小牛吃草案例

# By Chang"""Cow weight 0-5//体重标志牛 吃草次数 tag= //标志牛是否长大 eat() 吃草Rain ifRain() //判断是否下雨Grass height 0-3 //高度标志草是否成熟 isRipe //艹是否成熟 grow()// 草成长。"""import randomimport threadingimport timeclass Cow: def __init__(se

2020-06-19 19:41:15 763

原创 lua table打印

function print_r( t ) local print_r_cache={} local space = " " local function sub_print_r(t, indent) if (type(t) == "table") then for pos, val in pairs(t) do if (type(val) == "table") then

2020-05-09 09:48:58 183

原创 C++实例(员工分组)

主要知识点:vector容器 (sort的重写)#include<iostream>using namespace std;#include<vector>#include<string>#include <algorithm>#include <ctime>class Worker {public: int m_s...

2020-03-26 11:41:56 386

原创 linux命令笔记

查看centos版本:cat /etc/redhat-release

2019-11-25 11:19:40 105

原创 python操作数据库的简单类

#!/usr/bin/python# -*- coding: UTF-8 -*-import MySQLdbclass ClassDB: def __init__(self): self.ip = "localhost" self.user = "root" self.password = "123456" self.DBName = "TEST" self.db ...

2019-11-21 16:31:21 130

原创 安装mysql

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpmrpm -ivh mysql-community-release-el7-5.noarch.rpmyum updateyum install mysql-server权限设置:chown mysql:mysql -R /var/lib/mysql初始化 ...

2019-11-21 14:41:26 106

原创 pip install requests 安装失败解决办法

错误显示:[root@localhost test]# pip install requestsWARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.Requirement already satisfied: requ...

2019-11-20 11:39:11 6028 1

原创 django runserver: sqlite3.NotSupportedError: URIs not supported

修改图中的文件再运行runserver 还爆红再运行 python manage.py migrate最后再运行ok这个bug我重装了 python3.6 python3.7 django sqlite3 libress mysql centos

2019-07-17 10:47:22 298

原创 一个xlsx转lua的python小工具

目录结构:xlsx文件格式:xlsxToLua.py如下:import xlrdimport osdef toLua(): pwd = "./" fileList = list(os.listdir(pwd)) # 列出文件夹下所有的目录与文件 for file in fileList: if file.find(".xlsx") >...

2019-07-11 16:16:38 471

原创 记:lua对象 继承 多态

local om = { client = function(self, p) print("client p = ", p) return self end, send = function(self, p ) print("send p = ", p) return self end } local function new( ) loca...

2019-06-05 17:01:37 83

原创 lua __index __newindex _call元方法的理解

local class_a = {}local class_b = { b = 2 }class_b = setmetatable( class_b, { -- __index则用来对表访问,访问class_b中值时,不存在时则会执行class_a -- 例:先从class_b寻找key对应的value 若不存在则去元表class_a中寻找 -- __index = class_...

2019-05-27 16:06:33 2801

原创 lua select函数应用

function func( … )local argc = select("#", …)local a = select(1, …)local b = select(3, …)print('argc = ', argc, " a = ", a, " b = ", b) – 输出:argc = 6 a = 1 b = 3endfunc( 1,2,3,“a”,“b”,“c” ...

2019-05-27 15:05:32 161

原创 记 xshell 连接 virtual Box 失败

连接要素1 是否安装sshd(注意sshd_config配置 以及 22端口)2 是否关闭防火墙3 windows的ip跟虚拟机的ip是否在同一个网段4 配置的虚拟机静态IP是否跟别的机器冲突(怀疑本次失败的原因 我第一次设置设置192.168.0.177 (windowsIP:192.168.0.178) 前面三个原因的都没修改 该成192.168.0.179 然后xshell...

2019-05-15 10:51:51 210

原创 记 git操作失误:git config --global remore url

git config --global remore “url:123”现象:这样会设置git的全局url,导致你不管git pull什么地址,都会git pull “url:123”,造成拉取失败解决方式:vim ~/.gitconfig删除[“remote url”] 后面的地址按 shift + : ,输入wq 退出...

2019-03-07 10:46:01 3094

原创 django初试

安装python3:https://blog.csdn.net/lovefengruoqing/article/details/79284573安装pymysql:git clone https://github.com/PyMySQL/PyMySQLcd PyMySQL/python setup.py install安装mysql:http://www.runoob.com/mys...

2019-02-27 17:47:32 490 1

原创 git操作 每次需要输入密码

C盘坏了之后重新安装git,发现每次都要重新输入密码,找了很多资料都是说http模式换成ssh模式,看了同事的也是http模式,还有很多资料设置credential,亲测有效!git config --global credential.helper storetips:credential.helper中间没有空格...

2018-12-28 11:45:44 669

原创 sublime text3配置lua

{“cmd”: [“D:/soft/Lua/lua.exe”, “$file”],“file_regex”: “^(?:lua:)?\t

2018-12-25 15:46:07 257

转载 linux图形界面切换命令行

centos7 版本1.首先删除已经存在的符号链接:rm /etc/systemd/system/default.target2.默认级别转换为3(文本模式):ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target或者默认级别转换为5(图形模式):ln -sf /lib/system...

2018-12-13 10:21:31 648

转载 Centos6.9升级glibc解决“libc.so.6: version GLIBC_2.14 not found”报错问题

https://blog.csdn.net/heylun/article/details/78833050

2018-12-11 11:13:57 579 1

原创 git 提示http报错

curl 版本不对sudo yum update -y nss curl libcurl

2018-12-11 10:11:25 1291

原创 linux mount命令

mount -t cifs -o username=HASEE,password=123 //ip/test1 /test2username:Windows账号password:Windows密码ip:Windows ip 如图:test1:映射到linux的文件夹test:windows上被映射的文件夹注:新人一枚,如有错误请包涵!...

2018-12-07 16:05:31 425

原创 linux ln文件夹的链接

1 文件的链接ln -s a.py b.pya.py 软链接到b.py (无论 b.py 文件存在与否 都可以成功)2 文件夹的链接ln -s a ba文件夹软链接到b文件夹(b文件夹不能提前创建)...

2018-12-07 14:39:56 13526

空空如也

空空如也

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

TA关注的人

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