现在位置: 首页 > bouchon发表的所有文章
  • 07月
  • 16日
综合 ⁄ 共 1709字 评论关闭
转自:http://www.cnblogs.com/ghj1976/archive/2011/05/06/2038516.html Runnable 并不一定是新开一个线程,比如下面的调用方法就是运行在UI主线程中的: Handler mHandler=new Handler(); mHandler.post(new Runnable(){ @Override public void run() { // TODO Auto-generated method stub } }); 官方对这个方法的解释如下,注意其中的:“The runnable will be run on the user interface thread. ” boolean android.view.View .post(Runnable action) Causes the Runnable to be added to the message queue. The ......
阅读全文
  • 02月
  • 16日
综合 ⁄ 共 194字 评论关闭
之前用Android自带的VideoView播放在线视频一直没问题的,今天突然碰到无法播放。 MediaPalyer返回的错误代码是-1004,API文档上写的是:Bitstream is not conforming to the related coding standard or file spec. 最后查明是因为我用了Mac下的Charles,然后没有开代理服务导致的。。。 进入系统关闭代理即可。。。。
阅读全文
  • 01月
  • 14日
综合 ⁄ 共 1931字 评论关闭
whosyourdaddy  题目:http://acm.hdu.edu.cn/showproblem.php?pid=3498 题意:英雄可以放一个技能,使得一个点和与其相邻的点受到伤害,问最少攻击几个点能够让所有的点都受到至少一次伤害。 题解:建模套DLX模板。 代码: #include<cstdio> #include<cstring> #include<climits> #define N 60 #define M 3600 using namespace std; struct { int col,row; } node[M]; int l[M],r[M],d[M],u[M],h[M],res[N],cntcol[N]; int dcnt=-1,minn; int n,m; bool visit[N],mark[N][N]; int H() { int count=0; ......
阅读全文
  • 12月
  • 25日
综合 ⁄ 共 271字 评论关闭
文档: public View inflate (int resource, ViewGroup root) .... returns The root View of the inflated hierarchy. If root was supplied, this is the root View; otherwise it is the root of the inflated XML file. 如果提供root(不传null)时,返回值其实就是这个root,这个方法就是把xml解析成view之后挂载这个root下。 如果传null(不提供root),返回值也是View,它就是xml布局里面的根节点
阅读全文
  • 12月
  • 15日
综合 ⁄ 共 10742字 评论关闭
一、避免在循环条件中使用复杂表达式 在不做编译优化的情况下,在循环中,循环条件会被反复计算,如果不使用复杂表达式,而使循环条件值不变的话,程序将会运行的更快。 例子: import java.util.vector; class cel {     void method (vector vector) {         for (int i = 0; i < vector.size (); i++)  // violation             ; // ...     } } 更正: class cel_fixed {     void method (vector vector) {         int size = vector.size ()         for (int i = 0; i < size; i++)             ; // .........
阅读全文
  • 12月
  • 11日
综合 ⁄ 共 671字 评论关闭
开始写写博客,做做笔记,学习学习。 //符串A和B,输出A和B中的最大公共子串。 //比如A="aocdfe" B="pmcdfa" 则输出"cdf" #include <stdio.h> #include <stdlib.h> #include <string.h> char * comstr(char shortstr[], char longstr[]) { int i, j; char * com = new char[255]; if(strstr(longstr, shortstr) != NULL) return shortstr; for(i = strlen(shortstr)-1; i > 0; i--) { for(j = 0; j <= strlen(shortstr) - i; j++) { memcpy(com, &shortstr[j], i); com......
阅读全文
  • 12月
  • 11日
综合 ⁄ 共 1963字 评论关闭
fullQuralyEditer.aspx 页面 1261行开始 覆盖 case "date":                             if (((Session["TYPE"].ToString() == "16" && no == "9") || ((Session["TYPE"].ToString() == "17" || Session["TYPE"].ToString() == "12") && no == "11") || (((Session["TYPE"].ToString() == "13" || Session["TYPE"].ToString() == "14" || Session["TYPE"].ToString() == "15") && no == "12")) || (Session["TYPE"].ToString() == "11" && no == "20") || (Session["TYPE"].ToString() == "10" ......
阅读全文
文章目录        1. 天空盒的几何体表示        2. 天空盒纹理图        3. 天空纹理映射        4. 程序实现         (注:【D3D11游戏编程】学习笔记系列由CSDN作者BonChoix所写,转载请注明出处:http://blog.csdn.net/BonChoix,谢谢~)          这一节讨论有关纹理映射的进阶内容:Cube Mapping。        1. 简介        单从名字上,就大概可以看出点端倪了,翻译成中文为立方体映射,因此肯定跟立方体有关系。确实,Cube Mapping就是使用六张正方形的图片来进行纹......
阅读全文
  • 03月
  • 08日
综合 ⁄ 共 3382字 评论关闭
首先,了解什么是模糊,可以看一下这篇,图像模糊--快速均值滤波http://blog.csdn.net/zhonghuan1992/article/details/41131183 看完上面的那篇blog,应该就知道什么是模糊了,那么什么是高斯滤波,或者说是高斯模糊呢? 简单地替换一下就好了,均值滤波,就是取平均值,那么高斯滤波,取得是什么? 高斯滤波,会比均值滤波复杂一点,它不是简单地平均而已,而是加权平均,加权平均的意思,可以看下嘛。 注意,上面的图显示的是一个5*5的区域,不过,里面的数值,不再是图像的像素点了,而是这个区域的每一个点得权重,权重是......
阅读全文
  • 03月
  • 26日
综合 ⁄ 共 727字 评论关闭
功能:将两个表中的 相同的字段拼接到一起 测试: create external table IF NOT EXISTS temp_uniontest_ta ( a1 string, a2 string ) partitioned by (dt string) row format delimited fields terminated by '\t' stored as textfile; ALTER TABLE temp_uniontest_ta ADD IF NOT EXISTS PARTITION (dt = '2014-10-13') location '/temp/unionTest/ta/'; a1 a2 2014-10-13 b1 b2 2014-10-13 c1 c2 2014-10-13 create external table IF NOT EXISTS temp_uniontest_tb ( a1 string, a2 string ) partitioned by (dt string) row ......
阅读全文
  • 12月
  • 06日
综合 ⁄ 共 834字 评论关闭
A hard puzzle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 29415    Accepted Submission(s): 10581 Problem Description lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.everybody objects to this BT problem,so lcy makes the problem easier than begin. this puzzle describes that: gave a and b,how to know the a^b's the last digit number.But everybody is too lazy to slove this problem,so......
阅读全文
  • 10月
  • 12日
综合 ⁄ 共 2073字 评论关闭
        原本打算直接用CocosIDE的,毕竟是官方出品,而且支持Android远程调试,windows下的调试也很方便,调试的信息也很全,智能提示也不错。好了,一切看上去很完美,但是它有一个致命缺陷,就是继承了eclipse一贯的特性--“卡”。基于java写的eclipse我一直使不惯,一方面是快捷键跟vs迥异,而我又懒得去配置(如果他能像IntelliJ IDEA一样,可以方便的删除重复快捷键,我还有兴致去配置一下,但是重复的快捷键没有任何提示,只是在使用的过程中会有各种问题),另一方面就是内存占用高,卡成翔了。经常打两个字母IDE就卡一两秒......
阅读全文