自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 python+django 更改了urls.py 之后runserver报错的解决办法

新手学python+django时,更改了urls.py 为:from django.conf.urls import patterns, include, urlfrom django.contrib import adminadmin.autodiscover()urlpatterns = patterns('',    # Examples:    # url(r

2016-10-12 11:09:15 6906

原创 leetcode 52. N-Queens II

题目内容Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.题目分析n皇后问题,找出所有的可行解。通过本方法,没有记录皇后的坐标代码public class Solution {private final

2016-08-04 22:05:14 472

转载 PVR图像文件格式初探

ios上图片当然是用pvr(pvrtc2/pvrtc4)格式,推荐pvr.ccz的rgb565/rgba4444格式。一.PVR格式优点:1. cpu上,解压速度快,读取后不用解析直接交给显卡,不需要转换为ARGB形式就可以提交给显卡使用。2. 内存和显存上,读取后直接提交给显卡,不用开辟临时内存来读取像素数据,避免了内存的申请释放消耗和内存的飙升。3.文件

2016-07-22 17:38:50 1922

转载 TGA文件格式整理

整理自:http://dev.gameres.com/Program/Visual/Other/TGAFormat.htmhttp://blog.csdn.net/yyfzy/article/details/785948http://tech.watchstor.com/management-115327.htmhttp://baike.baidu.com/subview/1879

2016-07-15 14:22:24 548

原创 leetcode 371. Sum of Two Integers

题目内容 Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example: Given a = 1 and b = 2, return 3.Credits: Special thanks to @fujiaozhu for adding this pro

2016-07-13 21:35:43 319

原创 Run-Time Check Failure #2 - Stack around the variable '***' was corrupted.

这是一个指针错误,查你自己的“****”指针所指向的数据,在某个地方被强制转换了。列出,char转换成了 int 就会报类似的错误。改过来就ok了

2016-07-05 21:20:52 442

转载 C++二进制文件写操作

#includefstream.h>main(){ int a[10]={0}; for(int i=0;i9;i++) { a[i+1]=a[i]*10+i+1; couta[i]endl; } ofstream rs("ok2002com.bin",ios::binary);//打开二进制文件ok2002com.bin;注意:打开二进制

2016-07-05 21:04:10 541

原创 将VS2010默认Unicode编码设置为ANSI编码

我的输出结果和目标输出结果,一模一样但是无法被识别。查了半天错,发现是编码格式不一样,vs2010默认的编码格式是Unicode,而目标格式是ansi。改过来就好了。打开菜单栏–>项目–>XXX属性–>配置属性–>常规–>字符集–>设置你想要的编码方式即可

2016-07-05 17:29:46 4730 1

转载 LINK:fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏

原文地址:http://yacare.iteye.com/blog/2010049很多伙伴在更新VS2010,或者卸载VS2012安装2010后,建立Win32 Console Project/MFC项目时会出现”LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏”的错误。错误描述: 1>正在编译资源… 1>正在编译资源清单… 1>正在链接…

2016-07-05 11:10:10 413

原创 leetcode 357. Count Numbers with Unique Digits

题目内容Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n.Example: Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ x < 100, exc

2016-06-20 21:22:07 266

转载 TexturePacker非常棒的游戏资源图像处理工具

欢迎转载!转载时请注明出处:http://blog.csdn.net/aa4790139/article/details/8106993如果你还没接触到过这个工具,那你今天运气非常好了...下载地址:http://www.codeandweb.com/texturepacker说明:这款软件需要购买的,能够发一百多块买到这么好的工具还是挺值得,可以工具的价钱,肯定他带给的的

2016-06-16 15:40:35 618

转载 常用纹理和纹理压缩格式

转载请注明出处: http://blog.csdn.net/ynnmnm/article/details/44983545 by 夜风简单纹理格式RGBA8888 每个像素4字节,RGBA通道各占用8位RGBA4444 每个像素2字节,RGBA通道各占用4位RGB888 每个像素3字节,RGB通道各占用8位,无透明通道RGB565 每个像素2字节,RGB通道各占

2016-06-15 20:42:47 767

原创 leetcode 287. Find the Duplicate Number

题目内容 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 numbe

2016-06-15 20:22:00 262

原创 leetcode 213. House Robber II

题目内容 Note: This is an extension of House Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This tim

2016-06-15 19:48:38 280

转载 各种移动GPU压缩纹理的使用方法

1. 移动GPU大全目前移动市场的GPU主要有四大厂商系列:1)Imagination Technologies的PowerVR SGX系列代表型号:PowerVR SGX 535、PowerVR SGX 540、PowerVR SGX 543MP、PowerVR SGX 554MP等代表作 :Apple iPhone全系、iPad全系,三星I9000、P3100等

2016-06-15 11:15:53 777

原创 关于OpenGL ES中的纹理压缩

基于OpenGL ES的压缩纹理有常见的如下几种实现: 1. ETC1(Ericcson texture compression) 2. PVRTC(PowerVR texture compression) 3. ATITC(ATI texture compression) 对于使用NVIDIA Tegra2芯片的手机如Motorola XOOM,ATRIX和DRIOID BIONIC则支持

2016-06-15 10:52:44 676

原创 leetcode 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 ho

2016-06-14 22:43:49 259

转载 【科普文】 深度学习:使用PowerVR实现计算机视觉

嵌入式视觉产品的市场需求量大,且呈不断发展壮大之势,其范围包括消费产品如手机、笔记本电脑、电视、可穿戴设备、汽车安全、安全与数据分析等。来自ABI、Gartner和TSR的最新数据表明,智能相机产品的总市场(TAM)量在2019年时将超过30亿台。计算机视觉的用户案例包括计算摄影、扩增实境、挥手感控及场景感知。当下,很多手机能通过人脸检测自动调整相机对焦和曝光,而像美图手机这样的产品还能实

2016-06-14 15:48:47 1731

原创 leetcode 345. Reverse Vowels of a String

题目内容 Write a function that takes a string as input and reverse only the vowels of a string.Example 1: Given s = “hello”, return “holle”.Example 2: Given s = “leetcode”, return “leotcede”. 题目分析 翻转字符

2016-06-04 17:17:38 267

原创 leetcode 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. You

2016-06-04 16:26:46 243

原创 leetcode 88. Merge Sorted Array

题目内容 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note: You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold addi

2016-06-04 15:43:48 247

原创 leetcode 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.题目分析 将两个排序好的链表,归并成一个新排序好的链表。 比较两个链表的最前端的值,然后比较加入新链表,

2016-06-03 22:17:13 253

原创 leetcode 342. Power of Four

题目内容 Given an integer (signed 32 bits), write a function to check whether it is a power of 4.Example: Given num = 16, return true. Given num = 5, return false.Follow up: Could you solve it without l

2016-06-03 20:56:08 292

原创 leetcode 326. Power of Three

题目内容 Given an integer, write a function to determine if it is a power of three. 题目分析 写一个函数判断这个数是不是3的冥。 找出3的最大冥的的值,直接取mod就可以了。也就是说,这个方法适合所有的质数,其他数不行。。。。public class Solution { public boolean

2016-06-02 19:53:18 215

原创 leetcode 231. Power of Two

题目内容 Given an integer, write a function to determine if it is a power of two. 题目分析 判断一个数是不是2的冥。 只要对该数减一,然后&操作就可以了。 例如 8=1000,8-1=0111,1000&0111=0;即可知道该数是不是2的冥了。public class Solution { public bo

2016-06-02 19:38:23 202

原创 leetcode 230. Kth Smallest Element in a BST

题目内容 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 the BST i

2016-06-02 11:31:57 203

原创 leetcode 96. Unique Binary Search Trees

题目内容 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.1 3 3 2 1\ /

2016-06-01 17:14:11 204

原创 leetcode 108. Convert Sorted Array to Binary Search Tree

题目内容 Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 题目分析 给定一个排好序的数组,然后将其转换成最平衡的二叉查找树。 根据二叉查找树的特点,左孩子都小于父节点,右孩子都大于父节点。所以,可以直接利用排序好的数组,取数组中间下标的值,不断作

2016-06-01 11:49:30 249

转载 如何解决哈希冲突

就不自己写了,直接贴下吧看了ConcurrentHashMap的实现, 使用的是拉链法.虽然我们不希望发生冲突,但实际上发生冲突的可能性仍是存在的。当关键字值域远大于哈希表的长度,而且事先并不知道关键字的具体取值时。冲突就难免会发 生。另外,当关键字的实际取值大于哈希表的长度时,而且表中已装满了记录,如果插入一个新记录,不仅发生冲突,而且还会发生溢出。因此,处理冲突和溢出是 哈希技术中的两个重要问题

2016-05-31 11:10:44 345

原创 leetcode 350. Intersection of Two Arrays II

题目内容 Given two arrays, write a function to compute their intersection.Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Note:Each element in the result should appear as many times a

2016-05-31 09:56:47 402

原创 二叉树的前序遍历,中序遍历,后序遍历代码

前序遍历/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */public class Solution

2016-05-30 23:26:42 776

原创 leetcode 145. Binary Tree Postorder Traversal

题目内容 Given a binary tree, return the postorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3},1 \ 2 / 3return [3,2,1].Note: Recursive solution is trivial,

2016-05-30 23:22:04 240

原创 leetcode 347. Top K Frequent Elements

题目内容 Given a non-empty array of integers, return the k most frequent elements.For example, Given [1,1,1,2,2,3] and k = 2, return [1,2].Note:You may assume k is always valid, 1 ≤ k ≤ number of unique

2016-05-27 11:44:05 418

原创 leetcode 349. Intersection of Two Arrays

题目内容 Given two arrays, write a function to compute their intersection.Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Note:Each element in the result must be unique.The result can b

2016-05-26 22:57:39 266

原创 leetcode 319. Bulb Switcher

题目内容 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 turnin

2016-05-25 17:50:05 291

原创 leetcode 94. Binary Tree Inorder Traversal

题目内容 Given a binary tree, return the inorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3},1 \ 2 / 3return [1,3,2].Note: Recursive solution is trivial, c

2016-05-24 17:18:35 269

原创 leetcode 260. Single Number III

题目内容 Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:Given nums

2016-05-24 16:23:38 215

原创 leetcode 144. Binary Tree Preorder Traversal

题目内容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 solution

2016-05-23 11:44:30 238

原创 java 容器总结

java提供了一套完整的容器类:List,Set,Queue,Map。 按照用途的不同将其划分为两个概念,Collection 和 MapCollection :一个独立元素的序列,这些元素服从一条或者多条规则。List 必须按照插入顺序保存元素;Set 不能有重复元素;Queue 按照排队规则来确定对象产生的顺序。map:一组成对的“键值对”对象,允许使用键来查找值。这种映射关系使得我们能够

2016-05-23 10:32:06 266

原创 leetcode 268. Missing Number

题目内容 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 should run

2016-05-19 16:01:27 207

空空如也

空空如也

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

TA关注的人

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