|
Quiz Page lua The lua quiz has changed! We have replaced lua questions with answers! And from those answers you'll find further links to even more information - forums where you can ask questions, training courses, longer articles, and more. [link to quiz index] ...
If you really want the old quiz
questions, you can find them
here,
here,
here and
here ... and
with onward links to the possible answers to each question too.
Niche businesses in Melksham. From glass painting to Tcl and Lua courses. Melksham has a number of excellent shops and other establishments selling niche products and services - things that you won't find in other nearby towns or (in some cases) in any other towns at all. ...
Python or Lua - which should I use / learn?"Should I learn and use Python or Lua" - a question to me. The questioner was perceptive, knowing that he shouldn't try to learn lots of languages at the same time, and that he should always limit ...
Dark mornings, dog update, and Python and Lua courses before ChristmasIt's significantly darker each morning as we take Gypsy and Billy out for a morning walk. We're out well before sunrise now, which was at 07:29 on his first morning with us, it is at 08:04 today - ...
December courses - PHP, Python, Perl - and a weekend Lua courseLua is a powerful, fast, lightweight, embeddable scripting language. It's good and has a very open license so you can use it widely - even within your commercial products - at no cost. That's made ...
Metaclasses (Python) and Metatables (Lua)"A Metaclass (Python) or Metatable (Lua) adds extra code / data / behaviour to an object, table, or class."
What does that mean? It means that I can define a behavior that I want to be shared, that ...
Does a for loop evaluate its end condition once, or on every iteration?All the languages that we teach have a for loop or the equivalent, which is a clean way of repeating a block of code with a rising or falling index number. It's used in many circumstances - for ...
Tables as Objects in Lua - a gentle introduction to data driven programmingIn Lua, everything that's a collection is held in a table. During the Lua Course I have been giving this week, I set up a whole series of tables, object-like, to hold details of each station on the ...
Parallel but not really parallel. Moving game characters. Coroutines in Lua. Virtual World game programming involves moving many characters - both player controlled and automatic - in parallel. The movements of each character depend - to a greater or lesser extent - on the ...
Extra courses - Advanced PHP, MySQL and LuaHere are some extra dates for your diary ...
21st March - Object Oriented PHP (1 day) [link]
22nd and 23rd March - PHP Techniques Workshop (2 days) [link]
27th and 28th April - MySQL [link]
...
Lua, Tcl, Python; Worldwide training classesThe subjects we teach are used worldwide - there's just as much requirement to learn about Python in Salerno as there is in Swindon, about Tcl in Milwaukee as there is in Manchester, and about Lua in ...
Perl, Python, PHP, Lua, Linux, and more - and business hotel too. Menu for 2011Whar are our plans for 2011? "Steady as she goes", I think - a gentle year of building on all we've achieved in the past year, and all that has developed in the last six months. Our hotel at Well ...
Lua - variable function arguments and selectLua's select function allows you to look at the variable arguments to your current function. If you're going to be calling a function from different places with different numbers of parameters, you ...
Teaching Lua to a Perl advocateIt seems the rest of the class thinks I'll find Bill a tough case. Bill (not his real name) is a Perl fan - there's so much you can do, so shortly, in Perl. He's a great regular expression fan and ...
Making a Lua program run more than 10 times fasterI made an extraordinary claim on Thursday. One of my delegates had written a program that analyzed a huge data file in a Lua script, and it was taking over half an hour to run. "Give me five ...
Returning multiple values from a function - LuaDoes it strike you as odd that in many languages, functions can take in as many parameters as you like, but can only return one? Of course, you can return a single collection object (list, array, ...
__index and __newindex in Lua - metatable methodsWhen you call up an element in a table in Lua, it's like accessing an array element - and it works well. But you can go further by associating a metatable with a table - that's another table with a ...
Error trapping in Lua - no exceptions.Lua's a small language - it's about a twentieth of the size of most of the others I teach - so there isn't the space for the nicities of things like expection handling. But it does very nicely, ...
Lua MetatablesIn a recent article ([here]), I asked if Lua was an object oriented language - and I concluded that it supports the OO paradigm very well, even though it doesn't have keywords like "class", "private" ...
Is Lua an Object Oriented language?Lua isn't an object oriented languages in the sense that you define classes, create objects with a new method, define interfaces and declare variables to be private or protected ... but never the less ...
Lua tables - they are everythingIn PHP, it sometimes feels like the answer to every question is "there's a function to do that" and in Lua, it seems the answer is always "it's a table" or "use a table"!
I'm running a Lua course ...
A life lesson from the accuracy of numbers in Excel and LuaFloating point numbers aren't held EXACTLY in a computer's memory - they're held to a certain accuracy (number of significant figures or binary digits to be more accurante) after which they are ...
Dynamically formatting your results (Lua)Scenario: You're producing a short (text) table of results and you want to keep it reasonably small - not a great deal of white space, but the data in some of your columns differs dramatically from ...
Lua Classes - open enrolementAdvert - Extra Course!
I've just scheduled an extra Lua course - running from 19th (Thursday) to 22nd (Sunday) of November, on Lua. It's "last minute" which means that the group of delegates will be ...
Luac - getting lua to start fast by precompilingLuac is Lua's Compiler ... using "luac" you can turn your Lua program into a binary (executable) file. Covered on Installing Lua on our Lua Programming and Learning to program in Lua courses.
usage: ...
Lua examples - coroutines, error handling, objects, etcI have presented a bespoke Lua course over the last three days ... and it has lead me to some interesting new examples which I'm sharing here.
Object Orientation is more a way of thinking and coding ...
For loops in LuaAs an old Fortran programmer, I remember that a for loop was given a start point, an end point and a step ... and they had to be whole numbers (integers). Lua's for loops can be used that way, but ...
Lua Regular ExpressionsOK - don't believe the headline - Lua doesn't support "Regular expressions" but it does have pattern matching. Why? Because Lua is designed to have a small footprint, and a conventional Regular ...
Error Handling in Lua with assert and pcallWhen a function fails in lua, you'll often find that it return a nil value that you can check, or it returns two values, the second of which is an error status / message that tells you what went ...
A fresh example - objects the Lua wayOne of the requirements we often have in our web server log file analyses is to connect together a series of accesses from a single IP address into a "visit", and this formed an example on Tuesday's ...
Encapsulating shared code in a Lua moduleHave you ever written code like this?
seps = {" "," "," [",'] "','" '," ",' "','" "','"'}
Yes, I have ... in fact, that's code that I wrote on Tuesday during the Lua course; it's an indexed table of ...
Checking if the user has entered a number (Lua)In Lua, there's a difference between 0 and nil - and that means that you can easily code to ask your user to enter a number, testing the result and allowing him to enter zero as a legitimate value. ...
Passing multiple results back from a function - Lua, Python, etcHave you ever wondered why you can pass in as many parameters as you like to a function, but only return one? It seems rather unfair, doesn't it - especially as you may have lots of results.
In ...
Ternary operators alternatives - Perl and Lua lazy operators"If the gender is male, the answer is him, but if the gender is female, the answer is her". A common situation in programming - [is/are], [him/her], [yes/no], [child/children], [ice/water/steam], ...
Finding literals rather than patterns in LuaLua's string.find looks for a PATTERN ... it's not as big an sophisticated as a regular expression match (but then it's got nothing like as big a footprint!), but neither is it a literal match. So ...
Dot, dot, dot in Lua - variable length parameter listsLua functions can take any number of parameters - the ... (dot,dot,dot) table given as a parameter 'soaking up' all remaining parameters into the indexed section of the table, rather this "*" in front ...
The indexed and hashed parts of a Lua tableA Lua table contains both a sequentially indexed section and a hash keyed section (and a few other things too). When you sort the table, you sort only the index keyed section, when you use ipairs you ...
Automatically initialising Lua variables the first timeIn Lua, you need to initialise variables before you perform arithmetic on them, but you CAN test them (and if they don't exist, they will return false).
For example, this code initialises a variable ...
Reading a data file and sensing EOF in LuaIn Lua, the standard table io includes an io.open code element that lets you open a file. This returns a userdata to you (looks like a table but isn't - it's a C accessible structure) from which you ...
Certification Revisted - LuaI happened upon a "should you be certified" thread relating to Lua while browsing for quite other Lua topics ... it's here, and the initial post appears to provide a reasonable, if admittedly tilted, ...
Graphics in Lua - an example using the gd libraryIn answer to the question "how would you generate graphics from Lua?" ... I would (personally) look at a binding to the gd library - http://luaforge.net/projects/lua-gd/ - as this is an excellent ...
|
|