自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(29)
  • 收藏
  • 关注

原创 Chromium Views BoxLayout 的前世今生

BoxLayout 是 Chromium 和 Chromium OS 中原生视图使用非常广泛的布局算法。今天我们从一个Bug入手,细说一下BoxLayout算法的前世今生。

2024-03-29 13:07:15 556

原创 BP 神经网络算法识别MNIST数据集

BP 神经网络算法识别MNIST手写数字数据集人工神经网络的基本原理生物神经元在结构上由:细胞体(Cell body)树突(Dendrite)轴突(Axon)突触(Synapse)四部分组成。用来完成神经元间信息的接收、传递和处理。神经元及其突触是神经网络的基本器件。因此,模拟生物神经网络应首先模拟生物神经元, 人工神经元(节点)从三个方面进行模拟:节点本身的信息处理能力...

2018-12-24 00:14:05 4952 1

原创 模拟退火(SA)算法和遗传算法(GA)求解 Capacitated Facility Location Problem

模拟退火(SA)算法和遗传算法(GA)求解 Capacitated Facility Location Problem模拟退火(SA)算法和遗传算法(GA)求解 Capacitated Facility Location Problem题目模拟退火(SA)算法遗传算法(GA)结果模拟退火(SA)算法遗传算法(GA)题目Suppose there are n fa...

2018-12-23 02:10:29 1615

原创 [leetcode] 76. Minimum Window Substring

Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).Example:Input: S = "ADOBECODEBANC", T = "ABC"Output: "BANC"Note:If th...

2018-12-09 16:49:52 186

原创 [leetcode] Insert Interval

Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.Example...

2018-12-02 16:09:54 171

原创 [leetcode] N-Queenes

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.Each s...

2018-11-26 14:49:54 138

原创 [leetcode] Jump Game II

Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal is to r...

2018-11-18 21:19:36 196

原创 [leetcode] trapping rain water

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.The above elevation map is represented by array ...

2018-11-11 14:01:19 117

原创 [leetcode] Sudoku Solver

Write a program to solve a Sudoku puzzle by filling the empty cells.A sudoku solution must satisfy all of the following rules:Each of the digits 1-9must occur exactly once in each row.Each of the ...

2018-11-07 12:11:37 222

原创 [leetcode] string to integer

Implement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this...

2018-11-04 19:28:31 167

原创 [leetcode] Longest Valid Parentheses

Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.Example 1:Input: "(()"Output: 2Explanation: The longest valid pa...

2018-10-27 12:27:44 135

原创 [leetcode] Substring with Concatenation of All Words

You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and wi...

2018-10-20 13:07:39 127

原创 [leetcode] Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a positive integer and is less than or equal to the length of the linked list. If the number of n...

2018-10-14 19:08:29 161

原创 [leetcode] Is Graph Bipartite?

Given an undirected graph, return true if and only if it is bipartite.Recall that a graph is bipartite if we can split it’s set of nodes into two independent subsets A and B such that every edge in t...

2018-10-07 20:59:28 179

原创 [leetcode] Merge k Sorted Lists

Merge k Sorted ListsMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Example:Input:[ 1->4->5, 1->3->4, 2->6]Output: 1->1-...

2018-09-30 18:19:49 162

原创 [leetcode] Regular Expression Matching

Regular Expression MatchingGiven an input string (s) and a pattern §, implement regular expression matching with support for'.' and'*'.'.' Matches any single character.'*' Matches zero or more of t...

2018-09-23 14:06:59 115

原创 [leetcode] First Missing Positive

Given an unsorted integer array, find the smallest missing positive integer.Example 1:Input: [1,2,0]Output: 3Example 2:Input: [3,4,-1,1]Output: 2Example 3:Input: [7,8,9,11,12]Output: 1...

2018-09-16 11:04:31 148

原创 [leetcode] Median of Two Sorted Arrays

[leetcode] 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 time complexity should be O...

2018-09-09 14:45:55 150

原创 游戏开发之Unity学习(十一)——多人游戏与网络

unity3d网络游戏开发APIunity3d开发网络多人游戏各cs文件代码:unity3d网络游戏开发API从 Unity 5.0 开始,提供了全新的 UNet 开发网络游戏,面向两种类型的用户:使用 Unity 开发简单多人游戏,应该从高阶 API 开始 使用 “NetworkManager” 管理网络,控制游戏对象网络状态从客户端调用服务器函数 或 从服...

2018-06-26 21:38:47 1524

原创 游戏开发之Unity学习(十)——给游戏添加智能,牧师与魔鬼(智能版)

这次是在之前的博客的基础上,给游戏添加游戏智能。考虑使用广度优先搜索算法来寻找最佳路径。演示视频实现效果如下: 游戏状态图的考虑这个游戏的不同状态包括以下几个方面: 1. 河两岸的牧师与魔鬼数:public int[] currentStatus;//该数组长度为4 2. 船在哪一边的岸旁:public BoatLocation boatLocation; 3. 那些对...

2018-06-19 21:56:12 327

原创 游戏开发之Unity学习(九)——IMGUI和UGUI实现血条

