- 博客(81)
- 收藏
- 关注
原创 全网最简单的GraphRAG讲解,包你懂
GraphRAG 是一种结合了图结构的检索增强生成(Retrieval-Augmented Generation,简称 RAG)方法。它将大语言模型(Large Language Model,LLM)与知识图谱相结合,从非结构化数据中自动构建图数据库,以增强模型的生成能力。本文将深入浅出地讲解 GraphRAG 的原理、流程,以及大模型在构建图过程中的作用,并通过示例帮助你彻底理解这一概念。
2024-11-03 20:51:51
954
1
原创 SHELL脚本入门
SHELL脚本入门脚本格式执行脚本的方式脚本的变量脚本格式脚本采用以下格式开头作为标识,并指定解析器#!/bin/bash 脚本就是一个命令行的集合,把多条命令放在一起逐个执行。执行脚本的方式#方式一:bash xx.sh#方式二:./xx.sh这两种方式在执行区别在于:通过bash来执行的话,不要求脚本有x执行权限,而方式二必须要求执行权限。通过bash来执行,第一...
2019-08-30 16:03:32
256
翻译 Intellij IDEA问题:Error during artifact deployment. See server log for details
IDEA版本:2017.1.1 Tomcat版本:8.5,9.0 问题:在idea中使用tomcat部署web app时,提示:Error during artifact deployment. See server log for details解决办法: 替换IDEA 安装目录/plugins/Tomcat/lib/tomcatIntegration.jar重启IDEA附件tomcat
2017-04-17 13:05:56
18746
1
原创 简单的遗传算法(Genetic algorithms)-吃豆人
遗传算法简介:一直都在收听卓老板聊科技这个节目,最近播出了一起人工智能的节目,主要讲的是由霍兰提出的遗传算法,在目中详细阐述了一个有趣的小实验:吃豆人。首先简单介绍下遗传算法: 1:为了解决某个具体的问题,先随机生成若干个解决问题的实体,每个实体解决问题的方式都用“基因”来表示,也就是说,不同的实体拥有不同的基因,那么也对应着不同的解决问题的方案。 2:有了若干实体之后,接下来就是让这些实体来完
2016-12-05 20:52:39
10426
1
原创 JAVA字节流与字符流总结
字节流:字节流是处理的基本单位是单个的字节,在java中有两个最基本的抽象字节流类。InputStream 和 OutputStream 均为抽象类在InputStream中有一个最基本的方法,从字节流中读取一个字节,若到了流的末尾则返回-1,用这个方法每读一个字符就会进行一次系统读取请求,效率较低。另一个重载的方法可以读取多个字节,但在底层仍然是调用的read()方法public abstract
2016-09-08 20:53:56
542
原创 Java对象的序列化
Java对象的序列化什么是对象序列化Java的对象序列化能将一个实现了Serializable接口的对象转换成一组btye数组,这样日后要用到这个对象的时候,就能把这些byte数据恢复出来,重构那个对象。
2016-09-04 15:23:43
388
转载 译文:Java中的弱引用
转载自:http://droidyue.com/blog/2014/10/12/understanding-weakreference-in-java/译文:理解Java中的弱引用OCT 12TH, 2014不久之前,我面试了一些求职Java高级开发工程师的应聘者。我常常会面试他们说,“你能给我介绍一些Java中得弱引用吗?”,如果面试者这样说,“嗯,是不是垃圾回收
2016-08-01 18:52:14
402
原创 Java的基本类型总结
基本类型使用的内存是虚拟机栈中的内存。引用类型使用的内存是堆中的内存,对象的引用在栈中。基本类型 对应的封装类型位数boolean Boolean1byte Byte 8char Character16int Integer32short Short32long Long 64float Float32double Doubl
2016-08-01 15:26:57
489
转载 深入解析String#intern
原文地址:http://www.importnew.com/14142.html引言在 JAVA 语言中有8中基本类型和一种比较特殊的类型String。这些类型为了使他们在运行过程中速度更快,更节省内存,都提供了一种常量池的概念。常量池就类似一个JAVA系统级别提供的缓存。8种基本类型的常量池都是系统协调的,String类型的常量池比较特殊。它的主要使用方法有两种:
2016-07-16 19:43:02
470
转载 Java多态性理解
Java多态性理解Java中多态性的实现什么是多态面向对象的三大特性:封装、继承、多态。从一定角度来看,封装和继承几乎都是为多态而准备的。这是我们最后一个概念,也是最重要的知识点。多态的定义:指允许不同类的对象对同一消息做出响应。即同一消息可以根据发送对象的不同而采用多种不同的行为方式。(发送消息就是函数调用)实现多态的技术称为:动态绑定(dynamic
2016-07-06 17:44:34
448
原创 【Leetcode】:28. Implement strStr()问题 in JAVA
Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Subscribe to see which companies asked this question题目要求求字符串ne
2016-06-22 20:32:00
981
转载 Android关于SQLite的日期时间的存储
原文链接:https://segmentfault.com/a/1190000003008234最近一直在学习Android,由于Xana的Java完全是半路出家,以前一直在用C#、C++和Python之类的东西,对于时间和日期的处理,一直没能弄得比较清楚。说清楚,SQLiteSQLite中,原始的存储只有以下几种(SQLite文档):NULL。只有null。INTEG
2016-06-19 22:25:06
5673
原创 Android中“android:elevation”设置阴影,在真机上没有效果的问题
今天在Android界面的设计中遇到一个问题,我想要用elevation设置阴影效果,也就是对某个View添加android:elevation<ListView android:layout_marginLeft="16dp" android:layout_marginRight="16dp" android:padding="8dp" android:id=
2016-06-17 16:51:07
11598
原创 Java中的多线程处理-学习笔记
在Java中实现多线程处理的方法有两种第一种:继承Thread类,将需要完成的操作放在类的run()方法中,调用Thread中的start()方法就能启动线程public class MyThread extends Thread { private int count = 10; public void run() { while(true) { System.ou
2016-06-07 10:21:21
557
原创 【Leetcode】:9. Palindrome Number 问题 in JAVA
Determine whether an integer is a palindrome. Do this without extra space.题目要求判断一个数是否是回文数,例如123321,9889就是回文数这道题要求不能使用额外的空间,想了很久都不知道怎么做,只有网上查了下,原来创建一个变量不叫使用额外空间。。。public class Solution {
2016-05-24 21:47:14
776
原创 Java中的报错:Cannot make a static reference to the non-static field
在下面这段代码中会报错System.out.println(s1);Cannot make a static reference to the non-static field s1只要把s1的申明加上static,就不会报错了,这有点让奇怪,看报错是说不能在非静态域进行静态引用,查询了一下原因,由于该方法是静态方法,s1变量非静态变量,所以s1是依赖于对象的存在而存在的,也就
2016-05-24 12:22:45
11873
原创 【Leetcode】:116. Populating Next Right Pointers in Each Node 问题 in JAVA
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next right node. If there i
2016-05-11 13:03:48
594
原创 【Leetcode】:89. Gray Code 问题 in JAVA
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence of
2016-05-10 14:04:39
1313
原创 【Leetcode】:326. Power of Three 问题 in JAVA
Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly sinc
2016-05-09 12:17:41
406
原创 【Leetcode】:326. Power of Three 问题 in JAVA
Given an integer, write a function to determine if it is a power of three.Follow up:Could you do it without using any loop / recursion?题目要求不能使用循环或者递归,这里需要用到数学的一点小技巧。首先如果n《=0,那么一定返货false如
2016-05-07 15:46:03
1223
原创 【Leetcode】:Best Time to Buy and Sell Stock with Cooldown 问题 in JAVA
这是一道股票买卖的问题,加了一个特殊条件,卖出以后要隔一天才能交易,这道题花了我好久的时间,期间参考了“http://www.cnblogs.com/grandyang/p/4997417.html”
2016-05-05 23:05:01
489
原创 【Leetcode】:70. Climbing Stairs 问题 in Go语言
这道题的难度定义为Easy,知道思路解决起来确实简单,但是要分析出思路并不容易。题目要求出有多少种爬梯子的办法,并且规定每次只能爬一级阶梯或者两级解题,如此一来我们可以知道最后一步不是爬了一级阶梯就是爬了两级解题,那么问题就可以被分解了。爬n级阶梯的种数 = 最后一步爬一级阶梯种数+最后一步趴两级阶梯的种数 = 爬n-1级阶梯的种数 + 爬n-2级阶梯的种数
2016-05-05 19:36:40
672
原创 【Leetcode】:22. Generate Parentheses 问题 in Go语言
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()
2016-05-02 22:33:35
744
原创 【Leetcode】:108. Convert Sorted Array to Binary Search Tree 问题 in JAVA
题目:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题目要求按照给定的已经排序的数组,生成一个平衡的二叉树用递归的方法来做的话,这道题还是很简单的,只要记住,为了保持平衡,每一个节点的val在它所有子节点的val中排中间大。/** *
2016-05-02 20:13:49
744
原创 【Leetcode】:337. House Robber III 问题 in JAVA
题目:The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent house. Aft
2016-05-01 16:03:09
366
原创 【Leetcode】:96. Unique Binary Search Trees 问题 in Go语言
Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's.题目要求出func numTrees(n int) int { i
2016-04-29 15:41:23
404
原创 【Leetcode】:230. Kth Smallest Element in a BST 问题 in JAVA
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.Follow up:What if t
2016-04-28 22:55:47
341
原创 【Leetcode】:328. Odd Even Linked List 问题 in JAVA
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.You should try to do it in
2016-04-28 21:44:12
638
原创 【Leetcode】:344. Reverse String 问题 in JAVA
Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".这道题很简单,但是我写的第一个版本居然超时了,没有通过,下面这个版本可以通过。public class Solution {
2016-04-27 16:06:55
1937
原创 【Leetcode】:287. Find the Duplicate Number 问题 in JAVA
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number,
2016-04-27 15:41:28
382
原创 【Leetcode】:51. N-Queens 问题 in JAVA
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all distinct solutions to the n-queens puzzle.
2016-04-25 19:16:59
2707
原创 【Leetcode】:13. Roman to Integer 问题 in JAVA
Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.题目要求把罗马数字转换为阿拉伯数字,这个题很简单,只不过代码量比较大先查查维基百科罗马数字的知识,各个字母分别代表什么意思Symbol
2016-04-25 10:04:16
467
原创 【Leetcode】:94. Binary Tree Inorder Traversal 问题 in JAVA
题目难度中等,就是要求不用递归的情况下进行中序遍历:中序遍历就是先访问左孩子的值,再访问父节点的值,最后访问右孩子的值。这样的话,一棵树的最最左边的子节点的值一定是第一个被访问的所以实现起来的思路就是,沿着树一直向左走,直到走不动为止,这个时候再看看当前节点是否有右节点,如果有的话对该又节点进行前面的操作。/** * Definition for a binary tree
2016-04-24 12:21:42
562
原创 【Leetcode】:318. Maximum Product of Word Lengths 问题 in JAVA
Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case le
2016-04-22 20:17:58
885
原创 【Leetcode】:144. Binary Tree Preorder Traversal 问题 in Go语言
Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3].Note: Recursive soluti
2016-04-22 17:55:07
537
原创 【Leetcode】:268. Missing Number 问题 in JAVA
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return 2.Note:Your algorithm sho
2016-04-22 10:19:35
328
原创 【Leetcode】:319. Bulb Switcher 问题 in JAVA
There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it's off or turning of
2016-04-21 10:14:19
413
原创 【Leetcode】:343. Integer Break 问题 in JAVA
Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.For example, given n = 2, ret
2016-04-20 21:11:30
1305
原创 【Leetcode】:122. Best Time to Buy and Sell Stock II 问题 in JAVA
Say you have an array 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 complete as many transactions as you like (ie, buy on
2016-04-19 15:02:49
624
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人