require "Cocos2d"require "Cocos2dConstants"local cclog = function(...) print(string.format(...))endlocal TestScene = class("TestScene",function() ...
分类:
其他好文 时间:
2015-02-28 00:05:47
阅读次数:
211
今天来讲一个Go语言操作文件的问题,即如何遍历一个文件夹下的所有文件。
代码如下
package main
import (
"path/filepath"
"os"
"fmt"
"flag"
)
func getFilelist(path string) {
err := filepath.Walk(path, func(path string...
分类:
编程语言 时间:
2015-02-27 23:00:16
阅读次数:
250
String 方法用于文本分析及大量字符串处理时会对内存性能造成一些影响。可能导致内存占用太大甚至OOM。一、先介绍一下String对象的内存占用一般而言,Java 对象在虚拟机的结构如下:?对象头(object header):8 个字节(保存对象的 class 信息、ID、在虚拟机中的状态)?J...
分类:
其他好文 时间:
2015-02-27 22:56:08
阅读次数:
265
某次逛论坛时发现一个非常有意思的题目,如下:
class A
{
public String show(A obj)
{
return ("A and A");
}
public String show(B obj)
{...
分类:
编程语言 时间:
2015-02-27 22:55:37
阅读次数:
158
今天总结一下位运算 1 package 位操作; 2 3 public class SimpleDemo01 { 4 5 /** 6 * @param args 7 */ 8 public static void main(String[] args) { 9...
分类:
其他好文 时间:
2015-02-27 22:47:56
阅读次数:
193
NSScanner是一个类,用于在字符串中扫描指定的字符,尤其是把它们翻译/转换为数字和别的字符串。可以在创建NSScaner时指定它的string属性,然后scanner会按照你的要求从头到尾地扫描这个字符串的每个字符。
属性:
@property (readonly, copy) NSString *string; // 初始化时赋给NSScanner的字符串
@property ...
分类:
其他好文 时间:
2015-02-27 21:39:40
阅读次数:
432
Given a string containing just the characters '(' and ')',
find the length of the longest valid (well-formed) parentheses substring.
For "(()", the longest valid parentheses substring is "()",
...
分类:
其他好文 时间:
2015-02-27 21:37:53
阅读次数:
138
1、 说出以下代码的运行结果,并分析:public static void Main(String[] args) { int a = 0; int b = 2; int c = 4; a += b += c += 6; System.Console.WriteLine("c="+c); Syst....
分类:
Web程序 时间:
2015-02-27 21:31:17
阅读次数:
202
1,得到网页上的链接地址:string matchString = @"]+href=\s*(?:'(?[^']+)'|""(?[^""]+)""|(?[^>\s]+))\s*[^>]*>";2,得到网页的标题: string matchString = @"(?.*)";3,去...
分类:
Web程序 时间:
2015-02-27 21:30:13
阅读次数:
186
1.重写 data-load data-unload 事件;在随便的js文件中添加一下的代码;function dispatchPanelEvent(fnc,myPanel){ if (typeof fnc === "string" && window[fnc]) { retur...
分类:
移动开发 时间:
2015-02-27 20:11:26
阅读次数:
243