两种方式实现血条分析两种实现的优缺点IMGUI官方提供的是OnGUI函数来开发UI界面,当然问题也比较多,首先不支持可视化开发,其次UI始终位于所有3D对象的上方,无法实现在UI上添加3D模型的效果。 IMGUI开发简单,仅需几行代码,但是IMGUI需要在将3D位置映射到屏幕位置后,如果对结果进行加减,会使得血条位置偏移过多。UGUI优点: 1. 首先,5.2版本...

2018-06-05 18:10:22 2331

原创 游戏开发之Unity学习(八)——粒子光环

Unity 粒子系统 粒子系统通过生成使大量的2d图像成为动画的形式模拟流体,云,火焰使用粒子系统生成粒子光环 演示视频创建粒子系统和粒子位置数组新建工程和空场景,然后新建空对象并将它放在原点。这是“光环”的中心。接下来创建一个C#脚本并命名为ParticleCycle 。然后依次点击Components->Effects->Particle Syste...

2018-05-28 23:22:52 589

原创 游戏开发之Unity学习(七)——自动巡逻兵(订阅与发布模式)

游戏设计要求:游戏设计UML图游戏具体实现订阅与发布模式游戏中关键的实现部分动画部分场景部分脚本部分游戏设计要求:创建一个地图和若干巡逻兵(使用动画);每个巡逻兵走一个3~5个边的凸多边型,位置数据是相对地址。即每次确定下一个目标位置用自己当前位置为原点计算;巡逻兵碰撞到障碍物,则会自动选下一个点为目标;巡逻兵在设定范围内感知到玩家,会自动追击...

2018-05-11 13:58:38 586

原创 游戏开发之Unity学习(六)——鼠标打飞碟,适配器(Adapter)模式,结合物理引擎

本次实现效果图如下 Unity中物理引擎物理引擎是一种软件组件,用于仿真物理世界运动。这种仿真包括刚体力学、流体力学以及碰撞检测。 物理引擎通过为刚性物体赋予真实的物理属性,在外部力的作用下,计算运动、旋转和碰撞Unity中的常见物理组件:Rigidbody 刚体组件物体运动控制属性Collider 碰撞器物体碰撞与碰撞检测属性Mesh 网格物体形状属性J...

2018-04-24 15:56:22 462

原创 游戏开发之Unity学习(五)——鼠标打飞碟(Hit UFO)

一、游戏内容要求:游戏有 n 个 round,每个 round 都包括10 次 trial;每个 trial 的飞碟的色彩、大小、发射位置、速度、角度、同时出现的个数都可能不同。它们由该 round 的 ruler 控制;每个 trial 的飞碟有随机性,总体难度随 round 上升;鼠标点中得分,得分规则按色彩、大小、速度不同计算,规则可自由设定。二、游戏的要求:使用...

2018-04-17 15:57:18 481

原创 游戏开发之Unity学习(四)——牧师与魔鬼(动作管理器版)

使用动作管理器的原因前一个版本 FirstSceneController中包含了很多动作处理的部分。FirstSceneController类需要处理的事情太多,功能分离的不彻底。使用动作管理器将动作从 FirstSceneController类中分离出来能简化FirstSceneController类的结构,使之功能更加清晰。动作管理器的构建动作管理器分离后的最终结构(UML...

2018-04-10 14:48:00 331

原创 游戏开发之Unity学习(三)——小游戏:牧师与魔鬼

一、牧师与魔鬼游戏规则二、基于规则完善游戏对象三、基于规则完善游戏动作四、基于规则构建游戏场景五、根据规则编写行为约束代码一、牧师与魔鬼游戏规则在河的一边有三个牧师和三个魔鬼。 他们都想到达这条河的另一边,但只有一条船,这条船每次只能载两人。 而且必须有一个人将船从一侧转向另一侧。 您可以点击它们来移动它们,然后点击go按钮将船移动到另一个方向。 如果在岸上(如果船...

2018-04-03 21:20:46 476

原创 游戏开发之Unity学习(二) ——空间与运动

一、游戏对象运动的本质是什么?二、实现物体的抛物线运动。三、实现一个完整的太阳系(太阳、八大行星和月球)。一、游戏对象运动的本质是什么?游戏对象运动的本质就是不断的更新游戏对象的坐标,旋转游戏对象void Update () { this.transform.position += Vector3.left * Time.deltaTime;}...

2018-03-31 11:50:54 534

原创 游戏开发之Unity-学习(一) —— Unity基础概念和实现井字棋

游戏开发之Unity-学习(一) —— Unity基础概念和实现井字棋游戏开发之Unity-学习(一) —— Unity基础概念和实现井字棋一、游戏对象与资源的区别和联系:二、资源、对象组织的结构(指资源的目录组织结构与游戏对象树的层次结构)1. 资源的目录组织结构一般是:2. 对象组织的结构三、用 debug 语句来验证 MonoBehaviour基本行为或事件触发的条件...

2018-03-26 19:32:04 704

空空如也

空空如也

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

TA关注的人

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