自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(50)
  • 资源 (2)
  • 收藏
  • 关注

原创 Python深度解析:装饰器—提升代码灵活性与可维护性的艺术

定义一个接收函数作为参数的装饰器函数。在装饰器函数内部定义一个包装函数,处理传入的参数和返回值。在包装函数内编写所需的附加逻辑。返回包装函数,使其替代原始函数。"""一个装饰器,它会重复执行被装饰的函数指定的次数"""# 示例函数")# 调用示例函数。

2024-08-20 14:42:51 451

原创 Python深度解析:描述符的内部机制与高级用法

Python 的描述符协议是一种允许对象管理访问属性的特殊协议。描述符是实现了特定协议的对象,这个协议允许你控制属性的访问、赋值和删除行为。

2024-08-18 09:00:00 686

原创 Python深度解析:上下文协议设计与应用技巧

Python的上下文管理协议是一组特殊方法的集合,它们允许对象与with语句配合使用,以确保在代码块执行前后正确地管理资源。这个协议分为同步上下文管理协议和异步同步上下文管理协议。协议主要是实现两种方法上下文管理器是实现了上下文管理协议的对象。通过上下文管理器,能够实现精确控制资源创建和释放时机。它允许你执行一些设置和清理工作,而不需要显式地编写这些代码。和__exit__()。除了使用内置的上下文管理器,你还可以创建自定义的上下文管理器。这可以通过定义一个类并实现和__exit__()方法来完成。

2024-08-17 12:19:24 639

原创 Python深度解析:可迭代对象与迭代器的交互艺术

使用自定义迭代器print(num)# 输出结果# 5# 4# 3# 2# 1。

2024-08-17 09:00:00 1013

原创 浅谈Servlet

文章目录为什么还需要学习Servlet为什么还需要学习Servlet我从Java SE转向Java Web学习的时候,心中就总有那么一个疑问,main函数去哪里了?为什么在学习Java SE的时候,总是从main函数开始运行,而在学习Java Web的时候,按照步骤莫名奇妙的就可以跑起来了。这个疑问之前困扰了我很久。后面渐渐的Spring的兴起,渐渐的main函数又出现了。不得不说,Spring使得Java Web的学习曲线平滑了少许。不过现在回过头来看,对于Java EE来说,main函数已经封装在

2021-01-24 17:16:36 263

原创 浅谈Spring IOC

文章目录浅谈Spring IOC如何创建对象Spring IOC 是如何创建对象的Spring IOC对对象进行操作浅谈Spring IOC如何创建对象在Java中,我们通常创建对象都是通过new Object 的形式来创建一个新的对象的,然后通过这个对象的set方法对一个对象里面的属性进行赋值。譬如 User user = new User() user.setName = 'Liming'除了通过new的方式以外,我们也可以通过反射的方法创建对象。Class<?> clz

2021-01-06 23:08:51 181

原创 LeetCode28. Implement strStr() 字符串匹配

文章目录28.字符串匹配28. Implement strStr()暴力破解Rabin-Karp算法KMP算法BM算法(Boyer-Moore)Sunday算法28.字符串匹配28. Implement strStr()Implement strStr().Return the index of the first occurrence of needle in haystack, or ...

2020-04-05 10:08:44 218

原创 LeetCode 27.Remove Element 移除数组中的元素

文章目录移除元素27. Remove Element快慢双指针头尾双指针移除元素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...

2020-03-01 14:51:08 239

原创 LeetCode 26.Remove Duplicates from Sorted Array 移除有序数组的重复元素

文章目录26.移除有序数组的重复元素26. Remove Duplicates from Sorted Array双指针法26.移除有序数组的重复元素26. Remove Duplicates from Sorted ArrayGiven a sorted array nums, remove the duplicates in-place such that each element ap...

2020-02-29 00:21:30 154

原创 LeetCode 25. Reverse Nodes in k-Group 以组的形式反转节点

文章目录25.以组的形式反转节点25. Reverse Nodes in k-Group尾插法头插法25.以组的形式反转节点25. Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a po...

2020-02-26 23:07:40 279

原创 LeetCode 24.Swap Nodes in Pairs 成对交换链表节点

文章目录24.成对交换链表节点24. Swap Nodes in Pairs迭代法递归24.成对交换链表节点24. Swap Nodes in PairsGiven a linked list, swap every two adjacent nodes and return its head.You may not modify the values in the list’s node...

