Pubnub Lua (Corona) Library not working - lua

I am developing with Corona SDK, the most recent public release (v3.0, build 2015.2646), on OS X 10.10.
I have downloaded the pubnub corona repo from here: https://github.com/pubnub/lua/
When I try to run the pubnub examples, multiple examples are failing with a run-time error in the core pubnub.lua library.
For instance, example-channel-information, example-mathmania, example-multi-drum.
They all result in a console runtime error of:
Oct 20 10:46:51.328: Runtime error
.../pubnub/corona/examples/example-channel-information/pubnub.lua:534: attempt to call upvalue 'callback' (a table value)
stack traceback:
[C]: in function 'callback'
.../pubnub/corona/examples/example-channel-information/pubnub.lua:534: in function <.../pubnub/corona/examples/example-channel-information/pubnub.lua:532>
(tail call): ?
Is this a problem with my environment, or is there a more recent pubnub.lua release, or is this a bug?
thanks

Related

Mediawiki scribunto lua module do not know builtin functions

I am having a problem with calling Lua built-in functions using Scribunto.
I created basic module Module:Item
local p = {};
function p.test(frame)
print("Hello World!")
end
return p
Which I call in different page as {{#invoke: Item | test}}
and I receive a following error:
Lua error in Module:Item at line 3: attempt to call global 'print' (a nil value).
Backtrace:
1. (tail call): ?
2. Module:Item:3: in function "chunk"
3. mw.lua:511: ?
4. (tail call): ?
5. [C]: in function "xpcall"
6. MWServer.lua:99: in function "handleCall"
7. MWServer.lua:313: in function "dispatch"
8. MWServer.lua:52: in function "execute"
9. mw_main.lua:7: in main chunk
10. [C]: ?
Since print is Lua built-in function I have the feeling the problem will be somewhere in setting on the pc.
However, when I imported wiki Infoboxes, they are working OK.
Versions:
Linux Mint Tara - Cinnamon based on ubuntu 18
MediaWiki 1.31.7
Scribunto (106fbf4) 17:24, 15 May 2018
Lua 5.1.5
Any help pointing where the problem can be is highly appreciated.
Scribunto intentionally doesn't include print. The "Removed functions and packages" section in its manual says this about it:
This was discussed on wikitech-l and it was decided that it should be omitted in favour of return values, to improve code quality. If necessary, mw.log() may be used to output information to the debug console.

Attempt to index global 'Grid' (a nil value)

I have been trying to run the following codes from Euler Equations Solver. It is a Lua script that I have been toying with using ZeroBrane Studio. But the project gave the following error every time I try to execute it.
attempt to index global 'Grid' (a nil value)
stack traceback:
...mming Codes\Project 1\Lua Script\Problem 1\Problem 1.lua:7: in main chunk
[C]: at 0x00401b00
I am completely new to Lua and I have been looking for the solutions everywhere. Appreciate any help that I can get.

Error running call reference function for resource es_extended fiveM

Basically have another fivem es_extended issue where I am getting unwelcome errors everytime users try and join my server and show their money as undefined, and also not allow them to save their clothing.
I've dropped tables from my database and re-added them to no avail.
stack traceback:
#es_extended/server/main.lua:155: in upvalue 'ref'
citizen:/scripting/lua/scheduler.lua:391: in function <citizen:/scripting/lua/scheduler.lua:390>
[C]: in function 'xpcall'
citizen:/scripting/lua/scheduler.lua:390: in function <citizen:/scripting/lua/scheduler.lua:389>
stack traceback:
[C]: in function 'error'
citizen:/scripting/lua/scheduler.lua:405: in function <citizen:/scripting/lua/scheduler.lua:374>
Error: Unhandled error in timer: Error: BUFFER_SHORTAGE
Error: BUFFER_SHORTAGE
at n.e [as reserve] (citizen:/scripting/v8/msgpack.js:29:12766)
at h (citizen:/scripting/v8/msgpack.js:29:15761)
at n.r [as decode] (citizen:/scripting/v8/msgpack.js:29:13908)
at n.fetch (citizen:/scripting/v8/msgpack.js:29:6972)
at n.u [as read] (citizen:/scripting/v8/msgpack.js:29:12076)
at Object.n [as decode] (citizen:/scripting/v8/msgpack.js:29:7097)
at unpack (citizen:/scripting/v8/main.js:20:33)
at citizen:/scripting/v8/main.js:51:20
at setImmediate (mysql-async.js:4962:9)
at Object.callback (citizen:/scripting/v8/timer.js:96:21)
Expected should be no errors at all, and thats the error messages that come along when a new person joins the server for the first time.
All ESX 1.* are officially discontinued due to bugs in latest versions, based on ESX recommendations you can try Extended Mode, works fine with minimum amount of bugs

Lua Error Loading Limlib2 Library even though it's already installed?

I have install limlib2 and everything and I've checked the directories to see if it's existent, and limlib2 is there. I compile some lua code that uses
require("limlib2")
I receive this error:
lua: error loading module 'limlib2' from file '/usr/local/lib/lua/5.3/limlib2.so':
dlopen(/usr/local/lib/lua/5.3/limlib2.so, 6): Symbol not found: _luaL_checkint
Referenced from: /usr/local/lib/lua/5.3/limlib2.so
Expected in: flat namespace
in /usr/local/lib/lua/5.3/limlib2.so
stack traceback:
[C]: in ?
[C]: in function 'require'
imgpxl.lua:1: in main chunk
[C]: in ?
Any help? I don't understand what's going on.
limlib2 is referencing _luaL_checkint which fails in Lua 5.3 as _luaL_checkint has been replaced by _luaL_checkinteger in Lua 5.2
_luaL_checkint is deprecated. Just google for _luaL_checkint to find plenty of workarounds.
Checkout this: Cannot make gunplot on osx yosemite. Undefined symbols
imlib2 seems to haven't been updated in over 8 years. So no wonder you're facing problems

Issue with neuralnetwork_turial.lua with data preprocessing

I have installed the torch deep learning module by first git clone-ing and later using luarocks make and the installation was succussful. The require 'dp' works well in the torch prompt.
But when I try to execute the neuralnetwork_tutorial.lua(th neuralnetwork_tutorial.lua), it throws the following errors.
Tanny #neuralnetwork_tutorial.lua: About to initiate: datasource = dp.Mnist{input_preprocess = dp.Standardize()}
Tanny #/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/preprocess/standardize.lua: Marked presence!!!
Tanny #/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/torch/File.lua says: #177 typeidx= 3
Tanny #/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/torch/File.lua says: #177 typeidx= 1
Tanny #/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/torch/File.lua says: #177 typeidx= 4
Tanny #/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/torch/File.lua says: #177 typeidx= 0
Tanny #/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/torch/File.lua says: #177 typeidx= 28
Tanny #/home/ubuntu/binaries/torches/torch/install/share/lua/5.1/dp/torch/File.lua says: #259 typeidx= 28
/home/ubuntu/binaries/torches/torch/install/bin/luajit: ...aries/torches/torch/install/share/lua/5.1/torch/File.lua:260: unknown object
stack traceback:
[C]: in function 'error'
...aries/torches/torch/install/share/lua/5.1/torch/File.lua:260: in function 'readObject'
...aries/torches/torch/install/share/lua/5.1/torch/File.lua:252: in function 'readObject'
...aries/torches/torch/install/share/lua/5.1/torch/File.lua:277: in function 'loadData'
...es/torches/torch/install/share/lua/5.1/dp/data/mnist.lua:74: in function 'loadTrainValid'
...es/torches/torch/install/share/lua/5.1/dp/data/mnist.lua:61: in function '__init'
...aries/torches/torch/install/share/lua/5.1/torch/init.lua:50: in function <...aries/torches/torch/install/share/lua/5.1/torch/init.lua:46>
[C]: in function 'Mnist'
neuralnetwork_tutorial.lua:16: in main chunk
[C]: in function 'dofile'
...ches/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
[C]: at 0x0804d650
I put some print statements in those scripts to understand the flow. I happen to notice that in File.lua the first step after getting the object is to determine the type of the object; of which 8 have been declared. The types have been declared through 0 to 7, 0 being TYPE_NIL. However the code fails, as it detects a type 28(??).
Kindly any help where I am going wrong? Or where to look into to find the issue?
P.S.: The script downloads the data on its own, however due to certain standard corporate proxy setting issues, it could not download. Therefore, I personally downloaded the data MNIST and stored it in the specific data directory. If this could be a clue??
Okay, so it was a bug in the code (serialized MNIST wasn't cross-platform). Fixed by serializing dataset using ascii format instead of binary.

Resources