In 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" or "extends". At the end of that article, I mentioned metatables - a subject I have carefully sides ....
Conventional Wisdom says that it's pointless to start a regular expression with ".*" or ".+", as this is implied within a match - regular expression matches are looking for strings that are contained anyway:
'/abc/' - contains abc
'/.*abc/' - contains anything or nothing, followed by abc
However - ....
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 is a tool in which you can use object oriented techniques with (indeed) a freedom and flexibility t ....
I was asked how many languages I teach yesterday - and the answer's quite a few; at times, it's almost "the more the merrier" as to a very great extent they are varieties on a theme much of the way - but different balances of features make some languages especially good for some uses.
As a geek's r ....
In 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 this week, and I have just posted up an example in which I set up a table and showed some of the flexib ....
I first met Ruth Davis in 1996 - retired in Fort Myers, Florida, with a long, interesting and distinguished life already stretching back some 80 years behind her at that time. I got to know her better - but not as well as I would have liked - over the following years as I courted and then married h ....
Every few minutes, a spam email drops in my mailbox ... and indeed every five minutes or so throughout the day, our server rejects an email that is so obviously, undeniably spam that it doesn't even bother to notify us of its arrival. This is a long-running graph showing spam (red) and delivered to ....
Have you ever served up a meal to discover you've left something in the over that should have been an integral part of the meal? I know I have, and I did the equivalent thing at the end of last night's meeting where between 40 and 50 people turned out on a damp Friday night from all over Wiltshire ....
Python's socket module makes it easy for you to write your own clients and server ... and yesterday I produced "Hello World" style examples of each on the final day of our Python Programming Course. I'm going to share these examples with you here ... but I'm also going to add a word of caution firs ....
What is forking
If you want a process to head off in two different directions, you can fork it. That results in identical copies of the process being created - the original (parent) and the copy (child), each with their own complete set of variables, and program counter, etc.
The clever thing is t ....