- 博客(49)
- 收藏
- 关注
原创 微信小程序,修改按钮Button尺寸(宽度或高度)
当前版本的微信小程序,在.wxss文件里设置Button宽度无效,例如:.answer-button { display: block; margin-top: 2vh; font-size: 3.5vh; width: 80vw}无论如何调整width,Button的宽度都不会有变化,有博主提出,要把 app.json里的 style: v2语句删掉。这样虽然也...
2020-01-08 11:35:05
66806
19
原创 Unity适配全面屏两边黑边问题
若Unity在打包给安卓全面屏的时候,出现屏幕两边的黑边。在尝试适配策略,甚至代码中强行锁定分辨率也没用时,多半是自定义Android.Manifest文件中缺少以下代码:<meta-data android:name="android.max_aspect" android:value="2.2"/>(2.2这个数字可以改成2.1以上的数字,通常全面屏为18...
2018-03-19 22:39:50
10365
3
原创 Assets/spine-unity/Editor/SkeletonBaker.cs(803,21): error CS0619: ....升级Unity2017 问题解决
升级Unity2017后,spine 库会报出类似如下的错误。Assets/spine-unity/Editor/SkeletonBaker.cs(803,21): error CS0619: `UnityEditor.AnimationUtility.SetAnimationType(UnityEngine.AnimationClip, UnityEditor.ModelImporterAn
2017-07-19 09:49:00
3352
原创 U3D 接入Android SDK 后,运行游戏闪退问题
解决问题:进入游戏,弹出Unity3D图标(如果使用的是免费版Unity)后,自动退出。在Log中只能看见 onDestroy这样的内容,没有任何出错警告信息。
2016-08-26 13:00:46
8386
原创 ndnSIM 2.0 因缺少pythonbind无法使用visual组件问题 —pybindgen (found '') ".. ns3::VisualSimulatorImpl not found"
如果在执行 ./waf --run=ndn-simple --vis时,遇见 ns3::VisualSimulatorImpl not found 错误。并且在configure的时候,发现有如下信息:> Checking for pybindgen version : > pybindgen (found ''), (need '0.17.0.post45+ng4806e4f')
2016-08-18 17:23:12
3539
翻译 [ndnSIM 2.0] ndnSIM 2.0 综述摘要 - Introduction
内容来源于:ndnSIM 2.0: A new version of the NDN simulator for NS-3 Spyridon Mastorakis, Alexander Afanasyev, Ilya Moiseenko and Lixia Zhang University of California, Los Angeles.
2016-08-10 07:53:57
1028
原创 error CS0117: `System.IO.File' does not contain a definition for `WriteAllBytes'
今天将unity3d引擎升级了一个小版本,发现项目出现了error CS0117: `System.IO.File' does not contain a definition for `WriteAllBytes' 的报错。错误提示file中没有writeallbytes这个方法的定义,用ide查看代码,转到定义后发现库中的确没有相关定义。以为是vs的问题,重装了vs tools f
2016-06-18 15:50:53
4862
原创 U3D Destroy 由预设克隆出的物体后,预设组件丢失
U3D在脚本中通过预设来生成物体的方式是使用Instantiate(GameObject, Vector3, Quaternion)方法,具体可以去百度。此方法第一个参数是预设。这里有两种方法把预设导入到代码中:一种 是在代码里声明 public GameObject goPrefab,并通过U3D的图形界面把预设与此goPrefab绑定。二种 是把预设放置在 Resour
2016-04-30 13:20:34
2828
原创 LeetCode Algorithms #119 <Pascal's Triangle II>
Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to use only O(k) extra space?思路:因为只返回结果
2016-04-14 16:04:55
332
原创 LeetCode Algorithms #102 <Binary Tree Level Order Traversal>
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,9,20,#,#,15,7}, 3 / \ 9 20
2016-04-13 16:18:58
304
原创 LeetCode Algorithms #172 <Factorial Trailing Zeroes>
Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.思路:a * (b*c) = a * b * c;只有2*5会产生0;所以这道题可以转化成 1,2,3....n中
2016-04-13 16:06:11
362
原创 Unity3D中 Box Collider 2D 覆盖 OnMouseDown
利用Unity3D 自带的UI组件做界面时,因为Button组件不能很好的满足需求。所以很多时候是手动在控件上添加BoxCollider2D组件。
2016-04-12 12:42:36
3986
原创 LeetCode Algorithms #66 <Pascal's Triangle>
Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]思路:虽然我希望再简单的题我也能记录下自己的思路
2016-04-01 22:12:04
313
原创 LeetCode Algorithms #26 <Remove Duplicates from Sorted Array>
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with
2016-04-01 21:45:51
261
原创 LeetCode Algorithms #66 <Remove Element>
Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.思路:从最后一位开始+1,发现大
2016-04-01 19:36:43
352
原创 LeetCode Algorithms #27 <Remove Element>
Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant memory.
2016-04-01 18:39:36
315
原创 LeetCode Algorithms #107 <Binary Tree Level Order Traversal II>
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree {3,9,20,#,#,15,7},
2016-03-27 18:30:07
327
原创 LeetCode Algorithms #101 <Symmetric Tree>
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the f
2016-03-24 16:50:38
235
原创 LeetCode Algorithms #24 <Swap Nodes in Pairs>
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe
2016-03-24 16:25:18
327
原创 LeetCode Algorithms #198 <House Robber>
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house
2016-03-24 15:28:20
239
原创 LeetCode Algorithms #24 <Swap Nodes in Pairs>
Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. Y
2016-03-24 10:39:04
244
原创 LeetCode Algorithms #232 <Implement Queue using Stacks>
Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front of queue.peek() -- Get the front element.empty(
2016-02-24 19:06:33
338
原创 LeetCode Algorithms #21 <Merge Two Sorted Lists>
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.思路:就和玩积木一样,这些基本的链表操作是没有任何难度的,小心些,不犯低级错误就可以一次ac。解:
2016-02-24 18:38:56
411
原创 LeetCode Algorithms #231 <Power of Two>
Given an integer, write a function to determine if it is a power of two.思路:2这个数字很特殊,因为计算机使用的数制是二进制。所以可以尝试通过位操作来完成判断。2的幂的数字特点就是有且只有一个1,比如二进制1000,10这些。我发现1000-1 = 111和1000直接按位取反是一样的,但是C++语言的取反会把前面
2016-02-24 18:01:50
1068
原创 LeetCode Algorithms #326 <Power of Three>
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?思路:递归的很好做,就是在每次调用的时候看能不能被3整除,不能直接返回false,能的话继续除以3,直到最
2016-02-23 18:39:13
323
原创 LeetCode Algorithms #202 <Happy Number>
Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares
2016-02-16 21:49:15
276
原创 LeetCode Algorithms #263 <Ugly Number>
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 si
2016-02-16 21:29:42
232
原创 LeetCode Algorithms #83 <Remove Duplicates from Sorted List>
Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.思路:一个指针向后遍历,发现自己的下一
2016-02-13 02:07:04
285
原创 LeetCode Algorithms #70 <Climbing Stairs>
You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?思路:n个阶梯的方法相当于n-1个阶梯迈一步,和
2016-02-13 01:45:45
384
原创 LeetCode Algorithms #191 <Number of 1 Bits>
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11' has binary representation 000000
2016-02-13 01:26:14
365
原创 LeetCode Algorithms #13 <Roman to Integer>
Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.思路:(摘自互动百科)表示数的基本方法:除I、X、C位于大数后作为加数,位于大数前作为减数外,一般把若干罗马基本数字写在一起,它表示的数字等
2016-02-12 22:23:43
222
原创 LeetCode Algorithms #206 <Reverse Linked List>
Reverse a singly linked list.思路:。。。解:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * };
2016-02-02 19:46:01
396
原创 LeetCode Algorithms #328 <Odd Even Linked List>
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-02-02 12:51:21
300
原创 LeetCode Algorithms #235 <Lowest Common Ancestor of a Binary Search Tree>
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined betw
2016-02-02 00:16:13
236
原创 LeetCode Algorithms #169 <Majority Element>
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element
2016-01-31 17:59:49
280
原创 LeetCode Algorithms #217 <Contains Duplicate>
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element
2016-01-31 17:38:44
240
原创 LeetCode Algorithms #171 <Excel Sheet Column Number>
Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C -> 3 ...
2016-01-31 17:27:00
221
原创 LeetCode Algorithms #242 <Valid Anagram>
Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat", t = "car", return false.Note:You may a
2016-01-31 17:10:31
235
原创 LeetCode Algorithms #292 <Nim Game>
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the
2016-01-31 16:09:41
272
原创 LeetCode Algorithms #226 <Invert Binary Tree>
invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1思路:简单的递归调用,不知道Homebrew的作者为什么没做出来。解:/** * Definition for a bina
2015-10-11 08:33:25
325
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人