cocos2d-x学习笔记

摘要: cocos2d-x是一个很好的跨平台游戏引擎,更多介绍可查看中文官网,里面有很多教程,但是排版的不是很好,不方便查看全部,写了个脚本抓了一下,生成简单的网页,全局查看比较方便,代码如下# -*- coding: utf-8 -*-import urllib2firsturl="http://cn.c... 阅读全文
posted @ 2014-07-31 14:55 邪灵天使 阅读(132) 评论(0) 推荐(0) 编辑

安卓误删系统桌面解决方案

摘要: 本人手机是联想的,自带乐桌面,其实乐桌面还不错,但是好奇卸载后会是什么?系统自带桌面?于是用root 工具卸载掉了乐桌面,结果导致桌面整个是黑的,完全找不到应用,才知道桌面也是个应用程序,不是系统程序。界面一片黑,什么都没有,没办法只能安装个桌面应用程序。解决方法:可以在电脑上下个桌面的apk,然后用91呀360呀百度呀什么的手机管理工具装上就行了,也可用adb 装上。我是用adb shell进入手机shell界面然后启动 乐商店的activity下载的桌面应用就可以了,命令如下。am start -n com.lenovo.leos.appstore/.Main 阅读全文
posted @ 2014-04-01 17:34 邪灵天使 阅读(297) 评论(0) 推荐(0) 编辑

Ubuntu 常用工具

摘要: 由于工作关系,开始慢慢接触linux了,把常用命令写博客上随时查看,随时添加。把终端加到右键菜单:sudo apt-get install nautilus-open-terminal安装flash插件sudo cp libflashplayer.so /usr/lib/mozilla/plugin... 阅读全文
posted @ 2014-02-22 12:32 邪灵天使 阅读(163) 评论(0) 推荐(0) 编辑

Unique Binary Search Trees

摘要: class Solution {public: int numTrees(int n) { // IMPORTANT: Please reset any member data you declared, as // the same Solution instance will be reused for each test case. vector num; num.push_back(1); num.push_back(1); int temp = 1; for(int i = 2;i... 阅读全文
posted @ 2013-11-11 17:55 邪灵天使 阅读(131) 评论(0) 推荐(0) 编辑

Reorder List 微软笔试题

摘要: Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given{1,2,3,4}, reorder it to{1,4,2,3}现在在Leetcode上也有了,这题的做法有很多,我是用的是一个舍友给我提供的一种方法,先把后面部分反转在重新插入即可。/** * Definition for singly-linked list. * s 阅读全文
posted @ 2013-11-05 18:04 邪灵天使 阅读(150) 评论(0) 推荐(0) 编辑

有理数求n*n矩阵自乘

摘要: 先写了一个有理数的类,功能不全只有用到的乘法和加法。并且没有考虑分母为0的恶意输入。#include using namespace std;#include class rational{ private : int son; int mom; public : friend const rational operator+(const rational& r1,const rational& r2) { if(r1.son==0) ... 阅读全文
posted @ 2013-10-05 20:18 邪灵天使 阅读(237) 评论(0) 推荐(0) 编辑

Longest Substring Without Repeating Characters

摘要: class Solution {public: int lengthOfLongestSubstring(string s) { // Start typing your C/C++ solution below // DO NOT write int main() function if(s=="") return 0; map key; for(char i = 'a';iresult) { result = temp; ... 阅读全文
posted @ 2013-09-24 20:43 邪灵天使 阅读(99) 评论(0) 推荐(0) 编辑

Path Sum

摘要: /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Solution {public:bool flag;public: bool hasPathSum(TreeNode *root, int sum) { // Start typing your C/C++ ... 阅读全文
posted @ 2013-09-23 00:55 邪灵天使 阅读(161) 评论(0) 推荐(1) 编辑

Binary Tree Level Order Traversal II

摘要: /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Solution {public: vector > levelOrderBottom(TreeNode *root) { // Start typing your C/C++ solution below ... 阅读全文
posted @ 2013-09-23 00:30 邪灵天使 阅读(124) 评论(0) 推荐(1) 编辑

Jump Game

摘要: 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.Determine if you are able to reach the last index.For example:A =[2,3,1,1,4], returntrue.A =[3,2,1,0,4], returnfalse.先想 阅读全文
posted @ 2013-09-22 14:10 邪灵天使 阅读(169) 评论(1) 推荐(0) 编辑