repo_name stringlengths 6 78 | path stringlengths 4 206 | copies stringclasses 281
values | size stringlengths 4 7 | content stringlengths 625 1.05M | license stringclasses 15
values |
|---|---|---|---|---|---|
stevevance/Project-OSRM | profiles/examples/postgis.lua | 5 | 3421 |
-- This example shows how to query external data stored in PostGIS when processing ways.
-- This profile assumes that OSM data has been imported to PostGIS using imposm to a db
-- with the name 'imposm', the default user and no password. It assumes areas with
-- landusage=* was imported to the table osm_landusages, ... | bsd-2-clause |
cdrubin/wimbly-lib | email.lua | 1 | 4006 |
local email = {
client = 'wimbly'
}
function email.send( options )
options.cc = options.cc or {}
options.bcc = options.bcc or {}
options.attachments = options.attachments or {}
local sock = ngx.socket.tcp()
sock:settimeout( 5000 )
local ok, err = sock:connect( '127.0.0.1', 25 )
if not ok then ngx.sa... | mit |
pirate/snabbswitch | src/lib/hardware/register.lua | 7 | 7162 | -- register.lua -- Hardware device register abstraction
module(...,package.seeall)
local ffi = require("ffi")
local lib = require("core.lib")
--- ### Register object
--- There are three types of register objects, set by the mode when created:
--- * `RO` - read only.
--- * `RW` - read-write.
--- * `RC` - read-only an... | apache-2.0 |
xdel/snabbswitch | src/lib/hardware/register.lua | 7 | 7162 | -- register.lua -- Hardware device register abstraction
module(...,package.seeall)
local ffi = require("ffi")
local lib = require("core.lib")
--- ### Register object
--- There are three types of register objects, set by the mode when created:
--- * `RO` - read only.
--- * `RW` - read-write.
--- * `RC` - read-only an... | apache-2.0 |
zerotacg/wildstar-cartographer | cartographer/constants.lua | 1 | 1071 | local LibStub = _G["LibStub"]
local LibSpatial = LibStub:GetLibrary( "LibSpatial-0", 0 )
--------------------------------------------------------------------------------
local Constants = LibStub:NewLibrary( "cartographer/Constants-0", 0 )
if ( not Constants ) then return end
-----------------------------... | gpl-2.0 |
wcjscm/JackGame | frameworks/cocos2d-x/cocos/scripting/lua-bindings/auto/api/ActionScaleFrame.lua | 5 | 1739 |
--------------------------------
-- @module ActionScaleFrame
-- @extend ActionFrame
-- @parent_module ccs
--------------------------------
-- Changes the scale action scaleY.<br>
-- param rotation the scale action scaleY.
-- @function [parent=#ActionScaleFrame] setScaleY
-- @param self
-- @param #float scaleY
-- @re... | gpl-3.0 |
jafar-hasoon/demon | plugins/getlink.lua | 4 | 27427 |
do
local function check_member(cb_extra, success, result)
local receiver = cb_extra.receiver
local data = cb_extra.data
local msg = cb_extra.msg
for k,v in pairs(result.members) do
local member_id = v.id
if member_id ~= our_id then
-- Group configuration
data[tostring(msg.to.id)] = {
moderators = {},
set_owner = memb... | gpl-2.0 |
SLAPaper/MCGC | MCGC/c84130838.lua | 3 | 7053 | -- MC群服务器服主 纸睡
function c84130838.initial_effect(c)
-- 同调召唤
aux.AddSynchroProcedure(c, c84130838.filter, aux.NonTuner(c84130838.filter), 1)
c:EnableReviveLimit()
-- 召唤限制
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CAN... | mit |
LuaDist2/luacheck | src/luacheck/core_utils.lua | 5 | 2886 | local core_utils = {}
-- Calls callback with line, stack_set, index, item, ... for each item reachable from starting item.
-- `stack_set` is a set of indices of items in current propogation path from root, excluding current item.
-- Callback can return true to stop walking from current item.
function core_utils.walk_l... | mit |
amirkingred/telejian | plugins/id.lua | 226 | 4260 | 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..' '
end
if user.lastname then
text = text..user.last_name
end
return text
end
local function returnids(cb_extra, success, result)
local re... | gpl-2.0 |
heysion/prosody-modules | mod_benchmark_storage/mod_benchmark_storage.lua | 10 | 5752 | -- mod_benchmark_storage
-- Copyright (C) 2015 Kim Alvefur
--
-- Prime numbers are pretty cool
local gettime = require"socket".gettime;
local sm = require"core.storagemanager";
local um = require"core.usermanager";
local mm = require"core.modulemanager";
local test_data, test_users;
function module.command(arg)
lo... | mit |
rodrimc/ceu-media-multidevice | src/tv_samples/tv_mappings_v2.lua | 1 | 1367 | tvs = {}
controls = {}
function link_control_tv (control, tv)
map (control, 'KEY_PRESSED', tv, 'TURN_ON', function (_, key) return key == 0 end)
map (control, 'KEY_PRESSED', tv, 'PLAY', function (_, key) return key == 1 end)
map (control, 'KEY_PRESSED', tv, 'PAUSE', function (_, key) retur... | mit |
ominux/nn | Threshold.lua | 42 | 1158 | local Threshold, parent = torch.class('nn.Threshold','nn.Module')
function Threshold:__init(th,v,ip)
parent.__init(self)
self.threshold = th or 1e-6
self.val = v or 0
if (th and type(th) ~= 'number') or (v and type(v) ~= 'number') then
error('nn.Threshold(threshold, value)')
end
-- default for ... | bsd-3-clause |
ominux/nn | CMul.lua | 18 | 3574 | local CMul, parent = torch.class('nn.CMul', 'nn.Module')
function CMul:__init(...)
parent.__init(self)
local arg = {...}
self.size = torch.LongStorage()
local n = #arg
if n == 1 and torch.type(arg[1]) == 'torch.LongStorage' then
self.size:resize(#arg[1]):copy(arg[1])
else
self.size:r... | bsd-3-clause |
rbavishi/vlc-2.2.1 | 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... | lgpl-2.1 |
ld-test/lua-fann | test/module.lua | 2 | 1669 | -- This Lua script demonstrates how to use the LuaFann module
-- through the require("fann") statement.
-- It is based on the xor_train.c and xor_test.c example
-- programs distributed with FANN
require("fann")
-- Create a neural network, with 2 inputs, two hidden layer neurons,
-- and one output neuron
ann = fann.c... | lgpl-2.1 |
mahdiam1221/viper-FA | plugins/location.lua | 93 | 1704 | -- Implement a command !loc [area] which uses
-- the static map API to get a location image
-- Not sure if this is the proper way
-- Intent: get_latlong is in time.lua, we need it here
-- loadfile "time.lua"
-- Globals
-- If you have a google api key for the geocoding/timezone api
do
local api_key = nil
local base_... | gpl-2.0 |
OpenRA/OpenRA | mods/ra/maps/allies-06b/allies06b-AI.lua | 7 | 5725 | --[[
Copyright 2007-2022 The OpenRA Developers (see AUTHORS)
This file is part of OpenRA, which is free software. It is made
available to you under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later vers... | gpl-3.0 |
MrCerealGuy/Stonecraft | games/stonecraft_game/mods/farming/crops/peas.lua | 1 | 2445 |
local S = farming.intllib
-- Textures for Pea crop and Peas were done by Andrey01
-- pea pod
minetest.register_craftitem("farming:pea_pod", {
description = S("Pea Pod"),
inventory_image = "farming_pea_pod.png",
groups = {seed = 2, food_pea_pod = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_t... | gpl-3.0 |
pydsigner/naev | dat/missions/baron/baron_baron.lua | 7 | 12984 | --[[
-- This is the first mission in the crazy baron string.
--]]
-- localization stuff, translators would work here
lang = naev.lang()
if lang == "es" then
else -- default english
sysname1 = "Darkstone"
sysname2 = "Ingot"
planetname = "Varia"
title = {}
text = {}
osd_msg = {}
tit... | gpl-3.0 |
McGlaspie/mvm | lua/mvm/Hud/GUIWelderDisplay.lua | 1 | 6197 | // ======= Copyright (c) 2003-2011, Unknown Worlds Entertainment, Inc. All rights reserved. =======
//
// lua\GUIWelderDisplay.lua
//
// Created by: Andreas Urwalek (a_urwa@sbox.tugraz.at)
//
// Displays weld percentage of the current structure.
//
// ========= For more information, visit us at http://www.unknownworlds... | gpl-3.0 |
taeasy/packages | net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/interfaceconfig.lua | 26 | 7228 | -- ------ extra functions ------ --
function interfaceCheck()
metricValue = ut.trim(sys.exec("uci get -p /var/state network." .. arg[1] .. ".metric"))
if metricValue == "" then -- no metric
errorNoMetric = 1
else -- if metric exists create list of interface metrics to compare against for duplicates
uci.cursor()... | gpl-2.0 |
wcjscm/JackGame | frameworks/cocos2d-x/cocos/scripting/lua-bindings/auto/api/EaseCubicActionIn.lua | 2 | 1158 |
--------------------------------
-- @module EaseCubicActionIn
-- @extend ActionEase
-- @parent_module cc
--------------------------------
--
-- @function [parent=#EaseCubicActionIn] create
-- @param self
-- @param #cc.ActionInterval action
-- @return EaseCubicActionIn#EaseCubicActionIn ret (return value: cc.EaseCub... | gpl-3.0 |
salorium/awesome | lib/wibox/widget/progressbar.lua | 1 | 7399 | ---------------------------------------------------------------------------
--- A progressbar widget.
--
--@DOC_wibox_widget_defaults_progressbar_EXAMPLE@
-- @author Julien Danjou <julien@danjou.info>
-- @copyright 2009 Julien Danjou
-- @release @AWESOME_VERSION@
-- @classmod wibox.widget.progressbar
------------... | gpl-2.0 |
haider1984/-1 | plugins/ar-lock-bot.lua | 8 | 2916 | --[[
▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀
▀▄ ▄▀ ▀▄ ▄▀
▀▄ ▄▀ BY SAJJAD NOORI ▀▄ ▄▀
▀▄ ▄▀ BY SAJAD NOORI (@SAJJADNOORI) ▀▄ ▄▀
▀▄ ▄▀ JUST WRITED BY SAJJAD NOORI ▀▄ ▄▀
▀▄ ▄▀ ANTI BOT : منع بوتات ▀▄ ▄▀
▀▄▀... | gpl-2.0 |
pydsigner/naev | dat/missions/neutral/dts_01.lua | 5 | 10772 | --[[
MISSION: Defend the System 2
DESCRIPTION: A mission to defend the system against swarm of pirate ships.
This will be the second in a planned series of random encounters.
After the third mission, perhaps there'll be a regular diet of similar missions
Perhaps th... | gpl-3.0 |
spixi/wesnoth | data/lua/mapgen_helper.lua | 15 | 2713 | local LS = wesnoth.require "location_set"
local mapgen_helper, map_mt = {}, {__index = {}}
function mapgen_helper.create_map(width,height,default_terrain)
local map = setmetatable({w = width, h = height}, map_mt)
for i = 1, width * height do
table.insert(map, default_terrain or 'Gg')
end
return map
end
local v... | gpl-2.0 |
zturtleman/quakeconstruct | code/debug/lua/weapons/base_weapon/cl_init.lua | 2 | 2315 | function WEAPON:Register()
self.gun = LoadModel(self.baseModel)
self.ref = RefEntity()
self.ref:SetModel(self.gun)
self.fire = LoadSound("sound/weapons/deagle/fire.wav")
self.deploy = LoadSound("sound/weapons/deagle/deploy.wav")
self.holster = LoadSound("sound/weapons/deagle/holster.wav")
self.flash = Loa... | gpl-2.0 |
mathiasbynens/otclient | modules/game_playerdeath/playerdeath.lua | 3 | 1339 | deathWindow = nil
function init()
g_ui.importStyle('deathwindow')
connect(g_game, { onDeath = display,
onGameEnd = reset })
end
function terminate()
disconnect(g_game, { onDeath = display,
onGameEnd = reset })
reset()
end
function reset()
if deathWindow then
... | mit |
MOSAVI17/FreeTG | plugins/Time.lua | 120 | 2804 | -- Implement a command !time [area] which uses
-- 2 Google APIs to get the desired result:
-- 1. Geocoding to get from area to a lat/long pair
-- 2. Timezone to get the local time in that lat/long location
-- Globals
-- If you have a google api key for the geocoding/timezone api
api_key = nil
base_api = "https://m... | gpl-2.0 |
nimaghorbani/dozdi5 | plugins/TIME.lua | 120 | 2804 | -- Implement a command !time [area] which uses
-- 2 Google APIs to get the desired result:
-- 1. Geocoding to get from area to a lat/long pair
-- 2. Timezone to get the local time in that lat/long location
-- Globals
-- If you have a google api key for the geocoding/timezone api
api_key = nil
base_api = "https://m... | gpl-2.0 |
MrCerealGuy/Stonecraft | games/stonecraft_game/mods/farming/crops/melon.lua | 1 | 2528 |
local S = farming.intllib
-- melon
minetest.register_craftitem("farming:melon_slice", {
description = S("Melon Slice"),
inventory_image = "farming_melon_slice.png",
groups = {seed = 2, food_melon_slice = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack... | gpl-3.0 |
McGlaspie/mvm | lua/mvm/TeamIFFMixin.lua | 1 | 2067 | //
// Team Identify Friend or Foe Mixin
// author: Brock 'McGlaspie' Gillespie
// @McGlaspie - mcglaspie@gmail.com
//
//=============================================================================
if Client then
//TODO Create shader very similar to EquipmentOutline but fainter
// - Fade with distance or inverse?
/... | gpl-3.0 |
ananay/vice-players | Vendor/CEGUI/cegui/src/ScriptingModules/LuaScriptModule/support/tolua++bin/lua/class.lua | 7 | 5636 | -- tolua: class class
-- Written by Waldemar Celes
-- TeCGraf/PUC-Rio
-- Jul 1998
-- $Id: class.lua 1004 2006-02-27 13:03:20Z lindquist $
-- This code is free software; you can redistribute it and/or modify it.
-- The software provided hereunder is on an "as is" basis, and
-- the author has no obligation to provide ma... | gpl-3.0 |
pydsigner/naev | dat/events/tutorial/tutorial-aoutfits.lua | 11 | 4971 | -- This is the tutorial: activated outfits.
include("dat/events/tutorial/tutorial-common.lua")
-- localization stuff, translators would work here
lang = naev.lang()
if lang == "es" then
else -- default english
title1 = "Tutorial: Activated Outfits"
message1 = [[Welcome to the activated outfits tutorial.
This... | gpl-3.0 |
Shayan123456/shayanhhallaji | bot/utils.lua | 646 | 23489 | 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 |
spixi/wesnoth | data/ai/micro_ais/cas/ca_assassin_move.lua | 2 | 6223 | local H = wesnoth.require "helper"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local function get_units_target(cfg)
local units = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and", wml.get_child(cfg, "filter") }
}
local target = ... | gpl-2.0 |
mamaddeveloper/challegF | plugins/twitter_send.lua | 627 | 1555 | do
local OAuth = require "OAuth"
local consumer_key = ""
local consumer_secret = ""
local access_token = ""
local access_token_secret = ""
local client = OAuth.new(consumer_key, consumer_secret, {
RequestToken = "https://api.twitter.com/oauth/request_token",
AuthorizeUser = {"https://api.twitter.com/oauth/autho... | gpl-2.0 |
dmccuskey/dmc-gestures | examples/gesture-memtest/dmc_corona/dmc_gestures/core/gesture.lua | 10 | 14803 | --====================================================================--
-- dmc_corona/dmc_gesture/core/gesture.lua
--
-- Documentation:
--====================================================================--
--[[
The MIT License (MIT)
Copyright (c) 2015 David McCuskey
Permission is hereby granted, free of charge,... | mit |
dmccuskey/dmc-gestures | examples/gesture-tap-basic/dmc_corona/dmc_gestures/core/gesture.lua | 10 | 14803 | --====================================================================--
-- dmc_corona/dmc_gesture/core/gesture.lua
--
-- Documentation:
--====================================================================--
--[[
The MIT License (MIT)
Copyright (c) 2015 David McCuskey
Permission is hereby granted, free of charge,... | mit |
QuiQiJingFeng/skynet | lualib/skynet.lua | 3 | 16220 | -- read https://github.com/cloudwu/skynet/wiki/FAQ for the module "skynet.core"
local c = require "skynet.core"
local tostring = tostring
local tonumber = tonumber
local coroutine = coroutine
local assert = assert
local pairs = pairs
local pcall = pcall
local table = table
local profile = require "skynet.profile"
loc... | mit |
OpenRA/OpenRA | mods/cnc/maps/nod09/nod09.lua | 1 | 8763 | --[[
Copyright 2007-2022 The OpenRA Developers (see AUTHORS)
This file is part of OpenRA, which is free software. It is made
available to you under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later vers... | gpl-3.0 |
supermicronde3/NutScript-1.1-Plugins | perma3dstreamradio.lua | 1 | 1077 | PLUGIN.name = "PermaRadios"
PLUGIN.author = "SuperMicronde"
PLUGIN.desc = "Make the 3d stream radios permanent."
if StreamRadioLib then
nut.command.add("3dradioclean", {
superAdminOnly = true,
onRun = function (client, arguments)
for k, ent in pairs( ents.FindByClass( "sent_streamradio" ) ) do
ent:Re... | gpl-3.0 |
T3hArco/skeyler-gamemodes | Sassilization/gamemode/modules/unit/server/commands/move.lua | 1 | 1395 | ----------------------------------------
-- Sassilization
-- Shared Unit Module
-- http://sassilization.com
-- By Spacetech & Sassafrass
----------------------------------------
local CMD = {}
CMD.move = true
function CMD:Init( TargetPos )
self.pos = TargetPos
end
function CMD:Start( Unit )
... | bsd-3-clause |
MrCerealGuy/Stonecraft | games/stonecraft_game/mods/biome_lib/search_functions.lua | 1 | 2954 |
-- function to decide if a node has a wall that's in verticals_list{}
-- returns wall direction of valid node, or nil if invalid.
function biome_lib:find_adjacent_wall(pos, verticals, randomflag)
local verts = dump(verticals)
if randomflag then
local walltab = {}
if string.find(verts, minetest.get_node({ x=p... | gpl-3.0 |
drdownload/prosody-modules | mod_auto_accept_subscriptions/mod_auto_accept_subscriptions.lua | 11 | 2125 | local rostermanager = require "core.rostermanager";
local jid = require "util.jid";
local st = require "util.stanza";
local core_post_stanza = prosody.core_post_stanza;
local function handle_inbound_subscription_request(origin, stanza)
local to_bare, from_bare = jid.bare(stanza.attr.to), jid.bare(stanza.attr.from);
... | mit |
MrCerealGuy/Stonecraft | games/stonecraft_game/mods/mapgen_helper/place_schematic.lua | 1 | 12088 | -- These functions are a modification of the schematic placement code from src/mapgen/mg_schematic.cpp.
-- As such, this file is separately licened under the LGPL as follows:
-- License of Minetest source code
-------------------------------
--Minetest
--Copyright (C) 2010-2018 celeron55, Perttu Ahola <celeron55@gmai... | gpl-3.0 |
adan830/wicker | gadgets/functionqueue.lua | 6 | 2483 | --[[
Copyright (C) 2013 simplex
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 ... | gpl-2.0 |
litmus4/sejx3 | seCDhelper/seSparkingBoxes.lua | 1 | 3504 | seSparkingBoxes = {
bOn = true,
tShowTexture = {
{ szName = "¼¼ÄÜͼ±ê" },
{ szName = "ÉÁ¹â", Path = "star.UITex", },
{ szName = "Ping", Path = "ping.UITex", },
{ szName = "±¬Õ¨", Path = "starburst.UITex", },
{ szName = "Wave", Path = "wave.UITex", },
},
nBoxSize = 320,
nDelay = 1000,
MAX_ALPHA = 256,
n... | mit |
MethodicalAcceleratorDesign/MAD | src/ljit_bc.lua | 1 | 5621 | ----------------------------------------------------------------------------
-- LuaJIT bytecode listing module.
--
-- Copyright (C) 2005-2017 Mike Pall. All rights reserved.
-- Released under the MIT license. See Copyright Notice in luajit.h
----------------------------------------------------------------------------
-... | gpl-3.0 |
parsa13881/serverbot | plugins/anti-flood.lua | 281 | 2422 | local NUM_MSG_MAX = 5 -- Max number of messages per TIME_CHECK seconds
local TIME_CHECK = 5
local function kick_user(user_id, chat_id)
local chat = 'chat#id'..chat_id
local user = 'user#id'..user_id
chat_del_user(chat, user, function (data, success, result)
if success ~= 1 then
local text = 'I can\'t k... | gpl-2.0 |
zturtleman/quakeconstruct | code/debug/lua/includes/input.lua | 2 | 3391 | local users = {}
function PlayerUseKeyDown(pl)
if(type(pl) == "table") then
if(pl.EntIndex == nil) then return false end
local id = pl:EntIndex()+1
if(id > 0 and id <= #users) then
return (users[id] == 1)
end
elseif(type(pl) == "number") then
pl = pl + 1
if(pl > 0 and pl <= #users) then
... | gpl-2.0 |
ahmadreza5251/terojanbot | 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 |
libguestfs/libguestfs | lua/tests/070-optargs.lua | 4 | 1059 | #!/bin/sh
# -*- lua -*-
test -z "$LUA" && LUA=lua
exec $LUA << END_OF_FILE
-- libguestfs Lua bindings -*- lua -*-
-- Copyright (C) 2012 Red Hat Inc.
--
-- 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 Fou... | gpl-2.0 |
kkirstein/proglang-playground | Lua/complex_old.lua | 1 | 11763 | -- complex 0.3.0
-- Lua 5.1
-- 'complex' provides common tasks with complex numbers
-- function complex.to( arg ); complex( arg )
-- returns a complex number on success, nil on failure
-- arg := number or { number,number } or ( "(-)<number>" and/or "(+/-)<number>i" )
-- e.g. 5; {2,3}; "2", "2+i", "-2i", "2^2*3+1... | mit |
logzero/ValyriaTear | dat/maps/layna_forest/layna_forest_south_east_script.lua | 2 | 30474 | -- Set the namespace according to the map name.
local ns = {};
setmetatable(ns, {__index = _G});
layna_forest_south_east_script = ns;
setfenv(1, ns);
-- The map name, subname and location image
map_name = "Layna Forest"
map_image_filename = "img/menus/locations/layna_forest.png"
map_subname = ""
-- The music file use... | gpl-2.0 |
ominux/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 |
xingshuo/frame_sync_model | skynet/lualib/cluster.lua | 5 | 1436 | local skynet = require "skynet"
local clusterd
local cluster = {}
function cluster.call(node, address, ...)
-- skynet.pack(...) will free by cluster.core.packrequest
return skynet.call(clusterd, "lua", "req", node, address, skynet.pack(...))
end
function cluster.send(node, address, ...)
-- push is the same with r... | mit |
T3hArco/skeyler-gamemodes | Sassilization/gamemode/modules/building/shared.lua | 1 | 14749 | ----------------------------------------
-- Sassilization
-- Shared Building Module
-- http://sassilization.com
-- By Sassafrass / Spacetech
----------------------------------------
local table = table
local util = util
local umsg = umsg
local ents = ents
local SERVER = SERVER
local Vertex = Vert... | bsd-3-clause |
trink/symtseries | lua/test.lua | 2 | 7270 | require "sax"
require "string"
require "math"
assert(sax.version() == "0.5.0", sax.version())
local a = sax.word.new({10.3, 7, 1, -5, -5, 7.2}, 2, 8)
local b = sax.word.new("FC", 8)
assert(a == b, "Expected array to be equal to it's sax representation after transform")
local a = sax.word.new({10.3, 7, 1, -5, -5, 7.... | mpl-2.0 |
QuiQiJingFeng/skynet | lualib/skynet/db/redis/crc16.lua | 30 | 2687 | --/*
-- This is the CRC16 algorithm used by Redis Cluster to hash keys.
-- Implementation according to CCITT standards.
--
-- This is actually the XMODEM CRC 16 algorithm, using the
-- following parameters:
--
-- Name : "XMODEM", also known as "ZMODEM", "CRC-16/ACORN"
-- Width ... | mit |
MrCerealGuy/Stonecraft | games/stonecraft_game/mods/basic_materials/metals.lua | 1 | 8791 | -- Translation support
local S = minetest.get_translator("basic_materials")
-- items
minetest.register_craftitem("basic_materials:steel_wire", {
description = S("Spool of steel wire"),
groups = { wire = 1 },
inventory_image = "basic_materials_steel_wire.png"
})
minetest.register_craftitem("basic_materials:copper_... | gpl-3.0 |
MrCerealGuy/Stonecraft | games/stonecraft_game/mods/pyramids/room.lua | 2 | 2222 | local room = {"a","a","a","a","a","a","a","a","a",
"a","c","a","c","a","c","a","c","a",
"a","s","a","s","a","s","a","s","a",
"a","a","a","a","a","a","a","a","a",
"a","a","a","a","a","a","a","a","a",
"a","a","a","a","a","a","a","a","a",
"a","s","a","s","a","s","a","s","a",
"a","c","a","c","a","c","a","c","a",
"a... | gpl-3.0 |
pydsigner/naev | dat/missions/neutral/pirbounty_dead.lua | 4 | 15069 | --[[
Dead or Alive Pirate Bounty
Copyright 2014, 2015 Julian Marchant
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 3 of the License, or
(at your option) any later... | gpl-3.0 |
helkarakse/Miscellaneous | src/service/service.lua | 1 | 4520 | --[[
Player Services
Do not modify, copy or distribute without permission of author
Helkarakse 20131225
]]
-- Libraries
os.loadAPI("functions")
os.loadAPI("common")
-- References
local functions = functions
local switch = functions.switch
local common = common
local peripheral = peripheral
local os = os
local strin... | gpl-2.0 |
ahuraa/trinityadmin | Frames/MangFrames_PopupFrames.lua | 2 | 18088 | -------------------------------------------------------------------------------------------------------------
--
-- TrinityAdmin Version 3.x
-- TrinityAdmin is a derivative of MangAdmin.
--
-- Copyright (C) 2007 Free Software Foundation, Inc.
-- License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.h... | gpl-2.0 |
dmccuskey/dmc-gestures | examples/gesture-multigesture-basic/dmc_corona/lib/dmc_lua/lua_e4x.lua | 47 | 18011 | --====================================================================--
-- lua_e4x.lua
--
-- Documentation: http://docs.davidmccuskey.com/display/docs/lua_e4x.lua
--====================================================================--
--[[
The MIT License (MIT)
Copyright (C) 2014 David McCuskey. All Rights Reserve... | mit |
nuintun/payday2 | extras/mods/npc-weapons-customization/Weapons/c45_npc.lua | 1 | 4394 | log("c45_npc loaded")
Hooks:Add("LocalizationManagerPostInit", "NPCWeap_c45_Localization", function(loc)
LocalizationManager:add_localized_strings({
["random"] = "Random",
["c45_none"] = "None",
--Barrels
-- None, no modifications availiable
--Barrel Extensions
["c45_g_ns_ipsccomp"] = "IPSC Co... | mit |
cyox93/ftk | script_binding/lua/demo_check_button.lua | 8 | 1512 | function OnQuit(button)
Ftk.Quit()
return RET_OK
end
function OnClicked(button)
print("OnClicked")
return RET_OK
end
function AppInit()
win=FtkAppWindow.Create()
win:SetAttr(FTK_ATTR_QUIT_WHEN_CLOSE)
win:SetText("Demo check button")
width=win:Width()
height=win:Height()
width = width/2 - 10;
button=FtkC... | lgpl-3.0 |
AgentVi/DIGITS | digits/standard-networks/torch/ImageNet-Training/alexnet.lua | 2 | 3197 | if pcall(function() require('cudnn') end) then
print('Using CuDNN backend')
backend = cudnn
convLayer = cudnn.SpatialConvolution
convLayerName = 'cudnn.SpatialConvolution'
cudnn.fastest = true
else
print('Failed to load cudnn backend (is libcudnn.so in your library path?)')
if pcall(function() requ... | bsd-3-clause |
mamaddeveloper/challegF | plugins/modfake.lua | 3 | 11171 | do
local function check_member(cb_extra, success, result)
local receiver = cb_extra.receiver
local data = cb_extra.data
local msg = cb_extra.msg
for k,v in pairs(result.members) do
local member_id = v.id
if member_id ~= our_id then
local username = v.username
data[tostring(m... | gpl-2.0 |
salorium/awesome | tests/examples/gears/shape/template.lua | 1 | 1099 | -- Test if shape crash when called
-- Also generate some SVG to be used by the documentation
-- it also "prove" that the code examples are all working
local cairo = require( "lgi" ).cairo
local shape = require( "gears.shape" )
local filepath, svgpath, luacovpath = ...
-- If luacov is available, use it. Else, d... | gpl-2.0 |
libguestfs/libguestfs | lua/tests/050-lvcreate.lua | 4 | 1279 | #!/bin/sh
# -*- lua -*-
test -z "$LUA" && LUA=lua
exec $LUA << END_OF_FILE
-- libguestfs Lua bindings -*- lua -*-
-- Copyright (C) 2012 Red Hat Inc.
--
-- 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 Fou... | gpl-2.0 |
xdel/snabbswitch | src/core/timer.lua | 14 | 2701 | module(...,package.seeall)
local ffi = require("ffi")
local C = ffi.C
local lib = require("core.lib")
debug = _G.developer_debug
ticks = false -- current time, in ticks
ns_per_tick = 1e6 -- tick resolution (millisecond)
timers = {} -- table of {tick->timerlist}
-- This function can be removed in the futu... | apache-2.0 |
OpenRA/OpenRA | mods/d2k/maps/atreides-03a/atreides03a-AI.lua | 7 | 1962 | --[[
Copyright 2007-2022 The OpenRA Developers (see AUTHORS)
This file is part of OpenRA, which is free software. It is made
available to you under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later vers... | gpl-3.0 |
xdel/snabbswitch | src/lib/protocol/tcp.lua | 5 | 4120 | module(..., package.seeall)
local ffi = require("ffi")
local C = ffi.C
local lib = require("core.lib")
local header = require("lib.protocol.header")
local ipsum = require("lib.checksum").ipsum
local tcp_header_t = ffi.typeof[[
struct {
uint16_t src_port;
uint16_t dst_port;
uint32_t seq;
uint32_t ... | apache-2.0 |
luvit/luvit | init.lua | 2 | 3012 | --[[
Copyright 2014 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... | apache-2.0 |
SLAPaper/MCGC | MCGC/c84130834.lua | 3 | 2673 | -- MC群的萌物 菜鸟
function c84130834.initial_effect(c)
-- 召唤成功触发
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c84130834.target)
e1:SetOperation(c84130834.operation)
... | mit |
Ashkan7150/ASABOTS | plugins/id.lua | 3 | 3034 |
local function usernameinfo (user)
if user.username then
return '@'..user.username
end
if user.print_name then
return user.print_name
end
local text = ''
if user.first_name then
text = user.last_name..' '
end
if user.lastname then
text = text..user.last_n... | gpl-2.0 |
zturtleman/quakeconstruct | code/debug/lua/packs/advancedUI/painting/cl_skins.lua | 2 | 5503 | panel = panel or nil
local Skin = {}
local shader = LoadShader("9slice1")
local softwaremask = true
local maskOn = false
function SkinCall(func,...)
if(Skin[func]) then
local b,e = pcall(Skin[func],Skin,unpack(arg))
if(!b) then print(e .. "\n") end
if(b and e) then return e end
end
end
function ... | gpl-2.0 |
khanasbot/Avatar_Bot | plugins/face.lua | 641 | 3073 | local https = require("ssl.https")
local ltn12 = require "ltn12"
-- 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 request(imageUrl)
local api_key = mashape.api_key
if api_key:isempt... | gpl-2.0 |
mathiasbynens/otclient | modules/corelib/util.lua | 1 | 7363 | -- @docfuncs @{
function print(...)
local msg = ""
local args = {...}
local appendSpace = #args > 1
for i,v in ipairs(args) do
msg = msg .. tostring(v)
if appendSpace and i < #args then
msg = msg .. ' '
end
end
g_logger.log(LogInfo, msg)
end
function pinfo(msg)
g_logger.log(LogInfo,... | mit |
Djabbz/nn | SparseJacobian.lua | 61 | 8618 | nn.SparseJacobian = {}
function nn.SparseJacobian.backward (module, input, param, dparam)
local doparam = 0
if param then
doparam = 1
end
-- output deriv
module:forward(input)
local dout = module.output.new():resizeAs(module.output)
-- 1D view
local sdout = module.output.new(dout:stor... | bsd-3-clause |
ominux/nn | SpatialDropout.lua | 33 | 1453 | local SpatialDropout, Parent = torch.class('nn.SpatialDropout', 'nn.Module')
function SpatialDropout:__init(p)
Parent.__init(self)
self.p = p or 0.5
self.train = true
self.noise = torch.Tensor()
end
function SpatialDropout:updateOutput(input)
self.output:resizeAs(input):copy(input)
if self.train the... | bsd-3-clause |
pydsigner/naev | dat/ai/frontier_police.lua | 5 | 1671 | include("dat/ai/tpl/generic.lua")
include("dat/ai/personality/patrol.lua")
-- Settings
mem.aggressive = true
-- Create function
function create ()
-- Credits.
ai.setcredits( rnd.int(ai.shipprice()/300, ai.shipprice()/100) )
-- Handle bribing
if rnd.int() > 0.4 then
mem.bribe_no = "\"I shall espec... | gpl-3.0 |
heysion/prosody-modules | mod_turncredentials/mod_turncredentials.lua | 36 | 1415 | -- XEP-0215 implementation for time-limited turn credentials
-- Copyright (C) 2012-2013 Philipp Hancke
-- This file is MIT/X11 licensed.
local st = require "util.stanza";
local hmac_sha1 = require "util.hashes".hmac_sha1;
local base64 = require "util.encodings".base64;
local os_time = os.time;
local secret = module:ge... | mit |
pirate/snabbswitch | src/core/config.lua | 15 | 2423 | -- 'config' is a data structure that describes an app network.
module(..., package.seeall)
local lib = require("core.lib")
-- API: Create a new configuration.
-- Initially there are no apps or links.
function new ()
return {
apps = {}, -- list of {name, class, args}
links = {} -- table... | apache-2.0 |
kjoenth/naev | dat/missions/dvaered/dv_diversion.lua | 5 | 12741 | --[[
-- This is a oneoff mission where you help a new Dvaered Warlord takeover a planet
-- To Do: fix fighters being idle after mission ends
-- Other editors, feel free to update dialog to make it more dvaered like.
--]]
-- localization stuff, translators would work here
include("fleethelper.lua")
lang = naev.lang()... | gpl-3.0 |
rgujju/NexIDE | firmware/lua_examples/yet-another-ds18b20.lua | 79 | 1924 | ------------------------------------------------------------------------------
-- DS18B20 query module
--
-- LICENCE: http://opensource.org/licenses/MIT
-- Vladimir Dronnikov <dronnikov@gmail.com>
--
-- Example:
-- dofile("ds18b20.lua").read(4, function(r) for k, v in pairs(r) do print(k, v) end end)
------------------... | gpl-3.0 |
OpenRA/OpenRA | mods/ra/maps/sarin-gas-2-down-under/downunder.lua | 7 | 15672 | --[[
Copyright 2007-2022 The OpenRA Developers (see AUTHORS)
This file is part of OpenRA, which is free software. It is made
available to you under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later vers... | gpl-3.0 |
mamaddeveloper/challegF | plugins/qr.lua | 637 | 1730 | --[[
* qr plugin uses:
* - http://goqr.me/api/doc/create-qr-code/
* psykomantis
]]
local function get_hex(str)
local colors = {
red = "f00",
blue = "00f",
green = "0f0",
yellow = "ff0",
purple = "f0f",
white = "fff",
black = "000",
gray = "ccc"
}
for color, value in pairs(colors)... | gpl-2.0 |
salorium/awesome | lib/gears/matrix.lua | 1 | 8041 | ---------------------------------------------------------------------------
-- An implementation of matrices for describing and working with affine
-- transformations.
-- @author Uli Schlachter
-- @copyright 2015 Uli Schlachter
-- @release @AWESOME_VERSION@
-- @classmod gears.matrix
------------------------------------... | gpl-2.0 |
Djabbz/nn | Padding.lua | 32 | 1429 | local Padding, parent = torch.class('nn.Padding', 'nn.Module')
-- pad can be positive (right) negative (left)
function Padding:__init(dim, pad, nInputDim, value)
self.dim = dim
self.pad = pad
self.nInputDim = nInputDim
self.value = value or 0
self.outputSize = torch.LongStorage()
parent.__init(self)
... | bsd-3-clause |
T3hArco/skeyler-gamemodes | sslobby/entities/entities/info_minigame_ice/init.lua | 1 | 1514 | AddCSLuaFile("shared.lua")
AddCSLuaFile("cl_init.lua")
include("shared.lua")
---------------------------------------------------------
--
---------------------------------------------------------
function ENT:Initialize()
self:SetModel("models/sassafrass/icecube.mdl")
self:PhysicsInit(SOLID_VPHYSICS)
self:SetSoli... | bsd-3-clause |
OpenRA/OpenRA | mods/ra/maps/allies-06b/allies06b.lua | 7 | 7952 | --[[
Copyright 2007-2022 The OpenRA Developers (see AUTHORS)
This file is part of OpenRA, which is free software. It is made
available to you under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later vers... | gpl-3.0 |
adan830/wicker | api/themod.lua | 5 | 9876 | --[[
Copyright (C) 2013 simplex
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 ... | gpl-2.0 |
pirate/snabbswitch | src/lib/pmu.lua | 2 | 10393 | -- pmu.lua: Lua interface to the CPU Performance Monitoring Unit
module(..., package.seeall)
-- This module counts and reports on CPU events such as cache misses,
-- branch mispredictions, utilization of internal CPU resources such
-- as execution units, and so on.
--
-- Hundreds of low-level counters are available. ... | apache-2.0 |
xuqiongkai/GraphBasedRNN | model/ChildSumTreeRNN.lua | 1 | 6455 | --------------------------------------------------------------------------------
--
-- Graph-Based Recursive Neural Network for Vertex Classification
-- Copyright (C) 2016-2017 Qiongkai Xu, Chenchen Xu
--
-- Copyright (c) 2016 Kai Sheng Tai, Richard Socher,
-- and Christopher Mann... | gpl-3.0 |
wcjscm/JackGame | frameworks/cocos2d-x/cocos/scripting/lua-bindings/auto/api/ParticleSystemQuad.lua | 8 | 2822 |
--------------------------------
-- @module ParticleSystemQuad
-- @extend ParticleSystem
-- @parent_module cc
--------------------------------
-- Sets a new SpriteFrame as particle.<br>
-- WARNING: this method is experimental. Use setTextureWithRect instead.<br>
-- param spriteFrame A given sprite frame as particle ... | gpl-3.0 |
PersianLion/Work | plugins/inrealm.lua | 850 | 25085 | -- data saved to moderation.json
-- check moderation plugin
do
local function create_group(msg)
-- superuser and admins only (because sudo are always has privilege)
if is_sudo(msg) or is_realm(msg) and is_admin(msg) then
local group_creator = msg.from.print_name
create_g... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.