自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 走格子和求区间内素数平均值

最近参加了一个线上笔试,记录下里面两道题grid path 从一个田字格(2X2)的左上角出发,只允许向右或向下移动,恰好有6条路径。则对于20X15的,从左上角出发到右下角的路径共有多少条?思路:画图很直观。这里先把图转换为二维矩阵,则2X2的图对应的矩阵为(3,3),grid=[[0,0,0],[0,0,0],[0,0,0]]。由于只能向右或者向下,所以第一行以及第一列的路径都是1。即grid[0][x]=0,x in range(0,n+1),grid[y][0]=0,y in range(0

2020-09-18 10:31:04 298

原创 disposal disposable

早上到公司,吃早饭的时候突然瞥了眼每天发的口罩,包装袋上写了DISPOSABLE MASK,一想,disposable好眼熟,脑子里蹦出个dispossible(没这个词,实际应该是impossible)。立即去查了下词典,词根是背过的,而且很熟的disposal,那么disposable就可以理解成 “一次性”。附上必应词典:adj.用后即丢弃的;一次性的;可动用的;可自由支配的n.〈美口〉使用后随即抛掉的东西(尤指容器等)网络可任意使用的;抛弃式;一次性使用的...

2020-05-11 08:50:43 2117

转载 netstat 的10个基本用法

netstat 的10个基本用法转载:https://linux.cn/article-2434-1.html侵删

2020-05-09 10:06:33 705

原创 python使用pymongo操作mongodb后with方式close连接

最近python接口总是报错,看了下日志,提示cant start thread,起初以为是隔壁组的服务把服务器资源占满,但是他们项目重启后几天,又发生这个情况。我想大概是python接口连接mongodb后没有主动断开连接吧。方法mongodb对象import pymongoclass Mongo(object): def __init__(self, db_name): ...

2020-04-27 11:18:23 4431 1

原创 python用pymongo实现mongodb数据库重命名

mongodb不支持rename database,只支持renameCollection。实现rename database方法:方法1:测试时别把database删了!!print('method1:copydb + drop_database')start_time = time.time()self.client.admin.command('copydb', fromdb=‘...

2020-04-26 11:30:52 1178

原创 intensify fortify enhance reinforce strengthe

intensify有点加强之后变密集的意思,可看intensive,本身就有密集的意思,可以侧重于数量上; fortify是侧重巩固加强,和reinforce用法大致一样;strengthen能量的增强,主要是;enhance水平的提高,可以与improve互换。其实,当你想仔细区分几个单词之间的意思的时候,可以通过看它们的词根。以上先复制百度答案,后面再查词典详细注释。连接:百度知道...

2020-03-10 23:38:38 2899

原创 marsh swamp mire bog fen

marsh: [C, U] 湿地;沼泽;草本沼泽An area of low land that is always soft and wet because there is nowhere for the water to flow away to.swamp: [C, U] 沼泽(地)An area of ground that is very wet or covered with...

2020-03-07 17:11:11 1110

转载 英语sidewalk和pavement和footpath和footway区别?

sidewalk和pavement,footpath,footway意思上都是街边铺过塼的人行道,只是pavement是英式用法,sidewalk是美式用法。而footpath在意思上带有狭窄,即指供行人走的狭窄小道,footway也跟footpath一样带有狭窄意思。footway不是书面用语,会稍稍非正式一点,所以没有人会用这个词来写作。footpath就会正式一点。不过从语法来说,这四个词是...

2020-03-07 16:56:55 3733

转载 leetcode-20. 有效的括号

descriptionGiven a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same...

2020-02-07 23:08:58 128

原创 leetcode-13. 罗马数字转整数

descriptionRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L 50C 100D ...

2020-02-07 23:01:06 105

原创 leetcode-09. 回文数

leetcode T09descriptionDetermine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121...

2020-02-07 22:27:48 83

原创 leetcode-07. 整数反转

leetcode T07descriptionGiven a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:As...

2020-02-07 22:23:11 98

原创 leetcode-01. 两数之和

leetcode T01descriptionGiven an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and y...

2020-02-07 22:18:13 101

原创 leetcode-14. 最长公共前缀

leetcode T14descriptionWrite a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string “”.Example 1:Input: [“flower”,“fl...

2020-02-07 22:12:49 88

原创 c#调用接口上传base64编码的照片

[WebMethod]public static string UploadCustomerLogo(string img_64){ try { // 去除base64头 string pure_base64 = img_64.Replace("data:image/jpeg;base64,","").Replace("data:image/pn...

2019-11-29 13:59:12 608

转载 JavaScript编程风格 switch-case

switch…case结构要求,在每一个case的最后一行必须是break语句,否则会接着运行下一个case。这样不仅容易忘记,还会造成代码的冗长。而且,switch…case不使用大括号,不利于代码形式的统一。此外,这种结构类似于goto语句,容易造成程序流程的混乱,使得代码结构混乱不堪,不符合面向对象编程的原则。function doAction(action) { switch (a...

2019-11-22 17:10:11 155

原创 用Flask实现简单的MongoDB接口

Show Me the Code#!/usr/bin/env python # -*- coding:utf-8 -*-#@TIME :2019/11/18 18:52from flask import Flaskimport MongoDB as mgdbimport tracebackimport jsondef test(): return "{'result':...

2019-11-21 15:20:12 341

原创 pymongo中find_one和find的区别

find_oneimport pymongofrom bson import ObjectIdclient = pymongo.MongoClient('mongodb://127.0.0.1', 27017)db_name = 'test'db_test = client[db_name]collection = 'machines'doc = db_test[collectio...

2019-10-15 11:33:54 2437

转载 Python项目搬迁,快捷导出环境依赖包

项目搬迁的时候,需要把当前的环境依赖包导出,然后到部署项目的服务器上安装依赖。 通过下面的命令执行,把依赖包导出到requirements.txt文件里。 生成requirements.txtpip freeze > requirements.txt安装requirements.txt依赖pip install -r requirements.txt...

2019-10-11 16:55:57 230 1

原创 uWSGI部署Flask项目

uWSGI部署Flask项目用到的软件uWSGI安装uWSGI配置Flask例子启动,停止简单记录下本次在linux系统下用uWSGI部署flask项目的过程。用到的软件PuTTY:用来连接Linux服务器终端;FileZilla:当前系统与服务器之间传送文件(选择sftp://ip,22端口);uWSGI安装pip install uwsgiuWSGI配置[uwsgi]...

2019-08-02 15:17:54 574

原创 Windows系统利用IIS部署Flask项目

最近在学习Python,刚好被安排了任务是在Windows服务器上部署一套数据接口。项目使用Flask框架,数据来自mongodb。然后就面临Flask项目部署的问题。以下是流程。完成简单的Hello Flask网站#!/usr/bin/env python # -*- coding:utf-8 -*-#@TIME :2019/6/11 17:30from flask import ...

2019-06-14 17:12:31 1909

空空如也

空空如也

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

TA关注的人

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