现在位置: 首页 > forearm发表的所有文章
  • 05月
  • 30日
综合 ⁄ 共 328字 评论关闭
const char *ch1="open" ; const char *ch2="open" ; if(ch1==ch2) { AfxMesageBox("2字符串一样"); } 这样,你会发现,2个字符串永远不一样。。char不能直接比较。 他们比较有2种方法。 强制转换成CString const char *ch1="open" ; const char *ch2="open" ; if((CString)ch1==(CString)ch2) { AfxMesageBox("2字符串一样"); } 或者 const char *ch1="open" ; const char *ch2="open" ; int i = strcmp(ch1,ch2);  if(0==i) { AfxMesageBox("2字符串一样"); }
阅读全文
  • 12月
  • 13日
综合 ⁄ 共 1701字 评论关闭
转自:http://hi.baidu.com/zhaoshengjin/blog/item/f1df6618cb1debbe4bedbc5d.html 问题描述:给定一个十进制正整数N,写下从1开始,到N的所有整数,然后数一下其中出现的所有"1"的个数。例如: N = 2,写下1,2。这样只出现了1个"1"。 N = 12,写下1,2,……,12,这样有5个"1"。 写一个函数f(N),返回1到N之间出现的"1"的个数,比如f(12) = 5。     假设N = abcde,这里a,b,c,d,e分别是十进制数N的各个数位上的数字。如果要计算百位上出现1 的次数,将受3方面因素影响:百位上的数字,百位以下(低位)的数字,百位(更高位)以......
阅读全文
  • 05月
  • 25日
综合 ⁄ 共 194字 评论关闭
文章目录 印象笔记 Doit.im Mou Dash SimPholders OmniGraffle 开帖推荐一下mac下的工具类app 印象笔记 首推印象笔记,笔记类软件,主体功能是记录笔记,如果你想,可以用来做todo list, 甚至gtd, 或者知识收集归纳 Doit.im 当然了,gtd 还是用gtd专业软件的好, Mou 写文档就是这货了,谁用谁知道 Dash 看文档的 SimPholders ios 快速定位模拟器路径 OmniGraffle 可以说是领域类最好用的画图app(ps是别的领域的画图app)
阅读全文
  • 05月
  • 20日
综合 ⁄ 共 655字 评论关闭
1:切面(Aspect)     一个关注点的模块化,这一关注点的实现可能横切多个对象,而这个模块化过程,由Inteceptor来实现,数据库的事务管理就是一个典型的切面    2:通知(Advice)     在特定的连接点,AOP框架执行的动作,各种通知类型包括:Before通知,After通知,Around通知和Throw通知等 3:切入点(Pointcut)       指定一个通知将被引发的一系列连接点的集合。AOP框架必须允许开发者指定切入点,例如,使用正则表达式来指定触发通知的集合特征 4:连接点(Joinpoint)      程序执行过程中明确的点,如方法的调用或特定的异常......
阅读全文
  • 05月
  • 19日
综合 ⁄ 共 3203字 评论关闭
  最近在项目开发过程中,遇到date类型的数据,不知道该使用那个date,所以上网查了一下,一下是我总结的,只供参考: java.util.Date 就是在除了SQL语句的情况下面使用 java.sql.Date 是针对SQL语句使用的,它只包含日期而没有时间部分 它都有getTime方法返回毫秒数,自然就可以直接构建 java.util.Date d = new java.util.Date(sqlDate.getTime()); ... -------------------------------------------------------------------------------- java.util.Date 是 java.sql.Date 的父类(注意拼写) 前者是常用的表示时间的类,我......
阅读全文
  • 04月
  • 21日
综合 ⁄ 共 508字 评论关闭
TO and Fro 一个简单的字符串题目。将字符串存入二维数组 然后、一列一列的输出 代码略挫 #include <cstdio> #include <cstring> #include <iostream> using namespace std; char s[200][200],str[220]; int main(){ int n; while(~scanf("%d",&n),n){ scanf("%s",str); memset(s,'0',sizeof(s)); int cnt = 0,l = strlen(str); int x = 0; while(cnt < l){ if(x % 2 == 0){ for(int i = 0;i < n;i++){ ......
阅读全文
  • 04月
  • 03日
