在 UIResponder中存在这么一套方法-
(void)motionBegan:(UIEventSubtype)motion
withEvent:(UIEvent*)event__OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);-
(void)moti...
分类:
移动开发 时间:
2014-05-08 19:14:41
阅读次数:
401
static void shellsort(int a[], int n) {
for (int gap = n / 2; gap >= 1; gap /= 2) {
for (int i = gap; i < n; i++) {
if (a[i] < a[i - gap]) {
int temp = a[i];
int k = i - gap;
w...
分类:
其他好文 时间:
2014-05-07 16:31:06
阅读次数:
272
public class Sort {
static void insertSort(int a[], int n) {
for (int i = 1; i < n; i++) {
if (a[i] = 0 && a[k] > temp) {
...
分类:
其他好文 时间:
2014-05-07 16:15:39
阅读次数:
225
#include
#include
using namespace std;
class Point //定义坐标点类
{
public:
Point():x(0),y(0) {};
Point(double x0, double y0):x(x0),y(y0){};
void PrintPoint(); //输出点的信息
double getx()
{
...
分类:
其他好文 时间:
2014-05-07 16:14:20
阅读次数:
267
以微博分享为例:
1.public void onClickShare(View view) {
2.
3. Intent intent=new Intent(Intent.ACTION_SEND);
4. intent.setType("image/*");
5. intent.putExtra(Inten...
分类:
移动开发 时间:
2014-05-07 15:59:21
阅读次数:
396
RCP Editor 修改状态,Editor被修改后,在关闭Editor时提示用户保存的实现步骤。
1、Editor中声明
private boolean dirty;
2、重写isDirty
@Override
public boolean isDirty() {
return dirty;
}
3、设置方法
public void setDirty(boolea...
分类:
其他好文 时间:
2014-05-07 15:48:38
阅读次数:
242
一、 游戏结束检测
//检测游戏是否结束
void GameScene :: doCheck()
{
bool isGameOver = true ;
//判断每一个的上下左右和自己是否相同
for ( int y = 0 ; y < 4; y++)
{
for ( int x = 0 ; x < 4;...
分类:
其他好文 时间:
2014-05-07 15:14:04
阅读次数:
283
调用EditorPart的doSaveAs比较容易,调用doSave方法稍微复杂一些,因为需要传入IProgressMonitor参数,如下声明
@Override
public void doSave(IProgressMonitor monitor) {
// Do the Save operation
}
@Override
public void doSaveAs() {
...
分类:
其他好文 时间:
2014-05-07 15:08:58
阅读次数:
348
做个记录,写个示例using System;class Rubbish{ public
void Say() { Console.Write("Hello"); }}static class RubbishExtensions{ public
static...
分类:
其他好文 时间:
2014-05-07 14:57:23
阅读次数:
279
变形了的最近点对,关键在于计算距离的时候,如果同类点的话,直接判定为无穷大即可。
其他闲话:
(1)因为一些原因,被迫暂时用回C++.
(2)好久没刷题,忘记了数组一开始要开最大,多次new和delete,导致超时。
(3) 感觉算法导论的最近点对没有考虑到有多个点都在一条vertical line上的情形。
#include
#include
#include
#include...
分类:
其他好文 时间:
2014-05-07 11:29:11
阅读次数:
334