第一题:打车起步价8元(3KM以内)超过3KM,每公里1.2元超过5KM,每公里1.5元 static void Main(string[] args) { while (true) { ...
分类:
其他好文 时间:
2015-03-28 20:18:03
阅读次数:
182
1、sizeof(CDuiString)的大小是68字节:4字节的字符串指针+64字节的缓冲区。 这里使用64字节的额外缓冲区的目的是为了以空间换时间的方法,当遇到长度小于64的字符串时候直接使用该缓冲区而不用每次去申请内存。 这里跟std::string类似,都是使用小缓冲区来保留大小。std.....
分类:
其他好文 时间:
2015-03-28 20:16:05
阅读次数:
145
BOM头是UTF-8来告诉编辑器:我是UTF8编码。它的编码是\xEF\xBB\xBF但是PHP在设计之初并没有考虑到BOM头的问题,所以在编解码的时候很容易出现问题比如今天遇到的问题,json_decode,当解码的string有BOM头的时候json_decode就解析失败,返回NULL。(为什...
分类:
Web程序 时间:
2015-03-28 20:14:47
阅读次数:
157
package test;public class NumberFormatTest {static String[] units = { "", "十", "百", "千", "万", "十万", "百万", "千万", "亿","十亿", "百亿", "千亿", "万亿" };static ch...
分类:
编程语言 时间:
2015-03-28 20:13:58
阅读次数:
152
杨辉三角的源码: 1 import java.util.Scanner; 2 3 public class YangHui { 4 5 public static void main(String[] args) { 6 int i = 1; 7 Scan...
分类:
其他好文 时间:
2015-03-28 18:44:08
阅读次数:
122
缘起: 今天看到有一个工具类中有一句: String msgToPrint = Thread.currentThread().getStackTrace()[1].getMethodName();输出的结果很简单,就是调用类的方法名。文档: public StackTraceElement[] g....
分类:
其他好文 时间:
2015-03-28 18:40:07
阅读次数:
752
///
///GridPanelHelper///date:2014.7.22 by:wyl///GridPanel在我们系统中保存的是子表信息
///
public class GridPanelHelper
{
///
/// gridpanel 单元格双击事件
///
public const string fn = "function(e){e.ca...
分类:
Web程序 时间:
2015-03-28 17:23:27
阅读次数:
214
Go to my personal blog
There is a program to convert a string of hexadecimal digits into its equivalent integer value as below.
enum loop {NO, YES};
/* htoi: convert hexadecimal string s to int...
分类:
其他好文 时间:
2015-03-28 17:19:59
阅读次数:
269
一、File类
文件的创建
package file;
import java.io.File;
import java.io.IOException;
public class CreateFile {
public static void main(String[] args) {
// TODO 自动生成的方法存根
File file=new File("C:\\...
分类:
编程语言 时间:
2015-03-28 17:19:13
阅读次数:
227
线程优先级/*
* 线程优先级,范围[1,10]
* 不同优先级的线程获取执行的机会不同,优先级越高,执行机会越大
*
* 对比不同优先级的线程被执行的机率
*/
public class Test05 {
public static void main(String[] args) {
System.out.println("最大优先级:" + Thread.M...
分类:
编程语言 时间:
2015-03-28 17:18:15
阅读次数:
203