uva 1368 - DNA Consensus String
Figure 1. DNA (Deoxyribonucleic Acid) is the molecule which contains the genetic instructions. It consists of four different
nucleotides, namely Adenine...
分类:
其他好文 时间:
2015-02-01 13:35:42
阅读次数:
436
从给定的一个路径中筛选中某种格式的文件,通常的做法,便是遍历该目录,然后按照文件后缀来判断该文件是否符合判断条件。
FilenameFilter 接口中的accept方法,主要判断给定的文件是否包含在该目录中
通过FilenameFilter 接口改造后的代码
class FilterName implements FilenameFilter {
private String type;
// 构造方法,定义要过滤的文件类型
FilterNa...
分类:
其他好文 时间:
2015-02-01 13:31:42
阅读次数:
209
在不使用其他库的情况下,WP-RT应用中也可以处理JSON数据。主要的几个类都放到Windows.Data.Json命名空间中:IJsonValue接口作为用于封装JSON数据的规范,其中只读属性ValueType通过JsonValueType枚举来标识JSON值的类型,如String表示JSON的...
分类:
Web程序 时间:
2015-02-01 13:30:45
阅读次数:
154
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ...
分类:
其他好文 时间:
2015-02-01 13:29:34
阅读次数:
148
1.1. 通过key得到value
//得到所有的key值
Set keySet = map.keySet();
//根据key值得到value值
for (String key : keySet) {
System.out.println(key+":"+map.get(key));
}
...
分类:
编程语言 时间:
2015-02-01 12:13:54
阅读次数:
210
package acm;import java.util.Scanner;public class L3_2 {/** * @param args */ public static void main(String[] args) {// TODO Auto-generated method s.....
分类:
编程语言 时间:
2015-02-01 12:04:17
阅读次数:
192
package net.datafans.exercise.rockmq.TestJMS;import java.io.*;import java.net.*;public class ServerDemo { public static void main(String args[]) throw...
分类:
Web程序 时间:
2015-02-01 12:01:59
阅读次数:
180
Collections类提供了一些列静态的方法,用以更方便地操作集合类
排序机制
一个List可以通过下面的方法进行排序:
Collections.sort(list);
如果List包含的是字符串,将会按照字母表排序;如果List包含的是Date类型数据,会按照日期先后排序……这是怎么实现的呢?String和Date都实现了comparable接口,此接口强行对实现它的每个类的对象进行整...
分类:
其他好文 时间:
2015-02-01 10:51:59
阅读次数:
173
对数字显示额格式化可以使用NumberFormat或者DecimalFormat import?java.text.DecimalFormat;
import?java.text.NumberFormat;
public?class?TestDemo?{
?public?static?void?main(String[]?args)?{...
分类:
编程语言 时间:
2015-02-01 10:51:48
阅读次数:
218
atol和strtol的区别
字符串中有两个重要的函数:atol和strtol,它们的功能都是字符数组,转数值。但是用法差异较大。我们下面来说一下这两个函数在具体使用的时候要注意哪些方面。
首先,说atol。
这个函数定义为:
long atol(const char* s);
就是输入一个字符数组(注意,不是string类型的字符串)...
分类:
其他好文 时间:
2015-02-01 09:38:07
阅读次数:
1173