综合 ⁄ 共 3007字 评论关闭
hdu 5025 Saving Tang Monk 状态压缩的BFS,一般适用于每种状态能在有限空间内表示的情况 #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <queue> using namespace std; const int MAXN = 101; int n, m; bool vis[MAXN][MAXN][10][35]; int snake[10][2], csnk; char da[MAXN][MAXN]; int Kong[2], Tang[2], dir[4][2] = {0,1, 0,-1, -1,0, 1,0}; struct _node { int x, y, nk, snk, cost; _node (){} _node (int ix, int iy, int ink, i......
阅读全文
  • 04月
  • 02日
综合 ⁄ 共 2390字 评论关闭
From: http://blog.sina.com.cn/s/blog_4b5039210100gmsb.html      用python操作修改windows注册表,显然要比用C或者C++简单。     主要参考资料:官方文档:http://docs.python.org/library/_winreg.html 通过python操作注册表主要有两种方式,一种是通过python的内置模块 _winreg,另一种方式就是Win32 Extension For Python的win32api模块。这里主要简单看看用内置模块 _winreg如何操作注册表。   1.读取 读取用的方法是OpenKey方法:打开特定的key _winreg.OpenKey(key,sub_key,res=0,sam=KEY_READ) 例子:此例子是显示了本......
阅读全文
  • 12月
  • 22日
综合 ⁄ 共 395字 评论关闭
文章目录 2  size_type是一个无符号数 C++&C编程相关小细节 这里主要汇聚我自己在编程中遇到的一些小细节,容易导致bug的地方。 1  两个数字交换 a ^= b; b ^= a; a ^= b; 有些人会这样用,感觉有高达上,不用另外的空间就交换数字。 问题来了:当两个数指向同一个地址的时候,也就是对同一个数异或3次,异或一次就会就会变成0,更何况3次。所以下次要加上判断条件。 if (a == b) return; a ^= b; b ^= a; a ^= a; 2  size_ty......
阅读全文
We recently put an update out for one of our apps and many users told us that they could no longer run the app because it crashed on startup. We have been able to recreate the crash by building and running the previous release build onto a device and then building and running the new build overtop of it on the same device, but the stack trace for this crash is very strange: Thread 0 Crashed : 0   libSystem . B . dylib             0x000791d0 __kill + 8 1 ......
阅读全文
  • 10月
  • 29日
综合 ⁄ 共 6595字 评论关闭
通过前面的讲述,相信你已经对Volley的原理有了一定了解。本章将举一些我们能在应用中直接用到的例子,第一个例子是 NetworkImageView类,其实NetworkImageView顾名思义就是将异步的操作封装在了控件本身,这种设计可以充分保留控件的移植性和维护性。NetworkImageView通过调用setImageUrl来指定具体的url: public void setImageUrl(String url, ImageLoader imageLoader) { mUrl = url; mImageLoader = imageLoader; // The URL has potentially changed. See if we need to load it. loadImageIfN......
阅读全文
  • 10月
  • 21日
综合 ⁄ 共 1338字 评论关闭
MathJax是什么? MathJax是一个JavaScript,用于在博客或其他html页面上渲染Latex、MathML的工具,由服务器端提供,可以在网页上显示公式。 1,安装MathJax,需要在本地安装MathJax的Javascript,以及wordpress里面的MathJax插件 MathJax-LaTeX This plugin enables MathJax (http://www.mathjax.org) functionality for WordPress. Version 1.0 is compatible with MathJax 1.1 and the CDN. Download Version 1.0 Unzip the downloaded .zip archive to the /wp-content/plugins/ directory Download the MathJax Javascript ......
阅读全文