MacOS下LLDB调试Qt5程序
LLDB调试Qt5的问题
MacOS下,LLDB调试Qt5应用通常会遇到无法打印QString变量的问题。
1 | * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 |
这里无法获取变量s
的值Hello World
,只能看到一个地址。
MacOS下,LLDB调试Qt5应用通常会遇到无法打印QString变量的问题。
1 | * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 |
这里无法获取变量s
的值Hello World
,只能看到一个地址。
自从ChatGPT出现以来,就一直在使用,那么ChatGPT毕竟是有局限性的,因为ChatGPT训练的语料是有限的。很多问题回答不了, 也经常会胡言乱语闹笑话。
但是ChatGPT背后的大语言模型LLM是可以扩展的,也就是说,可以把特定的领域知识让LLM(大语言模型)学习。这样就在一定 程度上解决了局限性。
而LangChain项目就是这样的杀手锏,这里是官方文档。
leetcode
现在支持Go
了,这次用Go
写一个算法题——消除游戏。
You have a list arr of all integers in the range [1, n] sorted in a strictly increasing order. Apply the following algorithm on arr:
Starting from left to right, remove the first number and every other number afterward until you reach the end of the list.
Repeat the previous step again, but this time from right to left, remove the rightmost number and every other number from the remaining numbers.
Keep repeating the steps again, alternating left to right and right to left, until a single number remains.
Given the integer n, return the last number that remains in arr.
Example 1:
Input: n = 9
Output: 6
Explanation:
arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]
arr = [2, 4, 6, 8]
arr = [2, 6]
arr = [6]
简单说就是从左至右消除,再从右到左消除,如果不唯一继续这个过程。对于这个例子,输入是9,那么开始就有1-9, 9个数。第一次,消除{1,3,5,7,9}, 第二次消除{8,4},第三次消除{2},最后留下数字6。
老办法,先用naive、暴力的方法求解,再优化。