自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

润泽的博客

Ricky的技术分享

  • 博客(78)
  • 收藏
  • 关注

原创 neo4j如何手动安装plugins | plugins安装总是太慢或失败怎么办?

由于neo4j的各种包都在境外,所以使用它自带的路径安装时总是太慢或直接报错。 我想安装APOC和Graph Data Science Library包,手动安装过程如下。特此记录。plugins的文件是.jar的形式存在的。下载地址分别不一样,截止到04/03/2021,下载地址分别在:APOC地址在github上:https://github.com/neo4j-contrib/neo4j-apoc-procedures/releasesGraph Data Science Library地

2021-03-04 17:41:34 444 1

原创 neo4j 报错AttributeError: ‘Graph‘ object has no attribute ‘find_one‘ 解决 | V3和V4的问题

neo4j 在实际工作中遇到了报错AttributeError: ‘Graph’ object has no attribute ‘find_one’ 的问题。是因为py2neo 的V3 和 V4 版本方法大多更新导致。可按照如下方法进行替换。例如:V3中:user = graph.find_one('User', 'username', self.username)`V4中可这样替换: user = graph.nodes.match("User", self.username).first

2021-03-04 16:55:36 1755 1

原创 2020/10/27 大华 运维开发岗 面试总结

刚刚完成了大华运维开发岗的电话面,总结一下。大体的介绍了一个自己曾经做过的项目。聊了聊普遍的价值观。面试官表示对我的项目还挺感兴趣。然后深入的问了一些很细节的技术问题,在此记录一下。1. 聊一聊DNS服务。他运行在哪个端口?DNS是将域名解析为IP地址的服务。域名解析的流程是:(1)先查hosts文件。(2)若没有,再查本地DNS缓存。(3)若没有,再查DNS服务器。DNS服务是运行在UDP协议上的服务,和UDP一样,使用53号端口。2. 域名能不能解析到内网地址。这个问题可以转化为“如何

2020-10-27 18:03:16 537

原创 python 画饼图,标签、比例,重合怎么办?

做项目画图的时候遇到了一个问题,数据项分类太多,画饼图的时候重合了。 那如何把重合的数据分开呢?经过研究有以下几种办法比较可行:把比例重合附近的标签远离圆心部分。把整个标签重合的部分分别脱离饼图,远离圆心。调整字体角度重合的时候代码是这样的:plt.pie(y1,labels=x1,autopct='%1.1f%%',\ colors=['green','red','skyblue','blue','yellow'])图是这样的:1.让比例远离圆心。 代码这样写。p

2020-06-22 06:32:26 9760 3

原创 python画图(plt.)x轴横坐标被省略了(被间断)怎么办 | 如何让所有横坐标x值都展示出来 | 如何调整横坐标角度

每天的事情真的很多,老师又甩给我一个项目,他跟一个巧克力厂合作,给了我近四年的销售数据,让我分析一下数据返回厂家建议的生产调整。实际项目我当然很乐意接受啦! 解决现实问题真的很爽,每天跟着国内搞一些不解决实际问题的研究,真的难受。我就是一俗人,只想如何赚钱养家。画图的时候遇到一个问题,横坐标为数字,但是有缺省。 plt.自动生成的x轴坐标会把所有值看成一个连贯的数列,然后中间缺省。就像这样。解决这个问题的办法有一下几种:把x轴集合的每一个元素从int型转成str型。用显示精度来调整。方法1

2020-06-21 07:29:54 11646 7

原创 neo4j桌面版如何安装插件?neo4j桌面版没有plugins文件夹怎么办?neo4j桌面版plugins内是灰的怎么办?缺失algo包怎么办?

neo4j桌面版如何安插件?neo4j桌面版没有plugins文件夹怎么办?neo4j桌面版plugins内是灰的怎么办?Unknown function 'algo.怎么办?项目需要,需要算节点之间的相似度,需要用到algo包内的jaccard相似度距离算法。 然后第一次使用Neo4j的我果不其然的报错了。Unknown function ‘algo.similarity.jaccard’ 怎么办?这个问题是因为缺少algo包,然而algo包原始地址在github这里。但是已经停止更新! .

2020-06-17 00:26:02 2010 4

原创 [血泪教训]同时安装neo4j的desktop和community导致各种出错 py2neo无法连接,neo4j.bat无法打开等若干问题

一天的时间都花在这个上面了!血泪教训!项目需要安装了neo4j。 又因为技术栈是python,所以就得用py2neo来操作数据库。由于第一次使用不太懂,同时下载安装了community版和desktop版。没想那么多,就操作着。 随后一堆问题接踵而至。<1> 7474这个端口只能在community版本打开,也就是只能从cmd中从命令行打开。第一次打开的时候,7474端口是可以打开的,成功从浏览器打开了neo4j,可是第二次,就因为store_lock被程序占用,无法打开了。找了很长时间

2020-06-10 05:00:19 6048 7

原创 [亲测解决]cannot import name from 怎么办 neo4j引入节点选择方法失败(两个单词竟然都是敏感词汇!?)

[亲测有效]cannot import name 'NodeSelector' from 'py2neo' 怎么办

2020-06-09 18:39:56 2526 2

原创 [不完美解决,同时求助] java安装成功,版本也都显示正确,但环境变量查找路径还是旧路径出错怎么办 |neo4j依赖java出错

最近项目需要用到neo4j的图数据库。就下载下来。neo4j安装需要依赖java8的JDK,遂安装。过程出现的小坎坷暂且不表。配置环境什么的都是老一套。突然出现的问题,电脑是老电脑了,很久很久之前安装过java的旧版本。跟现在的版本有冲突了。 经过查找才知道现在的java安装已经不需要JRE了,只安装JDK就可以了。感觉不妙,果然冲突还是出现了。新版本的JAVA安装完成后,java -version 和 javac -version都显示正常。如图。两个都已更新到了14.0.1版本。但是当我运

2020-06-08 23:49:53 643 3

原创 Leetcode String to Integer (atoi) Python 如何从一堆符号中挑选出数字并表示出来,正则表达式,.strip() .group()

Leetcode 第8题 String to Integer (atoi)Implement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes

2020-06-05 22:50:23 244

原创 Leetcode Longest Palindromic Substring Python 如何在遗传字符串中找到回文的子字符串

Leetcode 第5题 Longest Palindromic SubstringGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: "babad"Output: "bab"Note: "aba" is also a valid answer.Example 2:Input:

2020-06-04 04:49:16 120

原创 Leetcode Longest Substring Without Repeating Characters Python 找到字符串中重复次数最多的字符长度

Leetcode 第3题 Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters.Example 1:Input: "abcabcbb"Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2:

2020-06-02 22:40:27 205

原创 Leetcode Add Two Numbers Python 用链表的方式做加法,如何构造链表

Leetcode 第2题 Add Two NumbersYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.You may

2020-06-02 01:43:54 126

原创 Leetcode Fizz Buzz Python 如何通过条件改变数组中的值

Leetcode 412题 Fizz BuzzWrite a program that outputs the string representation of numbers from 1 to n.But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”. For numbers which are multiples of

2020-05-29 22:19:50 180

原创 Leetcode First Unique Character in a String Python 列表中找到第一个只出现一次的第一个数字,如何计算字符出现次数。

Leetcode 387题 First Unique Character in a StringGiven a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1.Examples:s = "leetcode"return 0.s = "loveleetcode",return 2.Note: You may assume th

2020-05-29 01:56:10 183

原创 Leetcode Sum of Two Integers Python 使用与或非位运算实现加法 经典算法

Leetcode 371题 Sum of Two IntegersCalculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example 1:Input: a = 1, b = 2Output: 3Example 2:Input: a = -2, b = 3Output: 1题目大意: 不用加减号,实现相加的功能。这是到非常经典的计算机原理的题,如

2020-05-28 04:53:38 340

原创 Leetcode Intersection of Two Arrays II Python 如何求两个数组的交集 Counter()统计出现次数和.element()返回指定次数个元素 的用法

Leetcode 350题 Intersection of Two Arrays IIGiven two arrays, write a function to compute their intersection.Example 1:Input: nums1 = [1,2,2,1], nums2 = [2,2]Output: [2,2]Example 2:Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]Output: [4,9]Note:E

2020-05-25 20:58:35 192

原创 Leetcode Reverse String Python 如何反转列表中的字符串(元素) 列表中首尾相换s[i],s[l-i-1] = s[l-i-1],s[i]

Leetcode 344题 Reverse StringWrite a function that reverses a string. The input string is given as an array of characters char[].Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.

2020-05-24 23:53:44 329

原创 Leetcode Power of Three Python 如何判断给定数值是否为某一个数的幂 integer类型的取值范围是(-2,147,483,648,2,147,483,647)

Leetcode 326题 Power of ThreeGiven an integer, write a function to determine if it is a power of three.Example 1:Input: 27Output: trueExample 2:Input: 0Output: falseExample 3:Input: 9Output: trueExample 4:Input: 45Output: falseFollow u

2020-05-23 22:17:21 851

原创 Leetcode Missing Number Python 如何找出数组中缺少的值,异或方法。

leetcode 268题 Missing NumberGiven an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array.Example 1:Input: [3,0,1]Output: 2Example 2:Input: [9,6,4,2,3,5,7,0,1]Output: 8Note:Your algorithm sh

2020-05-22 20:34:41 208

原创 Leetcode Valid Anagram Python 如何判断两字符串拆开所有元素是否一样?

Leetcode 242题 Valid AnagramGiven two strings s and t , write a function to determine if t is an anagram of s.Example 1:Input: s = "anagram", t = "nagaram"Output: trueExample 2:Input: s = "rat", t = "car"Output: falseNote:You may assume the str

2020-05-19 20:07:55 149

原创 Leetcode Delete Node in a Linked List Python 单链中删除一个节点的方法,先赋值,后跳过。

Leetcode 237题 Delete Node in a Linked ListWrite a function to delete a node (except the tail) in a singly linked list, given only access to that node.Given linked list – head = [4,5,1,9], which looks like following:Example 1:Input: head = [4,5,1,9],

2020-05-17 21:54:45 126

原创 Leetcode Contains Duplicate Python | 如何判断列表中有重复数字? Python中用set()消重复

Leetcode 217题 Contains DuplicateGiven an array of integers, find if the array contains any duplicates.Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct.Example 1:

2020-05-16 21:33:01 184

原创 Leetcode Count Primes Python 求小于给出值所有的质数(素数) | 函数内嵌函数直接调用

Leetcode 204题 Count PrimesCount the number of prime numbers less than a non-negative number, n.Example:Input: 10Output: 4Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.题目大意: 找出小于n的所有质数的个数。这就是个数学问题。先给定义什么是质数?质数(Primenum

2020-05-15 23:32:34 528

原创 Leetcode Happy Number Python 计算数字每一位的平方和 | str()为了遍历每一位,再int()回来是为了数学计算

Leetcode 202题 Happy NumberWrite an algorithm to determine if a number n is “happy”.A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the

2020-05-13 21:41:54 1184

原创 Leetcode Number of 1 Bits Python 操作32位的数字要小心

Leetcode 191题 Number of 1 BitsWrite a function that takes an unsigned integer and return the number of ‘1’ bits it has (also known as the Hamming weight).Example 1:Input: 00000000000000000000000000001011Output: 3Explanation: The input binary string 0

2020-05-13 01:54:05 126

原创 Python中路径的表示方法 | 移植的项目一直跑不通怎么办? | Python中如何表示各种路径

我们都知道计算机中路径分为绝对路径和相对路径。移植项目的时候往往为了路径发愁。现在总结一下路径的表示方法。提醒一点,路径最好不要加入中文。 一些包对非英语之外的语言很不友好。<一>、在python中,路径可以接受“/”“\”,这里形象的比喻成撇和捺。但是由于“\”在python中是作为转义符使用,所以在路径中使用“\”时,要写成“\”。因此在python中,下面这两种写法都是可以接受的。"c:/test/my doc""c:\\test\\my doc"<二>、在pyt

2020-05-12 01:27:13 376

原创 Leetcode Reverse Bits Python python数组的高级裁切(切片)操作 | python[:]的多元操作 | 通过切片反转列表

Leetcode 190题 Reverse BitsReverse bits of a given 32 bits unsigned integer.Example 1:Input: 00000010100101000001111010011100Output: 00111001011110000010100101000000Explanation: The input binary string 00000010100101000001111010011100 represents the u

2020-05-11 20:43:40 152

原创 Leetcdoe Rotate Array Python 如何旋转(移动)数组,如何用取余表示循环后的元素

Leetcode 189题 Rotate ArrayGiven an array, rotate the array to the right by k steps, where k is non-negative.Follow up:Try to come up as many solutions as you can, there are at least 3 different ways to solve this problem.Could you do it in-place with O

2020-05-10 21:04:03 152

原创 Leetcode Factorial Trailing Zeroes Python 如何求阶乘之后的结果结尾有多少个0(零)

Leetcode 172题 Factorial Trailing ZeroesGiven an integer n, return the number of trailing zeroes in n!.Example 1:Input: 3Output: 0Explanation: 3! = 6, no trailing zero.Example 2:Input: 5Output: 1Explanation: 5! = 120, one trailing zero.Note: You

2020-05-09 21:21:42 197

原创 Leetcode Excel Sheet Column Number Python 读取数据库(或excel)对应列的值,26进制转10进制,ord()函数。

Leetcode 171题 Excel Sheet Column NumberGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C -> 3 ... Z ...

2020-05-07 22:32:00 207

原创 Leetcode Valid Palindrome Python 什么是回文 | 如何挑选出列表中的字母和数字.isalnum()方法

Leetcode 125题 Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.Note: For the purpose of this problem, we define empty stri...

2020-05-07 04:17:17 135

原创 Leetcode Best Time to Buy and Sell Stock II Python | 多次买卖股票求收益问题

Leetcode 122题 Best Time to Buy and Sell Stock IISay you have an array prices for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may ...

2020-05-06 23:20:47 159

原创 Leetcode Pascal's Triangle Python 经典题目,构建杨辉三角

Leetcode 118题 Pascal’s TriangleGiven a non-negative integer numRows, generate the first numRows of Pascal’s triangle.In Pascal’s triangle, each number is the sum of the two numbers directly above i...

2020-05-04 23:22:51 166

原创 Leetcode Convert Sorted Array to Binary Search Tree Python 如何把数组转化为BST(二叉搜索树),经典的二叉树操作。

Leetcode 108题 Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tr...

2020-05-03 23:25:26 258

原创 Leetcode Remove Element Python 用变量名删除数组中的相同元素,python的优势。

Leetcode 27题 Remove ElementGiven an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this ...

2020-05-03 21:50:46 153

原创 Leetcode Merge Sorted Array Phthon | 两个数组的互相比较插入,排序。

Leetcode 88题 Merge Sorted ArrayGiven two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:The number of elements initialized in nums1 and nums2 are m and n res...

2020-04-27 00:03:50 102

原创 Leetcode Sqrt(x) 实现求某一个数的平方根算法 Python

Leetcode 69题 Sqrt(x)Implement int sqrt(int x).Compute and return the square root of x, where x is guaranteed to be a non-negative integer.Since the return type is an integer, the decimal digits are...

2020-04-25 21:33:15 479

原创 Leetcode Plus One Python | 以字符串格式处理int数字加一进位的问题 str和int之间的连续转换

Leetcode 66题 Plus OneGiven a non-empty array of digits representing a non-negative integer, plus one to the integer.The digits are stored such that the most significant digit is at the head of the l...

2020-04-21 01:22:18 256

原创 Leetcode Count and Say Python 数字按照字符串来操作 | 计数和报数

Leetcode 38题 Count and SayThe count-and-say sequence is the sequence of integers with the first five terms as following:1. 12. 113. 214. 12115. 1112211 is read off as “one ...

2020-04-20 00:16:58 120

空空如也

空空如也

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

TA关注的人

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