require ’socket‘ require ’luasql.mysql' 上述返回结果都是正常 但是执行 env = luasql.mysql(),报错: stdin:1: attempt to index a nil value (global 'luasql')stack traceback: stdin:1: in main chunk [C]: in ? 解决方法: luasql= require ‘luasql.mysql' env = luasql.mysql()或env =…
在自己程序里调用Lua脚本print(xxx) 报出attempt to call a nil value (global 'print')错误 解决方法: luaopen_base(L); 或者 luaL_openlibs(L);…
Lua: getting started http://www.lua.org/start.html#learning Building from source Lua is very easy to build and install. Just download it and follow theinstructions in the package. Here is a simple terminal session that downloads the current release o…
原因: 不是这个原因,也不是那个原因,而是采用了中文路径, 把comder 整个搬到其他目录就行了…
在ITPUB 论坛上看到的一个帖子,很不错.根据论坛的帖子重做整理了一下. 原文链接如下: alter index rebuild online引发的血案 http://www.itpub.net/thread-1445427-1-1.html 一. 官网说明 在MOS 上的一篇文章讲到了rebuild online 和offline的区别: Index Rebuild Is Hanging Or Taking Too Long [ID 272762.1] Symptoms:========= …
oracle index build online与offline测试环境为oracle 11.2.0.4 --sql test SQL> conn test/test )); begin .. loop insert into test.rb_test values(i,'ok'); commit; end loop; end; / SQL> select count(*) from test.rb_test; COUNT(*) ---------- SQL> create index…
关于分区技术---索引 Index 一.   分区索引分类: 本地前缀分区索引(local prefixedpartitioned index) 全局分区索引(global partitionedindex) 本地非前缀分区索引(localnon-prefixed partitioned index) 1.1  表和索引的组合: 第一种:表和索引都不分区 最简单的方式  就是常见的索引 第二种:表分区了,但索引没分区 这导致了:“我们已经做了分区表了,怎么性能没有提高?”的主要原因之一. 在很多…
ASP.Net MVC 中配置Route的时候可以设置一个默认的Route. 比如我要在输入http://localhost的时候默认进入http://localhost/home/index.可以在Global.asax中这么配置: routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = &qu…
来源于: Partitioned Indexes: Global, Local, Prefixed and Non-Prefixed (文档 ID 69374.1) APPLIES TO: Oracle Database - Enterprise Edition - Version 8.0.3.0 and later Information in this document applies to any platform. PURPOSE To differentiate between typ…
现象:lostack启动正常,logstack收集输入redis数据,输出到elasticsearch写入失败 提示:去建索引 的时候elasticsearch返回404 [2019-11-12T11:37:29,009][WARN ][logstash.outputs.elasticsearch][main] Could not index event to Elasticsearch. {:status=>404, :action=>["index", {:_id=&g…
1.简介 该软件包可以安装和更新lua的第三方模块. 2.下载地址 请在 http://luarocks.org/releases/ 页面选择需要的软件包. wget http://luarocks.org/releases/luarocks-2.1.0.tar.gz 3.安装 tar -zxvf luarocks-2.1.0.tar.gz cd luarocks-2.1.0 ./configure --prefix=/usr/local/luarocks make build make ins…
协同程序与线程差不多,也就是一条执行序列,拥有自己独立的栈,局部变量和指令指针,同时又与其它协同程序共享全局变量和其它大部分东西.线程与协同程序的主要区别在于,一个具有多线程的程序可以同时运行几个线程,而协同程序却需要彼此协作地运行.就是说,一个具有多个协同程序的程序在任何时刻只能运行一个协同程序,并且正在运行的协同程序只会在其显示地挂起时,它的执行才会暂停. 一. lua协程函数概览 方法 描述 coroutine.create() 创建coroutine,返回coroutine, 参数是一个…
深度学习框架 Torch 7 问题笔记 1. 尝试第一个 CNN 的 torch版本, 代码如下: -- We now have 5 steps left to do in training our first torch neural network -- 1. Load and normalize data -- 2. Define Neural Network -- 3. Define Loss function -- 4. Train network on training data -…
首先,先来一段在lua创建一个类与对象的代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Class = {} Class.__index = Class   function Class:new(x,y)     local temp = {}     setmetatable(temp, Class)     temp.x = x     temp.y = y     return temp end   function Class:tes…
Introduction From a running C program, you can call a Lua script. The C program can pass arguments to the Lua script, and the Lua script can pass back a return. The Lua script can serve to initialize the C program, or the Lua script can install a cal…
uLua&SimpleFramework入门视频教程网盘地址 视频教程地址 http://pan.baidu.com/s/1gd8fG4N游戏框架地址 https://github.com/jarjin游戏案例地址 http://www.ulua.org/showcase.html ulua群里的一些资料,转过来方面查看   ulua学习顺序.请根据自身了解的知识入座. 初级:SimpleFramework框架 中级:ulua插件.cstolua 高级:底层库编译. 框架的角色定位分为2种, 第…
昨天遇到另外一位独立游戏开发人员,所以多聊了一会,然后-然后就没有看书了.(小若:借口!借口! ) 今天来聊聊错误处理吧.只是毕竟这仅仅是前面的章节.书上的内容似乎有点一笔带过的味道. 没关系,简单更好~ 笨木头花心贡献,哈?花心?不,是用心~ 转载请注明,原文地址: http://www.benmutou.com/archives/1728 文章来源:笨木头与游戏开发 1.红色警报--error 我们应该能常常看到相似下面的错误信息: [LUA-print] LUA ERROR: [strin…
Summary on deep learning framework --- Torch7  2018-07-22 21:30:28 1. 尝试第一个 CNN 的 torch版本, 代码如下: -- We now have 5 steps left to do in training our first torch neural network -- 1. Load and normalize data -- 2. Define Neural Network -- 3. Define Loss…
替同事做了个洛奇英雄传自动染色程序,关于屏幕取色的. 因为里面他对颜色的要求比较复杂,改动也比较大,于是我让他把逻辑写在 lua 脚本里面. uses LUA, LUALIB; function lua_CheckColor(r,g,b:Integer):Boolean; var Lua : TLua; begin Lua := TLua.Create; luaopen_debug(LuaInstance); //如果要使用debug库 //  luaopen_io(LuaInstance);…
前言 IOS不能热更新,不是因为不能用反射,是因为System.Reflection.Assembly.Load 无法使用System.Reflection.Emit 无法使用System.CodeDom.Compiler 无法使用这三个不能用,就把传统dotnet动态路径坑死了为啥“这三个不能用,就把传统dotnet动态路径坑死了”呢动态载入dll或者cs的方法就这几个, IOS 下不能动态载入dll或者cs 文件,已经编译进去的没事.=============================…
首先,先来一段在lua创建一个类与对象的代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Class = {} Class.__index = Class   function Class:new(x,y)     local temp = {}     setmetatable(temp, Class)     temp.x = x     temp.y = y     return temp end   function Class:tes…
Programming in LuaCopyright ® 2005, Translation Team, www.luachina.net Programming in LuaProgramming in Lua作者:Roberto Ierusalimschy翻译:www.luachina.netSimple is beautifulCopyright ® 2005, Translation Team, www.luachina.net Programming in Luai版权声明 <Pro…
1 简介 2 语法 2.1 语法约定 2.1.1 保留关键字 2.1.2 操作符 2.1.3 字符串定义 2.2 值与类型 2.2.1 强制转换 2.3 变量 2.3.1 索引 2.3.2 环境表 2.4 语句 | statement 2.4.1 语句组 | chuncks 2.4.2 语句块 | blocks 2.4.3 赋值 | assignment 2.4.4 控制结构 2.4.5 For 循环 2.5 表达式 2.5.1 数学运算操作符 2.5.2 比较操作符 2.5.3 逻辑操作符 2…
//这是一篇lua与C++交互的情景测试 #include <lua.hpp> #include <lauxlib.h> #include <lualib.h> #include <string.h> #include <limits.h> #pragma region not_importent_ static void stackDump (lua_State *L) { int i; int top = lua_gettop(L); ;i&…
class Array Arrays are ordered, integer-indexed collections of any object. Array indexing starts at 0, as in C or Java. A negative index is assumed to be relative to the end of the array—that is, an index of -1 indicates the last element of the array…
上一篇文章给了一个面向对象的方案,美中不足的是没有析构函数 Destructor,那么这一次就给它加上. 既然是析构,那么就是在对象被销毁之前做该做的事情,lua 5.1 的 userdata 可以给其 metatable 增加一个 __gc 域,指定一个函数,将会在被回收时调用,这个 __gc 只能用于 userdata,普遍的 table 不支持:到了 lua 5.2 以后,官方支持了给予普通 table 的 metatable 增加 __gc 域,可以在回收前被回调:具体细节可以参考对应版…
在工作中使用lua也有一年了,代码也写了不少,踩过不少坑,这里记录一下. table.sort table.sort是lua自带的排序函数,数据量小时,也还是不错的.不过要注意你传入的compare函数.例如: ,,,,,,, } table.sort( tb,function(a,b) return a>=b end ) 上面的代码够简单了,但是你运行起来,却是报错了. Program starting as '"D:\programs\ZeroBraneStudio\bin\lua53…
Runtime学习 -- weak应用源码学习   Runtime源码分析,带你了解OC实现过程.其中参考了大量的大神的代码以及文献,里面也有个人的见解,欢迎拍砖,欢迎交流. 两种常见使用场景 /// weak属性 @interface XX : XX @property(nonatomic,weak) Type* weakPtr; @end /// 代码块中使用 { /// 使用__weak __weak Type* weakPtr = [[SomeObject alloc] init]; }…
Lua的函数调用和协程中,栈的变化情况 1. lua_call / lua_pcall   对于这两个函数,对栈底是没有影响的--调用的时候,参数会被从栈中移除,当函数返 回的时候,其返回值会从函数处开始压入,可以通过新的栈顶减去旧的栈顶得到返回值数 量.   2. lua_yield   对 Lua 函数来说, yield相当于只是在调用一个函数,对C函数也是这样.yield的参数 是返回值的数量,这些返回值会被返回给resume,见下.   2. lua_resume   resume是最复…
[1]lua语言中完整的三目运算符 完整三目运算符形式:(a and {b} or {c})[1] [2]分析原因 大部分C或C++程序员经常会用到三目运算符(三元运算符),形如 a ? b : c; 的逻辑,即a为真,表达式值为b,否则表达式值为c. 这样的逻辑在写lua的时候也常常需要用到,于是有人发明了形如 a and b or c 这种写法,下面来先来分析一下这个表达式的问题: Lua语言中的逻辑操作符有and.or和not.所有的逻辑操作符将 false 或 nil 视为假,而将除此之…