Lighttpd

Lua Frequently Asked Questions ( FAQ )

Programming in Lua Image by Metaphox via Flickr

Lua Frequently Asked Questions (FAQ)


Marcadores: , , , , , , , , , ,



# 8/16/2009 04:30:00 AM, Comentários, Links para esta postagem,

Lua for Windows - Short Introduction and Files

PSP Lua script Image by toufeeq via Flickr

Lua for Windows - A Short Introduction.

1. What is Lua?
2. What is Lua for Windows?
3. What comes with Lua for Windows?
4. Using Lua for Windows.
4.1 Running Lua Programs.
4.2 Editing Lua Programs.
4.3 Debugging Lua Programs.
4.4 Using Lua without command console.
5. Concise Overview of Lua Programming Language.
6. Libraries included with Lua for Windows.
7. Learn more about Lua.
8. Acknowledgments.



1. What is Lua?

Lua is a small, fast, interpreted scripting language. Lua is the result of a merger of a configuration language (SOL) and a data entry language (DEL) . Lua's original goal was to be an extensible embedded scripting language inside software applications. Lua has been highly successful as an embedded scripting language and is used in many games, firmware and software applications. With the recent addition of modules, Lua now has a standard method to load libraries. Lua together with Lua libraries enables a complete standalone scripting language.

Lua's unique focus on extensibility, simplicity, efficiency and portability make it a small yet powerful scripting language. Lua is often used as a Domain Specific Language due to its small size, embeddability and portability. Lua supports a small set of general features and provides meta-mechanisms to allow the programmer to support programming styles of their choice.

Lua was developed by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes at the Pontifical University of Rio de Janeiro (PUC-Rio), in Brazil.

Lua means Moon in Portuguese, so be ready for libraries with references to space or the moon, and enjoy.


2. What is Lua for Windows?

Lua for Windows is a 'batteries included environment' for the Lua scripting language on Windows.

Lua for Windows combines Lua binaries, Lua libraries with a Lua-capable editor in a single install package for the Microsoft Windows operating system. Lua for Windows contains everything you need to write, run and debug Lua scripts on Windows. A wide variety of libraries and examples are included that are ready to use with Microsoft Windows. Lua for Windows runs on Windows 2000 and newer versions of Windows. Lua and its associated libraries are also available for other operating systems, so most scripts will be automatically cross-platform.


/
Parent Directory


/
cd


/
im


/
iup


/
md5


/
date


/
loop


/
lpeg


/
luabitops


/
alien


/
copas


/
lanes


/
lpack


/
luaex


/
luagd


/
luagl


/
rings


/
wxlua


/
scripts


/
luasocket


/
lualogging


/
metalua


/
lrexlib


/
luacurl


/
luatask


/
luaunit


/
luaexpat


/
lua5.1


/
luacom


/
luadoc


/
luasql


/
luaxml


/
luazip


/
coxpcall


/
stdlib


/
luainterface


/
lexecutor


/
vstruct


/
classlib


/
luafilesystem


/
luaprofiler


misc
Lua PiL Book.url

49 octets
text/html
luaforwindows.html

53455 octets
text/html
luarefv51.html

168347 octets


Related articles by Zemanta

Marcadores: , , , , , , , , , ,



# 8/11/2009 03:48:00 AM, Comentários, Links para esta postagem,

PHP is dying

A friend recently told me that PHP is on its way out, Lua is where it's at. I scoffed. I chuckled. Then I gave it some thought. Could PHP have had its day?

So time to do a bit of research. My first port of call was of course www.php.net - source for all things good and PHP-ish. According to the usage graph, things are not looking good. PHP usage peeked around August last year after an unstoppable climb since 2000, but has taken a disturbingly downward tack since then.

On to another report for a bit more clarity. The folk at Security Space have a pretty useful breakdown of all Apache modules' popularity. PHP is sitting pretty at number one on over 40% of Apache servers, but there is a minor decrease since last month. FrontPage (yuch!) is sitting at four, and Perl at number five. Python is quite far down the list, and Lua is way, way down.

I have to conclude that my friend might be right in one respect � PHP has had its day. If the trend continues, it means that PHP will one day not be the hottest thing on the web like it is right now. While I might lament about my soon-to-be-obsolete skills, if I remove my emotions from the situation it's clear that this was inevitable. The fact is that all top computing languages come in and out of favour. Coming in to favour in the first place is a major achievement � only a couple of the hundreds out there ever make the grade. Remember Cobol? Pascal? Logo? Delphi? They've all become historical anecdotes with the occasional application still clinging on to a glorious past, and desperate for developers with has-been skills.

But I'm not going to cry or gnash my teeth just yet. PHP still has plenty of legs, and it will take quite a bit to wind it. I'm not sure what will take its place, but somehow I think Lua will be the successor. For all its publicity, its market share seems pretty dismal and doesn't seem to be getting enough weight behind it to be a real challenger any time soon. Netcraft's stats show a surprise come-back from Microsoft recently, so maybe .Net or Mono might make a play, but I also feel that the .Net framework is a little too clunky for web applications. PHP's advantage over the rest is that it's a web application, through and through. It doesn't try to also be a desktop application language, a server application language, a widget application language... it just spits out web pages fast and efficiently.

