自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 关于C++内存生长

今天看到网上帖子说计算机中内存的生长的方式是从高地址到低地址的,很久以前就了解过这个知识点,但还是不禁写了个代码试了一下。这一试发现了更多问题。测试代码如下:​​​include #include struct TestType{    int _a;     int _b; };int main(){    int a =

2015-08-22 21:06:55 523

原创 探秘TCP数据包中的PSH标志

今天在用wireshark分析TCP数据包的时候,发现一个特别的标志,PSH,和ACK一块使用的,不太了解,所以查了一下,发现大部分的解释都是不外乎表示这个包是带数据的,发送端告诉接收端,这个数据包以及以前接收到的数据包需要交给应用层立即进行处理。但是是什么样一种契机促使发送端添加了PSH标志呢?添加这个标志时发送端是怎样一种心情呢?(^_^) 查了一些材料,最终在《TCP/IP详解卷1:协议》这

2015-07-15 16:12:09 52115 1

原创 Cocos2dx中RotateTo对旋转方向的处理

今天在写个demo的时候意外发现了一个跟rotate相关的有趣的事情。 如果我们想要将一个物体旋转朝向另外一个物体的时候,一般都会采用如下的方法: // 通过tan值求arctan来得到旋转角度 auto diff = objRotateToward->getPosition() - objRotated->getPosition(); float angleRadians

2015-07-12 13:19:34 7516

原创 LeetCode 208 Implement Trie (Prefix Tree)

Implement a trie with insert, search, and startsWith methods.Note: You may assume that all inputs are consist of lowercase letters a-z.这个题比较简单,就是实现一个单词树,单词树的相关资料可以参考:http://www.cppblog.com/yuyang7/arc

2015-07-09 16:39:05 371

原创 LeetCode 208 Implement Trie (Prefix Tree)

Implement a trie with insert, search, and startsWith methods.Note: You may assume that all inputs are consist of lowercase letters a-z.这个题比较简单,就是实现一个单词树,单词树的相关资料可以参考:http://www.cppblog.com/yuyang7/arc

2015-07-09 16:36:53 329

原创 LeetCode 207 Course Schedule

There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair:

2015-07-09 11:54:18 348

原创 Leetcode 204 Count Primes

Description:Count the number of prime numbers less than a non-negative number, n.求小于n的素数的数量。 最传统的做法就是做一个判定函数,从2开始到n判断,看有多少素数。判定素数的方法就是从2到根号n,看看是不是可以被n整除。但是看了提示后,发现还有别的便捷的方法来解,就是原始的Sieve of Eratosthene

2015-06-06 20:06:06 388

原创 Leetcode 201 Bitwise AND of Numbers Range

Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive.For example, given the range [5, 7], you should return 4.

2015-05-25 15:58:31 469

原创 C++模板类中的静态成员

今天看书看到关于C++中Template类的相关内容,涉及到静态成员。我们知道,模板类在使用的时候会根据指定的类型进行特化,这个过程发生在编译期。(需要注意的是模板类的静态成员在模板没有特化的时候是无法使用的。)但是模板类中的静态成员又是怎样的呢,是所有特化持有一份成员还是每一个特化均持有一份成员呢,经过测试,是后者,即每个特化类型均持有一个相应的静态成员。

2015-05-06 20:11:39 740

转载 欢迎使用CSDN-markdown编辑器

欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl

2015-05-06 16:52:34 312

转载 mac下gdb签名认证

转自:http://www.cnblogs.com/yishuiliunian/archive/2013/01/13/2858836.htmlIf you try to use your freshly built gdb, you will get an error message such as: Starting program: /x/y/foo

2015-03-13 14:54:23 413

原创 mac os下编译gcc4.9.2

最近在看C++原理相关的书,xcode所带的gcc的版本是4.2的,还是挺想在mac下使用高版本的gcc进行编译代码的,可以使用很多新特性,所以萌生了编译安装gcc的念头,网上找了一些材料,找到一篇英文的文章,参考着编译安装的,但是还是遇到了问题,英文原文链接:https://solarianprogrammer.com/2013/06/11/compiling-gcc-mac-os-x/

2015-03-13 00:46:01 1282

原创 Google 10月份在线笔试ProblemD(个人代码,未必最优,请不吝赐教)

ProblemTetris is a famous video game that almost everyone has played it. In this problem, you need to simulate a simplified version of it.In our version, the game is played in a W by H field wit

2014-10-25 15:10:15 748

原创 Google 10月份在线笔试ProblemC(个人代码,未必最优,请不吝赐教)

ProblemAlice is a smart student who is very good at math. She is attending a math class. In this class, the teacher is teaching the students how to use a calculator. The teacher will tell an integ

2014-10-25 14:57:40 572

原创 Google 10月份在线笔试ProblemB(个人代码,未必最优,请不吝赐教)

ProblemTom is taking metros in the city to go from station to station.The metro system in the city works like this:There are N metro lines in the city: line 1, line 2, ..., line N.For each

2014-10-25 14:47:25 523

原创 Google 10月份在线笔试ProblemA(个人代码,未必最优,请不吝赐教)

ProblemMinesweeper is a computer game that became popular in the 1980s, and is still included in some versions of the Microsoft Windows operating system. This problem has a similar idea, but it do

2014-10-25 14:30:20 501

原创 cocos2dx3.0中显示中文

今天写个test的lizi

2014-05-19 16:59:18 1412

原创 cocos2dx 3.0 找不到资源导致黑屏(用cocos new 创建的default工程一定要记得修改工作目录的配置)

昨天在调新工程的时候发现个问题,程序无法找到Resource目录下的资源,ranh

2014-05-12 23:55:04 2161

原创 git学习

最近在动手做一下小项目,所以看了一下有哪些免费的代码托管平台可以用,顺便k

2014-05-08 15:00:10 457

原创 初学cocos2dx-3.0之安装篇问题(linux)

linux下的安装问题主要有两个,一个是权限问题,一个就是

2014-04-29 19:57:51 1553

空空如也

空空如也

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

TA关注的人

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