content
stringlengths
5
1.05M
-- Solution to problem #3 local PrimeFactors = {} local prime_numbers = require("prime_numbers") local len = #prime_numbers function PrimeFactors.is_prime(a_number) for i=1, len do if prime_numbers[i] == a_number then return true end end return false end function PrimeFactors.get_prime_factors(a_number) ...
local Lib= require("lib") local split, sub, scan = Lib.split, Lib.sub, Lib.scan local Csv={} ------------------------------------------------------- -- ### csv(file: string) -- Iterator. Kills comments, white space. If any line ends in `,`, -- then we join it to the next one. Resulting lines -- are the...
---@class CS.UnityEngine.AvatarMask : CS.UnityEngine.Object ---@field public transformCount number ---@type CS.UnityEngine.AvatarMask CS.UnityEngine.AvatarMask = { } ---@return CS.UnityEngine.AvatarMask function CS.UnityEngine.AvatarMask.New() end ---@return boolean ---@param index number function CS.UnityEngine.Avata...
function moveTempToRealDimension(dimension) if dimension then dbExec(mysql:getConnection(),"DELETE FROM `objects` WHERE dimension='".. tostring(dimension) .."'") local result = dbExec(mysql:getConnection(),"INSERT INTO `objects` (`model`, `posX`, `posY`, `posZ`, `rotX`, `rotY`, `rotZ`, `interior`, `...
function onBeatHit() if game then triggerEvent('Camera Follow Pos','1700','1103') setProperty('defaultCamZoom',0.5); doTweenAlpha('alpha2','battlebg',1,0.1,'quartIn') doTweenAlpha('alpha4','birdbg',0,0.1,'quartIn') else setProperty('defaultCamZoom',0.75); doTweenAlpha('alpha3','battlebg',0,0.1,'quartI...
------------------------------------------------------------------------------- -- Super Mario World (U) Rainbow Filter #LoveWins Script for Snes9x-rr version -- https://github.com/snes9x-rr/snes9x -- -- Created by BrunoValads, checked in snes9x-rr 1.51 v7 -- http://github.com/brunovalads/smw-stuff -- -- Just to...
ys = ys or {} slot1 = singletonClass("BattleEnemyCharacterFactory", ys.Battle.BattleCharacterFactory) ys.Battle.BattleEnemyCharacterFactory = slot1 slot1.__name = "BattleEnemyCharacterFactory" slot1.Ctor = function (slot0) slot0.super.Ctor(slot0) slot0.HP_BAR_NAME = slot0.super.Ctor.Battle.BattleHPBarManager.HP_BAR...
#!/usr/bin/env tarantool local fio = require('fio') local json = require('json') local tap = require('tap') -- require in-repo version of graphql/ sources despite current working directory package.path = fio.abspath(debug.getinfo(1).source:match("@?(.*/)") :gsub('/./', '/'):gsub('/+$', '')) .. '/../../?.lua' .. '...
local dofile = dofile for _, pathname in ipairs({ 'test/capitalize_test.lua', 'test/has_test.lua', 'test/split_test.lua', 'test/stringex_test.lua', 'test/trim_test.lua', }) do dofile(pathname) end
require('os') require('math') function random() return string.format('{"event_type": "%s%d", "ts": %d, "params": {"p0":5, "p1":%d, "p2":%d} }', "test", math.random(1,10), os.time(), math.random(1,100), math.random(1,10)) end request = function() wrk.headers["Content-Type"] = "application/json" ret...
local uuid = require 'uuid' local spawn = ngx and ngx.thread.spawn or coroutine.create local wait = ngx and ngx.thread.wait or coroutine.resume local promise = {} function promise:start(fn) local id = uuid.new() local thread, err = spawn(function() return id, fn() end) if not thread then return nil, err e...
return function (ecs) for entity, vel, pos in ecs:entitiesWithAll("vel", "pos") do pos.x = pos.x + vel.x pos.y = pos.y + vel.y end end
local _, Engine = ... local Handler = Engine:GetHandler("UnitFrame") -- Lua API local unpack = unpack -- WoW API local UnitClassification = UnitClassification local UnitExists = UnitExists local UnitName = UnitName local colors = { elite = { 0/255, 112/255, 221/255 }, boss = { 163/255, 53/255, 255/238 }, normal =...
object_static_particle_shared_holo_planet_hoth = SharedStaticObjectTemplate:new { clientTemplateFileName = "object/static/particle/shared_holo_planet_hoth.iff" } ObjectTemplates:addClientTemplate(object_static_particle_shared_holo_planet_hoth, "object/static/particle/shared_holo_planet_hoth.iff") --------------------...
local octave = require"iota.parser.octave" print(octave) for k,v in pairs(octave) do print(k,v) end octave.load_ascii("EVALS-0000.mat") octave.load_ascii("EVECS-0000.mat")
------------------------------------------------------------------------ --[[ MuFuRu - Multi-Function Recurrent Unit ]]-- -- Author: Jonathan Uesato -- License: LICENSE.2nd.txt -- Ref. A.: http://arxiv.org/pdf/1606.03002v1.pdf ------------------------------------------------------------------------ local MuFuRu, pare...
---@class FishingLure local FishingLure = { name = "", label = "", ---@type { name: string, label: string, prob: number }[] catches = {} } FishingConfig = { ---@type FishingLure[] lures = {}, enableStats = false, _Loaded = false, key = "" } ---@param name string ---@return FishingL...
local InventoryFunctions = require "util/inventoryfunctions" local TrackedEquips = { orangestaff = true, yellowstaff = true, } local CurrentEquip = nil local function IsEquipped(prefab) return CurrentEquip == prefab end local FuncToPriority = {} local TagToPriority = { player = 0, } local function ...
object_tangible_wearables_hat_hat_imp_s02 = object_tangible_wearables_hat_shared_hat_imp_s02:new { } ObjectTemplates:addTemplate(object_tangible_wearables_hat_hat_imp_s02, "object/tangible/wearables/hat/hat_imp_s02.iff")
local csv={} for line in io.lines('file.csv') do table.insert(csv, {}) local i=1 for j=1,#line do if line:sub(j,j) == ',' then table.insert(csv[#csv], line:sub(i,j-1)) i=j+1 end end table.insert(csv[#csv], line:sub(i,j)) end table.insert(csv[1], 'SUM') for i=...
package("swig") set_kind("binary") set_homepage("http://swig.org/") set_description("SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.") set_license("GPL-3.0") if is_host("windows") then add_urls("https://sou...
class "Player" { posx = 0; posy = 0; angle = 0.5; rotate = 0; power = 1; } cRotateSpeed = 0.85 cCanonImpulse = 40 cShotRadius = 8 cShotTick = 0.10 cShootTimeout = 0.1 cShootVolumeChange = 3 function Player:__init(water, posx, posy, world) self.water = water self.posx = posx self.posy = posy self.gunOffX = 25...
--[[ Author: Tinywan Mail: Overcome.wan@Gmail.com Date: 2017/3/12 Github: https://github.com/Tinywan Description: 这是一个公共函数类包 Help :https://github.com/openresty/lua-redis-parser --]] M = {} local config = {ip='127.0.0.1',port=6379,auth='',db=0} -- connect function M.redis_connect() local redis = requi...
g_Plugin = {} g_LDH = false g_Placeholders = {} --[[ ["placeholder_text"] = { ["help_text"] = "text" ["plugin_name"] = "name" ["callback_function"] = "function" ["req_cPlayer"] = true/false ["has_equals"] = true/false } --]] g_Plugins = {}
--[[-- slot.restore_all( blob -- string as returned by slot.dump_all() ) Restores all slots using a string created by slot.dump_all(). --]]-- local function decode(str) return ( string.gsub( str, "%[[a-z]+%]", function(char) if char == "[eq]" then return "=" else...
local Gtk Gtk = require("lgi").Gtk local async_command async_command = require("gifine.commands").async_command local PreviewWindow do local _class_0 local _base_0 = { loaded_frames = nil, working_frames = nil, show_frame = function(self, idx) if not (self.current_frames) then return ...
function onUse(player, item, fromPosition, target, toPosition, isHotkey) if target.itemid ~= 4861 then return false end if player:getStorageValue(Storage.TheApeCity.Questline) ~= 17 or player:getStorageValue(Storage.TheApeCity.SnakeDestroyer) == 1 then return false end player:setStorageValue(Storage.TheAp...
local component=require("component") local shell=require("shell") local filesystem=require('filesystem') require("libevent") local fshare_version="v1.1" print("File Share Server " .. fshare_version) print("Author: Github/Kiritow") local args,opts=shell.parse(...) if((not opts["s"] and #args<1)) then print([==[U...
format_version = "1.0"
addCommandHandler("startmusic", function ( plr, commandName, url ) setTimer(triggerClientEvent, 1000, 1, "playmus", root, url) end)
bhamuka_all_consuming_god_consume_the_ground = class({}) function bhamuka_all_consuming_god_consume_the_ground:OnSpellStart() --- Get Caster, Victim, Player, Point --- local caster = self:GetCaster() local caster_loc = caster:GetAbsOrigin() local playerID = caster:GetPlayerOwnerID() local player = PlayerResour...
local splash = {} local first = true local alpha = {} alpha.alpha = 0 function splash:init() end function splash:enter() Timer.script(function(wait) Timer.tween(0.5, alpha, {alpha = 1}, 'in-out-quad') wait(0.6) Timer.tween(0.5, alpha, {alpha = 0}, 'in-out-quad') wait(0.6) ...
-- mpv issue 5222 -- Automatically set loop-file=inf for duration < given length. Default is 5s -- Use script-opts=autoloop-duration=x in mpv.conf to set your preferred length local autoloop_duration = 5 function getOption() local opt = mp.get_opt("autoloop-duration") if (opt ~= nil) then local test =...
project "ReflectionTool" defineProject("ConsoleApp", false, "ReflectionTool") dependson("Reflection")
----------------------------------- -- Area: Quicksand Caves -- NPC: ??? -- Involved in Mission: The Mithra and the Crystal (Zilart 12) -- !pos -504 20 -419 208 ----------------------------------- local ID = require("scripts/zones/Quicksand_Caves/IDs") require("scripts/globals/keyitems") require("scripts/globals/missi...
local DEBUG_ENABLED = false local comboZone = nil local insideZone = false local createdZones = {} local function addToComboZone(zone) if comboZone ~= nil then comboZone:AddZone(zone) else comboZone = ComboZone:Create({ zone }, { name = 'npc-polyzone' }) comboZone:onPlayerInOutExhaustiv...
local awful = require("awful") local naughty = require("naughty") local wibox = require("wibox") local textbox = require("wibox.widget.textbox") local HOME = os.getenv("HOME") --local manu = require("strlib_open") -- function to get content from textfile function fileToString(file) local f = assert(io.open(file, "...
object_tangible_component_weapon_core_weapon_core_ranged_base = object_tangible_component_weapon_core_shared_weapon_core_ranged_base:new { } ObjectTemplates:addTemplate(object_tangible_component_weapon_core_weapon_core_ranged_base, "object/tangible/component/weapon/core/weapon_core_ranged_base.iff")
local ItemModule = require "module.ItemModule" local guildTaskModule = require "module.guildTaskModule" local guildTaskCfg = require "config.guildTaskConfig" local ItemHelper = require "utils.ItemHelper" local Time = require "module.Time" local UnionConfig = require "config/UnionConfig" local View = {}; local activity_...
-- copy all globals into locals, some locals are prefixed with a G to reduce name clashes local coroutine,package,string,table,math,io,os,debug,assert,dofile,error,_G,getfenv,getmetatable,ipairs,Gload,loadfile,loadstring,next,pairs,pcall,print,rawequal,rawget,rawset,select,setfenv,setmetatable,tonumber,tostring,type,un...
---@type Ellyb local Ellyb = Ellyb(...); if Ellyb.Strings then return end ---@class Ellyb_Strings local Strings = {}; Ellyb.Strings = Strings; ---@param tableToConvert table A table of element ---@param customSeparator string A custom separator to use to when concatenating the table (default is " "). ---@overload f...
enable_check_bracket_line = false local status_ok = pcall(require, "nvim-autopairs") if not status_ok then return end local npairs = require "nvim-autopairs" npairs.setup { check_ts = true, ts_config = { lua = {"string"}, -- it will not add pair on that treesitter node javascript = {"templa...
-- ####################################### -- ## Project: MTA:scp-088 ## -- ## Name: MainMenu.lua ## -- ## Author: Noneatme ## -- ## Version: 1.0 ## -- ## License: See top Folder ## -- ####################################### -- FUNCTIONS / METHODS -- local cFunc = {}; -- Local Functions local cSett...
local http = require "http" local shortport = require "shortport" local stdnse = require "stdnse" local string = require "string" local vulns = require "vulns" local json = require "json" local base64 = require "base64" local nmap = require "nmap" description = [[ This script attempts to detect a vulnerability, CVE-20...
---[Documentation](https://wowpedia.fandom.com/wiki/ItemTransmogInfoMixin) ---@class ItemTransmogInfoMixin ItemTransmogInfoMixin = {} --- See [CreateAndInitFromMixin](https://www.townlong-yak.com/framexml/go/CreateAndInitFromMixin) ---@param appearanceID number ---@param secondaryAppearanceID number? ---@param illusio...
--================-- local libPlayer = {} --================-- --=============================================================-- -- getPlayingPlayerIds() -- -- -- -- Returns an array of playerIds of currently playing pl...
local register_node = minetest.register_node register_node('bt_core:raw_pickaxe_head_mold', { description = 'Raw Pickaxe Head Mold', tiles = { 'bt_core_clay.png' }, paramtype = "light", drawtype = "nodebox", groups = { oddly_breakable_by_hand = 3 }, is_ground_content = true, node_box = { ...
local print_debug = false local modifier_id = "Tremualin_Mentor_Bonus" local mentee_performance_gain = 20 local mentoring_message = "<green>Being mentored +<amount></color>" -- Mentors improve the performance of all other colonists in the same workplace local orig_Workplace_OnChangeWorkshift = Workplace.OnChangeWorks...
--[[ even and odd polynomial distortion --]] require "include/protoplug" local cbFilter = require "include/dsp/cookbook filters" local a = 1.3 local c = -0.8 stereoFx.init () function stereoFx.Channel:init () self.state = 0 end function stereoFx.Channel:processBlock (samples, smax) for i = 0, smax do local b =...
Dictionaries = { { name = "locale:leveldata/campaign/fxlf/fxlf.dat", }, }
local reasons = { "signal", "read" } local reasonIndex = {} for k,v in pairs(reasons) do reasonIndex[v] = k end function poll.addFd(fd, reason) poll.cAddFd(fd, reasonIndex[reason]) --print("add", fd, reason, reasonIndex[reason]) end function poll.dropFd(fd) poll.cDropFd(fd) end function poll.events(block) loc...
local bstm = require("bustm") local b = bstm.dobule(1) print("result: ", b)
rancor_guard = Creature:new { customName = "\\#00ff00<<< Rancor Guard >>> \\#ff0000[lvl 300]", socialGroup = "nightsister", faction = "nightsister", level = 300, chanceHit = 80.0, damageMin = 570, damageMax = 850, baseXp = 8500, baseHAM = 13000, baseHAMmax = 16000, armor = 1, resists = {40,170,40,200,200,20...
Macro { area="Shell Viewer Editor"; key="Ctrl'"; description="Opening last view/edit of a file"; action = function() Keys('AltF11 Up Enter') end; }
local awful = require("awful") local gears = require("gears") local M = {} function M.get() local globalkeys = gears.table.join( awful.key( {}, "XF86MonBrightnessDown", function() awful.spawn.with_shell("brightnessctl s 5%-") end, {description = "decrease brightness", group = "brightness"} ), ...
local config = { [31077] = {requireSoil = false, toPosition = Position(32908, 31081, 7), effect = CONST_ME_ENERGYHIT}, [31080] = {requireSoil = true, pushbackPosition = Position(32908, 31081, 7), toPosition = Position(32908, 31076, 7), effect = CONST_ME_ENERGYHIT}, [31081] = {requireSoil = true, pushbackPosition = P...
--Begin msg_checks.lua --Begin pre_process function local function pre_process(msg) -- Begin 'RondoMsgChecks' text checks by @rondoozle if is_chat_msg(msg) or is_super_group(msg) then if msg and not is_momod(msg) and not is_whitelisted(msg.from.id) then --if regular user local data = load_data(_config.moderatio...
local lowerclass = { _VERSION = "lowerclass v1.0.0", _DESCRIPTION = "Object Orientation for Lua with a Middleclass-like API", _URL = "https://github.com/Positive07/lowerclass", _LICENSE = "MIT LICENSE - Copyright (c) 2017 Pablo. Mayobre (Positive07)" } lowerclass.__TRACK_SUBCLASSES = false lowe...
--====================================================================-- -- dmc_lua/lua_class.lua -- -- Documentation: http://docs.davidmccuskey.com/ --====================================================================-- --[[ The MIT License (MIT) Copyright (c) 2015 David McCuskey Permission is hereby granted, fr...
return Def.Model { Meshes=NOTESKIN:GetPath('_OutfoxSMX','Note_Double'); -- use material file so the itgcolor version can fallback on this -- cant name it NoteMaterial cause it conflicts with the just Note file apparently Materials=NOTESKIN:GetPath('_Outfox','Material'); Bones=NOTESKIN:GetPath('_OutfoxSMX','Note_Do...
local PLUGIN = PLUGIN; local COMMAND = Clockwork.command:New("PlySetHP"); COMMAND.tip = "Set a player's HP."; COMMAND.text = "<string Name> [number Amount]"; COMMAND.access = "a"; COMMAND.arguments = 1; COMMAND.optionalArguments = 1; -- Called when the command has been run. function COMMAND:OnRun(player, arguments) ...
-- 本限流实现采用的是时间桶的概念,可以支持进行,秒,分,小时级别的访问总量限制。 -- Redis一共存储了秒桶(60个槽),分钟桶(60个槽),小时桶(24个槽),当用户去 -- 打印table d local function PrintTable(table , level) local key = "" level = level or 1 local indent = "" for i = 1, level do indent = indent.." " end if key ~= "" then print(indent..key....
bullets = {} num_bullets = 0 current_turn = GetGlobal('current_turn') difficulty = 3 wave_frames_elapsed = 0 --DEBUG MODE DIFFICULTY-- difficulty=3 Arena.Resize(220, 180) -- set properties -- a set refers to one left/right combo of fire streams -- init_y - the initial y position of a wave -- init...
local data = { Shared = { CurrentCamera = { Type = "Default", Id = 0, Model = nil, }, CameraData = { -- This is used purely by the lerper and only includes the data of the currently lerped camera Position = Vector3.new(), Rotation = Vector3.new(), CFrame = CFrame.new(), }, Focus = { Typ...
#!/usr/bin/env texlua -- Build script for "etoolbox" files -- Identify the bundle and module bundle = "" module = "etoolbox" -- Install .def files as well as .sty -- These are also the sources installfiles = {"*.def", "*.sty"} sourcefiles = installfiles -- Documentation is standalone typesetfiles = {"*.tex"} -- N...
Test = require('connecttest') require('cardinalities') local events = require('events') local mobile_session = require('mobile_session') local mobile = require('mobile_connection') local tcp = require('tcp_connection') local file_connection = require('file_connection') ----------------------------------------------...
-- ======================== -- Workspace -- ======================== workspace "plutoscript" location "./build" objdir "%{wks.location}/obj/%{cfg.buildcfg}" targetdir "%{wks.location}/bin/%{cfg.buildcfg}" targetname "%{prj.name}" language "C++" architecture "x86" buildoptions "/std:c++latest" systemversion ...
return { {"KEY_UP", "BULB_INCREASE", "localhost"}, {"KEY_DOWN", "BULB_DECREASE", "localhost"}, }
local cmsgpack = require "cmsgpack" local tlds = require "cdn.tlds" local lrucache_mod = require "resty.lrucache" local log = require "cdn.log" local lrudsc, err = lrucache_mod.new(500) if not lrudsc then error("failed to create the cache: " .. (err or "unknown")) end local lrucache, err = lrucache_mod.new(500) if n...
-- TODO: keygrabber. local tbl_contains = require("misc.libs.stdlib").contains local function tag_preview(tag) -- TODO: Make these constants? local geo = tag.screen:get_bounding_geometry({ honor_padding = true, honor_workarea = true, }) local scale = 0.15 local margin = 0 local width = scale * geo.width + ma...
--[[----------------- BETWEEN LINES HUD by DyaMetR Version 1.0.5 17/03/20 ]]------------------- surface.CreateFont( "lineHUD1", { font = "Britannic Bold", size = 45, weight = 500, blursize = 0, scanlines = 0, antialias = true, underline = false, italic = false, strikeout = false, symbol = false, rotary = false,...
--[[ 组件基类,所有组件必须继承该类 ]] ---组件基类 local BehaviorBase = class("BehaviorBase") BehaviorBase.className = "BehaviorBase" function BehaviorBase:ctor(behaviorName, depends, priority, conflictions) self.name_ = behaviorName self.depends_ = checktable(depends) self.priority_ = checkint(priority)...
describe("Sorting stabilization", function() local stabilize = require("sorting.stabilize") local quicksort = require("sorting.quicksort") local stabilized_quicksort = stabilize(quicksort()) -- random quicksort local is_sorted = require("sorting.is_sorted") -- Sort by the first element (= value) of the pair loca...
----------------------------------------- -- ID: 5722 -- Item: plate_of_crab_sushi_+1 -- Food Effect: 60Min, All Races ----------------------------------------- -- Vitality 2 -- Defense 15 -- Accuracy % 14 (cap 68) -- Resist Sleep +2 ----------------------------------------- require("scripts/globals/status") require("s...
-- (c) Fabien Fleutot, 2014. -- Released under the MIT public license. local log = require "log" local sched = require "sched" local web = require "web.server" local datalog = require "datalog.airvantage" local shell = require 'shell.telnet' local WEB_PORT = 9001 --- Associates USB product ids with the a...
--[[ spoonacular API The spoonacular Nutrition, Recipe, and Food API allows you to access over 380,000 recipes, thousands of ingredients, 800,000 food products, and 100,000 menu items. Our food ontology and semantic recipe search engine makes it possible to search for recipes using natural language queries, such ...
--------------------------------------------------------------------------------------------------- -- In case: -- 1) SDL is started (there was no LOW_VOLTAGE signal sent) -- 2) There are following app’s in HMI levels: -- App1 is in FULL -- App2 is in LIMITED -- App3 is in BACKGROUND -- App4 is in NONE -- 3) All apps h...
-- license:BSD-3-Clause -- copyright-holders:Miodrag Milanovic require('lfs') -- add helper to lfs for plugins to use function lfs.env_replace(str) local pathsep = package.config:sub(1,1) local function dorep(val) ret = os.getenv(val) if ret then return ret end return val end if pathsep == '\\' then ...
--!nocheck -- ^ change to strict to crash studio c: local oldtypeof = typeof local function typeof(objIn: any): string local objType = oldtypeof(objIn) if objType ~= "table" then return objType end -- Could be a custom type if it's a table. local meta = getmetatable(objIn) if oldtypeof(meta) ~= "table" then ...
local lu = require('luaunit') local EntityRepository = require('EntityRepository') local function query(...) local archetypes = {...} local Query = {} function Query:Match(archetype) return table.find(archetypes, archetype) ~= nil end function Query:Result(chunks) return chunks end re...
require( "iuplua" ) tree = iup.tree { } dialog = iup.dialog { tree; title = "Tree test", size = "HalfxHalf" } dialog:showxy( iup.CENTER, iup.CENTER ) --tree.addexpanded = "No" tree_data = { branchname = "STM32"; { branchname = "STM32F0"; "STM32F0x0", "STM32F0x1" }, { branchname = "STM32G0" } } ...
-- $Name: Фотоохота (ИНСТЕДОЗ 5)$ -- $Version: 0.3$ -- $Author: techniX$ --[[ Если Вы еще не играли в эту игру, не читайте, пожалуйста, код дальше, чтобы не испортить удовольствие от игры :) История версий: 0.1 первая версия 0.2 добавлены дополнительные реакции у предметов 0.3 добавлены достижения, улучшены н...
-- TODO make this solver/solver.lua, and make the old solver.lua something like structured-grid-solver local ffi = require 'ffi' local ig = require 'ffi.imgui' local class = require 'ext.class' local table = require 'ext.table' local file = require 'ext.file' local math = require 'ext.math' local CLBuffer = require 'c...
return { -- completion ['neovim/nvim-lspconfig'] = {}, ['hrsh7th/nvim-cmp'] = {}, ['hrsh7th/cmp-nvim-lsp'] = {}, ['hrsh7th/cmp-buffer'] = {}, ['hrsh7th/cmp-path'] = {}, ['quangnguyen30192/cmp-nvim-ultisnips'] = {}, ['glepnir/lspsaga.n...
if not turtle then printError("Requires a Turtle") return end local tArgs = { ... } if #tArgs ~= 1 then local programName = arg[0] or fs.getName(shell.getRunningProgram()) print("Usage: " .. programName .. " <length>") return end -- Mine in a quarry pattern until we hit something we can't dig loca...
diamondShopLayout_diamondNum=[[0]] diamondShopLayout_diamondTime=[[有效期:]] diamondShopLayout_errorInfo=[[无法获取数据]] diamondShopLayout_Text1=[[兑奖日期]] diamondShopLayout_Text2=[[奖品名称]] diamondShopLayout_Text3=[[消耗钻石]] diamondShopLayout_Text4=[[兑换数量]] diamondShopLayout_Text5=[[状态]] diamondShopLayout_errorText=...
--- @module source return { --- A boring function -- @source /foo/bar:23 a = function() end }
wlScans = { ["heirlooms"] = "122349:1,122352:1,122366:0,122354:1,122367:1,122385:1,122386:1,122389:0,122351:0,122369:0,122365:0,122363:0,122353:1,122368:0,105690:0,122350:0,122364:0,122391:0,105680:0,122392:0,122387:1,122263:1,122264:1,122388:1,122381:1,122245:1,122251:1,122355:1,127010:0,127012:1,127011:0,122373:0...
if not modules then modules = { } end modules ['data-tmf'] = { version = 1.001, comment = "companion to luat-lib.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", license = "see context related readme files" } local resolvers = reso...
local modname = minetest.get_current_modname() local S = minetest.get_translator(modname) local modpath = minetest.get_modpath(modname) dofile(modpath.."/wisp.lua") local gas_desc local gas_usage local seep_desc local seep_usage if minetest.get_modpath("doc") then gas_desc = S("Gaseous hydrocarbons formed from the...
require "lang.Signal" require "specs.busted" require "Logger" local Bridge = require("bridge.Bridge") local AppNotificationResponse = require("app.response.AppNotificationResponse") local match = require("specs.matchers") describe("modules.app", function() local subject local bridge local call local ...
return function(processing: boolean) return { type = "SET_SNIPPET_PROCESSING", payload = processing, } end
-- Buildat: builtin/ground_plane_lighting/client_lua/module.lua -- http://www.apache.org/licenses/LICENSE-2.0 -- Copyright 2014 Perttu Ahola <celeron55@gmail.com> local dump = buildat.dump local log = buildat.Logger("ground_plane_lighting") local magic = require("buildat/extension/urho3d") local replicate = require("bu...
-- Port of https://github.com/rhysbrettbowen/promise_impl/blob/master/promise.js -- and https://github.com/rhysbrettbowen/Aplus -- local queue = {} local State = { PENDING = 'pending', FULFILLED = 'fulfilled', REJECTED = 'rejected', } local passthrough = function(x) return x end local errorthrough = function...
addDockQueueFamily("Utility",300,300) addDockQueueFamily("Corvette",300,300) addDockQueueFamily("Fighter",300,300) addDockQueueFamily("Frigate",400,400) addDockQueueFamily("Platform",300,300) addDockQueueFamily("SuperCap",1000,1000) addDockQueueFamily("Shipyard",1500,1500) addDockQueueFamily("Resource",500,500) ...
local cfg = {} -- Sørrelse af SMS Historik cfg.sms_history = 15 -- Max størrelse af SMS. cfg.sms_size = 500 -- Hvor lang tid SMS position skal være. (10 minutter) cfg.smspos_duration = 600 -- define phone services -- blipid, blipcolor (customize alert blip) -- alert_time (alert blip display duration in seconds) --...
local length = table.getn(KEYS); local includecount; if ARGV and ARGV[2] == "withcard" then includecount = true else includecount = false end local res = {} for i = 1, length, 1 do res[(3 * i) - 2] = redis.call("zrank", KEYS[i], ARGV[1]); res[(3 * i) - 1] = redis.call("zscore", KEYS[i], ARGV[1]); i...
function fw.add_categories() local new_categories = {} for _, category in pairs(data.raw["recipe-category"]) do new_categories[#new_categories + 1] = { type = "recipe-category", name = "fluid-" .. category.name } end data:extend(new_categories) end fun...
-- sense battery voltage, using esp8266' built-in ADC -- see https://nodemcu.readthedocs.io/en/master/en/modules/adc/ -- returns 1000x voltage -- e.g. 3480 means 3.48v function get_voltage() v = adc.read(VOLTAGE_PORT) -- FIXME: some error/reasonable bounds checking return v end
-- This file offers helpers for dao and integration tests (migrate, start kong, stop, faker...) -- It is built so that it only needs to be required at the beginning of any spec file. -- It supports other environments by passing a configuration file. local IO = require "kong.tools.io" local Faker = require "kong.tools....