02 2012 档案
摘要:出处:http://blog.csdn.net/maojudong/article/details/7261986版本:Windows XP3JDK1.6Eclipse 3.7.1 (需要C++插件CDT)ADT 16.0.1NDK7(或是NDKR7B)cocos2d-1.0.1-x-0.11.0.zip(目前最新版)注意:本教程没有用到minigw +msys,也没有用到cygwin ,如果用到的是NDK R6B 或是以前的版本,则需要安装cygwin(或是minigw + msys)前提条件:假设已经成功安装了JDK + Eclipse + CDT + ADT下面讲解如何在Eclipse中
阅读全文
摘要:既然24点的算法写出来了,那就顺便做一个android的小游戏吧。界面比较简单,也没用复杂的控件。比http://blog.csdn.net/problc/article/details/7225512的Android版 hanoi 汉诺塔 源码简单。有用点的知识点1.动态图片设置int resID = getResources().getIdentifier("p" + data[i], "drawable","com.z");cards[i].setImageResource(resID);2.输入法控制getWindow().s
阅读全文
摘要:增加了部分去重复的功能,以及后缀转中缀显示。#include <iostream>
#include <stack>
#include <algorithm>
#include <string>
#include <cmath>
#include <time.h>
using namespace std; struct TOperData
{ int operType; double data;
}; //检查计算的参数是否合法,也可以用于过滤一些重复的表达式
bool checkjisuan(double a, doub
阅读全文
摘要:前面既然确定了后缀表达式的序列。那就可以开始遍历了。#include <iostream>
#include <stack>
#include <algorithm>
#include <string>
#include <cmath>
#include <time.h>
using namespace std; struct TOperData
{ int operType; double data;
}; //检查计算的参数是否合法,也可以用于过滤一些重复的表达式
bool checkjisuan(double a,
阅读全文
摘要:无意间看见这个24点的网站http://www.24theory.com/solutions/allsolutions/,于是想起来把程序写写。考虑到中缀表达式有括号的麻烦,所以打算用后缀表达式处理。24点用后缀表达式的话,一共4个数字,3个运算符。假设数字用1表示,运算符用2表示。那么可能的计算方式就是类似11112221112221。。。但是这样随便列举出来的不一定是合法的后缀表达式。所以第一步,找出合法的包含4个数值,3个运算符的后缀表达式。bool check(int data[])
{ int len = 7; stack<int> suffix; for ...
阅读全文
摘要:先存着,有空把24点算法实现一下。 Solvables Solution 1 Solution 2 Solution 3 Solution 4 Solution 5 Solution 6 Solution 7 Solution 8 Solution 9 Solution 10 Solution 11 1 1 1 1 8 (1+1+1)×82 1 1 1 11 (11+1)×(1+1)3 1 1 1 12 (1+1)×12×14 1 1 1 13 (1...
阅读全文
摘要:看了几本android的书,印象不深,还是要做个小东西理解一下。于是想到了这个经典的递归。里面用到了一些基本的东西。隐藏titlerequestWindowFeature(Window.FEATURE_NO_TITLE);全屏getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);配置保存SharedPreferences界面切换Intent intent = new Intent();intent.setClass(HanoiSett
阅读全文
摘要:想用nodejs写个微博客户端发微博,无奈新浪微博的nodejs sdk是OAuth1.0的。只能自己根据OAuth1.0 改了改。只写了statuses/update 和 statuses/upload,其他的实现基本都类似了。update是简单参数的post,upload是multipart 包含二进制图片的post。改改帐号参数和发送的图片路径,node weibotest.js就能成功发送了。如果中文出现乱码,请把这两个js文件保存成utf-8编码。weibo.jsvar querystring = require('querystring'),
crypto = re
阅读全文