自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(118)
  • 资源 (1)
  • 收藏
  • 关注

转载 cocos2d-x坐标系

GL坐标系Cocos2D以OpenglES为图形库,所以它使用OpenglES坐标系。GL坐标系原点在屏幕左下角,x轴向右,y轴向上。 屏幕坐标系苹果的Quarze2D使用的是不同的坐标系统,原点在屏幕左上角,x轴向右,y轴向下。ios的屏幕触摸事件CCTouch传入的位置信息使用的是该坐标系。因此在cocos2d中对触摸事件做出响应前需要首先把触摸点转化到GL坐标系。可以使用CC

2012-12-07 21:52:29 1066

原创 proguard混淆的简单总结

proguard混淆器运行的过程(其他的过程暂不讨论):通过在命令行中运行proguard脚本并使用直接加参数和调用proguard.cfg来实现,而eclipse adt在发布releaseapk时执行这一过程,它完成的大部分工作,他包括injars,outjars,libraryjars(自动添加工程libs中的jar的路径)的参数指定,并且通过jdk/tools/proguard/pro

2012-12-01 21:42:29 2089

原创 cocos2d-x问题汇总

在cygwin控制台运行cocos2d-x生成的项目中的build_native.sh时,报错:please define NDK_ROOT.这个问题是因为,没有配置环境变量,需要做的事情是:1. 复制/etc/defaults/etc/skel/.bash_profile文件到/home/用户名/目录下。(特别注意:如果cygwin安装后/home自带了.bash_profile,也

2012-11-25 23:08:03 14823 3

原创 c++学习小结

1.从虚基类派生,其基类必须是抽象类吗?优势是什么不一定,可以是普通类没得优势,只是抽象过程的一种情况2.抽象类的纯虚函数能不能定义,如果能,其派生类能不用实现此函数而获得定义吗?能够定义默认实现,但是派生类一样需要实现此方法,如果要使用纯虚函数的默认实现,则必须显示调用。// TODO

2012-11-17 00:38:38 737

转载 const形参的函数重载

转载至:http://www.cppblog.com/Marcky/archive/2009/07/12/89796.html《C++ primer》中提到“仅当形参是引用或指针的时候,形参是否为const才对重载有影响。”int add(int a, int b);int add(const int a, const int b);我想通过定义这两个函数来实现

2012-11-09 10:53:30 780

转载 如何用栈实现递归与非递归的转换

http://www.kuqin.com/article/23candcplusplus/331522.html一.为什么要学习递归与非递归的转换的实现方法?   1)并不是每一门语言都支持递归的.   2)有助于理解递归的本质.   3)有助于理解栈,树等数据结构.二.递归与非递归转换的原理.   递归与非递归的转换基于以下的原理:所有的递

2012-11-08 00:07:53 1025

转载 纯虚函数的默认实现

转载至http://blog.csdn.net/tonywearme/article/details/6979283在帮新同事进行代码审查的时候,常常会发现这样的问题:代码中原有基类B和派生类D1,现在新加一个派生类D2,它有一个函数f2()。由于经验不足,新同事并没有注意到D1也有类似的函数f1()。于是造成了类似的代码出现在了两个地方,代码冗余造成将来的维护工作异常困难。注意到f(

2012-11-07 21:55:28 717

翻译 多重继承 - 构造函数的规则

虚基类的子类的子类在多重继承时,构造函数初始化父类的构造函数将不会将信息传给虚基类,但可以显示调用对应虚基类的构造函数来构造自身对象,从而获得一个虚基类的对象避免多重继承的冲突;如果未显示调用虚基类的构造函数,将自动调用其默认的构造函数。C++ primer plus 6th     14. Reusing Code in C++           New Constru

2012-11-05 21:20:57 1158

原创 Handler,Looper,Message

1. Handler在创建实例时,会关联一个Looper对象,这个Looper对象是它对应线程的变量拷贝 - ThreadLocal变量的一员,当它sendMessage()的时候,会将Message.taget设置自身Handler对象并加入到Looper的MessageQueue中,等待消息循环。2. Looper管理了一个MessageQueue,线程的run()方法中会调用Loop

2012-10-25 01:48:02 649

转载 函数不能返回局部指针变量

声明自动指针变量时,编译器为其在堆栈区分配内存,如果在函数中将另外一个自动变量的地址赋值给自动指针变量,在函数调用完毕后,指向堆栈区的栈顶指针将移动到调用此函数之前的地址位置,从而使自动变量失去意义,返回的失去意义的地址将会使程序不稳定。函数返回指针。本来就是一个比较容易出问题的操作。在霍顿的《VC++ 入门经典》一书中,给出了一个很有代表性的例子,如下:// Ex5_

2012-10-08 01:12:14 5746

翻译 startActivityForResult using the tab Activity 的解决办法

tab activity 中调用startActivityForResult 以获取子activity的运行结果时,会有一个问题,那就是 onActivityResult 方法无法被回调。这通常发生在ActivityGroup中,(我估计的,未研究源码)其原因在于 从 tab activity 进入 子activity时,ActivityGroup进入了活动栈,而不是tab activit

2012-09-13 21:58:36 2578

原创 out-of-sync in juno

Lightweight refresh enabled by defaultIn Eclipse 3.7 a new lightweight refresh mechanism was introduced. Files discovered to be out-of-sync by the workspace, for example while accessing the file con

2012-08-31 16:49:58 716

原创 Handler 的运行过程和作用

过程:Handler发送Message(关联此Handler)到主线程的消息队列,当运行到此消息时,它将回调关联的Handler的handleMessage方法,此方法运行在主线程上。作用:1. 在主线程上,执行(或延迟执行)周期的任务,无需使用计时器或闹钟管理器。例如:public class CycleHandler extends Handler { @Ove

2012-08-26 18:01:28 762

转载 TextView 设置 Ellipsize 属性,但它不工作?

I have a listView with custom objects defined by the xml-layout below. I want the textView with id "info" to be ellipsized on a single line, and I've tried using the attributesandroid:singleLine="

2012-08-24 22:47:20 5076

转载 Unable to add window is not valid; is your activity running?

错误:android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@435def20 is not valid; is your activity running? at android.view.V

2012-08-16 23:20:46 866

原创 点击返回键关闭应用程序的步骤

1. 创建一个专门用于app关闭的类** * 专门用于应用程序关闭的类。 * * 主要功能: * 1. 创建退出AlertDialog * 2. 释放所有必要资源 * * @author Lear * */public final class APPCloser { public static Dialog buildLeavingDialog(Context c

2012-08-10 18:01:43 3773

转载 How to close Android application?

Android has a mechanism in place to close an application safely per its documentation. In the last Activity that is exited (usually the main Activity that first came up when the application started) j

2012-08-09 22:35:43 1091

转载 60FPS is the target

I recommend that you make every effort to reach a consistent rate of 60FPS. That corresponds to the maximum refresh rate of most LCD displays and is also the speed used on popular gaming platforms suc

2012-07-04 18:09:28 828

原创 ContentProvider和ContentResolver

ContentProvider向其他程序提供data.ContentResolver自动查找注册在系统中的ContentProvider,by authority。Activity 通过 ContentResolver 在URI的抽象层面上操作数据,而ContentResolver又在其内部的调用IContentProvider provider = acquireProv

2012-07-03 01:04:03 542

原创 speeding up app in android

1. View.onDraw( ) method is a very performance-criticalpiece of code, so it’s best to do as little as possible there.• If possible, avoid doing any object allocations in the method onDraw( ).• P

2012-06-19 15:29:49 473

原创 onDraw() and invalidate()

1. invalidate()定义脏的区域,而这两个区域会在未来的某个点上被刷新,及调用ondraw()。2. ondraw方法虽然全部都会执行,但在界面上只刷新 脏 的区域。3. 例如:onKeyDown()的每一次运行都会触发界面的刷新。

2012-06-16 15:47:13 817

原创 why don't we often use inner class in android development?

every new inner class takes up an extra 1KB of memory.

2012-06-12 11:49:44 431

原创 toggle style menu contribution ,which is not persisted

This is the definition,Menu Contributions/Toggle Button Command.Use the RegistryToggleState has two reasons:It implements IExecutableExtension. So you can specify the default values in the plu

2012-06-04 20:00:28 843

转载 How to change tooltip background color in Unity?

Here is a screenshot of Eclipse which displays some source code in a tool tip with black text on black background:I had to edit these files:/usr/share/themes/Ambiance/gtk-3.0/settings.ini

2012-05-01 20:51:29 1038

原创 1 2 3 4 5 6 7 8 9 = 110,在数字间填入加号或者减号(可以不填,但不能填入其它符号)使等式成立。

一共有3^8种可能。答案:成功:12+34+56+7-8+9 = 110成功:12+3+45+67-8-9 = 110成功:12-3+4-5+6+7+89 = 110成功:1+2+34+5+67-8+9 = 110成功:1-2+3+45-6+78-9 = 110成功:123+4-5-6-7-8+9 = 110成功:123-4+5-6-7+8-9 = 110成功:

2012-04-14 02:14:18 23190 1

转载 How do I find a particular class from an Eclipse plug-in?

There are two easier approaches to adding Eclipse plug-ins to the Java search engine's index.Option 1In Eclipse 3.5 (Galileo) or laterOpen the Plug-in Development Preference Page by going to W

2012-02-29 14:19:15 670

转载 How to turn off the Javadoc hover

Preferences / Java / Editor / Hover1. untick the "Combined Hover" option: no more popup.Then you would have:Shift+F2: open the external javadoc if javadoc archive or directory has been

2011-12-26 15:13:45 527

原创 Perspective's ratio configuration in plugin.xml

For a vertical split, the part on top gets the specified ratio of the current space and the part on bottom gets the rest. Likewise, for a horizontal split, the part at left gets the specified ratio of

2011-12-22 17:38:35 540

转载 The First Column in a Table Is Always Left-Aligned

Due to a restriction in Microsoft Windows, the alignment of the first column in a table cannot be changed. To create programs that are portable to other platforms, this restriction is enforced by SWT

2011-12-21 11:33:51 584

转载 Eclipse Tip: Hover to view source

There are different hovers in Eclipse which are shown based on modifiers like Shift, Ctrl… One of such hovers is pops up when the‘Shift’ key is pressed when hovering over a class or method in the Ja

2011-11-12 12:26:12 517

原创 Eclipse的trace功能测试插件的步骤

1. 在插件项目中新建一个名为.options的文件(会在启动trace后扫描出来),以‘插件id/选项=值’的形式书写测试选项。2. 在public class Activator extends AbstractUIPlugin类中以static块的形式加

2011-10-18 16:56:32 2421

原创 JDT - Java element hierarchy

hierarchy Java model (IJavaModel)Java project (IJavaProject) package fragment root (IPackageFragmentRoot)package fragment (IPa

2011-10-17 10:30:17 660

原创 use wizards framework

Wizard class hierarchy开发步骤(非实现Eclipse提供的3个Wizard Extension points:1. 继承Wizard:构造器中初始化基本信息,可创建一个带ISelection的构造器,由调用者传入以便提供Page的初始值;实现addPags()添加IWizardPage的实现类,同时传入ISelection;实现pe

2011-10-13 15:59:05 528

转载 error - "eUML2 Free Edition requires 'bundle org.apache.batik.dom.svg 1.6.0' "

"eUML2" UML Diagramming Tool  eUML2 Home Page:  http://www.soyatec.comeUML2 is a commercial UML diagramming tool for Eclipse that suppor

2011-10-12 17:42:21 2044

原创 视图间通信

视图间通信的3个步骤:1. 目标视图: 在createPartControl()中,将具体的viewer作为selectionProvider注册到selectionService的实例中。getSite().setSelectionProvider(

2011-09-30 15:39:42 763

原创 日志文件的功能

1. 从致命错误中恢复状态。2. 提高程序性能。

2011-08-23 10:36:18 802

原创 servlet objectinputstream eofexception

The constructor for ObjectInputStream reads some headerinformation from the serialized stream, and if the stream doesn't contain thishea

2011-08-02 14:55:49 874

转载 mysql -CREATE PROCEDURE和CREATE FUNCTION的语法

MySQL 5.1参考手册在MySQL 5.1中,一个存储子程序或函数与特定的数据库相联系。这里有几个意思: ·        当一个子程序被调用时,一个隐含的USE db_name 被执行(当子程序终止时停止执行)。存储子程序内的USE语句时不允许的。 ·

2011-07-10 00:54:45 6120

转载 firefox --快捷键

命令Mozilla Firefox添加为书签Ctrl+D后退Backspace (注: 这个快捷键只在windows中起作用.)Alt+Left Arrow打开书签Ctrl+BCtrl+I插入浏览F7关闭窗口Ctrl+WCtrl+F4补充 .com 地址Ctrl+Enter补充

2011-07-07 17:07:43 519

转载 web.xml中的url-pattern

在 web.xml 文件中,以下语法用于定义映射:以 ”/’ 开头和以 ”/*” 结尾的是用来做路径映射的。  以前缀 ”*.” 开头的是用来做扩展映射的。  “/” 是用来定义

2011-06-20 01:34:00 565

离散数学第二版课后习题 相机版

清华大学 曲婉玲 全部课后习题的答案 我找了很久才找到的PDF格式 不过不是很清晰

2010-08-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除