原文:http://coolshell.cn/articles/12199.htmlstl的string是经过严格优化的, 深入理解对以后编程过程中应用string非常有益处, 感谢左耳朵耗子的精彩文章Scott Meyers在《More Effective C++》中举了个例子,不知你是否还记得?...
分类:
编程语言 时间:
2015-06-09 11:11:34
阅读次数:
122
大家好,今天放了一天的假,无聊的我简单的敲了一下计算器的源代码,发现以前的东西都忘的差不多了,所以趁现在还有点记忆,先试着敲回以前的感觉。。。。
好了,废话不多说,先看原码:
先创建一个主类:
public class Test{
public static void main(String[ ] args){
Calculator calc=new Calculat...
分类:
编程语言 时间:
2015-06-09 10:05:42
阅读次数:
112
package com.mytomcat;
import java.net.*;
import java.io.*;
public class Mytomcat {
public static void main(String[] args)throws Exception
{
ServerSocket s = new ServerSocket(9988);
System....
分类:
编程语言 时间:
2015-06-09 10:01:45
阅读次数:
130
1.什么是templatetemplate是python中的string库的一部分使用template可以不编辑应用就可以改变其中的数据模板还可以被他的子类修改2. template如何工作的template是含有占位符的字符串用字典将值映射到模板中占位符后面跟着的变量名要符合python语法中的变量名规则Template(“$name is friends with $friend”)3.举例fr...
分类:
编程语言 时间:
2015-06-09 10:00:20
阅读次数:
186
题目:Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representat...
分类:
其他好文 时间:
2015-06-09 06:13:42
阅读次数:
93
Classic and challenging DP! And you need combine several tricks together with DP to make it 100% pass.My main reference is here:https://github.com/hav...
分类:
其他好文 时间:
2015-06-09 06:12:07
阅读次数:
127
最近由于工作项目,需要判断两个txt文本是否相似,于是开始在网上找资料研究,因为在程序中会把文本转换成String再做比较,所以最开始找到了这篇关于距离编辑算法Blog写的非常好,受益匪浅。 于是我决定把它用到项目中,来判断两个文本的相似度。但后来实际操作发现有一些问题:直接说就是查询一本书中的相似...
分类:
编程语言 时间:
2015-06-09 00:54:03
阅读次数:
143
注意, 包装类的实例之间比较, 是不能直接用 == 的 public static void main(String[] args) { // TODO Auto-generated method stub Integer a = new Integer(1); ...
分类:
移动开发 时间:
2015-06-09 00:53:13
阅读次数:
147
1 package MyTest; 2 3 import java.awt.*; 4 import javax.swing.*; 5 6 public class WhiteSnow { 7 public static void main(String args[]){ 8 ...
分类:
其他好文 时间:
2015-06-09 00:51:10
阅读次数:
100
class Program { static void Main(string[] args) { #region 交换两个变量 /* int num1 = 10; in...