Snusmumriken
Либописатель просто решил: "Мой модуль должен всегда находиться в корне, потому что мне лень морочиться/я не знаю как организовывать древовидные модули относительно произвольного места".
ㅤ
Есть ещё довольно часто встречающийся способ (обхода проблемы с путями) "упаковать всё в один файл".
Ivan
не, это же хреново, смысл использовать сабмодули же, чтобы если другая библитека обновилась ты бы просто её подтянул
ㅤ
Что хреново — не спорю. Просто мимо проходил, увидел разговор про пути библиотек.
Ivan
вы можете вырубить бота? Такое ощущение, что этот чат перегружен как чат по джаваскрипту, но это не так
Snusmumriken
Snusmumriken
Типа,
local root = arg[0]:match("(.*[\\/])")
package.path = root .. "?.lua;" .. root .. "?/init.lua;" .. package.path
Snusmumriken
У меня есть специальный скрипт, для комфорного запуска других скриптов:
https://pastebin.com/k00zSt16
Он же прописывает все package.path'ы, чтобы можно было реквайрить сабмодули из той же директории.
Ещё он запускает через xpcall и добавляет debug.debug, шоб можно было смотреть текст ошибок и дабы консоль не закрывалась сразу по исполнению скрипта.
Использовать примерно так:
c:/lua/luajit.exe c:/path/to/script_runner.lua c:/path/to/script.lua
Snusmumriken
Гы, а я и забыл что сделал его под JAIL-лицензией
Snusmumriken
А я такой фигачу чисто ffi-векторно-матричную библиотеку. Шоб и для 2д и для 3д.
И с переиспользованием всего и вся, шоб лишних объектов не плодить.
Yuriy
СЕРБСКИ
хр
Aleksey
Знает кто примеры гет запросов ручками на сокетах ? В гугле сплошные либы, точнее одна либа
Yuriy
Aleksey
ага спасибо, если осилить можно и на спичках гет запрос сделать
Yuriy
Чего там осиливать? Пять сток текста через \r\n
Создайте tcp socket
Найдите в интернете пример любого GET запроса
Поставьте туда свой request uri
Все
Aleksey
Aleksey
я уже сдался и использую луасек
Snusmumriken
Snusmumriken
Никаких хттпс в чистых луях.
mva
Tverd
да и штатный https тоже норм работает... есть правда ограничения
mva
mva
в коробке у lua вообще нет ничего для работы с сетью, емнип
mva
хинт: luasocket - не "из коробки", это такая же внешняя либа как luasec и lua-curl
mva
так почему бы сразу не взять удобный lua-curl?
Tverd
mva
🤦♂️
mva
при чём тут игровой движок и причие "везде" комбаены, куда lua лишь встроен?
mva
поставь в систему интерпретатор (и проследи чтобы "рекомендованные" не поставились)
mva
ну и что что-то другое по зависимостям не притянуло luasocket
mva
и убедись
mva
eix luasocket
[I] dev-lua/luasocket
Доступные версии: 3.0_rc1-r4^t 3.0_rc1-r5^t (**)9999*l{tbz2,xpak}[1] {debug doc examples ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32" LUA_TARGETS="lua51 lua52 lua53 luajit2"}
Установленные версии: 9999*l{tbz2,xpak}[1](06:48:03 26.08.2019)(-debug -doc -examples ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="32 64 -x32" LUA_TARGETS="lua51 lua52 lua53 luajit2")
Домашняя страница: http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/
Описание: Networking support library for the Lua language.
Tverd
ну ок, тогда беру свои слова обратно - не штатный )
Prath
Input:
1
5
Sam 40.08
Riya 30.7
Harry 41
Anne 35.2
Peter 36.6
Output:
Harry
Explanation:
The maximum score of student is 41 which belong to "Harry"
Prath
How to solved this problem using lu
Prath
Lua
fgntfg
There are multiple ways.
Snusmumriken
Prath
Take input from user in table...and print high score of that person name
Snusmumriken
Wow, you are alive. Ok, what is 1 and 5 in the input?
Prath
1 is test case
Prath
5 is input of members
Snusmumriken
Second: what is it for?
Prath
See 5 is no of element's in table...keys and value pair
Snusmumriken
Why do you need this task?
Prath
For practice on codechef
fgntfg
Obviously it is for school. Question is about the basics.
Prath
Confused how to solved
fgntfg
There are few ways to solve this problem
Prath
How to solved palindrome probelm using lua....but ignore upper and lower case
fgntfg
I strongly recomend to use ffi
Snusmumriken
Prath
fgntfg
FFI is not needed
Снус, если он принесёт решение с ffi - то в школе сразу всё поймут, а на работе - поржут
fgntfg
@rp030501 do you know how to add value to table?
Prath
Little bit
Prath
Not fullu..i am learning lua
fgntfg
Learn it more
fgntfg
Lua is simple language, that's why I love lua
fgntfg
Add all elements to the table, than iterate over the table and find max value.
Prath
fgntfg
How plz
Do you need full code or idea how to write the code?
fgntfg
Do you wanna learn lua or not?
Prath
Yes little bit...i am starting but confused on this probelm
fgntfg
Prath
Only logic know but how to done in that confused
Prath
ok, that's the logic
iterate over every line
if the score is higher than the maximum local score known, change the maximum local score and the name of the student
once done, the maximum local score will be the highest score (global maximum score)
Prath
But how write code in that i confused
Prath
Can you plz help me
fgntfg
Prath
Yes my frd send me
fgntfg
I can, but I wouldn't help lazy boy
fgntfg
You want solution, but not knowledge, I disrespect this
Prath
I am not lazy i am try to solved in last 3 hrs