Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I never programmed lua before, now I have to find a part in a script that generates a webinterface and verify a variable, so that it may only contain a valid hostname (only letters and the minus-sign)
How would I program this in lua?
Is there a simple manual, where to find such things (like php.net for PHP)
If you're looking for a simple Lua manual, one exists over at the official page: http://www.lua.org/manual/5.2/
The resource linked by plalx explains the basics of lua pattern matching. So does: http://www.lua.org/pil/20.1.html
Lpeg is a good pattern matching library: http://www.inf.puc-rio.br/~roberto/lpeg/
For a look at other pattern matching libraries, have a look at: http://lua-users.org/wiki/LibrariesAndBindings under the heading "Text Processing"
Try string.match(host,"^[%w%-]+$")~=nil.
I've never programmed in lua either, but it seems that it has a set of powerful pattern matching functions that you could use.
Just have a look at http://lua-users.org/wiki/PatternsTutorial
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I don't know where to start with this. If there is a way, all I need is an object name or collection name, so I can look up the feature on Microsoft's site, and go from there. But, searching there directly didn't turn anything up.
You're probably looking for the VBE Extensibility Library.
However note that depending on what you're actually trying to do ("modify other VBA code"), it may be very hard, if not impossible to implement.
The library will let you iterate modules, locate their members, pull the actual code into strings (from entire modules or just a given procedure)... but that's as granular as it gets.
If you're trying to do anything that requires understanding of the code's semantics, the VBIDE API won't be enough: you need a lexer and a parser for that... and I've yet to see a successful lexer/parser for VBA, written in VBA.
Good luck!
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
To Zerobrane users, since this is not a question on lua :
I use Zerobrane for editing lua programs that are to be used with LuaLatex. Very nice !
I make all tests there before using the developments in LuaLatex. So, at the beginning, the programs are run there. I need to tidy up this part, on ZeroBrane, by making files hierarchical, with a master file and slave files around.
Once again, it is a question about ZeroBrane, not about how I use the file within LuaLatex (I know enough about doFile, luaexec and co)
Does this exist ?
I saw PaulK passing by, if he could drop a line, it would be appreciated ...
An "include mechanism" as you call it is usually a language feature, not some feature of an IDE.
Lua provides various functions for running code from other files.
dofile, load, loadfile, require, ...
The most convenient and common is require which will find a file by its name in a given set of directories and execute its contents.
Read this:
https://www.lua.org/manual/5.3/manual.html#6.3
https://www.lua.org/pil/8.1.html
https://www.tutorialspoint.com/lua/lua_modules.htm
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm wondering if there already exists files that describe the Lex and Yacc tokens and parsing rules for LOGO.
I'll be using PLY for Python to parse the LOGO commands. I have to convert the files to Python so I'm hoping to use the files more as a guide.
I've searched here and Googled but can't find any.
There doesn't exist a Lex/Yacc configuration files for LOGO. LOGO can't be used with Lex, because the language doesn't have clearly defined arguments for functions. Making the matching of arguments to function lazy depending upon context. Lex only works with clearly defined argument structures.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
This may seem like a kind of amorphous question, but how can you get the most of the Linux Kernel Documentation directory?
I noticed on the Linux Cross Reference that there is a DocBook directory. How do I build it, use it and is it at all useful? What other ways are there to make efficient use of this directory?
All the various make targets are documented if you try "make help" at the top of the src tree. In the case of the DocBook stuff there are multiple targets, for example try:
make htmldocs
Oh and yes it is useful stuff and will probably be the most upto date reference around. A lot of the DocBook stuff extracts documentation on the various functions straight from the kernel source tree annotations.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
For me it's got to be the Microsoft SQL Server Cast and Convert reference. I must love that page, I seem to visit it several times a day.
PHP Documentation for me - clear, concise, user tips (although these are not always correct and secure - pinch of salt etc). Also good for typing directly into an address bar if you know the function name, eg php.net/in_array - straight to the function's page.
The YUI documentation has had a good number of views over my last few projects...a good example of a clear and concise API
Definitely should be http://www.w3.org/TR/xslt :)
It depends a lot on what I'm doing and what my toolset is. In generaly these days it is probably Stroustrup's The C++ Programming Language.
From time to time, I still find that people need my services maintaining/fixing/adding new features to ASP site (VBScript) pages from time to time (yuck). The MSDN VBScript reference is usually all I need.