如果我们的程序是在单线程下运行,或者是不必考虑到线程同步问题,我们应该优先使用StringBuilder类;如果要保证线程安全,自然是StringBuffer。 除了对多线程的支持不一样外,这两个类的使用方式和结果几乎没有任何差别, 区别在于StringBufferd支持并发操作,线性安全的,适 合 ...
分类:
移动开发 时间:
2017-02-07 12:11:32
阅读次数:
212
Python List numpy array numpy数组:元素只有一种类型,否则会转换成字符串。 不同的类型,不同的行为 numpy的构造子集 二维numpy数组 ndarray=n维数组 ...
分类:
其他好文 时间:
2017-02-07 01:13:39
阅读次数:
156
1. 如何比较两个字符串?使用“==”还是equals()方法? 简单来讲,“==”测试的是两个对象的引用是否相同,而equals()比较的是两个字符串的值是否相等。除非你想检查的是两个字符串是否是同一个对象,否则你应该使用equals()来比较字符串。 如果你知道interning的概念的话,那就 ...
分类:
其他好文 时间:
2017-02-06 19:30:50
阅读次数:
156
一、程序方面 01、务必删除脚本中为空或不需要的默认方法; 02、只在一个脚本中使用OnGUI方法; 03、避免在OnGUI中对变量、方法进行更新、赋值,输出变量建议在Update内; 04、同一脚本中频繁使用的变量建议声明其为全局变量,脚本之间频繁调用的变量或方法建议声明为全局静态变量或方法; 0 ...
分类:
编程语言 时间:
2017-02-06 16:47:50
阅读次数:
229
1 package Today; 2 //LeetCode:485. Max Consecutive Ones 3 /* 4 Given a binary array, find the maximum number of consecutive 1s in this array. 5 6 Exam... ...
分类:
其他好文 时间:
2017-02-06 13:22:30
阅读次数:
155
function mobile_device_detect(url) { var thisOS = navigator.platform; var os = new Array("iPhone", "iPod", "iPad", "android", "Nokia", "SymbianOS", "S... ...
分类:
移动开发 时间:
2017-02-06 13:20:57
阅读次数:
192
1 package Today; 2 //LeetCode:35. Search Insert Position 3 /* 4 Given a sorted array and a target value, return the index if the target is found. 5 If... ...
分类:
其他好文 时间:
2017-02-06 13:14:39
阅读次数:
130
点击查看代码 1 char *s = "Hello World"; 2 NSString *str = @"Hello Warcraft"; 3 //C -> OC 4 NSString *str1 = [NSString stringWithUTF8String: s]; 5 NSLog(@"st ...
分类:
其他好文 时间:
2017-02-06 12:57:49
阅读次数:
212
Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and t ...
1 package Today; 2 3 import java.util.HashMap; 4 import java.util.Map; 5 6 //LeetCode:167. Two Sum II - Input array is sorted 7 /* 8 Given an array of... ...
分类:
其他好文 时间:
2017-02-06 12:22:04
阅读次数:
182