content
stringlengths
5
1.05M
local a = vim.api local lir = require'lir' local M = {} function M.mmv() local context = lir.get_context() local cwd = context.dir local files = {} for _, f in ipairs(context.files) do table.insert(files, f.value) end local save_editor = vim.env.EDITOR vim.env.EDITOR = "nvr --remote-wait" loca...
-- libmthelpers.readonly: -- defensive protection of objects to prevent modifications to shared objects, -- so that users of the protected object cannot modify it, -- and therefore affect other users. local readonly = {} -- used to be here, now aliased from tableutils for compatibilty local tableutils = mtrequire("co...
-- Generated by util/isthe.com-number-names.sh number_names = {} number_names[2] = "hundred" number_names[3] = "thousand" number_names[6] = "million" number_names[9] = "billion" number_names[12] = "trillion" number_names[15] = "quadrillion" number_names[18] = "quintillion" number_names[21] = "sextillion" number_names...
--[[ (commented out due to not needed atm) if not DropDownMenuTest then CreateFrame("Button", "DropDownMenuTest", UIParent, "UIDropDownMenuTemplate") end DropDownMenuTest:ClearAllPoints() DropDownMenuTest:SetPoint("CENTER", 0, 0) DropDownMenuTest:Show() local items = { "Alpha", "Bet...
-- Credit for this implementation goes to @arbelt and @jasoncodes 🙇⚡️😻 -- -- https://gist.github.com/arbelt/b91e1f38a0880afb316dd5b5732759f1 -- https://github.com/jasoncodes/dotfiles/blob/ac9f3ac/hammerspoon/control_escape.lua send_escape = false last_mods = {} control_key_handler = function() send_escape = f...
-- -- Licensed to the Apache Software Foundation (ASF) under one or more -- contributor license agreements. See the NOTICE file distributed with -- this work for additional information regarding copyright ownership. -- The ASF licenses this file to You under the Apache License, Version 2.0 -- (the "License"); you may ...
true_zen = require("true-zen")
local wibox = require ('wibox') local awful = require ('awful') local hover_container = function ( widget ) local old_cursor, old_wibox widget:connect_signal ( 'mouse::enter', function() local w = mouse.current_wibox if w then old_cursor, old_wibox = w.cursor, w w.cursor = 'han...
local g = vim.g g.nvim_tree_indent_markers = 1 g.nvim_tree_quit_on_open = 1 g.nvim_tree_git_hl = 1 require("nvim-tree").setup { open_on_setup = false, filters = { custom = { "node_modules" } } }
Talk(106, "客倌请随便看看.", "talkname106", 0); ModifyEvent(-2, -2, -2, -2, 483, -2, -2, -2, -2, -2, -2, -2, -2); do return end;
tArgs = {...} local package = tArgs[1] local usr = tArgs[2] or "%ROOT%" local installPath = "" if usr == "%ROOT%" then installPath = "/os/programs/pkgs" .. package elseif usr ~= string.match(usr, "[%w_-]*") then error("User contains invalid characters") elseif not fs.isDir("/home/" .. usr) then error("User...
local path = minetest.get_modpath("flower_cow") -- Animals dofile(path .. "/flower_cow.lua") print ("[MOD] Flower cow loaded")
local palette = {0x000000, 0x000040, 0x000080, 0x0000BF, 0x0000FF, 0x002400, 0x002440, 0x002480, 0x0024BF, 0x0024FF, 0x004900, 0x004940, 0x004980, 0x0049BF, 0x0049FF, 0x006D00, 0x006D40, 0x006D80, 0x006DBF, 0x006DFF, 0x009200, 0x009240, 0x009280, 0x0092BF, 0x0092FF, 0x00B600, 0x00B640, 0x00B680, 0x00B6BF, 0x00B6FF, 0...
statusd.inform("wireless_template", "0%") local function inform_wireless(status) statusd.inform("wireless", tostring(status)) if status == "X" then statusd.inform("wireless_hint", "critical") else statusd.inform("wireless_hint", "important") end end local wireless_timer=statusd.create_...
project "gX-Sandbox" kind "ConsoleApp" language "C++" dependson { "gXtp-glad", "gXtp-glfw", "gXtp-stb", "gXtp-glm", "gX-Core", "gX-Platform" } objdir "%{wks.location}/.build/obj/%{prj.name}" targetdir "%{wks.location}/.build/%{prj.name}" fil...
function formattime(ticks) local minutes = math.floor(ticks / 60 / 60) local hours = math.floor(minutes / 60) return string.format("%02dh%02dm", hours, minutes % 60) end function wellbeing_message_handler() local ticks_per_minute = 60 * 60 local interval_list_in_ticks = {} for i, player in pai...
local assert = require("luassert") local say = require("say") local function less(state, arguments) return arguments[1] < arguments[2] end local function greater(state, arguments) return arguments[1] > arguments[2] end say:set_namespace("en") say:set("assertion.less.positive", "Expected %s to be smaller than ...
grainamount = 0.01 lumamount = 0.1 noise = -1 Editor.setPropertyType(this, "noise", Editor.RESOURCE_PROPERTY, "texture") function postprocess(env, transparent_phase, ldr_buffer, gbuffer0, gbuffer1, gbuffer2, gbuffer_depth, shadowmap) if not enabled then return ldr_buffer end if transparent_phase ~= "post_tone...
--[[ Resource: MultiRPG Type: Serverside Developers: Inder00 <admin@multirpg.pl> (©) 2022 <admin@multirpg.p>. All rights reserved. ]]-- -- List of events Events = { } -- events for key, event in pairs(Events) do -- asserts assert( type( event.name ) == "string", "Invalid field name @ Events(...
self = {} self.requests = {} Timeout = 2.1 socket = require("socket") function DispatchRequests() local connections = {} for k, thread in ipairs(self.requests) do local success, result = coroutine.resume(thread) if success and result then table.insert(connections, result) else table.remove(self.reque...
local boot = require "ltask.bootstrap" local ltask = require "ltask" local SERVICE_ROOT <const> = 1 local MESSSAGE_SYSTEM <const> = 0 local config = {} local function searchpath(name) return assert(package.searchpath(name, config.service_path)) end local function init_config() local config_file = assert(arg[1]) ...
--- Eva input module -- Register you callbacks with priority -- other gestures -- @submodule eva local gesture = require("in.gesture") local app = require("eva.app") local log = require("eva.log") local luax = require("eva.luax") local const = require("eva.const") local input_touch = require("eva.modules.input.input...
local ido = require("ido") local common = {} -- Check if the path exists -- @return true or false function common.exists(path) return io.open(path, "r") and true or false end -- Check if the current directory is a git repo -- @return true or false function common.ensure(condition, message) if not condition then...
local MAKE_JSON_SAFE = false -- If this is true, " will be replaced by ' in the encoding local CHAR_SET = [[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&()*+,./:;<=>?@[]^_`{|}~"]] local encode_CharSet = {} local decode_CharSet = {} for i = 1, 91 do encode_CharSet[i-1] = string.sub(CHAR_SET, i, ...
fx_version 'cerulean' game 'gta5' server_scripts { 'queue.js', 'functions.js' }
local playsession = { {"WorldofWarIII", {287936}}, {"TXL_PLAYZ", {1478}}, {"thesandbox", {4859}} } return playsession
print(inspect(types)) print(inspect(types.check(1, types.number))) print(types.check(false, types.number)) print(types.check({a = 1}, types.fields { a = types.string })) print(types.check({a = "b"}, types.fields { a = types.string })) local InstancedMap = require("api.InstancedMap") local m = InstancedMap:new(10, 10)...
function sumf(a, ...) return a and a + sumf(...) or 0 end function sumt(t) return sumf(unpack(t)) end function prodf(a, ...) return a and a * prodf(...) or 1 end function prodt(t) return prodf(unpack(t)) end print(sumt{1, 2, 3, 4, 5}) print(prodt{1, 2, 3, 4, 5})
XYZPresident.TotalMoney = XYZPresident.TotalMoney or 0 XYZPresident.TaxRate = XYZPresident.TaxRate or 20 XYZPresident.Stats.AddedToFunds = 0 XYZPresident.Stats.Tax = 0 -- THESE ARE INCLUDED IN ADDEDTOFUNDS XYZPresident.Stats.Tickets = 0 -- THESE ARE INCLUDED IN ADDEDTOFUNDS XYZPresident.Stats.Seizures = 0 -- THESE ARE ...
function newSetKeybindState( keybind, key ) local newSetKeybindState = {} end
-- Generated By protoc-gen-lua Do not Edit local protobuf = require "protobuf/protobuf" module('TeamCountInfo_pb') TEAMCOUNTINFO = protobuf.Descriptor(); local TEAMCOUNTINFO_TEAMTYPE_FIELD = protobuf.FieldDescriptor(); local TEAMCOUNTINFO_FINISHCOUNTTODAY_FIELD = protobuf.FieldDescriptor(); local TEAMCOUNTINFO_BUYCOU...
torch.setdefaulttensortype('torch.FloatTensor') model = "" function loadNeuralNetwork(path) print (path) print ("Loaded Neural Network -- Success") model = torch.load(path) print ("Model Architecture --\n") print (model) print ("---------------------\n") end function classifyExample(tensorInp...
local guide = require 'parser.guide' local util = require 'utility' local localID = require 'vm.local-id' local globalMgr = require 'vm.global-manager' local signMgr = require 'vm.sign' local config = require 'config' local genericMgr = require 'vm.generic' local rpath = require 'workspace.re...
--*********************************************************** --** THE INDIE STONE ** --** Author: turbotutone ** --*********************************************************** require "DebugUIs/DebugMenu/Base/ISDebugSubPanelBase"; ---@class ClimateOptionsDebug : ISDebu...
--Automatically generated by SWGEmu Spawn Tool v0.12 loot editor. janta_common = { description = "", minimumLevel = 0, maximumLevel = 0, lootItems = { {itemTemplate = "janta_blood", weight = 2500000}, {itemTemplate = "knife_janta", weight = 2500000}, {itemTemplate = "janta_hides", weight = 2500000}, {itemT...
module 'mock_edit' -------------------------------------------------------------------- CLASS: CanvasItemEditablePolygon ( mock_edit.EditorEntity ) :MODEL{} function CanvasItemEditablePolygon:__init() self.vertexList = {} self.triangles = false self.closed = false self:attach( mock.DrawScript{ priority = 500 } )...
object_tangible_furniture_house_cleanup_xeno_couch = object_tangible_furniture_house_cleanup_shared_xeno_couch:new { } ObjectTemplates:addTemplate(object_tangible_furniture_house_cleanup_xeno_couch, "object/tangible/furniture/house_cleanup/xeno_couch.iff")
-- Natural Selection 2 Competitive Mod -- Source located at - https://github.com/xToken/CompMod -- lua\CompMod\Classes\Alien\Gorge\shared.lua -- - Dragon -- Give gorges some more mobility (Default is 6) function Gorge:GetAirControl() return 18 end -- Slow down gorges going over the max speed from slidejumping (De...
local IndicatorL = false local IndicatorR = false Citizen.CreateThread(function() while true do Citizen.Wait(0) if IsControlJustPressed(1, 174) then -- left if IsPedInAnyVehicle(GetPlayerPed(-1), true) then TriggerEvent('Indicator', 'left') end end if IsControlJustPressed(1, 175) then --ri...
local parent, ns = debugstack():match[[\AddOns\(.-)\]], oUF local oUF = ns.oUF or _G.oUF local Update = function(self, event, unit) if(unit ~= self.unit) then return end if(self.PvP) then local factionGroup = UnitFactionGroup(unit) if(UnitIsPVPFreeForAll(unit)) then self.PvP:SetTexture[[Interface\Ta...
return { execute = require("lib.os.execute"), }
require( "bit" ) require( "math" ) local band, shl, shr, min = bit.band, bit.lshift, bit.rshift, math.min local ffi = require( "ffi" ) local lzf = ffi.load( "lzf" ) local winmm = ffi.load( "WINMM" ) ffi.cdef[[ unsigned lzf_compress( const void *const in, unsigned in_len, void *out, unsigned out_len); unsigned lzf_deco...
return { helpers = { sms = function(domoticz, subject, message) local text = subject .. ' ' .. message local smsVariable = domoticz.variables('SMS') local previousText = smsVariable.value if (smsVariable.lastUpdate.daysAgo > 0 and string.sub(pr...
function ix.weight.CalculateWeight(character) -- Calculates the total weight of all items a character is carrying. local inventory = character:GetInventory() local weight = 0 for i, v in pairs(inventory:GetItems()) do if (v:GetWeight()) then weight = weight + v:GetWeight() end end return weight end func...
-- Do NOT EDIT Unique Code. EDIT ONLY TEXT. -- 고유 코드를 절대로 수정하지 마십시오. 텍스트만 수정하십시오. local lang = ulxSTC:AddLanguage("English", "en") -- ulxSTC:AddLanguage("Language Name", "Language Code") -- lang.(Unique Code) = "text" lang.Make_New = "New" lang.Make_New_Shortcut = "Create A New Shortcut" lang.Edit_Shortcut...
local redis = require("resty.redis") local cjson = require("cjson") local cjson_encode = cjson.encode local ngx_log = ngx.log local ngx_ERR = ngx.ERR local ngx_exit = ngx.exit local ngx_print = ngx.print local ngx_re_match = ngx.re.match local ngx_var = ngx.var local function close_redis(red) if not red then ...
return {'cotangens','coterie','cothurne','cotillon','cottage','cothen','cotonou','coteries','coterietje','coterietjes','coterieen','cothurnen','cotillons','cottages'}
------------------------------------------------------------------- --------------------------- widget:luci ------------------------- ------------------------------------------------------------------- --[[ Luci Widget Elements: wd_luci.status (desc, on, busy) -- set Luce status intern...
--[[Kill wolves on resummon Author: Noya Date: 20.01.2015.]] function KillWolves( event ) local caster = event.caster local targets = caster.wolves or {} for _,unit in pairs(targets) do if unit and IsValidEntity(unit) then unit:ForceKill(true) end end -- Reset table caster.wolves = {} end --[[ Author: Noy...
local HttpReceiver = require 'stuart.streaming.HttpReceiver' local registerAsserts = require 'registerAsserts' local stuart = require 'stuart' registerAsserts(assert) describe('HttpReceiver', function() local sc = stuart.NewContext() local ssc = stuart.NewStreamingContext(sc) it('parses a status line', func...
--- === cp.battery === --- --- Provides access to various properties of the battery. Each of these properties --- is a `cp.prop`, so it can be watched for changes. For example: --- --- ```lua --- local battery = require("cp.battery") --- battery.powerSupply:watch(function(value) --- print("Now using "..value) --- e...
local AddonName, AddonTable = ... AddonTable.herbalism = { 72234, -- Green Tea Leaf 72237, -- Rain Poppy 72235, -- Silkweed 72238, -- Golden Lotus 79010, -- Snow Lily 79011, -- Fool's Cap 89639, -- Desecrated Herb }
local mtechs = mtechs local m = mtechs_nodes m.actions = { a_mtechs_nodes_check_supported = 'a_mtechs_nodes_check_supported', -- data.pos = {x = 0, y = 0, z = 0} } m.components = { c_mtechs_nodes_falling = 'c_mtechs_nodes_falling', c_mtechs_nodes_require_support_below = 'c_mtechs_nodes_require_support_b...
local colors = { white = "#abb2bf", red = "#9b111e", baby_pink = "#DE8C92", pink = "#ff75a0", vibrant_green = "#41b883", blue = "#61afef", yellow = "#f0db4f", sun = "#EBCB8B", dark_purple = "#c882e7", teal = "#264de4", orange = "#ec6231", cyan = "#a3b8ef", docker = "#0db7ed", debian = "#d70a53", } local ...
print("Lua says: Hello World")
-- https://github.com/pedro757/emmet local lspconfig = require("lspconfig") local M = {} M.setup = function(on_attach, capabilities) lspconfig.emmet_ls.setup({ capabilities = capabilities, cmd = { "ls_emmet", "--stdio" }, filetypes = { "css", "haml", "html", "javascriptreact", ...
-- This line is a comment. It makes no difference to the code's execution function love.load () -- This function should load the game's resources end function love.update (dt) -- This function should update the game's state end function love.draw () -- This function draws the game's display onto the open wind...
--[[ Copyright (c) 2015 深圳市辉游科技有限公司. --]] local BankruptAwardPlugin = {} local AccountInfo = require('AccountInfo') local showMessageBox = require('UICommon.MsgBox').showMessageBox local showToastBox = require('UICommon.ToastBox2').showToastBox function BankruptAwardPlugin.bind (theClass) function theClass:onBankru...
local term = require("term") local compiler = require("lt.compile") local slash = term.slash local color = term.color function usage(err) local spec = [[ luajit test.lua [-c] path where: path The path of a directory -c Compile to lua code only -h Show help ]] term.usage(sp...
local E, _, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local C, L = unpack(select(2, ...)) local CH = E:GetModule('Chat') local Bags = E:GetModule('Bags') local Layout = E:GetModule('Layout') local _G = _G local gsub = string.gsub local strlower = string.lower local GameTooltip ...
local settings_key = KEYS[1] if not (redis.call('exists', settings_key) == 1) then return redis.error_reply('SETTINGS_KEY_NOT_FOUND') end
--require "love.graphics" local SourceImage = love.graphics.newImage("images/plane.png") local image_w = SourceImage:getWidth() local image_h = SourceImage:getHeight() drawableObject = { new = function (self, o) o = o or {} setmetatable(o, self) self.__index = self self.sprite = love.gr...
-- This software is copyright Kong Inc. and its licensors. -- Use of the software is subject to the agreement between your organization -- and Kong Inc. If there is no such agreement, use is governed by and -- subject to the terms of the Kong Master Software License Agreement found -- at https://konghq.com/enterpriseso...
local API_SE = require(script:GetCustomProperty("APIStatusEffects")) local API_D = require(script:GetCustomProperty("APIDamage")) local API_RE = require(script:GetCustomProperty("APIReliableEvents")) local data = {} data.name = "Rising Fury" data.description = script:GetCustomProperty("Description") data.icon...
-- -- strict.lua -- checks uses of undeclared global variables -- All global variables must be 'declared' through a regular assignment -- (even assigning nil will do) in a main chunk before being used -- anywhere or assigned to inside a function. -- -- modified for better compatibility with LuaJIT, see: -- http...
-- 0 - disable debug info, 1 - less debug info, 2 - verbose debug info DEBUG = 2 DEBUG_FPS = false -- design resolution CONFIG_SCREEN_WIDTH = 960 CONFIG_SCREEN_HEIGHT = 640 -- auto scale mode CONFIG_SCREEN_AUTOSCALE = "FIXED_WIDTH" CCFileUtils:sharedFileUtils():addSearchPath("res/") require("framework.init") -- m...
-------------------------------------------------------------------------------- -- Let's Raid (c) 2019 by Siarkowy <http://siarkowy.net/letsraid> -- Released under the terms of BSD 3-Clause "New" license (see LICENSE file). -------------------------------------------------------------------------------- function Lets...
function Malchezaar_Hellfire(Unit, event, miscUnit, misc) Unit:FullCastSpellOnTarget(43465, Unit:GetClosestPlayer()) end function Malchezaar_Thrash(Unit, event, miscUnit, misc) Unit:FullCastSpell(21919) end function Malchezaar_Parry(Unit, event, miscUnit, misc) Unit:FullCastSpell(13668) end function Malchezaar_Su...
Font = {} --- Load font ---@param name string name of font ---@return FontObject function Font.LoadFont(name) end
laserfield = class:new() function laserfield:init(x, y, dir, r) self.cox = x self.coy = y self.x = x self.y = y self.dir = dir self.active = true self.inputstate = "off" self.r = {unpack(r)} table.remove(self.r, 1) table.remove(self.r, 1) if #self.r > 0 and self.r[1] ~= "link" then local v = convertr(sel...
local module = { on_private_msg = function(bot, message) end, } return module
local body_transformer = require "kong.plugins.xml2json-advanced.body_transformer" local cjson = require("cjson.safe").new() cjson.decode_array_with_array_mt(true) describe("Plugin: xml2json-advanced", function() describe("transform_xml_body()", function() describe("add", function() local conf = { ...
local M = {} local theme = {} ---Apply the colors and the config file to the theme's highlight groups ---@return table theme local function default_hlgroups() return { ColorColumn = { bg = theme.colors.color_column }, -- used for the columns set with 'colorcolumn' Comment = { fg = theme...
local skyla = require "skyla" local C = require "skyla_spine" local parent = require "skyla.game_object.node" local spine = { init = C.init, set_anim = C.set_anim, get_all_anim_names = C.get_all_anim_names, } setmetatable(spine, {__index = parent}) function spine.new(...) local obj = { __cob...
srv.secret = "8k9ezyvgm0" srv.map = "de_cs2d" srv.name = "Custom CS2D Dedicated Server" srv.port = 36971 srv.maxplayers = 10 srv.gamemode = 2 srv.usgnonly = 0 srv.friendlyfire = 0 srv.password = "" srv.luascripts = 0 srv.forcelight = 0 srv.recoil = 0 srv.offscreendamage = 0 srv.hasdownloads = 0 srv.fps = 120 srv.t_scor...
-- Single threaded Leaky Bucket implementation. -- args: key_base, leak_rate, max_bucket_capacity, block_duration, n_tokens -- returns: an array of two integers, the first of which indicates the remaining block time. -- if the block time is nonzero, the second integer is always zero. If the block time is zero, -- the s...
Credits = Scene:extend("Credits") function Credits:new(...) Credits.super.new(self, ...) self.centerSprites = buddies.new() self.centerSprites:add(self:addScenery(Sprite(0, 30, "logos/game_logo_x4"))) self.centerSprites:add(self:addScenery(Sprite(0, 680, "logos/sheepolution_hd"))) self:addScenery(self:createText...
function Inherit (object, field) if field == "parent" then -- avoid loops return nil end local p = object.parent -- access parent object if type(p) == "table" then -- check if parent is a table return p[field] -- (this may call Inherit again) else return ni...
local bar_mat = Material("gauge_stroke") local bar_mat_w, bar_mat_h = bar_mat:Width() * 2, bar_mat:Height() local texture = GetRenderTarget( "HUD_Gauges", bar_mat_w, bar_mat_h, false ) local mat = CreateMaterial( "HUD_Gauges","UnlitGeneric",{ ["$basetexture"] = texture, ["$ignorez"] = 1, ["$vertexcolor"] ...
local help_message = [[ This is a module file for the container quay.io/biocontainers/effectivet3:1.0.1--py35_0, which exposes the following programs: - appletviewer - easy_install-3.5 - effectivet3 - extcheck - idle3.5 - idlj - jar - jarsigner - java-rmi.cgi - javac - javadoc - javah - javap - jcmd - j...
-- Automation Logic initialization -- ========================================================================== function OnMsg.GameTimeStart() AutoShuttleConstructionInstallThread() end function OnMsg.LoadGame() AutoShuttleConstructionInstallThread() end local AutoShuttleConstructionModActive = true functi...
local Q = require 'Q' local Scalar = require 'libsclr' local tests = {} local qtypes = { "I1", "I2", "I4", "I8", "F4", "F8" } S1 = {} tests.t1 = function() -- test restore of table of Scalars for i, qtype in pairs(qtypes) do S1[#S1+1] = Scalar.new(1, qtype) -- creating global scalar end Q.save() ...
sptbl["fofilt"] = { files = { module = "fofilt.c", header = "fofilt.h", example = "ex_fofilt.c", }, func = { create = "ut_fofilt_create", destroy = "ut_fofilt_destroy", init = "ut_fofilt_init", compute = "ut_fofilt_compute", }, params = { ...
--- === plugins.core.watchfolders.menuitem === --- --- Adds the "Setup Watch Folders" to the menu bar. local require = require local i18n = require("cp.i18n") local plugin = { id = "core.watchfolders.menuitem", group = "core", dependencies = { ["core.menu.manager"] = "menu", ["core....
local errors = require "util.error" describe("util.error", function () describe("new()", function () it("works", function () local err = errors.new("bork", "bork bork"); assert.not_nil(err); assert.equal("cancel", err.type); assert.equal("undefined-condition", err.condition); assert.same("bork bork",...
local function scripts(instances, i) for i = (i or 0) + 1, #instances do local instance = instances[i] local success, result = pcall(instance.IsA, instance, 'LuaSourceContainer') if success and result then return i, instance end end end for i, source in scripts, game:GetDescendants() do print(source:GetF...
-------------------------- -- Kill Streak Modifier -- -------------------------- -- Created by Jacob -- -------------------------- KSM = {} -- {tablename} = {sound in Killstreakmodifier / sound}, now you can use the {tablename} as a reference. -- -- Sounds must be wav files on a 44100HZ frequency -- KSM.Sou...
local awful = require("awful") local screen = {} screen.screen_geometry = awful.screen.focused().geometry return screen
-- Liro - liro/functions.lua -- Micro optimisation local hook = hook local string = string local jit = jit local pairs = pairs local math = math local istable = istable local util = util local tostring = tostring local tonumber = tonumber local http = http -- liro.activateDeveloperHook() -- Calls a hook after checkin...
-- _ _____ ___ _ __ ___________ ________ __ -- | | | ___|/ _ \ | | / /| ___| _ \ | ___ \ \ / / -- | | | |__ / /_\ \| |/ / | |__ | | | | | |_/ /\ V / -- | | | __|| _ || \ | __|| | | | | ___ \ \ / -- | |____| |___| | | || |\ \| |___| |/ / | |_/ / | | -- \_____/\____/\_| |_/\_| \_/...
local L1Penalty, parent = torch.class('nn.L1Penalty','nn.Module') --This module acts as an L1 latent state regularizer, adding the --[gradOutput] to the gradient of the L1 loss. The [input] is copied to --the [output]. function L1Penalty:__init(l1weight, sizeAverage, provideOutput) parent.__init(self) self.l1...
-- date 函数和 time 函数正好相反,一般情况下 date 主要是用于格式化时间。 -- 比如转化为特定的日期时间字符串,或者获取年、月、日以及星期等具体的信息。 -- date 函数也有两种调用方式,默认为不传参数,返回本地格式化的一个时间+日期的字符串。 -- 一般还是使用传入格式化参数的方法,用于获取满足需求的信息。 -- 返回本地格式化的日期时间字符串 -- os.date() -- 返回 table -- os.date(format, time) -- -- 当 format=*t 时,返回的 table 为完整的字段信息,包括时间、日期、日在年中的位置、周几以及夏令信息等。如下所示: print(os.dat...
-- Copyright 2006-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. -- ApacheConf LPeg lexer. local l = lexer local token, style, color, word_match = l.token, l.style, l.color, l.word_match local P, R, S = l.lpeg.P, l.lpeg.R, l.lpeg.S module(...) -- Whitespace. local ws = token(l.WHITESPACE, l.space^1) -- Comm...
local P = require "plenary.path" local curl = require "plenary.curl" local eq = assert.are.same local sql = require "sqlite.db" local u = require "sqlite.utils" local luv = require "luv" describe("sqlite.db", function() local path = "/tmp/db.sqlite3" luv.fs_unlink(path) describe("sqlfunctions:", function() ...
--[[ Script for animating a simple tree-fall-over effect. (The tree just rotates 90 degrees around the base, and falls over, before vanishing) ]] local propRoot = script:GetCustomProperty("Root"):WaitForObject() local propCrashSFX = script:GetCustomProperty("CrashSFX"):WaitForObject() local rot = Rotation.New(0, 90...
local Los = require "plugin.wattageTileEngine.lineOfSight" local Utils = require "plugin.wattageTileEngine.utils" local LineOfSightTransitioner = {} LineOfSightTransitioner.new = function(params) Utils.requireParams({ "index", "transitionerValueByCoordinate", "transitionerTa...
-- Items: -- data:extend({ { type = "item", name = "explosives-analogue", icon = "__Engineersvsenvironmentalist__/graphics/icons/explosives/explosives.png", flags = {"goes-to-main-inventory"}, category = "chemistry", subgroup = "explosives-analogue", stack_size = 64000 }, }) --Recip...
slot0 = class(slot1) slot3 = "ddz.model.DdzModel" requireLuaFromModule("DdzModule") slot3 = "ddz.model.DdzModel+Report" requireLuaFromModule("DdzModule") slot3 = "ddz.controller.DdzController" requireLuaFromModule("DdzModule") slot3 = "ddz.controller.DdzController+Server" requireLuaFromModule("DdzModule") slot3...
-- Other mods can use these for looping through available colors dye = {} dye.basecolors = {"white", "grey", "black", "red", "yellow", "green", "cyan", "blue", "magenta"} dye.excolors = {"white", "lightgrey", "grey", "darkgrey", "black", "red", "orange", "yellow", "lime", "green", "aqua", "cyan", "sky_blue", "blue", ...
local s = require "packer" local b = s.pack{[10] = {1,2}} s.dump(b) local bb = s.unpack(b) for k,v in pairs(bb[10]) do print(k,v) end --[[]] local a = s.pack { hello={3,4}, false, 1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 } s.dump(a) a = s.append(a, 42,4.2,-1,1000,80000,"hello"...