22,964 questions
Advice
2
votes
1
replies
45
views
How to convert integer to booleans representing binary digits?
Apologies if this is a dumb question, I'm new to both stack exchange and programming in general.
Anyway, here's the problem I'm facing: I'm writing a function for a lua program, and I need to convert ...
Best practices
0
votes
1
replies
27
views
Lua learning for fxcm
I want to learn, writng code in lua for fxcm(marketscope) so im looking for a resource to learn it step by step.
I have a strategy that takes too long, manually so im intended to turn it to the code ...
Best practices
1
vote
8
replies
120
views
When is it appropriate to use the "Async" suffix when naming a function? Yield, or non-blocking, or both?
Let's say I named a function DoSomethingAsync.
Now, without running it. Do you think it yields, or runs immediately, but returns something later, and allows the caller to continue running more stuff ...
7
votes
1
answer
94
views
Why is a recursive Lua function calling itself via a local alias instead of directly?
Below code is from nmap tableaux.lua script file which is located at /usr/share/nmap/nselib
local tcopy_local
function tcopy(t)
local tc = {}
for k, v in pairs(t) do
if type(v) == "table&...
2
votes
1
answer
62
views
How to refresh nvim-tree filters after modifying a custom ignore file at runtime?
I’m using lazy.nvim to load nvim-tree.
I extended nvim-tree to read a project-local .fdignore file and use it to hide files/directories.
This works on startup, but changes to .fdignore are not ...
1
vote
0
answers
46
views
nvim restoring last cursor position
In macos, I have the following in my ~/.config/nvim/init.lua:
vim.api.nvim_create_autocmd("BufReadPost", {
callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"')
...
0
votes
0
answers
48
views
Catch `otherMouseDragged` event in Hammerspoon
I am totally new to Lua. The main idea is to use my logitech mouse but not the buggy and resource-eating Logi Options+ application. I try to implement these actions :
Btn 4 click : Mission Control
...
1
vote
0
answers
179
views
Is it normal for pattern matching to take forever when used on a 600kb+ string?
Take a look at the following code:
local contents = assert(io.open("foo.html", "r")):read("*a")
print(string.len(contents))
string.find(contents, ".+\"url\"...
3
votes
1
answer
124
views
Karatsuba Square Root implementation correctness
I'm currently trying to implement Karatsuba Sqrt for my BigInteger module in luau, though I'm having trouble with its accuracy and I don't know what I'm doing wrong.
Karatsuba function:
local function ...
Advice
1
vote
4
replies
187
views
Pygame or Love2d for game development?
I have been looking at frameworks for game development and I have found that pygame (a python game development libary) and love2d (a lua game development libary) seem the eisiest to learn. I also know ...
4
votes
1
answer
101
views
inlay hints don't work for golang in neovim?
i have hints working for lua, but not for go.
i've already tried a bunch of stuff like several go configs, though it seems like it is a server problem, because Settings: {} is what i get in ...
1
vote
0
answers
91
views
neovim treesitter and mini.ai
I found out the mini.ai html tag selection is very bad but treesitter was so good at it so I decided to change it to treesiter without loosing the good things in mini.ai so I did this config and so ...
1
vote
2
answers
1k
views
How to finish Tree-sitter plugin in Neovim by Lazy.nvim?
I am a newbie Neovim user and I am configuring Neovim by Lazy in init.lua. However, I had a problem when installing Tree-sitter plugin by Lazy.nvim.
In file init.lua, I use below command to install ...
1
vote
0
answers
70
views
Error while configuring jdtls on neovim 0.12 without using any plugin
I am trying to run jdtls lsp on the latest nvim 0.12 with minimal setup without using any plugin for my nvim version:
NVIM v0.12.0-dev-5299967
Build type: Debug
LuaJIT 2.1.1764270282
However, when i ...
3
votes
1
answer
63
views
Object and entity colliding multiple times regardless of disabling cantouch property
I am creating a game about fighting other people in arenas, and when 2 people are in the arena, anyone that tries to enter becomes a spectator, for some reason, the part you touch to enter the arena ...