Lua programming language
lua · 共 36 篇文章
How to create c extension for lua and pass complex structure step by step
Original link: http://sunxiunan.com/?p=1498 You could download the project from http://groups.google.com/group/lua5/web/luautil.rar At first, create a windows dll application. The IDE I used is VC2008. I suggest you download and install the " Lua for windows " from luaforge.net, it contains most us…
2009-11-24 11:00 · 评论(0)
Change Ugly code in our project
following code happens many times in our project: xxxxxxx; #if defined _ETHERNET tmp1String = deviceKey.GetAddressAsString(); #else tmp1String = deviceKey.GetNodeAsString(); #endif yyyyyyy; It should be changed like: CString GetAddrString(DeviceKey& deviceKey) { CString tmp1String; #if defined _ETH…
2009-11-23 17:48 · 评论(0)
Lua runtime code reading Lua运行期源代码分析阅读
http://sunxiunan.com/?p=1477 You could download the project for VC2008 in http://groups.google.com/group/lua5/web/lua_vc2008.rar The project will use parameter like "c:\test.lua", and the lua script like above image. The code starting point is pmain(). lua parser will parse the code file, and use L…
2009-11-19 13:25 · 评论(0)
Google的Go编程语言使用初探
http://sunxiunan.com/?p=1463 Go编程语言是Google中一些大牛(尤其是有着plan9前科的大牛们)如Rob Pike,Ken Thomason这两位赫赫有名的程序高手、技术作家。 很多人认为Go编程语言有点像是C语言与Python的混血,在Golang主页上也清楚写着Go的祖先有C,有Pascal/Modula(也是C++的祖先)/Oberon,还有CSP这个语言,另外很多基础代码也来自Plan 9操作系统。 我是在一个Ubuntu9.10的虚拟机上试用的Go,大家可以跟着我的脚步一探Go的究竟。 1,准备 安装Go之前需要安装mercurial,这是Go的版…
2009-11-12 19:00 · 评论(28)
勿用屠龙来杀猪-论如何正确整合Lua与C++
http://sunxiunan.com/?p=1447 经常有人问到关于Lua的问题是“Lua如何能使用C++的成员变量?”“Lua如何调用C++类的成员函数?”“C++的复杂数据结构(如数组)如何传递进入Lua让Lua可以使用?” 这些问题之频繁,几乎每天都可以看到。问题的起源也很简单,这些提问者大多是C++程序员,公司需要使用Lua,他们就想如何能够“完美无缝”整合C++和Lua。 如果在谷歌中文(google.cn)搜索Lua关键字,第一页大概前五六个网址中会有云风的这篇文字《 Lua 不是 C++ 》,里面的结论部分十分精彩: 对于那些新接触 lua 的 C/C++ 程序员来说,我…
2009-11-09 12:41 · 评论(1)
谷歌拼音输入法支持lua编写api
lua利好消息,google拼音加入支持lua。 下载最新版本的谷歌拼音,就可以通过lua来扩展它的功能了。 api的帮助信息在这里能看到 http://www.google.com/ime/pinyin/api.html 安装完以后,在 c:\Documents and Settings\All Users\Application Data\Google\Google Pinyin 2\Extensions 可以找到一个base.lua,里面代码写的比较清楚了。 比如这个计算模式。 function Compute(input) local expr = "return " .. _Add…
2009-10-29 13:03 · 评论(6)
Lua code reading
Online Lua 5.1 source code browser Recommended reading order: lmathlib.c, lstrlib.c: get familiar with the external C API. Don't bother with the pattern matcher though. Just the easy functions. lapi.c: Check how the API is implemented internally. Only skim this to get a feeling for the code. Cross-…
2009-10-16 14:42 · 评论(0)
使用ironruby播放twitter的timeline
require "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" require "System.Speech, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" require "System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" wc = System::Net::WebClient.new cont…
2009-10-15 17:29 · 评论(0)
如果我来做软件(2)- You ain’t gonna need it
http://sunxiunan.com/?p=1333 闲逛javaeye论坛,发现一个很有趣的帖子《 面子驱动编程 》,里面的观点简单说就是:从客户需求出发,实事求是,面向用户(或者说面向需求)来做设计。 前面我写了一篇文字 如果我来做软件(1)- 评《走出软件作坊》 ,这里想写的是软件开发最重要的一个时期,也就是所谓的 需求分析阶段 。 在维基百科上是这样解释需求分析的: 在 软件工程 中, 需求分析 指的是在建立一个新的或改变一个现存的 电脑系统 时描写新系统的目的、范围、定义和功能时所要做的所有的工作。需求分析是软件工程中的一个关键过程。在这个过程中,系统分析员和软件工程师确定顾客…
2009-10-13 17:22 · 评论(0)
Lua 解析C++代码tokens简单函数
function get_tokens(str) local string = string local table = table local tokens = {} local stringbuffer = "" local numberbuffer = "" local previous_is_number = false local previous_is_string = false local previous_is_quote = false local has_process = false local is_X16mode = false for i = 1, #str d…
2009-09-25 10:15 · 评论(0)
简单的迅雷链接转换工具
http://bbs.luaer.cn/read-Lua-tid-861.html -------------------------------------------------- require ("wx") -- Lua 5.1+ base64 v3.0 (c) 2009 by Alex Kloss < alexthkloss@web.de > -- licensed under the terms of the LGPL2 -- character table string local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrs…
2009-09-17 09:11 · 评论(0)
MonoDevelop for windows
Installer for Windows - Unstable To run MonoDevelop on Windows you have to download and run the following installers: .NET Framework 3.5 (You may already have this installed) Download GTK# for .NET 2.12.9-2 (if you have older versions installed, please uninstall first) Download MonoDevelop 2.2 Beta…
2009-09-16 08:41 · 评论(0)
Lua调用微软DotNet framework
-- http://penlight.luaforge.net/packages/LuaInterface/ require "CLRPackage" import "System.Threading" import "System.Console" import "System.Math" import "System.Timers" -- http://msdn.microsoft.com/zh-cn/library/system.math.aspx Console.WriteLine("Sqrt(99) " .. Math.Sqrt(99)) Console.WriteLine("Lo…
2009-09-09 17:47 · 评论(1)
VC2008正确建立PDB文件
http://sunxiunan.com/?p=1300 刚写完 一个CST问题的教训 ,发现John Robbins大牛最近也写了一篇博客《 Correctly Creating Native C++ Release Build PDBs 》(正确地建立原生C++Release Build PDB文件),里面有不少说法跟我那篇文字近似。在这里再介绍一下John博客里面的大意。关于pdb文件的重要性,John也有另外一篇博客介绍 PDB Files: What Every Developer Must Know ,感兴趣的同学可以去看看。 1)最重要的一点,任何一个项目一定要build时生成…
2009-09-07 14:54 · 评论(0)
Lua for Windows v5.1.4.29 Released
We are proud to announce the next release of Lua for Windows (LfW). Read the changelog for more information. Enjoy. Homepage: http://luaforwindows.luaforge.net/ Description: Lua for Windows is a 'batteries included environment' for the Lua scripting language on Windows. Lua for Windows combines Lua…
2009-09-04 08:22 · 评论(0)