码迷,mamicode.com
首页 >  
搜索关键字:str1    ( 1981个结果
优化 PHP 代码建议(转)
1、如果能将类的方法定义成static,就尽量定义成static,它的速度会提升将近4倍。2、$row[’id’] 的速度是$row[id]的7倍。3、echo 比 print 快,并且使用echo的多重参数(译注:指用逗号而不是句点)代替字符串连接,比如echo $str1,$str2。4、在执行...
分类:Web程序   时间:2014-06-20 08:48:10    阅读次数:337
C++中对字符串进行插入、替换、删除操作
#include #include using std::cout; using std::endl; using std::cin; using std::string; int main(void){ string str1="We can insert a string"; string str2="a str into "; //在字符串指定位置...
分类:编程语言   时间:2014-06-15 19:29:30    阅读次数:251
编辑距离 动态规划
动态规划经常被用来作为这个问题的解决手段之一。整数 Levenshtein距离(字符串 str1[1..m], 字符串 str2[1..n])//声明变量, d[i , j]用于记录str1[1...i]与str2[1..j]的Levenshtein距离int d[0..m, 0..n]//初始化f...
分类:其他好文   时间:2014-06-12 07:06:30    阅读次数:251
[Java 05 OO] (基础篇) 《Java开发实战经典》
p5OO 第五章 面向对象 (基础篇)Notes(1), Constructor / this / String String str1 = "hello"; 解释 : 是把一个在堆内存空间的使用权给了 str1 对象。 String str2 = "hello"; str1 == str2 是 t...
分类:编程语言   时间:2014-06-12 06:42:11    阅读次数:421
Java中的反射——(1)什么是反射
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
MapReduce实现排序功能
期间遇到了无法转value的值为int型,我采用try catch解决 str2 2 str1 1 str3 3 str1 4 str4 7 str2 5 str3 9 用的\t隔开,得到结果  str1 1,4  str2 2,5 str3 3,9 str4 7 我这里map,reduce都是单独出来的类,用了自定义的key package com.kan...
分类:其他好文   时间:2014-06-05 06:52:38    阅读次数:353
精悍的指令
最近在复习自己的linux笔记,看到cut和sort的时候突然想起一直遗忘做的一件事:给某文本文件去重。发现用这两条指令的组合可以很轻松的完成自己想做的工作。要处理的原文本文件一条数据的格式是:str1 # str2 #str3,每行一条这种格式的数据。我需要的只是str2去重后的数据,所以可以这么...
分类:其他好文   时间:2014-05-30 20:18:52    阅读次数:410
获取web路径的几种方式
1、string str1 = Request.ApplicationPath.ToString(); 返回路径为:\HolterClientWeb2、HttpServerUtility.MapPath 方法解释:返回对应于 Web 服务器上指定的虚拟路径的物理文件路径。 string path=S...
分类:Web程序   时间:2014-05-25 20:18:18    阅读次数:321
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!