03 2020 档案
摘要:错因:在使用c3p0连接池时,需要导入两个jar包,因为之前下的最新版的c3p0-0.9.5.3.jar,与之对应的是mchange-commons-java-0.2.19.jar。 而且这个版本我又找了很久,所以索性换成低版本! 连接成功:
阅读全文
摘要:1. 打开 terminal 2. 输入 command + shift + .
阅读全文
摘要:1. 打开terminal终端 快捷键 command + space ,输入 ter 回车,打开terminal。 2. 连接mysql 输入命令 mysql -uroot -p ,输入密码(输入密码看不见,主要不要多输入字符)。 登录成功! 3. 如果忘记密码,这样找回 在系统偏好中把mysql
阅读全文
摘要:C: strlen() int main() { const char* str = "I love coding."; printf("%d", strlen(str)); return 0; } C++: str.length() str.size() int main() { string s
阅读全文
摘要:1. Description 将一个只含有数字0~9和#的字符串按规则转换: 1. '1' ~ '9' -> 'a' ~ 'i';2. "10#" ~ "26#" -> 'j' ~ 'z' 返回最后字符串res。 2. Solution 顺序扫描字符,每次往后多看两个字符(如果可以的话),判断字符所
阅读全文
摘要:1. Description 给定一个整数n,求一个包含n个字符的串,串中每个字符出现奇数次。 2. Solution 分类讨论,如果n为1,返回"a",n为2,返回"ab",n大于2且为偶数,则返回"aaaa...aab"(n-1个a加1个b),n为奇数,直接返回n个a。 3. Code stri
阅读全文
摘要:1. Description 给定一个字符串s,先按从小到大的顺序抽取字符添加到res字符串中,然后按从大到小的顺序抽取字符添加到res末尾,直到原字符串中所有字符抽取完毕。 2. Solution 关键在于先一遍扫描提取每个字符频数,然后向前向后添加,一有字符添加,就要及时将cnt减一。 3. C
阅读全文
摘要:1. Description 给定一个字符串 s 是一个只包含 'L' or 'R' 的平衡串(L 和 R 数目一样多),求可以分成多少个平衡子串。 https://leetcode.com/problems/split-a-string-in-balanced-strings/ 2. Soluti
阅读全文
摘要:前言: 这篇文章通过 NorthWind Graph 的例子熟悉并掌握 neo4j 导入 CSV 文件。 一、环境配置 在导入之前确保 neo4j.conf 中允许 CSV 导入。 打开 neo4j.conf: $ vim neo4j.conf 修改 dbms.security.allow_csv_
阅读全文
摘要:前言: 这篇本章通过 neo4j 官方给出的 movie graph 例子学习 neo4j 基本的创建、查询、修改、删除语句。 一、创建图谱 1. 获取 Example Graph - Movie Graph 实例 2. 导入官网的图谱创建语句 下面展示了电影 "The Matrix" 的人物信息与
阅读全文
摘要:一、下载 1. 进入 neo4j 官网下载页面(https://neo4j.com/download/) 2. 下载 neo4j server 3. 查看对应版本,选择免费的 community 版本下载 4. 记住默认的用户名和密码都是:neo4j 5. 如果下载速度缓慢,两个解决方法: * 连接
阅读全文
摘要:1. 一个简单例子介绍关于Java HashMap 的基本操作:创建、添加、更新、删除及遍历。 2. 代码: 1 import java.util.*; 2 3 /** 4 * the basic usage of hashmap 5 * @author SheepCore 6 * @date 20
阅读全文
摘要:1. 设置分级标题 语法实例: # 一级标题 ## 二级标题 ### 三级标题 #### 四级标题 ##### 五级标题 ###### 六级标题 文本// # 与文字之间必须有一个空格 2. 加粗文本 语法实例: **I'm Bold.** // 加粗部分的内容与左右两边双星不能有额外空格 Note
阅读全文
摘要:一、知识图谱概述 知识图谱早期由语义网络(Semantic Web)发展而来 常见知识图谱:WordNet、ConceptNet5.0、Yago、DBpedia、Freebase、Schema.org、WikiData、Google and OpenKG 知识图谱的应用价值:辅助搜索、辅助问答、辅助
阅读全文
摘要:1. 使用 for-loop 复制数组元素 1 int[] num1 = {1, 2, 3, 4, 5}; 2 int[] num2 = new int[num1.length]; 3 for (int i = 0; i < num1.length; i++) { 4 num2[i] = num1[
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: /** * Created by sheepcore on 2018-12-24 */ class Solution { public int[] nextGreaterElement(int[] nu
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2018-12-24 3 */ 4 class Solution { 5 public String removeOuterParen
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2018-12-24 3 */ 4 class Solution { 5 public int calPoints(String[]
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2018-12-24 3 */ 4 class Solution { 5 public boolean buddyStrings(St
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2018-11-11 3 */ 4 class Solution { 5 public String reverseOnlyLette
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 class Solution { 2 public int findLUSlength(String a, String b) { 3 return a.equals(b) ? -1 : Math.
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2018-11-11 3 */ 4 class Solution { 5 public String[] reorderLogFile
阅读全文
摘要:1. Description: 2.Solutions: 1 /** 2 * Created by sheepcore on 2019-01-23 3 */ 4 class Solution { 5 public int[] twoSum(int[] nums, int target) { 6 Ma
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-24 3 */ 4 class Solution { 5 public int[] sumEvenAfterQueri
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-24 3 */ 4 class Solution { 5 public int arrayPairSum(int[]
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-24 3 */ 4 class Solution { 5 public int[][] kClosest(int[][
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-24 3 */ 4 class Solution { 5 public int[] sortArrayByParity
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-24 3 */ 4 class Solution { 5 public int numSpecialEquivGrou
阅读全文
摘要:1. Description: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-24 3 */ 4 class Solution { 5 public void reverseString(char[] s) {
阅读全文
摘要:1. Description: 2.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-24 3 */ 4 class Solution { 5 public String reverseWords(String s) { 6 String[]
阅读全文
摘要:1. Description: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-24 3 * best time complexity: O(n) 4 * average time complexity: O(n
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-24 3 */ 4 class Solution { 5 public int[][] flipAndInvertIm
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-24 3 */ 4 class Solution { 5 public int repeatedNTimes(int[
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-24 3 */ 4 class Solution { 5 public int uniqueMorseRepresen
阅读全文
摘要:1. Description: 2. Examples: 3.Solutions: 1 class Solution { 2 public String toLowerCase(String str) { 3 return str.toLowerCase(); 4 } 5 }
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-24 3 */ 4 class Solution { 5 public int numUniqueEmails(Str
阅读全文
摘要:1. Description: 2.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-24 3 */ 4 class Solution { 5 public int[] sortArrayByParity(int[] A) { 6 7 int[
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-02-12 3 */ 4 class Solution { 5 public int[] sortedSquares(int
阅读全文
摘要:1. Description: 2.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-10 3 * Definition for singly-linked list. 4 * public class ListNode { 5 * int v
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: /** * Created by sheepcore on 2019-05-10 * Definition for singly-linked list. * public class ListNode
阅读全文
摘要:1. Description: 2.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-10 3 * Definition for singly-linked list. 4 * public class ListNode { 5 * int v
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-10 3 * Definition for singly-linked list. 4 * public class
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-10 3 */ 4 class Solution { 5 public int[] nextGreaterElemen
阅读全文
摘要:1. Description: 2.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-09 3 * Definition for a binary tree node. 4 * public class TreeNode { 5 * int v
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-07 3 */ 4 class Solution { 5 public boolean isValid(String
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-09 3 */ 4 class Solution { 5 public int scoreOfParentheses(
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-09 3 * Definition for a binary tree node. 4 * public class
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-09 3 * Definition for singly-linked list. 4 * public class
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-09 3 */ 4 class Solution { 5 public boolean validateStackSe
阅读全文
摘要:1. Description: 2.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-07 3 */ 4 class Solution { 5 public int[] dailyTemperatures(int[] T) { 6 int[]
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-07 3 */ 4 class Solution { 5 public int minAddToMakeValid(S
阅读全文
摘要:1. Description: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-07 3 */ 4 5 class Solution { 6 public boolean isValid(String s) {
阅读全文
摘要:1. Description: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-07 3 * Your MinStack object will be instantiated and called as suc
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-07 3 * Your MyStack object will be instantiated and called
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-03-07 3 * Your MyQueue object will be instantiated and called
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-07 3 * Definition for singly-linked list. 4 * public class
阅读全文
摘要:1. Description: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-07 3 * Definition for singly-linked list. 4 * public class ListNod
阅读全文
摘要:1. Description: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-08 3 * Definition for singly-linked list. 4 * public class ListNod
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-14 3 * Definition for singly-linked list. 4 * class ListNod
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 1 public String defangIPaddr(String address) { 2 return address.replace(".", "[.]"); 3 } 4. Summary:
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: Version 1: hashmap 1 /** 2 * Created by sheepcore on 2020-03-02 3 * @param J 4 * @param S 5 * @return
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: 4. Summary:
阅读全文
摘要:1. Description: Notes: 2. Examples: 3.Solutions: Java Version 1: 1 /** 2 * @author sheepcore 3 * created on 2020-03-02 4 */ 5 public int[] decompressR
阅读全文
摘要:1. Description notes: 2. Examples: 3. Solution: 1 """ 2 created by sheepcore on 2020-03-02 3 """ 4 from typing import List 5 6 7 def smallerNumbersTha
阅读全文
摘要:1.Description: 2.Example: Input: 3 1 2 3 2 3 4 9223372036854775807 -9223372036854775808 0 Output: Case #1: false Case #2: true Case #3: false 3.soluti
阅读全文
摘要:1.Description: With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best
阅读全文
摘要:1.Description: Now you are asked to solve a more general problem: find the first K-digit prime in consecutive digits of any given L-digit number. 2.Ex
阅读全文
摘要:1.Description: The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which
阅读全文