Voidvvv

study

You are given a directed graph of n nodes numbered from 0 to n - 1, where each node has at most one outgoing edge.

The graph is represented with a given 0-indexed array edges of size n, indicating that there is a directed edge from node i to node edges[i]. If there is no outgoing edge from i, then edges[i] == -1.

You are also given two integers node1 and node2.

Return the index of the node that can be reached from both node1 and node2, such that the maximum between the distance from node1 to that node, and from node2 to that node is minimized. If there are multiple answers, return the node with the smallest index, and if no possible answer exists, return -1.

Note that edges may contain cycles.

Read more »

You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).
You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.

Read more »

在尝试将自己的项目推送到maven仓库时,遇到并解决了很多坑点,特此来记一下笔记

需要提前声明一下,推送maven仓库,官方有很多中方法,比如使用build插件(maven plugin, gradle plugin),API等等,我这次是直接手手动在页面上上传的。

Read more »

Spring security 基础使用

整合springboot,基本可以说是开箱即用。甚至无需额外设置,只需要引入依赖:

1
2
3
4
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>

然后直接运行,即可看到spring security默认的登陆页面。

Read more »

这里用来记录虚幻引擎学习的踩坑记录。
大部分是引擎API以及内置设置相关问题。部分问题可以通过手动写代码来实现的功能,但是使用引擎会对开发更加友好,大部分是这种问题
2024-06-01T165305

Read more »

在前面已经成功的给游戏引入了OpenAL作为音频播放工具,并且使用了FreeAlut来解析音频。
但是这个freeALUT有一个问题,就是目前只支持Wav格式的文件。我们这次来给我们的系统添加对MP3和ogg的支持

Read more »

为了给游戏添加一些炫酷的音效,所以我就又开始了搜索c++的一些音乐库,最后选择了同是open系列的OpenAL,但是对这个库的使用着实费了一些功夫,因为OPENAL只能负责如何播放音频,但是不负责加载音频,所以我们还需要FREEAlut这个工具来帮助我们,但是这个库的使用并不简单。

Read more »

这几天在试着用c++和opengl写一个连连看小游戏。发现坑还挺多。其中一个就是判断两个块之间是否可以连通,经过分析之后我使用了AStar寻路算法来完成判断。为了保证复用还使用了模板。但是抽象这一块费了很大的劲,因为需要让代码能够跟我游戏中定义的一些类来相配合。
先说一下简单的思路:
按照AStar寻路算法,就是从起点开始,依次判断周围连同点的cost大小,若联通点没有被经过或者之前经过的cost大于当前计算的cost,则使用当前的路径,否则使用之前的路径,依次判断,直到找到终点.

Read more »
0%