现在位置: 首页 > dentes发表的所有文章
2013年5月9日 47_手势识别 -------------------- 第一步:建立手势库 使用SDK自带例子GestureBuilder建立手势库(位置:android-sdk-windows\samples\android-8\GestureBuilder)。使用GestureBuilder之前,你需要恢复其到开发环境,然后进行编绎并部署到手机上。此时,就可以使用GestureBuilder建立手势库,生成的手势库文件在SCDard上,默认文件名称为:gestures 第二步:在应用中加载手势库文件,然后开发手势识别代码。 把手势库文件gestures文件拷贝到项目的res/raw目录下。然后在布局文件中添加用于手势绘制的View:  <an......
阅读全文
  • 05月
  • 12日
综合 ⁄ 共 2678字 评论关闭
转载自:一号门 annotation 方式写程序越来越称谓主流了,以前用hibernate 也用 xml 一大堆配置文件。spring beans 管理也是一大堆xml 配置文件,但现在的趋势是 annotation ,这种方式写程序更方便,很少配置文件,维护起来也比较方便。这几天重新看 spring 的文档,仔细看了下 annotation 方式下事务的管理方式. 1. 配置 <context:annotation-config/>: 告诉spring 去读 @Transactional 标注 2. <tx:annotation-driven/>:  自动包装代码,生产事务管理 3. 初始化 Datasource TransactionManager bean. 程序代码 ......
阅读全文
  • 03月
  • 23日
综合 ⁄ 共 1315字 评论关闭
总结的。 http://blog.csdn.net/dongpanshan/article/details/7942230 typedef struct { DWORD fsize; /* File size */ WORD fdate; /* Last modified date */ WORD ftime; /* Last modified time */ BYTE fattrib; /* Attribute */ TCHAR fname[13]; /* Short file name (8.3 format) */ #if _USE_LFN TCHAR* lfname; /* Pointer to the LFN buffer */ int lfsize; /* Size of the LFN buffer in unit of TCHAR */ #endif } FILINFO; fsize Indicates size of t......
阅读全文
一、构建文件输入流FileInputStream(file),并获取该文件输入流的编码 String encode = CharacterEnding.getFileEncode(new FileInputStream(file)); 具体的实现代码见上篇博客 二、根据文件输入流和该输入流的编码,构建输入流读取器 InputStreamReader in = new InputStreamReader(new FileInputStream(file), encode); InputStreamReader:字节流通向字符流的桥梁,它使用指定的字符集读取字节并将其解码为字符 三、根据输入流读取器构建带缓冲的读取器 BufferedReader buf = new BufferedReader(in); 四、循环按行读取解析文件......
阅读全文
  • 05月
  • 10日
综合 ⁄ 共 1040字 评论关闭
判断WIFI是否打开 public static boolean isWifiEnabled(Context context) { ConnectivityManager mgrConn = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); TelephonyManager mgrTel = (TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE); return ((mgrConn.getActiveNetworkInfo() != null && mgrConn .getActiveNetworkInfo().getState() == NetworkInfo.State.CONNECTED) || mgrTel .getNetworkType() == TelephonyManager.NETWORK_TYPE_UMTS); } 判断......
阅读全文
  • 05月
  • 08日
综合 ⁄ 共 3036字 评论关闭
http://blog.csdn.net/genios/article/details/7821133 上两周看了wwdc 2012 developer session 400 - 412的视频,下面总结一下xcode4.5的新特性。(部分参考onevcat的文章,在此感谢。) @synthesize by default(属性自动绑定)在xcode4.4以前,当我们想为类添加一个新的属性,一般都要对应写实例变量和相应的synthesis,但是在Xcode 4.4之后,synthesis现在会对应property自动生成。默认行为下,对于属性foo,当开发者没有写相应的synthesis的时候,编译器会自动在实现文件中为开发者补全synthesis,就好像你写了@synthesis ......
阅读全文
  • 04月
  • 29日
综合 ⁄ 共 564字 评论关闭
1.题目描述:点击打开链接· 2.解题思路:本题属于找规律题。通过多次尝试,可以发现,我们可以每次让所有大于n/2都减去n/2,这样得到的结果等价于序列1~n/2,令f(n)表示序列1~n的操作次数,那么f(n)=f(n/2)+1。边界是f(1)=1。 3.代码: #define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<algorithm> #include<string> #include<sstream> #include<set> #include<vector> #include<stack> #include<map> #include<queue> #include<deque> #include<c......
阅读全文
  • 04月
  • 21日
综合 ⁄ 共 5834字 评论关闭
http://blog.csdn.net/baimy1985/article/details/7853268   这篇是关于外拨电话的具体流程,也就是去电流程,虽然网上的资料很多(重复的也很多),但作为电话的主要操作之一,为了保证phone系列的完整性,还是要把它写一下的。开始看代码。 TwelveKeyDialer.java,既然要打电话,总要先输入号码才拨出,这个类就是拨号盘的界面,只是这个phone用到的类却是放在com.android.contacts包下,应该是出于代码结构的考虑吧。毕竟联系人、拨号盘、通话记录和收藏都是在一个Tab标签里的。这个界面没什么好说的,0-9数字键,P和W(也可......
阅读全文
  • 04月
  • 11日
综合 ⁄ 共 5232字 评论关闭
_________________________________________________________________________________________________________________________________ 批处理(dir/a/s/b) 例:某目录下有a、b、c、d、e、f、g、h、j的图片和一个文件夹JN,里边包含一张图片john.jpg 我们在该目录下的命令行中 输入:dir/b b:只显示当前目录下文件名及文件夹名 a-d:只是显示该目录下的文件名(没有了文件夹的名) 我们在该目录下的命令行中 输入:dir/a-d/b S:显示该目录下的文件名和文件夹名,及子目录下的文件名,并显示这些文件的绝对路径 我们在该目录......
阅读全文
  • 04月
  • 10日
综合 ⁄ 共 1726字 评论关闭
文章目录 intern   intern public String intern() Returns a canonical representation for the string object. A pool of strings, initially empty, is maintained privately by the class String. When the intern method is invoked, if the pool already contains a string equal to this String object as determined by the equals(Object) method, then the string from the pool is returned. Otherwise, this String object is added to the pool and a refe......
阅读全文
  • 01月
  • 31日
综合 ⁄ 共 2411字 评论关闭
<!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"/@宋体"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, ......
阅读全文
  • 01月
  • 29日
综合 ⁄ 共 2499字 评论关闭
这段时间需要将Lab转成rgb,在网上找了好久,找到了好几个算法,结果一试,都不能如愿。 下面介绍一个 转化成中间量的方式来做: 一共4个方法:lab->xyz     xyz->lab    rgb->xyz     xyz->rgb 代码如下: import java.lang.Math; 。。。。 public static double[] Lab2XYZ(double[] Lab) {double[] XYZ = new double[3];double L, a, b;double fx, fy, fz;double Xn, Yn, Zn;Xn = 95.04;Yn = 100;Zn = 108.89; L = Lab[0];a = Lab[1];b = Lab[2]; fy = (L + 16) / 116;fx = a / 500 + fy;fz = fy - b / 200; if (fx......
阅读全文