System的getProperties()方法返回Properties类型对象,其中Properties类属于Hashtable的子类,属于Map集合的一个子类对象,所以可以通过key和value取值。Properties的key和value实际上都是String类型的。这一点是其和Hashtable不同的地方。我们可以查看Properties.java得到这个信息——
public...
分类:
其他好文 时间:
2015-05-10 09:55:51
阅读次数:
158
阶乘很好求,递归就行了,但对于较大的数,阶乘的结果非常非常大,木有办法,只能用string来处理。
我们用string的乘法来做。经测试,这个程序能运行的最大n值差不多能到3000,和windows上自带的科学计算器差不多:)
string multiply(string num1, string num2) {
int len1 = num1.size(), len2 = n...
分类:
编程语言 时间:
2015-05-10 09:55:30
阅读次数:
132
我们想往一个文件里写东西,初始版本:
import java.io.*;
class FileWriterDemo{
public static void main(String[] args) {
FileWriter fw = new FileWriter("demo.txt"); //创建流,打开(如果不存在,新建)文件
fw.write("abcdefg");...
分类:
编程语言 时间:
2015-05-10 09:53:20
阅读次数:
132
extension String { var length: Int { return countElements(self) } // Swift 1.1 } extension String { var length: Int { return count(self) } // Swift 1....
分类:
编程语言 时间:
2015-05-10 09:37:41
阅读次数:
124
1、archive 归档 数据的保存 1: let result = NSKeyedArchiver.archiveRootObject(contacts, toFile: path as String) 2: println("保存结果\(result)") 数据的读取: 1:...
分类:
移动开发 时间:
2015-05-10 08:29:49
阅读次数:
132
前文已经介绍了《使用IE测试COM》,那么我们用一个实际的实例来使用他。
在这之前,我们需要了解2个Javascript函数:
replace(regexp/substr,replacement)
使用这个函数来替换多余的空格。
str.replace(/\s/g, "");
split(separator,howmany)
字符串转换成字符数组。
string.split(",");...
分类:
其他好文 时间:
2015-05-10 06:25:34
阅读次数:
267
Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given "Is PAT&TAP symmetric?", the longest symmetric sub-string is "s PAT&TAP s", hence you must...
分类:
其他好文 时间:
2015-05-10 06:22:13
阅读次数:
218
1 常用模块介绍1.1 os模块1.2 sys模块1.3 built-in内置模块1.4 time模块1.5 re模块2 常用模块分类2.1 python运行时服务2.2 数学2.3 数据结构,算法和代码简化2.4 string 和 text 处理2.5 python数据库访问2.6 文件和目录处理...
分类:
编程语言 时间:
2015-05-10 06:18:23
阅读次数:
171
class Program { static void Main(string[] args){ Console.WriteLine("请输入要生成随机数的范围1-?");//接收用户输入的字符 string str=Console.ReadLine (); int it;//尝试转换用户...
分类:
其他好文 时间:
2015-05-10 06:17:16
阅读次数:
123
1 import java.io.*; 2 public class TestBufferStream1 { 3 public static void main(String[] args) { 4 try { 5 FileInputStream fis = 6 ...
分类:
编程语言 时间:
2015-05-10 06:14:33
阅读次数:
265