local db = 'lablua' require "luasql.mysql" require "orbit.model" local env = luasql.mysql() local conn = env:connect(db, "root", "password") local mapper = orbit.model.new("toycms_", conn, "mysql") -- Table post local t = mapper:new('post') -- Record 1 local rec = { ["id"] = 1, ["external_url"] = "", ["body"] = "

About

\ \

Lablua is a research lab at PUC-Rio, affiliated with its\ Computer Science Department. It is dedicated to research\ about programming languages, with emphasis on research involving the Lua\ language. Lablua was founded on May 2004 by Prof. Roberto Ierusalimschy.\ Since then its members have produced one PhD thesis and two MSc dissertations.

\ \

Lua is a scripting language not totally unlike Tcl, Perl, or Python. Like Tcl, Lua is an \"embedded language\", in the sense that embedding the interpreter into your program is a trivial task, and it is very easy to interface Lua with other languages like C, C++, or even Fortran. Like Python, Lua has a clear and intuitive syntax. Like all those three, Lua is an interpreted language with dynamic typing, and with several reflexive facilities.

\ \

In these pages you can find information about current and past projects, publications and members. Please\ follow the links above to go to the other sections of the web site.

\ \

Contact

\ \

Lablua is situated at PUC-Rio's campus, near the Cardeal Leme building. Prof. Ierusalimschy's contact\ information is in his web page. You can also contact\ Lablua by phone: 55-21-3527-1497 Ext. 4523.

", ["published_at"] = 1183576020, ["image"] = "", ["title"] = "Home Page", ["comment_status"] = "closed", ["section_id"] = 1, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 2 local rec = { ["id"] = 2, ["external_url"] = "http://www.lua.org", ["body"] = "", ["published_at"] = 1183576020, ["image"] = "", ["title"] = "Lua.org", ["comment_status"] = "closed", ["section_id"] = 5, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 3 local rec = { ["id"] = 3, ["external_url"] = "http://luaforge.net/", ["body"] = "", ["published_at"] = 1183489980, ["image"] = "", ["title"] = "Luaforge", ["comment_status"] = "closed", ["section_id"] = 5, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 4 local rec = { ["id"] = 4, ["external_url"] = "http://www.lua.inf.puc-rio.br/luaclr", ["body"] = "", ["published_at"] = 1180984800, ["image"] = "", ["title"] = "LuaCLR", ["comment_status"] = "closed", ["section_id"] = 2, ["published"] = true, ["abstract"] = "

LuaCLR is a newer implementation of\ Lua on the CLR that targets Lua 5.1 and compiles from \ source (without using the Lua parser and lexer).

", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 5 local rec = { ["id"] = 5, ["external_url"] = "", ["body"] = "

libscript

\ \

\ libscript is a plugin-based library designed to add\ language-independent extensibility to applications.\

\ \

\ It allows to decouple an application from the virtual machines provided by the\ various scripting languages. The main library, libscript, is a thin layer that provides a\ language-independent scripting API, allowing the application to register its\ functions and invoke code to be performed. Libscript then invokes the\ appropriate plugin (libscript-python, libscript-ruby, libscript-lua, etc.)\ to run the code. This way, the application can support all those scripting\ languages without adding each of them as a dependency.\

\ \

\ libscript was developed by Hisham Muhammad as a case study for\ his MSc dissertation at PUC-RIO.\

\ \

For more information, please go the the Sourceforge page.

\ \ ", ["published_at"] = 1183576860, ["image"] = "", ["title"] = "libscript", ["comment_status"] = "closed", ["section_id"] = 2, ["published"] = true, ["abstract"] = "

libscript is a plugin-based library designed to add language-independent\ extensibility to applications.

", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 6 local rec = { ["id"] = 6, ["external_url"] = "", ["body"] = "

LuaDec, Lua bytecode decompiler

\ \

Overview

\ \

LuaDec is a decompiler for the Lua language. It takes compiled Lua bytecodes and attempts to produce equivalent\ Lua source code on standard output. It targets Lua 5.0.2.

\ \ \

\ The decompiler performs two passes. The first pass is considered a \"preliminary\ pass\". Only two actions are performed: addresses of backward jumps are gathered\ for while constructs, and variables referenced by CLOSE\ \ instructions are taken note of in order to identify the point where explicit\ do blocks should be opened.\

\

\ The actual decompilation takes place in the second, \"main pass\". In this pass,\ the instructions are symbolically interpreted. As functions are traversed\ recursively, the symbolic content of registers are kept track of, as well as\ a few additional data structures: two register stacks, one for \"variable\ registers\" (registers currently allocated for variables) one for \"temporary\ registers\" (registers holding temporary values); and a list of boolean conditions. \

\

\ Instructions like ADD and MOVE combine the string\ representation of symbols and move them around in registers. Emission of actual\ statements is delayed until the temporaries stack is empty, so that constructs\ like a,b=b,a are processed correctly. \ \

\

\ The list of boolean conditions accumulate pairs of relational operators (or\ TESTs and jumps). The translation of a list into a boolean expression\ is done in three stages. In the first stage, jump addresses are checked to identify\ \"then\" and \"else\" addresses and to break the list into smaller lists in the case of\ nested if statements. In the second stage, the relations between the\ jumps is analyzed serially to devise a parenthization scheme. In the third scheme,\ taking into account the parenthization and an 'inversion' flag (used to tell\ \"jump-if-true\" from \"jump-if-false\" expressions), the expression is printed,\ recursively.\

\

\ Two forms of \"backpatching\" are used in the main processing pass: boolean conditions\ for while constructs are inserted in the marked addresses (as noted in\ the first pass), and do blocks are added as necessary, according to the\ liveness information of local variables.\ \

\

LuaDec is written by Hisham Muhammad, and is licensed\ under the same terms as Lua. Windows binaries contributed by Fabio Mascarenhas.

\ \

Status

\ \

\ LuaDec, in its current form, is not a complete decompiler. It does\ succeed in decompiling most of the Lua constructs, so it could be used as\ a tool to aid in retrieving lost sources.\

\ \

\ The situations where LuaDec \"get it wrong\" are usually related to deciding\ whether a sequence of relational constructs including TEST operators\ are part of an assignment or an if construct. Also, the \"single pass\"\ nature of the symbolic interpreter fails at some corner cases where there simply\ is not enough information in the sequence of operator/jump pairs to identify what\ are the \"then\" and \"else\" addresses. This is an example of such a case:\

\ \
\
1       [2]     LOADNIL         0 2 0\
2       [3]     JMP             0 16    ; to 19\
3       [4]     EQ              0 1 250 ; - 2\
4       [4]     JMP             0 2     ; to 7\
5       [4]     TEST            2 2 1\
6       [4]     JMP             0 5     ; to 12\
7       [4]     EQ              0 1 251 ; - 3\
8       [4]     JMP             0 3     ; to 12\
9       [4]     LOADK           3 2     ; 1\
10      [4]     TEST            3 3 1\
11      [4]     JMP             0 0     ; to 12\
12      [6]     LOADK           0 2     ; 1\
13      [7]     JMP             0 7     ; to 21\
14      [8]     LOADK           0 0     ; 2\
15      [8]     JMP             0 3     ; to 19\
16      [10]    LOADK           0 1     ; 3\
17      [11]    JMP             0 3     ; to 21\
18      [12]    LOADK           0 4     ; 4\
19      [3]     TEST            1 1 1\
20      [3]     JMP             0 -18   ; to 3\
21      [14]    RETURN          0 1 0\
\ \
\
local a, x, y\
while x do\
   if ((x==2) and y) or ((x==3) and 1) or 0\
\
   then\
      a = 1\
   do break end\
      a = 2\
   else\
      a = 3\
   do break end\
      a = 4\
   end\
   a = 5\
end\
\ \

\ Notice that there is no reference to the \"else\" address in the highlighted sequence.\ Only with a more sophisticated block analysis it would be possible to identify the\ varying purposes of the JMP instructions at addresses 13, 15 and 17.\

\ \

\ For illustrational purposes, here are the results of running LuaDec on the\ bytecodes generated by the Lua demos included in the test/ subdirectory\ of the official Lua distribution, as of version 0.4.\

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
bisect.lua - works
cf.lua - works
echo.lua - works
env.lua - works
factorial.lua - works
fibfor.lua - works
fib.lua - works
globals.lua - works
hello.lua - works
life.lua - works
luac.lua - works
printf.lua - works
readonly.lua - works
sieve.lua - works
sort.lua - works
table.lua - works
trace-calls.lua - fails assertion works (fixed in 0.4)
trace-globals.lua - works
undefined.lua - works
xd.lua - works
\ \

\ \

Running it

\ \

\ To try out LuaDec:\

\ \
\
make\
bin/luac test/life.lua\
bin/luadec luac.out > newlife.lua\
bin/lua newlife.lua\
\ \

\ LuaDec includes a -d flag, which displays the progress\ of the symbolic interpretation: for each bytecode, the variable stacks\ and the code generated so far are shown.\

\ \

Operation modes

\ \

\ In its default operation mode, LuaDec recursively processes the program functions,\ starting from the outmost chunk (\"main\"). When LuaDec detects a decompilation error\ (by doing sanity checks on its internal data structures), Luadec outputs the portion\ of the function decompiled so far, and resumes decompilation in the outer closure.\

\ \

\ There is an alternative operation mode, set with the -f flag,\ where all functions are decompiled separately. This does not generate a .lua file\ structured like the original program, but it is useful in the cases where a\ decompilation error makes a closure declaration \"unreachable\" in the default\ operation mode. This allows a larger portion of the sources to be restored in\ the event of errors.\

\ \

Download and Feedback

\ \

To download LuaDec, and send any comments, questions or bug reports, please go to the LuaForge page.

\ \ ", ["published_at"] = 1183576920, ["image"] = "", ["title"] = "LuaDec", ["comment_status"] = "closed", ["section_id"] = 2, ["published"] = true, ["abstract"] = "

LuaDec decompiles Lua bytecodes, reconstructing the original source code (or an approximation\ of it.

", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 7 local rec = { ["id"] = 7, ["external_url"] = "", ["body"] = "

Lua2IL, a Lua to CIL compiler

\ \

Overview

\ \

Lua2IL compiles scripts written in the Lua language to\ Common Language Infrastructure (CLI) assemblies. The compiler generates pure managed Common\ Intermediate Language (CIL) code. Besides compiling scripts to CIL, Lua2IL also lets them\ interface with CLI objects written in other languages.

\ \

For an interpreted language, Lua2IL generates efficient code, with the code being\ about three times faster than similar JScript code compiled by the Microsoft JScript.NET\ compiler bundled with .NET Framework 1.1 (without type optimizations).

\ \

A paper about the Lua2IL compiler was published in a special edition of the\ Journal of Universal Computer Science. You can read the paper\ here.

\ \

Lua2IL is designed and implemented by Fabio Mascarenhas.

\ \

Download

\ \

The compiler is a prototype. It compiles the full Lua 5.0 language, but doesn't include\ most of the Lua standard library. You can download Lua2IL here.

\ \

Feedback

\ \

Please send questions or comments to Fabio Mascarenhas.

\ \ ", ["published_at"] = 1183576980, ["image"] = "", ["title"] = "Lua2IL", ["comment_status"] = "closed", ["section_id"] = 2, ["published"] = true, ["abstract"] = "

Lua2IL is a prototype of an implementation of the Lua language on the CLR. It converts\ Lua bytecodes to the CLR intermediate language, so Lua scripts can run on the CLR without\ the Lua interpreter.

", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 8 local rec = { ["id"] = 8, ["external_url"] = "", ["body"] = "

LuaInterface: Scripting CLR objects with Lua

\ \

Overview

\ \

LuaInterface is a library for brdging the\ Lua language and Microsoft .NET platform's\ Common Language Runtime \ (CLR). LuaInterface is a full consumer of the Common Language Specification (CLS),\ so Lua scripts can use LuaInterface to instantiate CLR objects, access their properties,\ call their methods, and even handle their events with Lua functions. Any CLR program\ can also use LuaInterface to run Lua scripts and modify the scripts' environment. This is\ a short, working example of LuaInterface in action (it shows a window, with two buttons,\ on the screen):

\ \
\
    require(\"luanet\")\
    \
    Form = luanet.System.Windows.Forms.Form\
    Button = luanet.System.Windows.Forms.Button\
    Point = luanet.System.Drawing.Point\
    \
    mainForm = Form()\
    buttonOk = Button()\
    buttonCancel = Button()\
    \
    buttonOk.Text = \"Ok\"\
    buttonCancel.Text = \"Cancel\"\
    buttonOk.Location = Point(10,10)\
    buttonCancel.Location = Point(buttonOk.Left, buttonOk.Height +\
      buttonOk.Top + 10)\
    mainForm.Controls:Add(buttonOk)\
    mainForm.Controls:Add(buttonCancel)\
    mainForm.StartPosition = \
      luanet.System.Windows.Forms.FormStartPosition.CenterScreen\
    \
    function handleMouseUp(sender,args)\
      print(sender:ToString() .. \" MouseUp!\")\
    end\
    \
    handlerUp = buttonOk.MouseUp:Add(handleMouseUp)\
    handlerClick = buttonCancel.Click:Add(os.exit)\
    \
    mainForm:ShowDialog()\
\ \

You can find more about LuaInterface by reading this paper,\ published in the proceedings of the 8th Brazilian Symposium on Programming Languages, or\ download the library and try it out.

\ \

Fabio Mascarenhas did the initial design and implementation of LuaInterface, and it is now being actively maintained by Kevin Hester.

\ \

Download

\ \

LuaInterface is free software (MIT license), and can be downloaded from its LuaForge page. There are versions for Lua 5.1 and 5.0, and for use in versions 1.1 and 2.0 of the CLR.

\ \ \

Feedback

\ \

Please send comments, suggestions or bug reports through the LuaForge page.

\ \ ", ["published_at"] = 1183577040, ["image"] = "", ["title"] = "LuaInterface", ["comment_status"] = "closed", ["section_id"] = 2, ["published"] = true, ["abstract"] = "

LuaInterface is a bridge between Lua and the Common Language Runtime. It lets Lua\ scripts instantiate and use CLR objects, and makes it easier for CLR programs to embed\ the Lua Interpreter.

", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 9 local rec = { ["id"] = 9, ["external_url"] = "", ["body"] = "

Lua.NET: Integrating Lua with the CLI

\ \

Lua is a scripting language not totally unlike \ Tcl, Perl, or Python. Like Tcl, Lua is an \"embedded language\", in the sense that embedding \ the interpreter into your\ program is a trivial task, and it is very easy to interface Lua with other languages\ like C, C++, or even Fortran. Like Python, Lua has a clear and intuitive syntax. \ Like all those three, Lua is an interpreted language with dynamic typing, and with \ several reflexive facilities.

\ \ \

What sets Lua apart from those languages is its portability, simplicity, and small size. \ Lua is written in ANSI C, and runs without modifications in almost any platform (MS-DOS, \ all versions of Windows, all flavors of Unix, plus X-Box, PlayStation II, OS/2, BeOS, \ EPOC, etc.). The whole program lua.exe has less than 200 Kbytes. Its simplicity led other \ groups to adopt Lua as a scripting language for other scripting languages (see, for \ instance, Ruby-Lua).

\ \

Currently, Lua has a strong presence whenever programmers need a light, efficient,\ and portable language. It is being used by some tens of thousands programmers around \ the world, both in research and in industrial projects. Lua has been successfully \ used in games (e.g. Grim Fandango, Escape from Monkey Island, MK2, Baldur's Gate), \ in robots (e.g. Crazy Ivan, that won the Danish RoboCup in 2000 and 2001), and \ several other applications (e.g. a hot-swappable Ethernet switch (CPC4400), a genetic \ sequence visualization system (GUPPY), \"The most Linux on one floppy disk\" (tomsrtbt)). \ An extended list of applications using Lua can be found \ here.

\ \

The Lua.NET project integrates Lua with the \ Common Language Infrastructure,\ a framework for language interoperability. \ This integration allows Lua \ to act both as a \"client\" language and as a \"server\" language, although with a\ limited capacity for the latter. As a client, Lua scripts can access components available \ through the CLI. As a server, Lua scripts can implement new components accessible by \ other languages integrated with the CLI.

\ \

Because Lua is an interpreted language with dynamic typing, its integration with \ the CLI demands a dynamic nature. Lua.NET employs two approaches for this integration. \ The first uses the same techniques used to implement LuaOrb, \ a scripting tool that can access and implement CORBA, COM and Java \ components. The approach is implemented by the LuaInterface library.

\ \ \

The second approach compiles Lua to the CLI's Common Intermediate \ Language, instead of its own bytecode representation. This approach is implemented\ by the Lua2IL compiler.

\ \

The authors of the Lua.NET project are Roberto Ierusalimschy,\ Renato Cequeira and Fabio Mascarenhas.\ The project is sponsored by Microsoft Research\ \ and CAPES.

\ \

Publications

\ \

Fabio Mascarenhas, Roberto Ierusalimschy. LuaInterface: Scripting the .NET CLR with Lua. Journal of Universal Computer Science, 10(7):892-908, July 2004.

\ \

Fabio Mascarenhas, Roberto Ierusalimschy. Running Lua Scripts on the CLR Through Bytecode Translation. Due for publication in a special edition of the Journal of Universal Computer Science.

\ \ ", ["published_at"] = 1183663440, ["image"] = "", ["title"] = "Lua.NET", ["comment_status"] = "closed", ["section_id"] = 2, ["published"] = true, ["abstract"] = "

Lua.NET was a project sponsored by Microsoft Research\ to integrate Lua with the Common Language Runtime. It generated both LuaInterface and\ Lua2IL.

", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 10 local rec = { ["id"] = 10, ["external_url"] = "", ["body"] = "

Running Lua scripts on the CLR through bytecode translation, by Fabio Mascarenhas and Roberto Ierusalimschy. Journal of Universal Computer Science 11 #7 (2005) 1275-1290.

", ["published_at"] = 1183577760, ["image"] = "", ["title"] = "Running Lua scripts on the CLR through bytecode translation", ["comment_status"] = "closed", ["section_id"] = 6, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 11 local rec = { ["id"] = 11, ["external_url"] = "", ["body"] = "

Coroutines in Lua, by Ana Lúcia de Moura, Noemi Rodriguez, and Roberto Ierusalimschy. Journal of Universal Computer Science 10 #7 (2004) 910-925.

", ["published_at"] = 1183491420, ["image"] = "", ["title"] = "Coroutines in Lua", ["comment_status"] = "closed", ["section_id"] = 6, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 12 local rec = { ["id"] = 12, ["external_url"] = "", ["body"] = "

LuaInterface: Scripting .NET CLR with Lua, by Fabio Mascarenhas and Roberto Ierusalimschy. Journal of Universal Computer Science 10 #7 (2004) 892-909.

", ["published_at"] = 1183405020, ["image"] = "", ["title"] = "LuaInterface: Scripting .NET CLR with Lua", ["comment_status"] = "closed", ["section_id"] = 6, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 13 local rec = { ["id"] = 13, ["external_url"] = "", ["body"] = "

Revisitando co-rotinas, by Ana Lúcia de Moura. Ph.D. thesis, Department of Computer Science, PUC-Rio, Sep 2004.

", ["published_at"] = 1183577880, ["image"] = "", ["title"] = "Revisitando co-rotinas", ["comment_status"] = "closed", ["section_id"] = 7, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 14 local rec = { ["id"] = 14, ["external_url"] = "", ["body"] = "

Estudo sobre APIs de Linguagens de Script, by Hisham Muhammad. M.Sc. dissertation, Department of Computer Science, PUC-Rio, Aug 2006.

", ["published_at"] = 1183491480, ["image"] = "", ["title"] = "Estudo sobre APIs de Linguagens de Script", ["comment_status"] = "closed", ["section_id"] = 7, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 15 local rec = { ["id"] = 15, ["external_url"] = "", ["body"] = "

Integração entre a linguagem Lua e o Common Language Runtime, by Fabio Mascarenhas. M.Sc. dissertation, Department of Computer Science, PUC-Rio, Mar 2004.", ["published_at"] = 1183405140, ["image"] = "", ["title"] = "Integração entre a linguagem Lua e o Common Language Runtime", ["comment_status"] = "closed", ["section_id"] = 7, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 16 local rec = { ["id"] = 16, ["external_url"] = "", ["body"] = "

A study on scripting language APIs, by Hisham Muhammad. M.Sc. dissertation (english translation), Department of Computer Science, PUC-Rio, Aug 2006.

", ["published_at"] = 1183577940, ["image"] = "", ["title"] = "A study on scripting language APIs", ["comment_status"] = "closed", ["section_id"] = 8, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 17 local rec = { ["id"] = 17, ["external_url"] = "", ["body"] = "

Roberto Ierusalimschy, Associate Professor, Computer Science\ Department, PUC-Rio.

", ["published_at"] = 1183578360, ["image"] = "", ["title"] = "Roberto Ierusalimschy", ["comment_status"] = "closed", ["section_id"] = 9, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 18 local rec = { ["id"] = 18, ["external_url"] = "", ["body"] = "

Fabio Mascarenhas, PhD Student, Computer Science Department, PUC-Rio.

", ["published_at"] = 1183578360, ["image"] = "", ["title"] = "Fabio Mascarenhas", ["comment_status"] = "closed", ["section_id"] = 10, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 19 local rec = { ["id"] = 19, ["external_url"] = "", ["body"] = "

Sérgio Medeiros, PhD Student, Computer Science Department, PUC-Rio.

", ["published_at"] = 1183491960, ["image"] = "", ["title"] = "Sérgio Medeiros", ["comment_status"] = "closed", ["section_id"] = 10, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 20 local rec = { ["id"] = 20, ["external_url"] = "", ["body"] = "

Alexandra Barros, MSc Student, Computer Science Department, PUC-Rio.

", ["published_at"] = 1183578420, ["image"] = "", ["title"] = "Alexandra Barros", ["comment_status"] = "closed", ["section_id"] = 11, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 21 local rec = { ["id"] = 21, ["external_url"] = "", ["body"] = "

Hisham Muhammad, MSc Computer Science, PUC-Rio.

", ["published_at"] = 1183492020, ["image"] = "", ["title"] = "Hisham Muhammad", ["comment_status"] = "closed", ["section_id"] = 11, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Record 22 local rec = { ["id"] = 22, ["external_url"] = "", ["body"] = "

Ana Lúcia de Moura, PhD Computer Science, PUC-Rio.

", ["published_at"] = 1183405620, ["image"] = "", ["title"] = "Ana Lúcia de Moura", ["comment_status"] = "closed", ["section_id"] = 11, ["published"] = true, ["abstract"] = "", ["user_id"] = 1} rec = t:new(rec) rec:save(true) -- Table comment local t = mapper:new('comment') -- Table user local t = mapper:new('user') -- Record 1 local rec = { ["id"] = 1, ["name"] = "Fabio Mascarenhas", ["login"] = "mascarenhas@acm.org", ["password"] = "password"} rec = t:new(rec) rec:save(true) -- Table section local t = mapper:new('section') -- Record 1 local rec = { ["id"] = 1, ["description"] = "", ["title"] = "Home", ["tag"] = "home"} rec = t:new(rec) rec:save(true) -- Record 2 local rec = { ["id"] = 2, ["description"] = "", ["title"] = "Projects", ["tag"] = "menu-projects"} rec = t:new(rec) rec:save(true) -- Record 3 local rec = { ["id"] = 3, ["description"] = "", ["title"] = "Publications", ["tag"] = "menu-publications"} rec = t:new(rec) rec:save(true) -- Record 4 local rec = { ["id"] = 4, ["description"] = "", ["title"] = "People", ["tag"] = "menu-people"} rec = t:new(rec) rec:save(true) -- Record 5 local rec = { ["id"] = 5, ["description"] = "", ["title"] = "Related Links", ["tag"] = "links"} rec = t:new(rec) rec:save(true) -- Record 6 local rec = { ["id"] = 6, ["description"] = "", ["title"] = "Papers", ["tag"] = "pubs-papers"} rec = t:new(rec) rec:save(true) -- Record 7 local rec = { ["id"] = 7, ["description"] = "", ["title"] = "Dissertations and Theses", ["tag"] = "pubs-theses"} rec = t:new(rec) rec:save(true) -- Record 8 local rec = { ["id"] = 8, ["description"] = "", ["title"] = "Drafts", ["tag"] = "pubs-drafts"} rec = t:new(rec) rec:save(true) -- Record 9 local rec = { ["id"] = 9, ["description"] = "", ["title"] = "Coordinator", ["tag"] = "people-coordinator"} rec = t:new(rec) rec:save(true) -- Record 10 local rec = { ["id"] = 10, ["description"] = "", ["title"] = "Current Members", ["tag"] = "people-current"} rec = t:new(rec) rec:save(true) -- Record 11 local rec = { ["id"] = 11, ["description"] = "", ["title"] = "Former Members", ["tag"] = "people-former"} rec = t:new(rec) rec:save(true)