Java程序中的各个Java类属于同一类事物,描述这类事物的Java类名就是Class.public class ReflectTest {
public static void main(String[] args) throws ClassNotFoundException {
String str1 = "abc";
Class cls1 = String.class;
Cla...
分类:
编程语言 时间:
2014-06-09 23:39:33
阅读次数:
376
Protocols and Extensions
Protocols 协议的使用
使用关键字 protocol 定义一个协议
protocol ExampleProtocol {
var simpleDescription: String { get }
mutating func adjust()
}
类,枚举和结构体都可以实现协议
class SimpleC...
分类:
其他好文 时间:
2014-06-08 17:09:31
阅读次数:
254
package com.hao947;
public class hao947 {
public static void main(String[] args) {
int a = 1;
int b = 2;
int c = 3;
int d = 4;
int count = 0;
for (int i = 0; i <= 12; i++) {
for (int...
分类:
编程语言 时间:
2014-06-08 16:51:26
阅读次数:
258
构建一个list注意要标记不要求值,比如用‘ 或者list> (list "a" "b" "c")
("a" "b" "c")或者> '("a" "b" "c")
("a" "b" "c")
查找在一个全是string的list中用正则表达式查找查找第一个匹配到的元素:> (set 'l '("WARNING: org.apache.hadoop.metrics.jvm.EventCounter...
分类:
其他好文 时间:
2014-06-08 16:23:41
阅读次数:
243
这是个老题目了,主要考察的是能不能考虑到所有的情况,还有就是怎么判断是否溢出。
情况大致分为如下四种:(下面我使用@代替空格,x代表除数字之外的所有字符)
1. "@@[+-]3232343@@"
2. "@@[+-]333x54"
3. "@@[+-]4343"
4. "2147483648"或者"-2147483649"(也就是溢出的情况)
下面代码中给出了两个判断是否溢出的方法。...
分类:
其他好文 时间:
2014-06-08 15:47:49
阅读次数:
270
闲来没事,写了个acm中经常遇到的大数加减问题的java 解决代码,我想说,用java的BigInteger 很容易。大爱java!!
例如:
实现多组输入的大数加减问题:
import java.math.*;
import java.util.*;
public class Bignum {
public static void main(String[] args) {...
分类:
编程语言 时间:
2014-06-08 15:01:17
阅读次数:
252
题目如下:
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
click to show clarification.
Clarification:
What co...
分类:
其他好文 时间:
2014-06-08 14:58:13
阅读次数:
231
public static Date stringToDate(String str) {
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date date = null;
try {
// Fri Feb 24 00:00:00 CST...
分类:
编程语言 时间:
2014-06-08 09:49:00
阅读次数:
268
题目
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.
For example,
Given:
s1 = "aabcc",
s2 = "dbbca",
When s3 = "aadbbcbcac", return true.
When s3 = "aadb...
分类:
其他好文 时间:
2014-06-08 09:14:26
阅读次数:
215
在ios7以前,我们开发二维码扫描,或者生产都需要借助第三方的开源库进行开发。
然后升级到ios7时,在passbook中苹果自带二维码扫描功能,而且扫描速度非常快,秒杀一切第三方开源库。所以,我们做二维码的开发选用自带sdk优先级应该高于其他的库。
说到二维码的开发,我们需要用到这两个对象。如下。。
@property (nonatomic,
strong) AVCaptureS...
分类:
移动开发 时间:
2014-06-08 09:04:05
阅读次数:
232