repo_name
stringlengths
6
69
path
stringlengths
6
178
copies
stringclasses
278 values
size
stringlengths
4
7
content
stringlengths
671
917k
license
stringclasses
15 values
storevpsnet/SV
libs/tdcli.lua
102
88571
--[[ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be use...
gpl-3.0
MinetestForFun/minetest-minetestforfun-server
mods/3d_armor/3d_armor/intllib.lua
53
1122
-- Fallback functions for when `intllib` is not installed. -- Code released under Unlicense <http://unlicense.org>. -- Get the latest version of this file at: -- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua local function format(str, ...) local args = { ... } local function repl...
unlicense
MinetestForFun/minetest-minetestforfun-server
mods/sea/noairblocks/init.lua
8
7236
-- NODES minetest.register_node("noairblocks:water_flowingx", { description = "Flowing Waterx", inventory_image = minetest.inventorycube("default_water.png"), drawtype = "flowingliquid", tiles = {"default_water.png"}, special_tiles = { { image="default_water_flowing_animated.png", backface_culling=false, ...
unlicense
poppy-project/poppy-ergo-jr
software/poppy_ergo_jr/vrep-scene/timer.lua
8
1041
-- DO NOT WRITE CODE OUTSIDE OF THE if-then-end SECTIONS BELOW!! if (sim_call_type==sim_childscriptcall_initialization) then simSetScriptAttribute(sim_handle_self,sim_childscriptattribute_automaticcascadingcalls,false) end if (sim_call_type==sim_childscriptcall_actuation) then if not firstTimeHere9384673...
gpl-3.0
syj2010syj/w3x2lni
script/gui/new/page/report.lua
1
1724
local fs = require 'bee.filesystem' local gui = require 'yue.gui' local backend = require 'gui.backend' local lang = require 'share.lang' local ui = require 'gui.new.template' local ev = require 'gui.event' local root = fs.current_path() local function count_report_height(text) local n = 1 for _ in text:gmatch...
gpl-3.0
android3003/tele-roid3003
bot/utils.lua
473
24167
URL = require "socket.url" http = require "socket.http" https = require "ssl.https" ltn12 = require "ltn12" serpent = require "serpent" feedparser = require "feedparser" json = (loadfile "./libs/JSON.lua")() mimetype = (loadfile "./libs/mimetype.lua")() redis = (loadfile "./libs/redis.lua")() JSON = (loadfile "./libs/...
gpl-2.0
syj2010syj/w3x2lni
script/gui/new/template/progress.lua
3
1765
local gui = require 'yue.gui' local ca = require 'gui.new.common_attribute' local timer = require 'gui.timer' return function (t, data) local view = gui.Container.create() if t.style then view:setstyle(t.style) end view:setbackgroundcolor '#444' local frontlabel = gui.Label.create('') v...
gpl-3.0
motangish/OpenComputers
MGOS/bin/edit.lua
2
18241
local event = require("event") local fs = require("filesystem") local keyboard = require("keyboard") local shell = require("shell") local term = require("term") local text = require("text") local unicode = require("unicode") local cmp = require("component") local gpu = cmp.gpu if not term.isAvailable() then return e...
gpl-3.0
jiweil/Neural-Dialogue-Generation
Atten/parse.lua
1
1218
local stringx = require('pl.stringx') local cmd = torch.CmdLine() cmd:option("-batch_size",128,"batch size") cmd:option("-dimension",512,"vector dimensionality") cmd:option("-dropout",0.2,"dropout rate") cmd:option("-train_file","../data/t_given_s_train.txt","") cmd:option("-dev_file","../data/t_given_s_dev.txt","") cm...
mit
dev-osrose/osIROSE-new
scripts/mobs/ai/worm_dragon.lua
2
1073
registerNpc(201, { walk_speed = 300, run_speed = 450, scale = 430, r_weapon = 1084, l_weapon = 0, level = 88, hp = 195, attack = 494, hit = 256, def = 460, res = 249, avoi...
apache-2.0
MinetestForFun/minetest-minetestforfun-server
mods/mesecons/mesecons/wires.lua
8
7900
-- naming scheme: wire:(xp)(zp)(xm)(zm)(xpyp)(zpyp)(xmyp)(zmyp)_on/off -- where x= x direction, z= z direction, y= y direction, p = +1, m = -1, e.g. xpym = {x=1, y=-1, z=0} -- The (xp)/(zpyp)/.. statements shall be replaced by either 0 or 1 -- Where 0 means the wire has no visual connection to that direction and -- 1 m...
unlicense
dev-osrose/osIROSE-new
scripts/mobs/ai/captive_doogoliath.lua
2
1063
registerNpc(1501, { walk_speed = 0, run_speed = 0, scale = 405, r_weapon = 0, l_weapon = 0, level = 60, hp = 3250, attack = 20, hit = 20, def = 500, res = 500, avoid ...
apache-2.0
dev-osrose/osIROSE-new
scripts/mobs/ai/ghostseed.lua
2
7972
registerNpc(701, { walk_speed = 160, run_speed = 250, scale = 110, r_weapon = 0, l_weapon = 0, level = 1, hp = 73, attack = 1, hit = 1, def = 200, res = 200, avoid ...
apache-2.0
MinetestForFun/minetest-minetestforfun-server
mods/throwing/init.lua
8
2439
throwing_arrows = { {"throwing:arrow_steel", "throwing:arrow_steel_entity"}, {"throwing:arrow_stone", "throwing:arrow_stone_entity"}, {"throwing:arrow_obsidian", "throwing:arrow_obsidian_entity"}, {"throwing:arrow_diamond", "throwing:arrow_diamond_entity"}, {"throwing:arrow_mithril", "throwing:arrow_mithril_entity...
unlicense
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/Armature.lua
11
7075
-------------------------------- -- @module Armature -- @extend Node,BlendProtocol -- @parent_module ccs -------------------------------- -- Get a bone with the specified name<br> -- param name The bone's name you want to get -- @function [parent=#Armature] getBone -- @param self -- @param #string name -- @return Bo...
mit
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/AudioEngine.lua
2
8281
-------------------------------- -- @module AudioEngine -- @parent_module ccexp -------------------------------- -- -- @function [parent=#AudioEngine] lazyInit -- @param self -- @return bool#bool ret (return value: bool) -------------------------------- -- Sets the current playback position of an audio ins...
mit
mrbangi/bangii
plugins/domaintools.lua
359
1494
local ltn12 = require "ltn12" local https = require "ssl.https" -- Edit data/mashape.lua with your Mashape API key -- http://docs.mashape.com/api-keys local mashape = load_from_file('data/mashape.lua', { api_key = '' }) local function check(name) local api = "https://domainsearch.p.mashape.com/index.php?"...
gpl-2.0
jeffrysleddens/KarniCrap
libs/lib_Water.lua
1
2176
--[[ Karni's Crap Filter ]]-- --------------------------------------------------------------------------------- -- -- Karni's Crap Filter - A World of Warcraft addon -- -- Copyright (C) 2008-2014 Karnifex -- -- This file is part of Karni's Crap Filter. -- -- Karni's Crap Filter is free software: you can red...
gpl-3.0
icebreaker/premake-dev
scripts/embed.lua
8
2300
-- -- Embed the Lua scripts into src/host/scripts.c as static data buffers. -- I embed the actual scripts, rather than Lua bytecodes, because the -- bytecodes are not portable to different architectures, which causes -- issues in Mac OS X Universal builds. -- local function stripfile(fname) local f = io.open(fnam...
bsd-3-clause
TsarN/uber-os
packages/libarchive/Build.lua
1
1164
--Build this package from inside UberOS local minify = lua.include("min") local SRC = {"libarchive"} local PWD = shell.dir() local DEST = "/lib" local EXTIN = ".lua" local EXTOUT = ".lua" local argv = { ... } local function clean() fs.delete(PWD .. "/out") end local function prepare() fs.makeDir(PWD .. "/out"...
mit
icebreaker/premake-dev
src/base/option.lua
11
2145
-- -- option.lua -- Work with the list of registered options. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- premake.option = { } -- -- The list of registered options. -- premake.option.list = { } -- -- Register a new option. -- -- @param opt -- The new option object. -- function pre...
bsd-3-clause
hafizbistar/dst_healthinfo
black_white_lists.lua
1
61142
--Always add health_info WHITE_FILTER = {wilson=true, catcoon=true, monkey=true, pumpkin_lantern=true, chester=true, spiderden_2=true, spat=true, maxwellendgame=true, mole=true, eyeturret=true, glommer=true, mossling=true, spider_warrior=true, walrus=true, mosquito=true, minotaur=true, deerclops=true, waxwell=true, ru...
unlicense
opentomb/OpenTomb
scripts/level/tr3/CRASH.lua
3
3320
-- OPENTOMB LEVEL SCRIPT -- FOR TOMB RAIDER 3, CRASH.TR2 print("Level script loaded (CRASH.lua)"); level_PostLoad = function() addCharacterHair(player, getHairSetup(HAIR_TR3)); playStream(33); end; level_PreLoad = function() -- STATIC COLLISION FLAGS ------------------------------------------------------...
lgpl-3.0
jeffrysleddens/KarniCrap
libs/lib_MobsMinable.lua
1
8331
--[[ Karni's Crap Filter ]]-- --------------------------------------------------------------------------------- -- -- Karni's Crap Filter - A World of Warcraft addon -- -- Copyright (C) 2008-2014 Karnifex -- -- This file is part of Karni's Crap Filter. -- -- Karni's Crap Filter is free software: you can red...
gpl-3.0
crazyhamedboy/botoliver
plugins/rae.lua
616
1312
do function getDulcinea( text ) -- Powered by https://github.com/javierhonduco/dulcinea local api = "http://dulcinea.herokuapp.com/api/?query=" local query_url = api..text local b, code = http.request(query_url) if code ~= 200 then return "Error: HTTP Connection" end dulcinea = json:decode(b) ...
gpl-2.0
jiweil/Neural-Dialogue-Generation
Decode/decode_parse.lua
1
1266
local stringx = require('pl.stringx') local cmd = torch.CmdLine() cmd:option("-beam_size",7,"beam_size") cmd:option("-batch_size",128,"decoding batch_size") cmd:option("-params_file","","") cmd:option("-model_file","","") cmd:option("-setting","BS","setting for decoding, sampling, BS, DiverseBS,StochasticGreedy") cmd:o...
mit
vorbi123/zeus2seed
plugins/stats.lua
866
4001
do -- Returns a table with `name` and `msgs` local function get_msgs_user_chat(user_id, chat_id) local user_info = {} local uhash = 'user:'..user_id local user = redis:hgetall(uhash) local um_hash = 'msgs:'..user_id..':'..chat_id user_info.msgs = tonumber(redis:get(um_hash) or 0) user_info.name = user_prin...
gpl-2.0
WhatTeam/FantasyLand
SampleCode/lua/actors/Rat.lua
1
4406
require "GlobalVariables" require "MessageDispatchCenter" require "Helper" require "AttackCommand" local file = "model/rat/rat.c3b" Rat = class("Rat", function() return require "Actor".create() end) function Rat:ctor() copyTable(ActorCommonValues, self) copyTable(RatValues,self) self:init3D() se...
mit
MinetestForFun/minetest-minetestforfun-server
minetestforfun_game/mods/farming/blueberry.lua
12
1857
local S = farming.intllib -- blueberries minetest.register_craftitem("farming:blueberries", { description = S("Blueberries"), inventory_image = "farming_blueberries.png", on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:blueberry_1") end,...
unlicense
ibawt/ev
lib/font.lua
1
1249
local ffi = require('ffi') local C = ffi.C ffi.cdef[[ typedef struct _ev_font ev_font; ev_font* ev_font_create(const char *name, float pt_size); void ev_font_destroy(ev_font*); void ev_font_set_position(ev_font*, ev_vec2); ev_vec2 ev_font_get_position(ev_font*); float ev_font_set_text(ev_font *font, const...
mit
mattyx14/forgottenserver-1
data/spells/scripts/party/train.lua
2
2033
local combat = createCombatObject() local area = createCombatArea(AREA_CROSS5X5) setCombatArea(combat, area) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, ...
gpl-2.0
icebreaker/premake-dev
src/actions/codelite/codelite_project.lua
13
5664
-- -- codelite_project.lua -- Generate a CodeLite C/C++ project file. -- Copyright (c) 2009, 2011 Jason Perkins and the Premake project -- local codelite = premake.codelite local tree = premake.tree -- -- Write out a list of the source code files in the project. -- function codelite.files(prj) local tr = prema...
bsd-3-clause
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/ControlSaturationBrightnessPicker.lua
18
2571
-------------------------------- -- @module ControlSaturationBrightnessPicker -- @extend Control -- @parent_module cc -------------------------------- -- -- @function [parent=#ControlSaturationBrightnessPicker] getShadow -- @param self -- @return Sprite#Sprite ret (return value: cc.Sprite) ----------------...
mit
npge/lua-npge
spec/mosses_id65_len50_frame200.lua
2
265300
-- This file covers all sequences; local not_sandbox = _G and not _G.setDescriptions if not_sandbox then local ShortForm = require 'npge.io.ShortForm' ShortForm.initRawLoading() end; setDescriptions {["ANOAT&mit1&c"] = "ac=NC_021931.1 Anomodon attenuatus mitochondrion, complete genome",["ANORU&mit1&c"] = "ac=NC...
mit
bm01/PokeBotBad
BizHawk-1.11.6/Lua/Genesis/Splatterhouse 2 (JPN).lua
7
1864
--Splatterhouse 2 (JPN) Collision box viewer v1.0 --Author Pasky --For use with Bizhawk local cx = 0 local player = false local attack = false local weapon = false local function camera() cx = mainmemory.read_u16_be(0x9E) end local function drawAxis(x1,y1,x2,y2) local x = ((x2 - x1) / 2) + x1 local y = ((y2 - y1)...
mit
MinetestForFun/minetest-minetestforfun-server
mods/moreblocks/stairsplus/panels.lua
7
2740
--[[ More Blocks: panel definitions Copyright (c) 2011-2015 Calinou and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] local S = moreblocks.intllib -- Node will be called <modname>:panel_<subname> function register_panel(modname, subname, recipeitem, groups, images, descrip...
unlicense
cogddo/vlc
share/lua/playlist/canalplus.lua
113
3501
--[[ $Id: $ Copyright (c) 2007 the VideoLAN team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distr...
gpl-2.0
tgcloner/how-
plugins/chat.lua
3
1232
local function run(msg) if msg.text == "hi" then return "سلام" end if msg.text == "Hi" then return "سلام" end if msg.text == "Hello" then return "سلام" end if msg.text == "hello" then return "سلام" end if msg.text == "Salam" and is_sudo(msg) then return "سلام بابایی جونم" end if msg.text == "salam" and is_sudo(ms...
gpl-2.0
drunklurker/wesnoth
data/ai/micro_ais/cas/ca_goto.lua
26
9404
local H = wesnoth.require "lua/helper.lua" local AH = wesnoth.require "ai/lua/ai_helper.lua" local BC = wesnoth.require "ai/lua/battle_calcs.lua" local LS = wesnoth.require "lua/location_set.lua" local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" local MAISD = wesnoth.require "ai/micro_ais/micro_a...
gpl-2.0
bluesquall/lcm
test/lua/client.lua
3
10294
local lcm = require('lcm') -- this line required to make `require` correctly search the working directory package.path = './?/init.lua;' .. package.path local lcmtest = require('lcmtest') local function info(text) print("client: " .. text) end local function check_field(value, expectedvalue, name) if value ~= e...
lgpl-2.1
dev-osrose/osIROSE-new
scripts/mobs/ai/red_jelly_bean.lua
2
1060
registerNpc(5, { walk_speed = 200, run_speed = 450, scale = 55, r_weapon = 0, l_weapon = 0, level = 6, hp = 11, attack = 12, hit = 56, def = 33, res = 17, avoid ...
apache-2.0
lapayx/tsdemuxer
xupnpd/src/plugins/staff/xupnpd_orttv.lua
6
2630
-- smorygo.philipp at gmail.com -- Licensed under GNU GPL version 2 -- https://www.gnu.org/licenses/gpl-2.0.html -- Uses 'si' parameter of http://www.1tv.ru/sprojects/si=5685 -- config example -- feeds = -- { -- { "orttv", "5685", "Пусть говорят" }, -- } function orttv_updatefeed(feed,friendly_name) local rc...
mit
bm01/PokeBotBad
BizHawk-1.11.6/Lua/NES/SMB2U.lua
7
6148
-- Super Mario Bros. 2 USA - Grids & Contents (Unfinished) -- Super Mario Bros. 2 (U) (PRG0) [!].nes -- Written by QFox -- 31 July 2008 -- shows (proper!) grid and contents. disable grid by setting variable to false -- shows any non-air grid's tile-id -- Slow! Will be heavy on lighter systems local angrybirdo = fal...
mit
MinetestForFun/minetest-minetestforfun-server
mods/profnsched/init.lua
3
5032
dofile(minetest.get_modpath("profnsched").."/queue.lua") dofile(minetest.get_modpath("profnsched").."/after.lua") local durations = {} local active = minetest.settings:get("profnsched_activate") local dump_delay = minetest.settings:get("profnsched_dump_delay") if not active then active = false end if not dump_delay th...
unlicense
icebreaker/premake-dev
src/actions/vstudio/_vstudio.lua
3
9954
-- -- _vstudio.lua -- Define the Visual Studio 200x actions. -- Copyright (c) 2008-2011 Jason Perkins and the Premake project -- premake.vstudio = { } local vstudio = premake.vstudio -- -- Map Premake platform identifiers to the Visual Studio versions. Adds the Visual -- Studio specific "any" and "mixed" to make s...
bsd-3-clause
MinetestForFun/minetest-minetestforfun-server
mods/plantlife_modpack/cavestuff/mapgen.lua
9
1721
--Map Generation Stuff minetest.register_on_generated(function(minp, maxp, seed) if maxp.y >= 2 and minp.y <= 0 then -- Generate pebbles local perlin1 = minetest.get_perlin(329, 3, 0.6, 100) -- Assume X and Z lengths are equal local divlen = 16 local divs = (maxp.x-minp.x)/divlen+1; for divx=0,divs-1 do ...
unlicense
adamjoniec/cmdline
cmder/vendor/clink-completions/net.lua
4
1150
local parser = clink.arg.new_parser local net_parser = parser( { "accounts" .. parser("/forcelogoff:", "/forcelogoff:no", "/domain", "/maxpwage:", "/maxpwage:unlimited", "/minpwage:", "/minpwlen:","/uniquepw:"), "computer" .. parser({"*" .. p...
gpl-3.0
drunklurker/wesnoth
data/ai/micro_ais/cas/ca_hunter.lua
26
8246
local H = wesnoth.require "lua/helper.lua" local W = H.set_wml_action_metatable {} local AH = wesnoth.require "ai/lua/ai_helper.lua" local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" local function hunter_attack_weakest_adj_enemy(ai, hunter) -- Attack the enemy with the fewest hitpoints adja...
gpl-2.0
Amorph/premake-dev
src/base/premake.lua
1
8202
-- -- premake.lua -- High-level processing functions. -- Copyright (c) 2002-2013 Jason Perkins and the Premake project -- local solution = premake.solution local project = premake5.project local config = premake5.config --- -- Add a namespace for extensions to use. --- premake.extensions = {} -- -- Define som...
bsd-3-clause
MinetestForFun/minetest-minetestforfun-server
mods/colormachine/paint_roller.lua
9
1870
-- This is based upon the paint_roller mod by Krock. minetest.register_tool("colormachine:paint_roller", { description = "Paint roller", inventory_image = "paint_roller.png", on_use = function(itemstack, placer, pointed_thing) if pointed_thing.type ~= "node" then return end local idx = placer:get_wield_ind...
unlicense
Amorph/premake-dev
src/base/api.lua
1
22473
-- -- api.lua -- Implementation of the solution, project, and configuration APIs. -- Copyright (c) 2002-2012 Jason Perkins and the Premake project -- premake.api = {} local api = premake.api local configset = premake.configset premake.fields = {} -- -- A place to store the current active objects in each projec...
bsd-3-clause
pperichon/domoticz
dzVents/runtime/Time.lua
1
16244
local utils = require('Utils') local _MS -- kind of a cache so we don't have to extract ms every time local function getTimezone() local now = os.time() local dnow = os.date('*t', now) local diff = os.difftime(now, os.time(os.date("!*t", now))) if (dnow.isdst) then diff = diff + 3600 end return diff end func...
gpl-3.0
groupsky/nodemcu-car
nodemcu/main.lua
1
1399
ENA = 6 ENB = 8 IN1 = 7 IN2 = 5 IN3 = 2 IN4 = 1 BROKER_IP = "178.62.67.131" BROKER_PORT = 1883 BROKER_USER = "" BROKER_PASS = "" BROKER_CLIENT = "car-" .. wifi.sta.getmac() BROKER_TOPIC = "/hackafe-car" driver = require("l298") driver.setup(ENA, IN1, IN2) driver.setup(ENB, IN3, IN4) m = mqtt.Client(BROKER_CLIENT, 12...
mit
WhatTeam/FantasyLand
SampleCode/lua/actors/Slime.lua
9
4882
require "GlobalVariables" require "MessageDispatchCenter" require "Helper" require "AttackCommand" local file = "model/slime/slime.c3b" Slime = class("Slime", function() return require "Actor".create() end) function Slime:ctor() copyTable(ActorCommonValues, self) copyTable(SlimeValues,self) self._ang...
mit
Amorph/premake-dev
tests/actions/vstudio/cs2005/test_assembly_refs.lua
1
1716
-- -- tests/actions/vstudio/cs2005/test_assembly_refs.lua -- Test the assembly linking block of a Visual Studio 2005+ C# project. -- Copyright (c) 2012 Jason Perkins and the Premake project -- T.vstudio_cs2005_assembly_refs = {} local suite = T.vstudio_cs2005_assembly_refs local cs2005 = premake.vstudio.cs2005 --...
bsd-3-clause
marwac-9/myframework
code/exts/luajit/src/host/genminilua.lua
47
12039
---------------------------------------------------------------------------- -- Lua script to generate a customized, minified version of Lua. -- The resulting 'minilua' is used for the build process of LuaJIT. ---------------------------------------------------------------------------- -- Copyright (C) 2005-2017 Mike P...
apache-2.0
RayRiver/LinkWar
src/framework/cc/registry.lua
23
1841
local Registry = class("Registry") Registry.classes_ = {} Registry.objects_ = {} function Registry.add(cls, name) assert(type(cls) == "table" and cls.__cname ~= nil, "Registry.add() - invalid class") if not name then name = cls.__cname end assert(Registry.classes_[name] == nil, string.format("Registry.ad...
lgpl-3.0
notcake/gooey
lua/gooey/ui/controls/gtab.lua
1
4245
local self = {} Gooey.Tab = Gooey.MakeConstructor (self) --[[ Events: CloseRequested () Fired when the close button of this tab has been clicked. ContentsChanged (Panel oldContents, Panel contents) Fired when the content panel of this tab has changed. Removed () Fired when this tab has been r...
gpl-3.0
autowitch/conky-aw2
scripts/init.lua
1
11495
config = require("pl.config") pretty = require("pl.pretty") seq = require('pl.seq') seq.import() dir = require('pl.dir') stringx = require('pl.stringx') glue = require('./scripts/glue') draw = require('./scripts/lib/draw') conky_cfg = require('./scripts/lib/config') widgets = require('./scripts/lib/widgets') cache = ...
mit
eriche2016/exercises
music_classification/data.lua
1
2655
require 'torch' require 'paths' local matio = require 'matio' dataset = {"data1.mat", "data2.mat", "data3.mat", "data4.mat"} data_paths = "./data/" function load_dataset(data_name) local path2data = data_paths .. data_name local label_data = matio.load(path2data) return label_data end -- music_dataset[i] for cl...
gpl-2.0
npge/lua-npge
spec/fragment/is_subfragment_of_spec.lua
2
1943
-- lua-npge, Nucleotide PanGenome explorer (Lua module) -- Copyright (C) 2014-2016 Boris Nagaev -- See the LICENSE file for terms of use. describe("npge.fragment.isSubfragmentOf", function() it("#is_subfragment", function() local model = require 'npge.model' local s = model.Sequence("genome&chromos...
mit
alikingambav/archer3
plugins/invite.lua
12
4020
do local function invite_user(chat_id, user_id, type_id) if is_banned(user_id, chat_id) then return send_large_msg('chat#id'..chat_id, 'Invitation canceled.\n' ..'ID'..user_id..' is (super)banned.') end chat_add_user('chat#id'..chat_id, 'user#id'..user_id, ok_cb, false) end local function resolve_username(extra...
gpl-2.0
tahashakiba/boomrange_bot
plugins/danbooru.lua
616
1750
do local URL = "http://danbooru.donmai.us" local URL_NEW = "/posts.json" local URL_POP = "/explore/posts/popular.json" local scale_day = "?scale=day" local scale_week = "?scale=week" local scale_month = "?scale=month" local function get_post(url) local b, c, h = http.request(url) if c ~= 200 then return nil end ...
gpl-2.0
joecridge/Jeo
hammerspoon/numpad.lua
1
2425
return { ['1'] = { key = 'none', alt = false, shift = false }, ['2'] = { key = 'none', alt = false, shift = false }, ['3'] = { key = 'none', alt = false, shift = false }, ['4'] = { key = 'none', alt = false, shift = false }, ['5'] = { key = 'none', alt = false, shift = false }, ['6'] = { key = '3', alt =...
unlicense
luzexi/slua-3rd
build/lua-cjson-2.1.0/tests/bench.lua
145
3247
#!/usr/bin/env lua -- This benchmark script measures wall clock time and should be -- run on an unloaded system. -- -- Your Mileage May Vary. -- -- Mark Pulford <mark@kyne.com.au> local json_module = os.getenv("JSON_MODULE") or "cjson" require "socket" local json = require(json_module) local util = require "cjson.ut...
mit
MinetestForFun/minetest-minetestforfun-server
mods/pipeworks/flowing_logic.lua
7
4511
-- This file provides the actual flow and pathfinding logic that makes water -- move through the pipes. -- -- Contributed by mauvebic, 2013-01-03, rewritten a bit by Vanessa Ezekowitz -- local finitewater = minetest.setting_getbool("liquid_finite") pipeworks.check_for_liquids = function(pos) local coords = { {x=po...
unlicense
MinetestForFun/minetest-minetestforfun-server
mods/whoison/init.lua
3
3907
whoison = {} whoison.lastrun = os.time() whoison.lastseen = {} local filename = minetest.get_worldpath().."/online-players" local seenfile = minetest.get_worldpath().."/last-seen" function whoison.createFile(loopit) local file = io.open(filename, "w") file:write(os.time().."\n") file:write(minetest.get_server_stat...
unlicense
hery/nn
Copy.lua
18
1142
local Copy, parent = torch.class('nn.Copy', 'nn.Module') function Copy:__init(intype, outtype, forceCopy, dontCast) intype = intype or torch.Tensor.__typename outtype = outtype or torch.Tensor.__typename self.dontCast = dontCast parent.__init(self) self.gradInput = torch.getmetatable(intype).new() ...
bsd-3-clause
cogddo/vlc
share/lua/intf/dumpmeta.lua
98
2125
--[==========================================================================[ dumpmeta.lua: dump a file's meta data on stdout/stderr --[==========================================================================[ Copyright (C) 2010 the VideoLAN team $Id$ Authors: Antoine Cellerier <dionoea at videolan dot org> Th...
gpl-2.0
holyscroll/holyscroll
plugins/setsticker.lua
2
1029
local function tosticker(msg, success, result) local receiver = get_receiver(msg) if success then local file = '/root/pika/data/pika.webp' print('File downloaded to:', result) os.rename(result, file) print('File moved to:', file) send_document(get_receiver(msg), file, ok_cb, false) redis:del...
gpl-2.0
wvdvegt/google-diff-match-patch
lua/diff_match_patch.lua
265
73869
--[[ * Diff Match and Patch * * Copyright 2006 Google Inc. * http://code.google.com/p/google-diff-match-patch/ * * Based on the JavaScript implementation by Neil Fraser. * Ported to Lua by Duncan Cross. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance ...
apache-2.0
dev-osrose/osIROSE-new
scripts/mobs/ai/pincer.lua
2
1072
registerNpc(511, { walk_speed = 250, run_speed = 550, scale = 200, r_weapon = 0, l_weapon = 0, level = 143, hp = 33, attack = 604, hit = 411, def = 524, res = 393, avoid ...
apache-2.0
Amorph/premake-dev
tests/actions/vstudio/vc2010/test_link.lua
1
8792
-- -- tests/actions/vstudio/vc2010/test_link.lua -- Validate linking and project references in Visual Studio 2010 C/C++ projects. -- Copyright (c) 2011-2013 Jason Perkins and the Premake project -- local suite = test.declare("vs2010_link") local vc2010 = premake.vstudio.vc2010 local project = premake5.proje...
bsd-3-clause
jak-boy/jak_boy-
plugins/stats.lua
22
4011
do -- Returns a table with `name` and `msgs` local function get_msgs_user_chat(user_id, chat_id) local user_info = {} local uhash = 'user:'..user_id local user = redis:hgetall(uhash) local um_hash = 'msgs:'..user_id..':'..chat_id user_info.msgs = tonumber(redis:get(um_hash) or 0) user_info.name = user_prin...
gpl-3.0
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/Tween.lua
19
2495
-------------------------------- -- @module Tween -- @extend ProcessBase -- @parent_module ccs -------------------------------- -- -- @function [parent=#Tween] getAnimation -- @param self -- @return ArmatureAnimation#ArmatureAnimation ret (return value: ccs.ArmatureAnimation) ------------------------------...
mit
ignorabimus/luasocket
samples/cddb.lua
56
1415
local socket = require("socket") local http = require("socket.http") if not arg or not arg[1] or not arg[2] then print("luasocket cddb.lua <category> <disc-id> [<server>]") os.exit(1) end local server = arg[3] or "http://freedb.freedb.org/~cddb/cddb.cgi" function parse(body) local lines = string.gfind(bo...
mit
luzexi/slua-3rd
build/luasocket-2.0.2/samples/cddb.lua
56
1415
local socket = require("socket") local http = require("socket.http") if not arg or not arg[1] or not arg[2] then print("luasocket cddb.lua <category> <disc-id> [<server>]") os.exit(1) end local server = arg[3] or "http://freedb.freedb.org/~cddb/cddb.cgi" function parse(body) local lines = string.gfind(bo...
mit
jetspam20/jetspam
plugins/groupmanager-fa.lua
16
110863
local function modadd(msg) local hash = "gp_lang:"..msg.chat_id_ local lang = redis:get(hash) if not is_admin(msg) then if not lang then return '_You are not bot admin_' else return 'شما مدیر ربات نمیباشید' end end local data = load_data(_config.moderation.data) if data[tostring(msg.chat_i...
gpl-3.0
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/EventListener.lua
8
1445
-------------------------------- -- @module EventListener -- @extend Ref -- @parent_module cc -------------------------------- -- Enables or disables the listener.<br> -- note Only listeners with `enabled` state will be able to receive events.<br> -- When an listener was initialized, it's enabled by default.<br> -- ...
mit
icebreaker/premake-dev
src/actions/vstudio/vs2002_csproj.lua
2
4726
-- -- vs2002_csproj.lua -- Generate a Visual Studio 2002/2003 C# project. -- Copyright (c) 2009-2011 Jason Perkins and the Premake project -- premake.vstudio.cs2002 = { } local vstudio = premake.vstudio local cs2002 = premake.vstudio.cs2002 -- -- Figure out what elements a particular file need in its item block,...
bsd-3-clause
syj2010syj/w3x2lni
script/gui/old/plugin.lua
1
3216
local fs = require 'bee.filesystem' require 'utility' local root = fs.current_path():remove_filename() local plugin_path = root / 'plugin' local function load_one_plugin(path) local plugin = assert(load(io.load(path), '@'..path:string(), 't', _ENV))() return { path = path:stem():string(), name ...
gpl-3.0
crazyhamedboy/botoliver
plugins/stats.lua
458
4098
-- Saves the number of messages from a user -- Can check the number of messages with !stats do local NUM_MSG_MAX = 5 local TIME_CHECK = 4 -- seconds local function user_print_name(user) if user.print_name then return user.print_name end local text = '' if user.first_name then text = user.last_name....
gpl-2.0
syj2010syj/w3x2lni
script/gui/new/common_attribute.lua
3
3987
local gui = require 'yue.gui' local function BindValue(t, data, bind, name, func) if t.bind and t.bind[name] then bind[name] = data:bind(t.bind[name], function() func(bind[name]:get()) end) func(bind[name]:get()) else if t[name] ~= nil then func(t[name]) ...
gpl-3.0
mlperf/training_results_v0.7
Inspur/benchmarks/transformer/implementations/implementation_closed/scripts/convert_model.lua
6
3533
-- Copyright (c) 2017-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the license found in the LICENSE file in -- the root directory of this source tree. An additional grant of patent rights -- can be found in the PATENTS file in the same directory. -- -- Usage: convert_model.lu...
apache-2.0
dev-osrose/osIROSE-new
scripts/mobs/ai/elder_bloodbat.lua
2
1069
registerNpc(258, { walk_speed = 500, run_speed = 850, scale = 115, r_weapon = 1076, l_weapon = 0, level = 60, hp = 32, attack = 281, hit = 137, def = 150, res = 122, avoid...
apache-2.0
Amorph/premake-dev
src/actions/vstudio/vs2010_vcxproj.lua
1
29037
-- -- vs2010_vcxproj.lua -- Generate a Visual Studio 201x C/C++ project. -- Copyright (c) 2009-2013 Jason Perkins and the Premake project -- premake.vstudio.vc2010 = {} local vc2010 = premake.vstudio.vc2010 local vstudio = premake.vstudio local project = premake5.project local config = premake5.config local tree...
bsd-3-clause
dev-osrose/osIROSE-new
scripts/mobs/ai/cherry_blossom_smouly.lua
2
1074
registerNpc(938, { walk_speed = 300, run_speed = 600, scale = 160, r_weapon = 1074, l_weapon = 0, level = 70, hp = 1886, attack = 295, hit = 215, def = 191, res = 90, avoi...
apache-2.0
MinetestForFun/minetest-minetestforfun-server
mods/interact/init.lua
9
13033
dofile(minetest.get_modpath("interact") .. "/config.lua") dofile(minetest.get_modpath("interact") .. "/rules.lua") --I put the rules in their own file so that they don't get lost/overlooked! local rule1 = 0 local rule2 = 0 local rule3 = 0 local rule4 = 0 local multi = 0 function table.length(T) local count = 0 for ...
unlicense
PurgePJ/VouchBot
deps/http-header.lua
5
4010
--[[ Copyright 2015 The Luvit Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agr...
gpl-3.0
siktirmirza/infernal
libs/mimetype.lua
28
2924
-- Thanks to https://github.com/catwell/lua-toolbox/blob/master/mime.types do local mimetype = {} -- TODO: Add more? local types = { ["text/html"] = "html", ["text/css"] = "css", ["text/xml"] = "xml", ["image/gif"] = "gif", ["image/jpeg"] = "jpg", ["application/x-javascript"] = "js", ["application/ato...
gpl-2.0
icebreaker/premake-dev
tests/test_string.lua
84
1550
-- -- tests/test_string.lua -- Automated test suite for the new string functions. -- Copyright (c) 2008 Jason Perkins and the Premake project -- T.string = { } -- -- string.endswith() tests -- function T.string.endswith_ReturnsTrue_OnMatch() test.istrue(string.endswith("Abcdef", "def")) end function T.strin...
bsd-3-clause
alikingambav/archer3
plugins/links-warn(@alireza_PT).lua.lua
1
2105
--by @mr_k1ng (@CliApi) --Our channel: @venus_ch do local function pre_process(msg) local alireza = msg['id'] local alireza1 = 'alirezapt:'..msg.to.id local link = msg.text:match("[Tt][Ee][Ll][Ee][Gg][Rr][Aa][Mm]%.[Mm][Ee]/") or msg.text:match("[Tt][Ll][Gg][Rr][Mm]%.[Mm][Ee]/") or msg.text:match("[Tt][Ee][Ll][Ee][Gg...
gpl-2.0
Amorph/premake-dev
tests/actions/vstudio/vc2010/test_item_def_group.lua
1
1302
-- -- tests/actions/vstudio/vc2010/test_item_def_group.lua -- Check the item definition groups, containing compile and link flags. -- Copyright (c) 2013 Jason Perkins and the Premake project -- local suite = test.declare("vs2010_item_def_group") local vc2010 = premake.vstudio.vc2010 local project = premake5.project...
bsd-3-clause
gregflynn/dotsanity
modules/awesome/sanity/widgets/screenlock.lua
1
1361
local button = require('awful.button') local gears = require('gears') local spawn = require('awful.spawn') local Container = require('sanity/util/container') local FontIcon = require('sanity/util/fonticon') local display = require('sanity/util/display') local color_on = colors.white local lock_icon = '' local...
mit
jak-boy/jak_boy-
plugins/jak_boy3.lua
1
3087
--[[ ▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀ ▀▄ ▄▀ ▀▄ ▄▀ ▀▄ ▄▀ BY MOHAMMED HISHAM ▀▄ ▄▀ ▀▄ ▄▀ BY MOHAMMEDHISHAM (@TH3BOSS) ▀▄ ▄▀ ▀▄ ▄▀ JUST WRITED BY MOHAMMED HISHAM ▀▄ ▄▀ ▀▄ ▄▀ مساعدة 3 ...
gpl-3.0
jak-boy/jak_boy-
plugins/plugins.lua
20
7107
--[[ ▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀ ▀▄ ▄▀ ▀▄ ▄▀ ▀▄ ▄▀ BY MOHAMMED HISHAM ▀▄ ▄▀ ▀▄ ▄▀ BY MOHAMMEDHISHAM (@TH3BOSS) ▀▄ ▄▀ ▀▄ ▄▀ JUST WRITED BY MOHAMMED HISHAM ▀▄ ▄▀ ▀▄ ▄▀ plugins : تفعيل الملفات ▀▄ ▄▀ ▀▄▀▀▄...
gpl-3.0
holyscroll/holyscroll
plugins/leave_ban.lua
1
2853
local function run(msg, matches) local data = load_data(_config.moderation.data) if msg.action and msg.action.type then local action = msg.action.type if data[tostring(msg.to.id)] then if data[tostring(msg.to.id)]['settings'] then if data[tostring(msg.to.id)]['settings']['leave_ban'] then ...
gpl-2.0
cega/papercrop
main.lua
15
10241
require('mylib') require('config') function processOption(option) option=string.gsub(option,"%) ", ")\n"); option=string.gsub(option," %(", " \n("); return option; end function unprocessOption(option) option=string.gsub(option, "%)\n", ") "); option=string.gsub(option, " \n%(", " ("); return option end functio...
gpl-2.0
rsjaffe/MIDI2LR
src/plugin/ProfileTypes.lua
1
5955
--[[---------------------------------------------------------------------------- ProfileTypes.lua Used in Profiles.lua and Init.lua This file is part of MIDI2LR. Copyright 2015 by Rory Jaffe. MIDI2LR is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publ...
gpl-3.0
jiweil/Neural-Dialogue-Generation
Atten/atten.lua
1
21444
require "cutorch" require "nn" require 'cunn' require "nngraph" local stringx = require('pl.stringx') local tds = require('tds') cutorch.manualSeed(123) local model={}; model.Data=torch.reload("./data") function model:Initial(params) self.Data:Initial(params) self.params=params self.lstm_source =self:lstm...
mit