摘要:
一、整体工程图 二、activity_bind.xml 三、BindActivity.javapackage com.jltxgcy.bindservice;import android.app.Activity;import android.content.ComponentName;import android.content.Context;import android.content.Intent;import android.content.ServiceConnection;import android.os.Bundle;import android.os.IBinder;im.
阅读全文
posted @ 2013-08-25 21:20
风言枫语
阅读(373)
推荐(0)
摘要:
由于本人英文能力实在有限,不足之初敬请谅解本博客只要没有注明“转”,那么均为原创,转贴请注明本博客链接链接Loading a single bitmap into your user interface (UI) is straightforward, however things get more complicated if you need to load a larger set of images at once. In many cases (such as with components like ListView, GridView or ViewPager), the tot
阅读全文
posted @ 2013-08-25 21:18
风言枫语
阅读(310)
推荐(0)
摘要:
require最常用的方法require('http') 内置模块 require('./server') “./”表示当前路径,后面跟的是相对路径 require("../lib/server") ../表示上一级目录,后面跟的也是相对路径 server.js [javascript] var http = require('http'); function start(){ server = http.createServer(function (req, res) { res.writeHeader(200, {&quo
阅读全文
posted @ 2013-08-25 21:16
风言枫语
阅读(1210)
推荐(0)
摘要:
今天闲来无事,用google搜索了一下自己csdn的博客名,查看了一下搜索结果,发现自己在csdn上的博客被其他一下网站转载了,转载后注明作者的网站这里我也就不去说了,问题是我发现了一个名叫“开心问答网”的网站,居然直接套用csdn博客的版式。且除了在google搜索的结果中出现了我的博客名——即作者名外,其网站网页中居然只有博客文章,不注明作者,且不标记为转载。后来我打开了该网站的主页http://www.kaixinwenda.com/,发现该网站搜集了许多csdn博客的内容,我不知道这是否是“开心问答网”与csdn在合作状态中,还是该网站不经许可随意盗用csdn的博客内容。我现在把这个问
阅读全文
posted @ 2013-08-25 21:14
风言枫语
阅读(195)
推荐(0)
摘要:
#include #include using namespace std;const int MAX = 32;int n, MOD;struct Matrix{ int v[MAX][MAX];}Matrix mtAdd(Matrix A, Matrix B){ Matrix C; for(int i = 0; i < n; ++i) for(int j = 0; j < n; ++j){ C.v[i][j] = A.v[i][j] + B.v[i][j]; } return C;}Matrix mtMul(Matrix A, Matrix B){ Matrix C; for(
阅读全文
posted @ 2013-08-25 21:11
风言枫语
阅读(163)
推荐(0)
摘要:
在x-codeVersion 4.3.2 (4E2002)下编译:在 Controller. m 文件下添加如下实例方法即可: - (void)viewDidUnload{ [super viewDidUnload]; // Release any retained subviews of the main view.}然后将UITextField和这个方法关联起来,这里要注意的是,关联的是 Did End On Exit 事件。千万不要关联成Editing Did End。
阅读全文
posted @ 2013-08-25 21:09
风言枫语
阅读(186)
推荐(0)
摘要:
VIM 的作者Bram Moolenaar在一篇叫高效文本编辑器的7个习惯的ppt中有这么一段话。Three basic steps1. Detect inefficiency2. Find a quicker way3. Make it a habit即1.检测哪里效率低下2.找到一种更快的方法3.养成习惯这3个步骤可谓是大道至简。放之四海而皆准。不止适用于vim,一样适用于python以及其他语言,也适用于现实生活。这简单的道理很多人都懂,但是却有很多人没有贯彻。一遇到性能问题就胡乱猜测,毫无目的,无针对性。性能问题也符合20/80规则。即20%的代码引起了80%的性能损耗。可能有很多地方
阅读全文
posted @ 2013-08-25 21:07
风言枫语
阅读(4566)
推荐(0)
摘要:
所谓的长连接,就是不断去发送请求,把请求阻塞在服务器端,每次超过请求时间就去重新发送请求,保持连接,随时获取服务器端的响应的数据项目案例:function connection(){ $.ajax({ type:"GET", url:"/api2/session/event?", data:{ "uid":obj.uid, "sessionID":"cool" }, success:function(serverData){ connection(); }, ...
阅读全文
posted @ 2013-08-25 21:05
风言枫语
阅读(140)
推荐(0)
摘要:
总目录:通过一段代码学习javascript基础知识系列 注意: 为了便于执行和演示,建议使用chrome浏览器,按F12,然后按Esc(或手动选择)打开console,在console进行执行和演示。 由于代码中使用了console.log或dir方法,因此如果在ie中执行,请自行替换为alert或注释掉。 第三节 - ()()用法 在JS中,有一种特殊的写法,就是两个小括号,如下(代码一):(function(){ console.log("执行");})(); 这段代码会在页面加载的时候直接执行,在控制台输出“执行”。 这段代码的等价代码为(代码二):function
阅读全文
posted @ 2013-08-25 21:03
风言枫语
阅读(504)
推荐(0)
摘要:
第一步:新建一个工程,在 .h文件中坐如下声明:#import @interface MyButtonViewController : UIViewController{ UIButton* myButton; }@property (nonatomic,retain)UIButton *myButton; 在. m 文件中#import "MyButtonViewController.h"@interface MyButtonViewController ()@end@implementation MyButtonViewController@synthesize myL
阅读全文
posted @ 2013-08-25 21:00
风言枫语
阅读(169)
推荐(0)