content stringlengths 5 1.05M |
|---|
-----------------------------------------
-- ID: 5483
-- Paladin Die
-- Teaches the job ability Gallant's Roll
-----------------------------------------
function onItemCheck(target)
return target:canLearnAbility(88)
end
function onItemUse(target)
target:addLearnedAbility(88)
end |
return {
Logs = require(script.Logs)
} |
local M = {}
function M.run_file(self)
return self.job_factory:create({ "flutter", "run" })
end
M.working_dir_marker = require("cmdhndlr.util").working_dir.upward_marker("pubspec.yaml")
return M
|
local test = {}
return test |
battle = {}
function battle.battle()
print("To the battle!")
end
return battle |
--[[
state machine
a finite state machine implementation
each state is either:
- a table with enter, exit, update and draw callbacks (all optional)
which each take the state table and varargs as arguments
- a function
which gets passed the current event name, the machine, and varargs as arguments
on chang... |
require "enet"
require('fa')
env = require('env')
server = {}
function server:init()
--szerver beállítása
local file = "port"
if not love.filesystem.exists(file) then error([[Hiányzik a "]]..file..[[" file]]) end
server.host = enet.host_create("*:"..love.filesystem.read(file))
--env beállításai
... |
require "abclua"
-------------------------------------------
-- Index a set of ABC tunes --
-- produces a sortable searchable index --
------------------------------------------
-- Takes a directory as a command line parameter, and writes out
-- an HTML representation of all the tunes in that directory tree to... |
additem = nil
local additem
function createWindow()
lootWindow = g_ui.displayUI('loot')
end
function disable()
lootButton:hide()
end
function hide()
lootWindow:hide()
end
function show()
lootWindow:show()
lootWindow:raise()
lootWindow:focus()
end |
require("class")
require("spatialgrid")
require("emitter")
require("particles/hydrogen")
require("particles/oxygen")
require("particles/lava")
require("particles/block")
StateTester = class()
function StateTester:_init()
self.paused = false
-- The grid which is used for broad-phased collision detection.
self.spat... |
-- nvim-tree.lua
----------------
vim.g.nvim_tree_auto_open = 1
vim.g.nvim_tree_ignore = { '.git', 'node_modules', '.cache' }
vim.g.nvim_tree_auto_ignore_ft = { 'startify' }
local opts = {
noremap = true,
silent = false,
expr = false,
}
vim.api.nvim_set_keymap('n', '<c-n>', ":NvimTreeToggle<cr>", opts)
|
local gamera = require "lib.gamera"
camera = gamera.new(0, 0, 512, 512)
camera:setWindow(0, 0, 64, 64)
return camera
|
--[[ DBiEncoder is a deep bidirectional sequencer used for the source language.
It is a special case of a PDBiEncoder with pdbrnn_reduction = 1.
]]
local DBiEncoder, parent = torch.class('onmt.DBiEncoder', 'onmt.PDBiEncoder')
local options = {}
function DBiEncoder.declareOpts(cmd)
onmt.BiEncoder.declareOpts(cmd)
... |
_G.__TEST__ = true
local _ = package.loaded['fun'] or require 'fun'()
require 'nginx-metrix.lib.is'()
local copy
copy = function(obj, seen)
if type(obj) ~= 'table' then return obj end
if seen and seen[obj] then return seen[obj] end
local s = seen or {}
local res = setmetatable({}, getmetatable(obj))
s[obj] ... |
local alphabet = {
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
"0", "1", "2", "3", "4", "5", "... |
ITEM.name = "357 Ammo"
ITEM.desc = "Box of 30 Bullets for High-Calibur Guns."
ITEM.base = "base_ammo"
ITEM.uniqueID = "a_10_357"
ITEM.ammo = "357"
ITEM.amount = 10
ITEM.model = Model( "models/Items/357ammo.mdl" ) |
local skynet = require "skynet"
require "skynet.manager"
-- register protocol text before skynet.start would be better.
skynet.register_protocol {
name = "text",
id = skynet.PTYPE_TEXT,
unpack = skynet.tostring,
dispatch = function(_, address, msg)
print(string.format(":%08x(%.2f): %s", address, skynet.time(), m... |
irate_flewt_matriarch = Creature:new {
objectName = "@mob/creature_names:irate_flewt_matriarch",
socialGroup = "flewt",
faction = "",
level = 8,
chanceHit = 0.27,
damageMin = 70,
damageMax = 75,
baseXp = 235,
baseHAM = 405,
baseHAMmax = 495,
armor = 0,
resists = {0,0,0,0,0,0,0,-1,-1},
meatType = "meat_avia... |
local ITEM = Clockwork.item:New("backpack_base");
ITEM.name = "Chest Rig";
ITEM.uniqueID = "chest_rig";
ITEM.model = "models/props_junk/cardboard_box003b.mdl";
ITEM.actualWeight = 1.5;
ITEM.invSpace = 6;
ITEM.slot = "chest";
ITEM.slotSpace = 7;
ITEM.description = "A chest rig with pouches all over it, very good to kee... |
local Trigger = script:GetCustomProperty("Trigger"):WaitForObject()
local BANG = script:GetCustomProperty("BANG")
local LOCAL_PLAYER = Game.GetLocalPlayer()
local SCALE = 15
function SpawnBang()
World.SpawnAsset(BANG, {position = Trigger:GetWorldPosition()})
script:Destroy()
end
function OnBeginOverlap(_, oth... |
--
-- Translations
--
local AceLocale = LibStub:GetLibrary("AceLocale-3.0")
local L = AceLocale:NewLocale("RealmImIn", "zhTW", false)
if not L then return end
--Probably static
L["ADDON_NAME"] = "StableSnapshot"
-- Translations
L["Addon_Desc"] = "StableSnapshot - An addon for hunters to take a snapshot of their stab... |
-- check for MineClone2
local mcl = minetest.get_modpath("mcl_core")
local item_water, item_dirt, item_grass
if mcl then
item_water = "mcl_core:water_source"
item_dirt = "mcl_core:dirt"
item_grass = "mcl_core:dirt_with_grass"
else
item_water = "default:water_source"
item_dirt = "default:dirt"
item_grass = "defa... |
--心者
local m=14010029
local cm=_G["c"..m]
function cm.initial_effect(c)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:Se... |
local Dependencies = require(script.Parent.Parent.Dependencies)
local TrackDependencies = Dependencies.TrackDependencies
local UpdateWithoutTracking = Dependencies.UpdateWithoutTracking
local UseDependency = Dependencies.UseDependency
local WEAK_KEYS = {__mode = "k"}
local StaticEffect = {ClassName = "StaticEffect"}
... |
--[[Author:
-- d2imba: 13.08.2015 (datadriven)
Editors:
-- EarthSalamander #42: 13.10.2018 (luafied)
-- ]]
------------------------------
-- CHEESE
------------------------------
-- Utilities
local function ConsumeCheese(parent, item)
-- Play sound
parent:EmitSound("DOTA_Item.Cheese.Activate")
-- Fully he... |
object_static_item_item_stone_cage_wall = object_static_item_shared_item_stone_cage_wall:new {
}
ObjectTemplates:addTemplate(object_static_item_item_stone_cage_wall, "object/static/item/item_stone_cage_wall.iff")
|
--[[
GD50
Super Mario Bros. Remake
Author: Colton Ogden
cogden@cs50.harvard.edu
]]
-- Don't do this in a "real" project, I've only done this so we don't need
-- to have copies of the extra libraries in every directory. Best practice is
-- to set things up so your project works with the default package... |
ESX = nil
local PlayerData = {}
local deliveredPosistions = 0
local hasDeletedAirplane = false
local hasStarted = false
local hasGottenReward = false
local drugCrates = {}
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait... |
local nativegetfenv = getfenv
if _VERSION == "Lua 5.1" then
-- If we're on Lua 5.1, install parts of the Lua 5.2/5.3 API so that programs can be written against it
local nativeload = load
local nativeloadstring = loadstring
local nativesetfenv = setfenv
function load( x, name, mode, env )
i... |
if (mode() == "load") then
local result = userInGroup("vasp")
io.stderr:write('userInGroup("vasp"): ', tostring(result),"\n")
local result = userInGroups("vasp")
io.stderr:write('userInGroups("vasp"): ', tostring(result),"\n")
local result = userInGroups("Vasp")
io.stderr:write('userI... |
-- redis-cli --eval ./batch-processor.lua source-queue source-job batch-queue batch-job , 1000 10 job-id 1504163093390 2017-08-31T07:04:53.390Z
local sourceQueue = KEYS[1]
local sourceJobName = KEYS[2]
local targetQueue = KEYS[3]
local targetJobName = KEYS[4]
local batchTimeout = tonumber(ARGV[1])
local batchMaxLength ... |
--
-- network.lua
-- simple network widget
-- dependencies: iproute2, iw
--
local awful = require("awful")
local wibox = require("wibox")
local gears = require("gears")
local beautiful = require("beautiful")
local keys = require("keys")
-- ========================================
-- Config
-- =======================... |
--[=[
Provides a data storage facility with an ability to get sub-stores. So you can write
directly to this store, overwriting all children, or you can have more partial control
at children level. This minimizes accidently overwriting.
The big cost here is that we may leave keys that can't be removed.
@server
@c... |
local optim = require 'optim'
local image = require 'image'
--local display = require 'display'
--display.configure({hostname='127.0.0.1', port=8000})
local M = {}
local Trainer = torch.class('matching.Trainer', M)
function Trainer:__init(model, criterion, opt, optimState)
self.model = model
self.criterion ... |
-- Papyrus Tank, by Silden 03-SEP-17
dofile("screen_reader_common.inc"); -- required for askForWindow function
dofile("common.inc"); -- required for findText function
local papyrusAmount = 7; -- Amount of Papyrus to plant
local papyrusPlanted = false;
local stepCounter = 0;
function doit()
askForWindow("For Loading... |
local ABCD = {}
function ABCD.NEW(data,rx, i)
return {data=data or "", rx=rx or "", yes=0, no=0,
known = {}, a={}, b={}, c={}, d ={}} end
local fmt = string.format
local function inc(f,a,n) f=f or {};f[a]=(f[a] or 0) + (n or 1) return f end
local function slots(t, u)
u={}; for k,v in pairs(t) do u[1... |
--[[
-- added by passion @ 2019/11/14 16:39:51
-- UIBoard模块窗口配置,要使用还需要导出到UI.Config.UIConfig.lua
-- 窗口配置
--]]
local UIBoardPlayer= {
Name = UIWindowNames.UIBoardPlayer,
Layer = UILayers.BackgroudLayer,
Model = require "UI.UIBoard.Model.UIBoardPlayerModel",
Ctrl = nil,
View = require "UI.UIBoard.View.UIBoardPlayer... |
-- =====================================================================
--
-- init.lua -
--
-- Created by liubang on 2020/12/11
-- Last Modified: 2020/12/11 00:23
--
-- =====================================================================
local g, o, fn = vim.g, vim.o, vim.fn
-- global functions
_G.P = function(v)
... |
--[[ Command ]]
CommandManager.Command("help", function(Args, Payload)
local HelpCommands = {}
local HelpSubCommands = {}
for CommandName, Command in pairs(CommandManager.GetAllCommands()) do
local CommandCategory = Command:GetCategory()
local CommandName = Command:GetName()
local CommandDescription = Command:... |
UIMenuGridPanel = setmetatable({}, UIMenuGridPanel)
UIMenuGridPanel.__index = UIMenuGridPanel
UIMenuGridPanel.__call = function() return "UIMenuPanel", "UIMenuGridPanel" end
function UIMenuGridPanel.New(TopText, LeftText, RightText, BottomText)
_UIMenuGridPanel = {
Data = {
Enabled = true,
},
Background = Sp... |
function ability( event )
-- Variables
local caster = event.caster
local attacker = event.attacker
local ability = event.ability
local damage = ability:GetLevelSpecialValueFor( "return_damage" , ability:GetLevel() - 1 )
local return_damage = damage
-- Damage
if attacker:IsRangedAttack... |
maraud_boots_schematic = {
minimumLevel = 0,
maximumLevel = -1,
customObjectName = "Marauder Boots Schematic",
directObjectTemplate = "object/tangible/loot/loot_schematic/marauder_s02_boots_schematic.iff",
craftingValues = {
},
customizationStringNames = {},
customizationValues = {}
}
addLootItemTemplate("mara... |
local p, t = pcall(require, 'nvim-tree')
if not p then
return
end
local g = vim.g
vim.o.termguicolors = true
--g.nvim_tree_ignore = { '.git', 'node_modules', '.cache', 'vendor' } -- empty by default
--g.nvim_tree_auto_ignore_ft = { 'startify', 'dashboard' } -- empty by default, don't auto open tree on specific file... |
function onCreate()
-- background shit
makeLuaSprite('whitey', 'whitey', -2200, -1700);
scaleLuaSprite('whitey', 1.5, 1.5);
setLuaSpriteScrollFactor('whitey', 0.5, 0.5);
addLuaSprite('whitey', false);
close(true); --For performance reasons, close this script once the stage is fully loaded, a... |
local opt = vim.opt
-- cmdline: mode, ruler {{{1
-- When `'statusline'` is empty, Vim displays the current line address, and
-- column number, in the statusline. This region is called the “ruler bar“
-- (`:help ruler`).
--
-- Even though we should never see it, disable it explicitly.
opt.ruler = false
-- NOTE: If on... |
require 'bit'
local SDL = require "LuaSDL2"
SDL.init()
SDL.videoInit()
do
local window = SDL.createWindow("Video test window", SDL.WINDOWPOS_CENTERED_MASK, SDL.WINDOWPOS_CENTERED_MASK, 640, 480, bit.bor(SDL.WINDOW_OPENGL, SDL.WINDOW_RESIZABLE))
if window then
window.title = "Test window title"
local running =... |
local zproto = require "suite.zproto"
local core = netsocket
local M = {}
local ALIVE = setmetatable({}, {__mode = "kv"})
local mt = {__index = M}
function M:create(proto)
local str = table.concat(proto, "\n")
str = [[
error 0x1 {
.cmd:integer 1
.errno:integer 2
}
]] .. str
print(str)
loc... |
require('scrollview').setup({
excluded_filetypes = {'NvimTree'},
current_only = true,
winblend = 0,
})
|
function siren_sync ( sirenTable )
local veh = source
for k,v in ipairs( sirenTable ) do
setVehicleSirens(veh, k, v.x ~= nil and v.x or 0, v.y ~= nil and v.y or 0, v.z ~= nil and v.z or 0, v.Red ~= nil and v.Red or 0, v.Green ~= nil and v.Green or 0, v.Blue ~= nil and v.Blue or 255, v.Alpha ~= nil and v.Alpha or 25... |
local webhook = "WEBHOOK_URL"
Users = {}
violations = {}
hashValidatedUsers = {}
Citizen.CreateThread(function()
AddEventHandler('playerDropped', function(reason)
local source = source
local sname = GetPlayerName(source)
for i,user in pairs(hashValidatedUsers) do
if user.identifier == GetPlayerIdentifie... |
--- @module luarocks.which_cmd
-- Driver for the `luarocks which` command.
local which_cmd = {}
local loader = require("luarocks.loader")
local cfg = require("luarocks.core.cfg")
local util = require("luarocks.util")
which_cmd.help_summary = "Tell which file corresponds to a given module name."
which_cmd.help_argume... |
local Class = require('luatest.class')
-- Utils for smart comparison.
local comparator = {}
function comparator.cast(value)
if type(value) == 'cdata' then
local ok, table_value = pcall(function() return value:totable() end)
if ok then
return table_value
end
end
return v... |
Room = {}
Room.__index = Room
function Room:Create(id, data)
local bucket = math.abs(GetHashKey(id))
if bucket ~= 0 then
SetRoutingBucketPopulationEnabled(bucket, false)
end
data = data or {}
data.id = id
data.bucket = bucket
data.players = {}
local room = setmetatable(data, Room)
Instances.rooms[id] = ... |
object_mobile_outbreak_undead_boss_f_hum_01 = object_mobile_shared_outbreak_undead_boss_f_hum_01:new {
}
ObjectTemplates:addTemplate(object_mobile_outbreak_undead_boss_f_hum_01, "object/mobile/outbreak_undead_boss_f_hum_01.iff")
|
fx_version 'cerulean'
games { 'gta5' }
description 'NPC-Emotes'
version '1.0.0'
client_script "@npc-warmenu/warmenu.lua"
client_script "@npc-scripts/client/errorlog.lua"
client_script "client.lua"
client_script "cl_menu.lua"
client_script "sitchair.lua"
client_script "finger-point.lua" |
---
-- FDMMTEST Unit Test Module.
-- @module FDMMTEST_UnitTest
env.info("---FDMMTEST_UnitTest Start---")
do -- FDMMTESTUnitTest
--- Unit test class.
-- @type FDMMTESTUnitTest
-- @extends FDMMFacility
FDMMTESTUnitTest = {}
FDMMTESTUnitTest.__index = FDMMTESTUnitTest
setmetatable(FDMMTESTUnitTest, {
__c... |
Dot = require "dot"
local Bonus = Dot:extend()
types = {"tripple shot", "infinity ammo", "red shot", "reversed grav", "less enemys"}
times = {10, 8, 4, 12, 8}
images = {
love.graphics.newImage("bonus-images/tripple.png"),
love.graphics.newImage("bonus-images/infini.png"),
love.graphics.newImage("bonus-ima... |
local math = require("__flib__.math")
local util = require("scripts.util")
local fluid_proc = require("scripts.processors.fluid")
return function(recipe_book, strings, metadata)
for name, prototype in pairs(game.recipe_prototypes) do
local category = prototype.category
local enabled_at_start = prototype.e... |
AddCSLuaFile()
DEFINE_BASECLASS( "base_wire_entity" )
ENT.PrintName = "Wire Advanced Input"
ENT.WireDebugName = "Adv. Input"
if CLIENT then return end -- No more client
function ENT:Initialize()
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPHYSICS )
self.Inputs =... |
minetest.override_item("metal_melter:heated_bricks", {
groups = {cracky = 3, multifurnace = 1},
})
|
return {'ddt'} |
local PALETTE_DB = require 'database.palette'
local State = require 'state'
local ListMenu = require 'view.list_menu'
local Vec = require 'common.vec'
local ChooseQuestState = require 'common.class' (State)
local LMARGIN = 32
function ChooseQuestState:_init(stack)
self:super(stack)
local options = self:_load_qu... |
return {
version = "1.1",
luaversion = "5.1",
tiledversion = "v0.15.2-100-gd5be8ea",
orientation = "orthogonal",
renderorder = "right-down",
width = 30,
height = 17,
tilewidth = 32,
tileheight = 32,
nextobjectid = 15,
properties = {
["areaNameKey"] = "binaryborderArea"
},
tilesets = {
... |
local concord = require("lib.concord")
local core = require("const.core")
return concord.component(
function(e, capacity, genericCost, food, water, dangerousExertionLevel)
e.capacity = capacity
e.genericCost = genericCost or 1 / (core.speed * 60 * 30)
e.food = food or not water and capacity / 2
e.water = water... |
require("prototypes.steam-barrel")
|
local round_status = 0 -- 0 = end 1 = active
local active_round = 1
local targetPos = Vector ()
local spawnPos = Vector(-96.74 , -210.92 , 202.03)
--local spawnPos = Vector(-28.11 , -197.56 , 92.03) --Spawn downstairs for change problem
local spawnWall1 = Vector(-49.10 , 180.01 , 175.74)
local spawnTub = Vector(-180.... |
local Quest = {}
Quest.Name = "quest_arsenalupgrade"
Quest.PrintName = "Arsenal Upgrade"
Quest.Story = "Ah, I see you're still lugging around that dinky little pistol.. Here, I'll tell you what. If you collect the materials, I'll upgrade it for you."
Quest.Level = 13
Quest.ObtainItems = {}
Quest.ObtainItems["weapon_ran... |
EFFECT.Mat = Material( "snowysnowtime/contrails/sniper_contrail" )
function EFFECT:Init( data )
self.texcoord = math.Rand( 0, 0 )/3
self.Position = data:GetStart()
self.WeaponEnt = data:GetEntity()
self.Attachment = data:GetAttachment()
self.StartPos = self:GetTracerShootPos( self.Position, self.WeaponEnt, ... |
-- 'Class' representing a independent part of the factory with in- and outputs
Subfactory = {}
function Subfactory.init(name, icon, timescale_setting)
local subfactory = {
name = name,
icon = nil,
timescale = nil,
energy_consumption = 0,
pollution = 0,
notes = "",
... |
-- Dejunk: enUS (English) localization file.
local AddonName = ...
local L = _G.LibStub('AceLocale-3.0'):NewLocale(AddonName, 'enUS', true)
L["ACTIVE_PROFILE_TEXT"] = "Active Profile"
L["ADDED_ITEM_TO_LIST"] = "Added %s to %s."
L["ALT_RIGHT_CLICK"] = "Alt Right-Click"
L["AUTO_OPEN_DESTROY_TOOLTIP"] = "Automatically o... |
local t = Def.ActorFrame{
LoadActor("PaneRadar")..{
InitCommand=cmd(x,SCREEN_RIGHT-175-120;y,SCREEN_CENTER_Y-118+12;player,PLAYER_2;zoom,0.9);
OffCommand=cmd(linear,0.25;addx,500);
};
StandardDecorationFromFileOptional( "GrooveRadarP2_Pane", "GrooveRadarP2_Pane" );
StandardDecorationFromFileOptional("PaneDisplayText... |
local fontlist = require("fontlist")
local function createFaceDb(facelist)
local facedb = {}
for _, face in ipairs(facelist) do
--print(face.family)
local familyslot = facedb[face.family]
if not familyslot then
familyslot = {}
facedb[face.family] = familyslot
... |
require 'Q/UTILS/lua/strict'
local pldir = require 'pl.dir'
local plpath = require 'pl.path'
--=== Following to prune unwanted file
local blacklist = require 'Q/TEST_RUNNER/blacklist'
local qconsts = require 'Q/UTILS/lua/qconsts'
local q_src_root = qconsts.Q_SRC_ROOT
local ignore_files = {}
for i, v in pairs(blackli... |
net.Receive("EventSystem:UI:Admin", function()
EventSystem.Core.GameMasterUI()
end)
net.Receive("EventSystem:UI:Admin:CreateEvent", function()
EventSystem.Core.CreateEventUI()
end)
net.Receive("EventSystem:Message", function()
local msg = net.ReadString()
EventSystem.Core.MessageUI(msg)
XYZShit.Msg("Game Master"... |
-- Unified Inventory for Minetest 0.4.8+
local modpath = minetest.get_modpath(minetest.get_current_modname())
local worldpath = minetest.get_worldpath()
-- Data tables definitions
unified_inventory = {
activefilter = {},
active_search_direction = {},
alternate = {},
current_page = {},
current_searchbox = {},
cu... |
project "AppFrame"
kind "StaticLib"
language "C++"
cppdialect "C++17"
staticruntime "off"
targetdir ("../Build/bin/" .. outputdir .. "/%{prj.name}")
objdir ("../Build/bin-int/" .. outputdir .. "/%{prj.name}")
files {
"src/**.h",
"src/**.c",
"src/**.hpp",
"src/**.cpp"
}
defines {
}
includedirs {... |
local Root = script:FindFirstAncestorWhichIsA("Script")
local Roact = require(Root.dependencies.Roact)
local e = Roact.createElement
local Page = Roact.Component:extend("Page")
return Page |
-- Program 2: Vypocet faktorialu (rekurzivne)
function factorial(n)
local temp_result;
local decremented_n;
local result;
if n < 2 then
result = 1;
else
decremented_n = n - 1;
temp_result = factorial(decremented_n);
result = n * temp_result;
end;
return result;
end
function main() --Hlavni telo ... |
local partition = require("partition")
local AREA = 25000 -- area size
local DISKS = 1e6
local DISK_MINR = 1
local DISK_MAXR = 15
local SCALE = 10 -- pixels/meter
local SPEED = 100 -- m/s
local MRADIUS = 2
local function randf(a, b) return math.random()*(b-a)+a end
local function reflect(vx, vy, nx, ny)
local NdotI... |
local t = Def.ActorFrame{};
if ScreenMetric("Summary") then
-- summary just uses the normal background
t[#t+1] = Def.Quad{
InitCommand=cmd(FullScreen;diffuse,HSV(192,1,0.05);diffusebottomedge,HSV(192,0.75,0.125))
}
elseif GAMESTATE:IsCourseMode() then
-- course mode
t[#t+1] = Def.Quad{
InitCommand=cmd(FullScr... |
local cjson = require "cjson"
local helpers = require "spec.helpers"
describe("Plugin: oauth (API)", function()
local consumer, api, admin_client
setup(function()
helpers.prepare_prefix()
assert(helpers.start_kong())
admin_client = helpers.admin_client()
end)
teardown(function()
if admin_clien... |
local addonName, addonScope = ...
local data = addonScope.data
local AL = addonScope.AL
local ALIL = addonScope.ALIL
local NORMAL_DIFF = addonScope.NORMAL_DIFF
local ALLIANCE_DIFF = addonScope.ALLIANCE_DIFF
local HORDE_DIFF = addonScope.HORDE_DIFF
local LOAD_DIFF = addonScope.LOAD_DIFF
local NORMAL_ITTYPE = addonScope.... |
--[[
Author: tochonement
Email: tochonement@gmail.com
14.07.2021
--]]
whoi = whoi or {}
include("libraries/sh_load.lua")
include("shared.lua") |
local selected = {}
local de = function(e, k)
return exports.denstats:getPlayerAccountData(e, k)
end
local dez = function(e, k)
return exports.DENmysql:querySingle("SELECT * FROM playerstats WHERE userid=? LIMIT 1", e)[k]
end
local rank = function (e, occ)
if e and occ then
local name, num, maxs = exports... |
local EchoPolicy = require('apicast.policy.echo')
describe('Echo policy', function()
describe('.rewrite', function()
describe('when configured with exit=request', function()
it('stops processing the request and returns with the configured status', function()
local ngx_exit_spy = spy.on(ngx, 'exit')... |
local M = {}
function M.config()
local status_ok, nvimtree = pcall(require, 'nvim-tree')
if not status_ok then
return
end
nvimtree.setup {
filters = {
dotfiles = false,
custom = {
".git",
"node_modules",
".cache",
},
},
disable_netrw = true,
hijack... |
require 'optim'
-- class for training a composition model
-- code based on the Torch supervised learning tutorial (https://github.com/torch/tutorials/tree/master/2_supervised)
local Composer = torch.class('nn.Composer')
function Composer:__init(m, config)
self.module = m
if (config.criterion == 'abs') then
sel... |
local cfg = {}
cfg.display_css = [[
.div_job{
position: absolute;
top: 160px;
right: 20px;
font-size: 1.4em;
font-weight: bold;
color: white;
text-shadow: 3px 3px 2px rgba(0, 0, 0, 0.80);
}
]]
return cfg
|
remote = require 'net.box'
fiber = require 'fiber'
test_run = require('test_run').new()
-- #636: Reload schema on demand
sp = box.schema.space.create('test_old')
_ = sp:create_index('primary')
sp:insert{1, 2, 3}
box.schema.user.grant('guest', 'read', 'space', 'test_old')
con = remote.new(box.cfg.listen)
con:ping()
co... |
-- Copyright (c) 2017-present, Facebook, Inc.
-- All rights reserved.
-- This source code is licensed under the BSD-style 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.
local gtn = require ... |
-- zeus_flash_sub
-- claw_flash_sub
return {
["zeus_flash_sub"] = {
unit_sparkles = {
air = true,
class = [[CSimpleParticleSystem]],
count = 3,
ground = true,
unit = 1,
water = true,
properti... |
-- a Lua expect-like library
require 'path'
if not path.loadlib('lexpect','spawnx') then
print 'cannot find spawnx in same directory as lexpect.lua'
end
local append = table.insert
local find = string.find
local remove = table.remove
local concat = table.concat
local type = type
local ipairs = ipairs
local ... |
require("love.timer")
local thread, timer
do
local _obj_0 = love
thread, timer = _obj_0.thread, _obj_0.timer
end
local http = require("socket.http")
local check
check = function(data)
local send = thread.getChannel(data.thread_channel or "itchy")
local exponential_backoff = 1
while true do
local _continue... |
Appender = require("lua-log-r.appender.null")
appender = Appender:new()
appender:append("This line will appear nowhere") |
#!/usr/bin/env lua
a=10
while( a < 20 )
do
print("a 的值为:", a)
a = a+1
end
function f(x)
print("function")
return x*2
end
for i=1,f(5) do print(i)
end
for i=10,1,-1 do
print(i)
end
a = {"one", "two", "three"}
for i, v in ipairs(a) do
print(i, v)
end
days = {"Sunday","Monday","Tuesd... |
local t = require( "taptest" )
local tobase16 = require( "tobase16" )
-- should convert data to a hex string
t( tobase16( "Hello world!" ), "48656C6C6F20776F726C6421" )
t()
|
-- test vectors from milagro
print("TEST DECRYPTION VECTORS")
function runtest()
assert( multiparty.decrypt(P, Q, CIPHERTEXT) == PLAINTEXT )
end
TEST = "0"
P = "94f689d07ba20cf7c7ca7ccbed22ae6b40c426db74eaee4ce0ced2b6f52a5e136663f5f1ef379cdbb0c4fdd6e4074d6cff21082d4803d43d89e42fd8dfa82b135aa31a8844ffea25f255f956cbc... |
Config = {}
Config.DrawDistance = 100.0
Config.MarkerType = 1
Config.MarkerSize = { x = 1.5, y = 1.5, z = 1.0 }
Config.MarkerColor = { r = 50, g = 50, b = 204 }
Config.NPCJobEarnings = {min = 450, max = 750}
Config.Enabl... |
UiMemo = UiCopyTable(dxMain)
function UiMemo:Create(x, y, sx, sy,text,parent)
local text = setmetatable({
x=x,
y=y,
sx=sx,
sy=sy,
text = text,
children = {},
el = createElement("dxmemo"),
parent = false,
visible = true,
redraw = true,
enabled = true,
alignX = "left",
alignY... |
-- Local instances of Global tables --
local PA = PersonalAssistant
-- =====================================================================================================================
local PALootMenuDefaults = {
name = table.concat({GetString(SI_PA_PROFILE), " ", 1}),
-- -------------------------------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.