2020-02-25 16:01:29 187

原创 LeetCode 23.Merge k Sorted Lists 合并K个的有序链表

文章目录23.合并排序N个有序链表23. Merge k Sorted Lists直接合并分治法23.合并排序N个有序链表23. Merge k Sorted ListsMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Example:Inpu...

2020-02-24 19:55:45 257

原创 LeetCode22.Generate Parentheses 产生括号组合

22.产生括号组合22. Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ "((()))", ...

2020-02-23 16:40:46 170

原创 LeetCode 19.Remove Nth Node From End of List 移除链表从后算起第几个元素

文章目录19.移除链表从后算起第几个元素19. Remove Nth Node From End of List两次遍历单次遍历19.移除链表从后算起第几个元素19. Remove Nth Node From End of ListGiven a linked list, remove the n-th node from the end of list and return its hea...

2020-02-17 21:41:20 93

原创 LeetCode17. Letter Combinations of a Phone Number电话号码组合

文章目录17. 电话号码组合17. Letter Combinations of a Phone Number深度优先遍历(DFS)直接拼接17. 电话号码组合17. Letter Combinations of a Phone NumberGiven a string containing digits from 2-9 inclusive, return all possible let...

2020-02-16 18:53:38 415

原创 LeetCode 18. 4Sum四数之和

18.4Sum 四数之和18. 4SumGiven an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array whic...

2020-02-13 19:47:48 222

原创 LeetCode16. 3Sum Closest 三数之和改

16.3Sum Closest最接近目标值的三数之和3Sum ClosestGiven an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integer...

2020-02-10 20:36:50 111

原创 LeetCode15.3Sum 三数之和

文章目录15. 3Sum 三数之和15. 3Sum双指针使用Map15. 3Sum 三数之和15. 3SumGiven an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which give...

2020-02-08 11:57:49 149

原创 LeetCode 14. Longest Common Prefix最长公共子前缀