Somewhere out there, there's probably a geek in a basement or cubicle crafting a completely new web language. His work now might see the emergence of something new and great in five years time. And when that comes, I guess I'll have to change, re-learn, re-skill. Until then, I'm going to cling tenaciously to my PHP, because today � no matter what anyone tells me � PHP is still very much alive.

So time to do a bit of research. My first port of call was of course www.php.net - source for all things good and PHP-ish. According to the usage graph, things are not looking good. PHP usage peeked around August last year after an unstoppable climb since 2000, but has taken a disturbingly downward tack since then.

On to another report for a bit more clarity. The folk at Security Space have a pretty useful breakdown of all Apache modules' popularity. PHP is sitting pretty at number one on over 40% of Apache servers, but there is a minor decrease since last month. FrontPage (yuch!) is sitting at four, and Perl at number five. Python is quite far down the list, and Lua is way, way down.

I have to conclude that my friend might be right in one respect � PHP has had its day. If the trend continues, it means that PHP will one day not be the hottest thing on the web like it is right now. While I might lament about my soon-to-be-obsolete skills, if I remove my emotions from the situation it's clear that this was inevitable. The fact is that all top computing languages come in and out of favour. Coming in to favour in the first place is a major achievement � only a couple of the hundreds out there ever make the grade. Remember Cobol? Pascal? Logo? Delphi? They've all become historical anecdotes with the occasional application still clinging on to a glorious past, and desperate for developers with has-been skills.

But I'm not going to cry or gnash my teeth just yet. PHP still has plenty of legs, and it will take quite a bit to wind it. I'm not sure what will take its place, but somehow I don't think Lua will be the successor. For all its publicity, its market share seems pretty dismal and doesn't seem to be getting enough weight behind it to be a real challenger any time soon. Netcraft's stats show a surprise come-back from Microsoft recently, so maybe .Net or Mono might make a play, but I also feel that the .Net framework is a little too clunky for web applications. PHP's advantage over the rest is that it's a web application, through and through. It doesn't try to also be a desktop application language, a server application language, a widget application language... it just spits out web pages fast and efficiently.

Somewhere out there, there's probably a geek in a basement or cubicle crafting a completely new web language. His work now might see the emergence of something new and great in five years time. And when that comes, I guess I'll have to change, re-learn, re-skill. Until then, I'm going to cling tenaciously to my PHP, because today � no matter what anyone tells me � PHP is still very much alive.




Related articles by Zemanta

Marcadores: , , , , , ,



# 8/01/2009 05:21:00 PM, Comentários, Links para esta postagem,

Can't connect to [local] MySQL server

Flickr MySQL error Image by Gea-Suan Lin via Flickr
Um cliente MySQL em Unix pode conectar ao servidor mysqld de dois modos diferentes: sockets Unix, que conectam através de um arquivo no sistema de arquivos (padrão /tmp/mysqld.sock) ou TCP/IP, que conecta através um número de porta. Sockets Unix são mais rápidos que TCP/IP mas só podem ser usados quando conectados ao servidor no mesmo computador. Sockets Unix são usados se você não especificar um nome de máquina ou se você especificar o nome de máquina especial localhost.

No Windows, se o servidor mysqld está rodando no 9x/Me, você só pode conectar via TCP/IP. Se o servidor estiver rodando no NT/2000/XP e o mysqld é iniciado com --enable-named-pipe, você também pode conectar com named pipes. O nome do named pipes é MySQL. Se você não der um nome de máquina quando conectar ao mysqld, um cliente MySQL tentará conectar primeiro ao named pipe, e se isto não funcionar ele irá conectar a porta TCP/IP. Você pode forçar o uso de named pipes no Windows usando . como nome de máquina.

O erro (2002) Can't connect to ... normalmente significa que não há um servidor MySQL rodando no sistema ou que você está usando um arquivo socket ou porta TCP/IP errado ao tentar conectar so servidor mysqld.

Inicie verificando (usando ps ou gerenciador de tarefas do Windows) que há um processo chamado mysqld executando em seu sistema! Se não houver nenhum processo mysqld, você deve iniciar um. Veja Secção 2.4.2, "Problemas Inicializando o Servidor MySQL".

Se um processo mysqld estiver em execução, você pode verificar o servidor tentando estas diferentes conexões (o número da porta e o caminho do socket devem ser diferente em sua consiguração, é claro):

shell> mysqladmin version
shell> mysqladmin variables
shell> mysqladmin -h `hostname` version variables
shell> mysqladmin -h `hostname` --port=3306 version
shell> mysqladmin -h 'ip for your host' version
shell> mysqladmin --protocol=socket --socket=/tmp/mysql.sock version

Note o uso de aspas para traz em vez de aspas para frente com o comando hostname; isto provoca a saída de hostname (que é, o nome de máquina atual) para ser substituído no comando mysqladmin.

Aqui estão algumas razões pela quais o erro Can't connect to local MySQL server pode ocorrer:




Se você obter a mensagem de erro Can't connect to MySQL server on alguma_maquina, você pode tentar o seguinte para descobrir qual é o problema:

Related articles by Zemanta

Marcadores: , , , , , , , , , ,



# 7/27/2007 07:27:00 AM, Comentários, Links para esta postagem,