lua中文件读写经常在游戏配置中用到,比如客户端的音效音乐开关等。
Lua官方API文档:点这里
I/O库为文件操作提供4个主要函数:io.open(),io.read(),io.write和io.close()。
io.open(文件路径,打开方式):以指定方式打开一个文件,打开成功返回一个文件句柄,失败返回nil和错误描述。
可以传入以下六种打开方式:...
分类:
其他好文 时间:
2014-08-09 11:42:44
阅读次数:
256
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given target is in the...
分类:
其他好文 时间:
2014-08-09 11:38:57
阅读次数:
147
1、自带的jconsole工具。
(1)如果是从命令行启动,使 JDK 在 PATH 上,运行 jconsole 即可。
(2)如果从 GUI shell 启动,找到 JDK 安装路径,打开 bin 文件夹,双击 jconsole 。
(3)当分析工具弹出时(取决于正在运行的 Java 版本以及正在运行的 Java 程序数量),可能会出现一个对话框,要求输...
分类:
编程语言 时间:
2014-08-09 11:35:27
阅读次数:
328
/**
* @author default7
* @description 演示PHP弹出下载的原理
*
* @param $file_name
*/
function downFile($file_name)
{
$file_path = "/tmp/" . $file_name;
$buffer = 102400; //一次返回102400个字节
i...
分类:
Web程序 时间:
2014-08-09 07:00:37
阅读次数:
196
(一)关于模板,Template ????可以在项目根目录下的settings.py 配置文件中,声明 import?os
BASE_DIR?=?os.path.dirname(os.path.dirname(__file__))
TEMPLATE_DIRS?=?os.path.join(BASE_DIR,?‘temp...
分类:
编程语言 时间:
2014-08-09 00:22:37
阅读次数:
265
import urllib2,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path();
os.makedirs( ...
分类:
其他好文 时间:
2014-08-09 00:19:46
阅读次数:
262
用于自己备注,呵呵 写的比较简单
操作系统:win7
————————————————————————————————
1,安装JDK
2,下载ADT
3,下载ANT
4,安装node.JS
5,配置环境变量
ANDROID_HOME D:\adt-bundle-windows-x86_64-20131030\sdk
path 加入 D:\apache-ant-1.9.4-bin...
分类:
其他好文 时间:
2014-08-09 00:13:56
阅读次数:
300
冒泡排序:#include #include #include #define N 100000#define M 100000void show_arr(int * a,int n){ int i; for(i = 0; i a[j+1]) { temp = a[j]; a[j] = a[j+1]...
分类:
其他好文 时间:
2014-08-09 00:00:36
阅读次数:
357
//1、输入一个数,将其每一位分离,并保存如一个数组//2、判断数组最后录入的一位是第几位//3、循环判断是否满足回问数的要求#includeusing namespace std;int main(){ int n,temp; int k=0; int a[20]; cou...
分类:
其他好文 时间:
2014-08-08 23:40:46
阅读次数:
658
1 递归,很简单
代码:
#include
using namespace std;
typedef struct node{
int data;
struct node * pNext;
}Node ,*pNode;
void createNode(pNode & pHead){
int temp;
scanf("%d",&temp);
pNode p,q;
boo...
分类:
其他好文 时间:
2014-08-08 21:28:56
阅读次数:
314