现在位置: 首页 > speculate发表的所有文章
  • 10月
  • 09日
综合 ⁄ 共 1616字 评论关闭
/** * Write a compressed version of the bitmap to the specified outputstream. * If this returns true, the bitmap can be reconstructed by passing a * corresponding inputstream to BitmapFactory.decodeStream(). Note: not * all Formats support all bitmap configs directly, so it is possible that * the returned bitmap from BitmapFactory could be in a different bitdepth, * and/or may have lost per-pixel alpha (e.g. JPEG only supports opaque * pixels). * ......
阅读全文
  • 09月
  • 24日
综合 ⁄ 共 12904字 评论关闭
Ajax虽是“旧酒装新瓶”,但其威力着实不小。近两年来可谓红透半边天,它之所以能为大众接受,其中一个很大的原因就是提高了用户浏览体验,能更逼真的模拟出GUI界面。好了,Ajax的益处就说到这里,下面让我们看下Grails是如何帮助我们方便地应用Ajax的: 如果您对下面说设计的内容有点不解,那么您可以先看一下 Groovy轻松入门——Grails实战基础篇,然后开始我们的Ajax之旅。 1, 在命令行中输入:“grails create-app AjaxDemo”(注意:不带引号“”)创建一个Grails project,我将它命名为AjaxDemo: D:/Temp/grails_apps>grails cre......
阅读全文
  • 03月
  • 15日
综合 ⁄ 共 819字 评论关闭
BeanCreationException: No unique bean of type 我定义了一个基类接口BaseDao,下面有些update\save的方法;  然后我用一个BaseDaoImpl去实现这个接口;好啦,然后我现在有两个Dao接口,一个ADao extends BaseDao,一个BDao extends BaseDao; 然后再有这两个Dao的实现: ADaoImpl extends  BaseDaoImpl implements ADao; BDaoImpl extends BaseDaoImpl  implements BDao;  这两个实现都加了@repository。结果就是启动错:  No unique bean of type [com.a.b.BaseDao] is defined: expected single matching bean but found 2: [a......
阅读全文
  • 01月
  • 02日
综合 ⁄ 共 5297字 评论关闭
from:http://www.cnblogs.com/zhyg6516/archive/2011/03/07/1971898.html 问题: Static_cast 与 Dynamic_cast的区别 来自书本上的解释:   用 static_cast<type-id > ( expression )   1. static_cast(expression) The static_cast<>() is used to cast between the integer types. 'e.g.' char->long, int->short etc.    用来数值之间的转化。 2.  可以在相关指针之间转换,指针在void * 之间转换,还可以在基类和派生类之间转换。 这些转换是在编译的时候就确定下来转换(无非就是根据继承关系,......
阅读全文
  • 07月
  • 05日
综合 ⁄ 共 1834字 评论关闭
#include <iostream> using namespace std; void f1(int a,int b) { } int main() {     f1(3,4);     system("pause"); } 将上述代码反汇编如下(vs05debug):   int main() { 004113D0  push        ebp  ;/保存栈基址 004113D1  mov         ebp,esp ;将栈顶指针赋给ebp,重新构造了一个函数栈帧,此函数栈帧属于main函数的。 004113D3  sub         esp,0C0h ;栈顶指针下移0xc0h,为main函数内局部变量分配空间 004113D9  push        ebx     ;在栈中保存ebx 004113DA  push        esi   004113DB  push ......
阅读全文
  • 05月
  • 25日
综合 ⁄ 共 575字 评论关闭
在编译配置里添加一个x64的就可以了。  从菜单【编译(Build)】->【配置管理(Configuration Manager)】  在弹出的窗口里的右上角有个【可用工程平台(Active solution platform)】下拉框,打开可以看到有个【新建】菜单,点击打开【新建工程平台】的对话框,选择平台为x64。   //////////////////////////////////////////// 用VC判断系统CPU是否为64位    SYSTEM_INFO si;     GetNativeSystemInfo(&si);     if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 ||            si.wProcessorArchitecture !......
阅读全文
  • 04月
  • 26日
综合 ⁄ 共 7891字 评论关闭
2006 年底,Sun 公司发布了 Java Standard Edition 6(Java SE 6)的最终正式版,代号 Mustang(野马)。跟 Tiger(Java SE 5)相比,Mustang 在性能方面有了不错的提升。与 Tiger 在 API 库方面的大幅度加强相比,虽然 Mustang 在 API 库方面的新特性显得不太多,但是也提供了许多实用和方便的功能:在脚本,WebService,XML,编译器 API,数据库,JMX,网络和 Instrumentation 方面都有不错的新特性和功能加强。 本系列 文章主要介绍 Java SE 6 在 API 库方面的部分新特性,通过一些例子......
阅读全文
  • 04月
  • 25日
综合 ⁄ 共 1895字 评论关闭
Corn Fields http://poj.org/problem?id=3254 Description Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettably, some of the squares are infertile and can't be planted. Canny FJ knows that the cows dislike eating close to each other, so when choosing which squares to plant, he avoids choosing squares that are adjacent; no two chosen squares sh......
阅读全文
  • 04月
  • 08日
综合 ⁄ 共 1934字 评论关闭
译者:zhanhailiang 日期:2015-01-17 原文链接:25 Tips for Intermediate Git Users 基本技巧 1. 安装git后,需要配置用户名和邮箱: $ git config --global user.name "Some One" $ git config --global user.email "someone@gmail.com" 2. git是基于指针的 git中的一切都以文件形式存储,举例: 每创建一次提交动作,git其实将创建一个文件(.git/refs),其中包含提交注释和相关信息(用户名,邮箱,时间,之前的提交等),并将其与一个树结构文件(.git/objects)关联。这个树结构文件包含对象列表。这些对象或块就......
阅读全文
  • 04月
  • 04日
综合 ⁄ 共 1103字 评论关闭
View container1 = this.findViewById(R.id.fl_container1 ); View container2 = this.findViewById(R.id.fl_container2 ); Fragment f1 = new Fragment1(); Fragment f2 = new Fragment2(); FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.replace(R.id.fl_container1,f1); transaction.replace(R.id.fl_container2,f2); transaction.commit(); <FrameLayout android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1" > ......
阅读全文
  • 02月
  • 18日
综合 ⁄ 共 830字 评论关闭
1、更多内容请参考:http://blog.csdn.net/freshlover/article/details/11616563 http://blog.csdn.net/barebear/article/details/5100260 2、当使用jsp+tomcat+mysql开发时,将tomcat上传到服务器后,使用360浏览器通过ip访问网站时,本来很好的网站样式会变得混乱,导航栏,图片,特别是盒模型会有很大的变化。使用360的工具-》开发人员工具。查看网页文档模式时,发现使用的是Qiurks模式,改变模式为7、8时网页有一些变化,但是不能变化到想要的模式。使用标准和ie9时,可以出现正常的效果。但是不能每次都默认已怪异模式(qiu......
阅读全文
  • 12月
  • 14日
综合 ⁄ 共 5103字 评论关闭
linux的poll机制 转载:http://blog.csdn.net/yangsong512/article/details/12402345 Poll就是监控文件是否可读的一种机制,作用与select一样。 应用程序的调用函数如下: int poll(struct pollfd *fds,nfds_t nfds, int timeout); Poll机制会判断fds中的文件是否可读,如果可读则会立即返回,返回的值就是可读fd的数量,如果不可读,那么就进程就会休眠timeout这么长的时间,然后再来判断是否有文件可读,如果有,返回fd的数量,如果没有,则返回0.  内核实现流程: 当应用程序调用poll函数的时候,会调用到系统调用sys......
阅读全文