内存管理重写dealloc方法@implementation Dog#pragma mark
当一个对象从内存中移除的时候,就会被调用- (void) dealloc{ NSLog(@"----Dog被销毁了------");
//一定要调用super的方法,写在该方法的最后 [sup...
分类:
移动开发 时间:
2014-05-23 12:03:27
阅读次数:
347
概念编辑距离(Edit
Distance),又称Levenshtein距离,是指两个字串之间,由一个转成另一个所需的最少编辑操作次数。许可的编辑操作包括将一个字符替换成另一个字符,插入一个字符,删除一个字符。例如将kitten一字转成sitting:sitten
(k→s)sittin (e→i)s...
分类:
其他好文 时间:
2014-05-22 03:56:16
阅读次数:
348
1. 对象属性的使用方法2. 多对象的创建方法3. 匿名对象的创建和使用方法1. 对象属性的使用方法
使用对象调用变量和函数 1. 对象.变量 2. 对象.函数() Dog.java class Dog{ String name ; int age ;
String color ; void ju....
分类:
其他好文 时间:
2014-05-19 11:34:37
阅读次数:
183
// Cast a sphere with the desired distance. Check
each collider hit to see if it is within the field of view. Set objectFound //
to the object that...
分类:
其他好文 时间:
2014-05-19 07:40:39
阅读次数:
360
Euclidean projection on a setAn Euclidean
projection of a point on a set is a point that achieves the smallest Euclidean
distance from to the set. ...
分类:
其他好文 时间:
2014-05-16 20:08:59
阅读次数:
1697
题目来源:POJ 2689 Prime Distance
题意:给出一个区间L R 区间内的距离最远和最近的2个素数 并且是相邻的 R-L
思路:一般素数筛选法是拿一个素数 然后它的2倍3倍4倍...都不是 然后这题可以直接从2的L/2倍开始它的L/2+1倍L/2+2倍...都不是素数
首先筛选出一些素数 然后在以这些素数为基础 在L-R上在筛一次因为 R-L
#include
#i...
分类:
其他好文 时间:
2014-05-15 19:51:58
阅读次数:
313
假设有个名为Dog的类1.当首次创建型为Dog的对象时(构造器可以看成静态方法),或者Dog类的静态方法/静态域首次被访问时,Java解释器必须查找类路径,以定位Dog.class文件。2.然后载入Dog.class(这将创建一个Class对象),有关静态初始化的动作都会执行。因此,静态初始化只在C...
分类:
编程语言 时间:
2014-05-14 11:32:21
阅读次数:
264
Problem Description
Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grav...
分类:
其他好文 时间:
2014-05-13 06:58:19
阅读次数:
523
Pat1016代码
题目描述:
A long-distance telephone company charges its customers by the following rules:
Making a long-distance call costs a certain amount per minute, depending on the time of day w...
分类:
其他好文 时间:
2014-05-13 06:45:05
阅读次数:
460
可以用递归简洁的写出,但是会超时。
dp嘛。这个问题需要从后往前算,最右下角的小规模是已知的,边界也很明显,是最后一行和最后一列,行走方向的限制决定了这些位置的走法是唯一的,可以先算出来。然后不断的往前推算。
用distance[i][j]保存从当前位置走到最右下角所需的最短距离,状态转移方程是从distance[i+1][j]和distance[i][j+1]中选一个小的,然后再加上自身的。...
分类:
其他好文 时间:
2014-05-13 00:13:56
阅读次数:
339