最长公共子前缀14. Longest Common PrefixWrite 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: ["fl...

2020-02-04 12:24:57 301

原创 LeetCode 13. Roman to Integer 罗马数字转阿拉伯数字

13. 罗马数字转阿拉伯数字13. Roman to IntegerLeetCode 12 的镜像问题Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X ...

2020-02-02 15:09:30 195

原创 LeetCode 12.Integer to Roman 阿拉伯数字转换为罗马数字

LeetCode 12.Integer to Roman 阿拉伯数字转换为罗马数字12. Integer to RomanRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X ...

2020-02-01 20:26:22 258

原创 LeetCode 11. Container With Most Water 容器最大水容量

11. Container With Most Water 容器最大水容量11. Container With Most WaterGiven n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such t...

2020-01-30 10:37:42 189

原创 LeetCode 10.Regular Expression Matching 正则匹配

LeetCode 10 . Regular Expression Matching 正则匹配10. Regular Expression MatchingGiven an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'.'.' Mat...

2020-01-29 10:13:17 218

原创 LeetCode 9. Palindrome Number 回文数字

LeetCode 9. Palindrome Number9.Palindrome NumberDetermine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121Output: tru...

2020-01-27 09:17:56 323

原创 LeetCode 8. String to Integer (atoi) 字符串转整形

LeetCode 8. String to Integer (atoi) 字符串转整形8. String to Integer (atoi)Implement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary unt...

2020-01-24 22:37:40 139

原创 LeetCode 7. Reverse Integer 反转整数

LeetCode 7. Reverse Integer 反转整数文章目录LeetCode 7. Reverse Integer 反转整数7. Reverse Integer直接反转7. Reverse IntegerGiven a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output...

2020-01-22 21:06:21 345

原创 LeetCode 6. ZigZag ConversionZ字形转换

LeetCode 6. ZigZag ConversionZ字形转换文章目录LeetCode 6. ZigZag ConversionZ字形转换6. ZigZag Conversion直接跳转法(横着走)拉链法(竖着走)6. ZigZag ConversionThe string "PAYPALISHIRING" is written in a zigzag pattern on a giv...

2020-01-21 21:41:32 294

原创 LeetCode5. Longest Palindromic Substring 最长子回文串

最长子回文串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...

2020-01-19 23:18:22 139

原创 LeetCode4.Median of Two Sorted Arrays 求有序数组的中位数

Median of Two Sorted Arrays 有序数组的中位数4. Median of Two Sorted ArraysThere are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run ...

2020-01-16 19:57:53 113

原创 LeetCode3. Longest Substring Without Repeating Characters 子字符串长度

文章目录字符串的长度3. Longest Substring Without Repeating Characters暴力破解滑动窗口(双指针法)滑动窗口改进字符串的长度3. Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring withou...

2020-01-13 21:53:17 99

原创 强烈安利几款效率工具

文章目录工具集视频:爱奇艺万能播放器文件搜索:everything,Wox截图:greenshot垃圾清理:CCleanerMarkdown编辑器:Typora预览器:Seer浏览器:Chrome,firefox文本编辑器:Notepad++IDE:VSCode,IDEATodoList:滴答清单工具集视频:爱奇艺万能播放器无广告,支持格式多文件搜索:everything,Wox...

2020-01-12 17:57:55 880

原创 Leetcode 2. Add Two Numbers 两数相加

Add Two Numbers 两数相加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...

2020-01-12 17:02:46 92

原创 数据库引擎笔记

MySQLmysql使用文件系统存储表名和表的。 使用.frm文件存储表MyISAMmyISAM提供了全文检索,压缩和空间函数等功能。但是不提供事务支持和行级锁存储方面使用了数据文件和索引文件分离模式。使用.MYD记录数据,.MYI记录索引支持数据库的行数由硬盘空间和系统允许创建的文件大小所确定的。默认最大可以处理256TB的数据MyISAM使用的是表锁。支持自动/手动检查和修复表。...

2019-10-21 16:32:57 140

原创 Jest运行单个测试文件

Jest跑单个测试文件问题背景:当我们使用vue框架进行测试时,使用的是直接运行jest,就会直接测试所有在__tests__目录下的所有测试文件。但往往有时候,我们不需要执行所有的测试文件,那么如何使用jest运行单个测试文件或者是运行非__tests__目录下的文件遇到第一个问题的第一反应,我就查看官方提供的文档。官方文档是这样描述的Run unit tests with Jest...

2019-07-16 08:41:21 14071 2

原创 css学习笔记

css学习笔记在html引入css的三种方式外链<link rel="stylesheet" href="style.css">嵌入p1{background-color: #00500F;font-size: 2em;text-align: center;}内联<p style="background-color: #00539F; font-size:...

2019-07-03 16:33:56 104

原创 IntelliJ IDEA 常用快捷键(Win下)

IntelliJ IDEA 常用快捷键(Win下)idea 的快捷键功能强大,但是过于繁杂,因此本文的主要目的是作为一个简单的摘录,记录一些自己常用的快捷键。1. 编辑相关alt + enter 智能提示ctrl + d 复制行ctrl + x 剪切行ctrl + y 删除行alt + ctrl + enter 上方插入行shift + enter 下方插入行ctrl + s...

2019-07-03 16:31:58 131

原创 提问的艺术

提问的艺术提问之前在提问的论坛的旧文章中搜索答案阅读手册查找答案上网搜索答案阅读常见问题文件(FAQ)自己检查或者实验尝试阅读源码查找答案可以使用谁能给点提示?我的这个例子里缺了什么?以及我应该检查什么地方这样的提问方式,表现出只要有人能指个正确方向,你就有完成它的能力和决心。提问时要在主题符合的论坛上提问题不要在探讨进阶技术问题的论坛张贴非常初...

2019-07-03 16:31:01 235

原创 html学习笔记

html学习笔记基本组件文本内容段落标签 <p>标题标签 <h1>.<h2> ,,,, <h6>分割线 <hr>有序标签 <ol> 每一子项用<li>标签表示无序标签 <ul> 每一子项用<li>标签表示列表标签 <dl> 子项用<dt>表示标题,&l...

2019-07-03 16:30:01 153

原创 Merge Two Sorted Lists 有序链表合并问题

Merge Two Sorted Lists 链表合并问题题目Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input: 1-&gt;2-&...

2019-01-27 10:46:03 167

原创 Valid Parentheses 括号匹配问题

Valid Parentheses 括号匹配问题题目:Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.An input string is valid if:Open brackets must be c...

2019-01-18 19:17:24 264

Gson资源包,版本2.8.1

gson资源包

2017-07-14

fastjson Android包 版本1.1.59

fastjson 包

2017-07-14

空空如也

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

TA关注的人

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