content stringlengths 5 1.05M |
|---|
-- default spacebar config
c = {}
c.paths = {}
-- Paths
c.paths.yabai = '/opt/homebrew/bin/yabai'
return c
|
function table.find (tbl, index, value)
for i, v in pairs (tbl) do
if v[index] == value then
return i;
end
end
return false;
end
local mods = {};
local mods_ordered = {};
addEventHandler ("onResourceStart", resourceRoot,
function ()
local meta = xmlLoadFile ("meta.xml");
for i, v in ... |
-- Settings
--
-- Load filetype plugin and indent files
vim.cmd 'filetype plugin indent on'
-- Enable syntax highlighting
vim.cmd 'syntax on'
-- Enable 24-bit RGB color in the TUI
vim.opt.termguicolors = true
-- Enable the colorscheme
vim.cmd 'colorscheme onedark'
-- Access system clipboard in VIM
vim.opt.clipboard... |
-- Manage Prompt Sections
-- Sections Consist of a table with properties
local sections = {}
local function merge(t1, t2)
for k, v in pairs(t2) do
if (type(v) == "table") and (type(t1[k] or false) == "table") then
merge(t1[k], t2[k])
else
t1[k] = v
end
... |
local crab = {}
crab.skin = {crab1, crab2, crab3, crab4, crab5, crab6, crab7, crab8, crab9, crab10}
for i = 1, 10 do
if not pcall(function () crab.skin[i] = love.graphics.newImage("assets/crab/crabm" .. i .. ".png") end) then
print("Could not load crab asset.")
return 2
end
end
crab.scalex = 0.5
crab.scaley... |
--[[
-- slt2 - Simple Lua Template 2
--
-- Project page: https://github.com/henix/slt2
--
-- @License
-- MIT License
--]]
local slt2 = {}
-- a tree fold on inclusion tree
-- @param init_func: must return a new value when called
local function include_fold(template, start_tag, end_tag, fold_func, init_func)
local res... |
describe('stringstrong.septableconcat() #concat #sep #table', function()
local strongstring
lazy_setup(function()
strongstring = require('src/strongstring')
end)
it('concat table with sep', function()
local t = {'abc', 'def'}
local sep = '.'
assert.are.equals('abc.def',... |
-- Override minimap update function
function map.update_hud_flags(player)
if not player or player.is_fake_player then
return -- Can't be used by a fake player
end
local creative_enabled = minetest.is_creative_enabled(player:get_player_name())
local inv = player:get_inventory()
local has_map = inv:contains_ite... |
local _2afile_2a = "fnl/conjure/log.fnl"
local _2amodule_name_2a = "conjure.log"
local _2amodule_2a
do
package.loaded[_2amodule_name_2a] = {}
_2amodule_2a = package.loaded[_2amodule_name_2a]
end
local _2amodule_locals_2a
do
_2amodule_2a["aniseed/locals"] = {}
_2amodule_locals_2a = (_2amodule_2a)["aniseed/locals... |
local _ = function(k, ...) return ImportPackage("i18n").t(GetPackageName(), k, ...) end
local deliveryNpc = {
{
location = {-16925, -29058, 2200, -90},
spawn = {-17450, -28600, 2060, -90}
},
{
location = {-168301, -41499, 1192, 90},
spawn = {-168233, -40914, 1146, 90}
},... |
---- -*- Mode: Lua; -*-
----
---- all.lua run all tests
----
---- © Copyright IBM Corporation 2016, 2017.
---- LICENSE: MIT License (https://opensource.org/licenses/mit-license.html)
---- AUTHOR: Jamie A. Jennings
-- See Makefile for how t... |
client = nil
service = nil
return function(data)
local window = client.UI.Make("Window",{
Name = "Credits";
Title = "Credits";
Icon = client.MatIcons.Grade;
Size = {280, 300};
AllowMultiple = false;
})
local tabFrame = window:Add("TabFrame",{
Size = UDim2.new(1, -10, 1, -10);
Position = UDim2.new(0... |
#!/usr/bin/env tarantool
local clock = require('clock')
local os = require('os')
local fiber = require('fiber')
local queue = require('queue')
-- Set the number of consumers.
local consumers_count = 100
-- Set the number of tasks processed by one consumer per iteration.
local batch_size = 100
local barrier = fiber.c... |
--- === cp.i18n.languageID ===
---
--- As per [Apple's documentation](https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html#//apple_ref/doc/uid/10000171i-CH15-SW6),
--- a `language ID` is a code which identifies either a language used ... |
local function OpenPanel( ply, key )
if ( key == "KEY_F1" && ply:IsUserGroup("developer") ) then
local basepanel = vgui.Create("DFrame")
basepanel:SetPos( ScrW()/2*0.5, ScrH()/2*0.5 )
basepanel:SetSize( ScrW()/2*0.5, ScrH()/2*0.5 )
basepanel:SetTitle( "" )
basepanel:MakePopup()
basepanel:SetDeleteOnClose(t... |
event_handlers = {}
event_handlers.on_gui_click = {}
event_handlers.on_gui_confirmed = {}
event_handlers.on_gui_elem_changed = {}
local Calculator = require "gui/calculator"
local Cacher = require "logic/cacher"
local Initializer = require "logic/initializer"
local Reinitializer = require "logic/reinitializer"... |
local ROCK_VERSION = require('luatest.VERSION')
-- See directory junitxml for more information about the junit format
local Output = require('luatest.output.generic'):new_class()
-- Escapes string for XML attributes
function Output.xml_escape(str)
return string.gsub(str, '.', {
['&'] = "&",
['... |
local crypto = require "sys.crypto"
local testaux = require "testaux"
local P = require "print"
return function()
---------------------test hamc
local hmac_key = "test"
local hmac_body = "helloworld"
local res = crypto.hmac(hmac_key, hmac_body)
print(string.format("hmac key:%s body:%s, res:", hmac_key, hmac_body)... |
--[[ Lokasenna_GUI - Label class.
---- User parameters ----
(name, z, x, y, caption[, shadow, font, color, bg])
Required:
z Element depth, used for hiding and disabling layers. 1 is the highest.
x, y Coordinates of top-left corner
caption Label text
Optional:
shadow Boolean. Draw a shadow?
font Which... |
--bookmark light version
--record your playing history for each folder
--and you can choose resume to play next time
local mp = require 'mp'
local utils = require 'mp.utils'
local options = require 'mp.options'
local M = {}
local o = {
save_period = 30
}
options.read_options(o)
local cwd_root = utils.getcwd()
l... |
--Chiptune Generator
local wave, freq, amp = 0, 0, 1
local sel = 0
local waves = 5
local wname = {
"Sin", "Square", "Pulse","Sawtooth",
"Triangle", "Noise"
}
local wpics = {}
local wquads = {}
local wx = 0
function _extractPics()
local pics = {1,5,9,13,17,21}
for id, sid in ipairs(pics) do
local rx, ry, rw, r... |
local itemUtil = {}
local sounds = require("__base__.prototypes.entity.sounds")
local danyao_pic = "__xiuxian-graphics__/graphics/icons/danyao/dan-juqi.png"
local dihuo_pic = "__xiuxian-graphics__/graphics/icons/地火.png"
function itemUtil.createDanyao(item_name)
data:extend(
{
{
... |
table.insert(emojichatHTML, [===[gs","url"],char:"🔗",fitzpatrick_scale:!1,category:"objects"},paperclip:{keywords:["documents","stationery"],char:"📎",fitzpatrick_scale:!1,category:"objects"},paperclips:{keywords:["documents","stationery"],char:"🖇",fitzpatrick_scale:!1,category:"objects"},scissors:{keywords:["station... |
-- Returns a factory that creates a function which returns an existing instance of an object, or returns a new instance of that object.
-- Sorry if that was confusing.
-- Example for help:
-- local GetOrCreateFactory = require(this)
-- local GetOrCreateFolder = GetOrCreateFactory("Folder")
-- GetOrCreateFolder(game.Re... |
local refresh_expiration = function (now, nextRequest, groupTimeout)
if groupTimeout ~= nil then
local ttl = (nextRequest + groupTimeout) - now
for i = 1, #KEYS do
redis.call('pexpire', KEYS[i], ttl)
end
end
end
|
package("mkl")
set_homepage("https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html")
set_description("Intel® oneAPI Math Kernel Library")
if is_plat("windows") then
if is_arch("x64") then
add_urls("https://anaconda.org/intel/mkl-static/$(version)/down... |
require 'nn'
require 'lfs'
input_params = {
data_dir = "/home/prannayk/machine_learning/datasets/",
learningRate = 0.1,
dropout = 0.2,
skip_window = 2,
margin = 0.02,
num_layers = 3,
train_frac = 0.7,
valid_frac = 0.2,
test_frac = 0.1,
input_file = "text8",
vocab_file = "voc... |
local BX_DIR = "%{wks.location}/bx"
local BIMG_DIR = "%{wks.location}/bimg"
project "bimg"
kind "StaticLib"
language "C++"
cppdialect "C++14"
exceptionhandling "Off"
rtti "Off"
files
{
BIMG_DIR .. "/include/bimg/*.h",
BIMG_DIR .. "/src/image.cpp",
BIMG_DIR .. "/src/image_gnf.cpp",
BIMG_DIR .. "/src/*.h"... |
local ffi = require('ffi')
local keymap = require('fzf.keymap')
fzf = {}
fzf.results = {}
fzf.prompt = {}
ffi.cdef[[
typedef struct
{
char* str;
size_t len;
} fzf_string;
typedef struct
{
fzf_string results[40];
size_t len;
} fzf_output;
void fzf_init(char** ignore, int len);
void fzf_start(fzf_str... |
local debug = require("__janosch-lib__.debug")
local error = {}
-- error types
error.no_handler_for_request_type = function (request_type)
return {
code = 1,
message = "No handler found for request_type: " .. request_type,
}
end
error.request_handler_failed = function (request_type, lua_err... |
RoundController = Class {
init = function(self)
self.roundIndex = 1
self.readyToStart = false
self.currentRound = Round(1)
self.totalRounds = 30
self.crucible = Crucible(3)
self.ENEMY_BLUEPRINTS = require("src.enemy-blueprints")
self.bossRounds = {
... |
--[[
Try this file with the following commands lines;
example.lua --help
example.lua -o myfile -d --compress=gzip inputfile
example.lua --__DUMP__ -o myfile -d --compress=gzip inputfile
--]]
local cli = require "cliargs"
-- this is called when the flag -v or --version is set
local function print_version()
p... |
local a = require('plenary.async.async')
local wrap = a.wrap
local void = a.void
local scheduler = require('plenary.async.util').scheduler
local cache = require('gitsigns.cache').cache
local config = require('gitsigns.config').config
local BlameInfo = require('gitsigns.git').BlameInfo
local api = vim.api
local curre... |
local composer = require( "composer" )
local scene = composer.newScene()
-- -----------------------------------------------------------------------------------
-- Code outside of the scene event functions below will only be executed ONCE unless
-- the scene is removed entirely (not recycled) via "composer.removeScen... |
--[[
© 2016-2017 TeslaCloud Studios
See license in LICENSE.txt.
--]]
-- A function to include a file based on it's prefix.
function util.Include(strFile)
if (SERVER) then
if (string.find(strFile, "sh_") or string.find(strFile, "shared.lua")) then
AddCSLuaFile(strFile)
return include(strFile)
elseif (str... |
function setup()
sb = {}
t = Text.new(50, 30)
table.insert(sb, t)
t:fakeBoot()
x, y = 0, 0
end
function update()
if y > 0 and window.button.downTime["up"] % 5 == 1 then
y = y - 1
end
if y < 28 and window.button.downTime["down"] % 5 == 1 then
y = y + 1
end
if x > 0 and window.button.downTime["left"] %... |
-- returns if a number is even or not
return (function(num)
if (num % 2 == 0) then
return true
else
return false
end
end)
|
local channel_busy = love.thread.getChannel("3DreamEngine_channel_jobs_channel_busy")
local channel_jobs = love.thread.getChannel("3DreamEngine_channel_jobs")
local channel_results = love.thread.getChannel("3DreamEngine_channel_results")
require("love.image")
--combine three image datas
local function combineImages(r... |
local unpack, select, type, pairs, tinsert, max, floor, abs
= unpack, select, type, pairs, table.insert, math.max, math.floor, math.abs
local UnitFactionGroup, DressUpTexturePath, CreateFrame, GetItemIcon, GetSpecializationInfoByID, GetClassInfoByID, GetInventorySlotInfo, UnitStat, BreakUpLargeNumbers, UnitName
= ... |
Thread.jump("lib/thread/invalid.lua")
finished = true
|
return function()
local evaluate = require(script.Parent)
it("should return 10", function()
expect(evaluate("10")).to.equal(10)
end)
it("should return -10", function()
expect(evaluate("-10")).to.equal(-10)
end)
it("should return +10", function()
expect(evaluate("+10")).to.equal(10)
end)
it("should add... |
entities.require("entity")
class "structure" ("entity")
function structure:structure()
entity.entity(self)
if (_CLIENT) then
local sprite = sprite("images.obj.structures")
sprite:setFilter("nearest", "nearest")
self:setSprite(sprite)
end
end
function structure:use(activator, value)
-- return true so deriv... |
cgilua.htmlheader()
cgilua.put"Oi!"
--io.write"something\n"
cgilua.errorlog ("eca", "emerg")
|
local Vector = require "vector"
local physics = {}
local g = 9.81
local pi = 3.14159265359
function math.clamp(low, n, high) return math.min(math.max(n, low), high) end
function physics.calculatePhysics(objects, step, width, height)
for i, object in ipairs(objects) do
-- check horizontal bounds
if object.p... |
local me = peripheral.wrap("top")
local function getCraftable()
local gold = me.getItemDetail({id="minecraft:gold_ingot"},false)
if gold == nil then
return 0
else
return math.floor(gold.qty / 3)
end
end
while true do
local cpus = me.getCraftingCPUs()
local free = 0
for i=... |
return { sharp = { 18, 9, 6 } } |
#!/usr/bin/env lua
package.path = package.path..";../?.lua"
local glfw = require("moonglfw")
local gl = require("moongl")
local glmath = require("moonglmath")
local new_objmesh = require("common.objmesh")
local vec3, vec4 = glmath.vec3, glmath.vec4
local mat3, mat4 = glmath.mat3, glmath.mat4
local pi, rad = math.pi, m... |
------------------------------------------------------------------------------
-- kong-plugin-soap2rest 1.0.2-1
------------------------------------------------------------------------------
-- Copyright 2021 adesso SE
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file ex... |
local L = select(2, ...).L('esES')
L['ALT key'] = ALT_KEY
L['ALT + CTRL key'] = ALT_KEY_TEXT .. ' + ' .. CTRL_KEY
L['ALT + SHIFT key'] = ALT_KEY_TEXT .. ' + ' .. SHIFT_KEY
L['You can\'t do that while in combat'] = ERR_NOT_IN_COMBAT
-- config
-- L['Modified to use %s'] -- MISSING! %s = "Molinari"
-- L['Item Blocklist'... |
-- Block users from switching to other skins
function FadeVariantMixin:SetVariant()
end |
---
-- @module factory
local types = require("lualife.types")
local PlacedField = require("lualife.models.placedfield")
local FieldSettings = require("biohazardcore.models.fieldsettings")
local random = require("lualife.random")
local factory = {}
---
-- @tparam FieldSettings settings
-- @treturn lualife.models.Plac... |
stormtrooper_common = {
description = "",
minimumLevel = 0,
maximumLevel = 0,
lootItems = {
{itemTemplate = "painting_bw_stormtrooper", weight = 2500000},
{itemTemplate = "painting_han_wanted", weight = 2500000},
{itemTemplate = "painting_leia_wanted", weight = 2500000},
{itemTemplate = "painting_luke_wante... |
--[[
The MIT License (MIT)
Copyright (c) 2015 Xaymar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merg... |
--
-- Created by IntelliJ IDEA.
-- User: RJ
-- Date: 21/09/16
-- Time: 10:19
-- To change this template use File | Settings | File Templates.
--
--***********************************************************
--** ROBERT JOHNSON **
--************************************************... |
local module1 = ...
print("loading module 1")
function module1.test()
print("running module 1 test")
end
|
---@class RGB @R, G, B 값을 나타냅니다.
---@field R number @Red value
---@field G number @Green value
---@field B number @Blue value
RGB = {}
---@param color number @RGB 값
---@return RGB
function numberToRGB(color)
return {
R = color % 0x100,
G = math.floor(color / 0x100) % 0x100,
B = math.floor(c... |
-----------------------------------------------------------------------------
-- JSONRPC4MinetestLua: JSONRPC4Lua modified for minetest engine.
-- json-rpc Module.
-- This module is released under the MIT License (MIT).
--
-- Requires JSON4MinetestLua to be installed.
--
-- USAGE:
-- This module exposes two functions:... |
-- kalimba
-- follow a real kalimba
-- with a synthesized one
engine.name='Kalimba'
local SCREEN_FRAMERATE=15
local DEBOUNCE_TIME=0.1
local debounce_timer={0,0,0,0}
local current_freq=-1
local last_freq=-1
local currrent_amp=-1
local last_amp=-1
local amp_min=0.01
local amp_max=0.06
local note_activated=false
local v... |
local propText = script:GetCustomProperty("Text"):WaitForObject()
local propShadowText = script:GetCustomProperty("ShadowText"):WaitForObject()
local LOCAL_PLAYER = Game.GetLocalPlayer()
Events.Connect("PlayerWins_Event", function(player)
local textToDisplay = player.name .. " wins!!"
if player == LOCAL_PLAYER then... |
local cmp = require "cmp"
local luasnip = require "luasnip"
local kind_icons = {
Text = "",
Method = "",
Function = "",
Constructor = "",
Field = "",
Variable = "",
Class = "ﴯ",
Interface = "",
Module = "",
Property = "ﰠ",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippe... |
return {'vrijheidsbeeld','vriend','vriendelijk','vriendelijkheid','vriendenclub','vriendendienst','vriendenfeest','vriendengroep','vriendengroet','vriendenkring','vriendenmaal','vriendenmatch','vriendenpaar','vriendenploeg','vriendenprijsje','vriendenschaar','vriendin','vriendinnenkring','vriendinnetje','vriendjespolit... |
-- All the net messages defined here
util.AddNetworkString("xAdminNetworkIDRank")
util.AddNetworkString("xAdminNetworkExistingUsers")
util.AddNetworkString("xAdminNetworkCommands")
util.AddNetworkString("xAdminAFKCheck")
util.AddNetworkString("xAdminAFKConfirm")
util.AddNetworkString("xAdminChatMessage")
util.AddNetwor... |
add_requires("spdlog 1.8.5")
target("log")
set_kind("shared")
set_pcxxheader("../pch.h")
add_includedirs("$(projectdir)/deps/headeronly", "$(projectdir)/deps/libs", "$(projectdir)/deps/src", "$(projectdir)/src")
add_files("*.cpp")
add_packages("spdlog") |
-- double-ended stack?
local m = {}
function m.new()
return {
[0] = {},
from = 0,
to = -1
}
end
function m.empty(l)
return l.to < l.from
end
function m.is(l)
return l.to and l.from and type(l[0]) == "table"
end
function m.len(l)
return l.to - l.from + 1
end
function m.g... |
-- Each time a judgment occurs during gameplay, the engine broadcasts some relevant data
-- as a key/value table that themeside Lua can listen for via JudgmentMessageCommand()
--
-- The details of *what* gets broadcast is complicated and not documented anywhere I've found,
-- but you can grep the src for "Judgment" (qu... |
class.name = "rotateAlongX"
class.base = "engine.monoBehaviour"
function class:awake()
self.meshRenderer = self.gameObject:getComponent(engine.meshRenderer)
self.meshRenderer.colour:set(1.0, 0.0, 0.0, 1.0)
end
function class:update(dt)
self.transform.rotation:rotate(1, 0, 0, dt)
end |
local get_request = require("resty.core.base").get_request
local ngx_var = ngx.var
local _M = {
_version = 0.1,
}
function _M.request()
local r = get_request()
if not r then
return nil, "no request found"
end
return r
end
function _M.fetch(name, request)
return ngx_var[name]
end
... |
---------------------------------------------------------------------------------------------------
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/3136
--
-- Description: Successful 2nd PTU if it's triggered within failed retry for the 1st PTU
-- Note: script is applicable for PROPRIETARY policy flow
--
-... |
--------------------------------------------------------------------------------
-- ARS-MP safety system
--------------------------------------------------------------------------------
-- Copyright (C) 2013-2018 Metrostroi Team & FoxWorks Aerospace s.r.o.
-- Contains proprietary code. See license.txt for additional in... |
local M = {}
-- Get files from an exact filepath and return them as
-- a lua module path
-- @param path string
-- @param modulepath string - A module path that can be appended
-- @returns table
function M.get_files_as_modules(path, modulepath)
if vim.endswith(modulepath, '.') then
error('[FileSystem] Cannot have... |
local test = require 'pl.test'
local lapp = require 'pl.lapp'
local k = 1
function check (spec,args,match)
local args = lapp(spec,args)
for k,v in pairs(args) do
if type(v) == 'userdata' then args[k]:close(); args[k] = '<file>' end
end
test.asserteq(args,match)
end
-- force Lapp to throw an e... |
local skynet = require "skynet"
local mysql = require "skynet.db.mysql"
require "skynet.manager"
require "common.util"
--[[
用法:
local dbserver = skynet.localname(".your db name")
local is_succeed = skynet.call(dbserver, "lua", "insert", "insert into Table(Id) values(1)")
--]]
local db
local function ping()
while tru... |
--[[
@ filename : master_db.lua
@ author : zhangshiqian1214@163.com
@ modify : 2017-08-23 17:53
@ company : zhangshiqian1214
]]
require "skynet.manager"
local skynet = require "skynet"
local db_config = require "config.db_config"
local command = {}
local db_pool = {}
local db_pool_index = {}
local function... |
local stf=dofile "gstuff/pwm.lua"
local menu_sgn={
{name="Signal 0", ind_t=stf.ind, act=stf.acts, par=6},
{name="Signal 1", ind_t=stf.ind, act=stf.acts, par=5},
{name=" ..main menu"}
}
stf=nil
return menu_sgn
|
-- pastebin run -f B5pvDmYi
-- openDHD from Asher9
-- https://github.com/Asher9/Asher9-s-Programms/tree/master/openDHD
local fs = fs or require("filesystem")
local NEU = ...
local standard = loadfile("/stargate/Sicherungsdatei.lua")
local Sicherung = {}
local sprachen = {}
local ALT = {}
if fs.ex... |
-- https://github.com/Lautenschlager-id/prepdir
local prepdir
do
local format = string.format
local gsub = string.gsub
local match = string.match
local sub = string.sub
local rep = string.rep
local conditionalSymbols = {
['&'] = "and",
['|'] = "or",
['!'] = "not ",
["!="] = "~="
}
local symbolReplace ... |
local resolver_cache = require 'resty.resolver.cache'
describe('resty.resolver.cache', function()
local answers = { {
class = 1,
cname = "elb.example.com",
name = "www.example.com",
section = 1,
ttl = 599,
type = 5
}, {
class = 1,
cname = "example.us-east-1.elb.amazonaws.com",
... |
function stdout(...)
print(...)
end
|
--MoveCurve
--H_Tohka/curve_Attack_3 curve_Attack_3
return
{
filePath = "H_Tohka/curve_Attack_3",
startTime = Fixed64(17825792) --[[17]],
startRealTime = Fixed64(267387) --[[0.255]],
endTime = Fixed64(24117248) --[[23]],
endRealTime = Fixed64(361759) --[[0.345]],
isZoom = false,
isCompensate = false,
curve = {... |
-- script containing supporting code/methods
local utils = {};
cjson = require 'cjson'
-- right align the question tokens in 3d volume
function utils.rightAlign(sequences, lengths)
-- clone the sequences
local rAligned = sequences:clone():fill(0);
local numDims = sequences:dim();
if numDims == 3 then
... |
return
{
[1] = {x4=1,x1=true,x2=4,x3=128,x5=112233445566,x6=1.3,x7=1112232.43123,x8_0=123,x8=112233,x9=112334,x10='yf',x12={x1=1,},x13=4,x14={ _name='DemoD2',x1=1,x2=2,},s1='xml text',v2={x=1,y=2},v3={x=1.2,y=2.3,z=3.4},v4={x=1.2,y=2.2,z=3.2,w=4.3},t1=-28800,k1={1,2,},k2={1,2,},k3={1,2,},k4={1,2,},k5={1,2,},k6={1,2,},... |
-- 迭代器
function values( t )
local i = 0
return function ()
i = i + 1;
return t[i]
end
end
-- 使用迭代器
t = {10, 20, 30}
iter = values(t)
while true do
local element = iter()
if element == nil then
break
end
print(element)
end
-- 泛型for
for element in values(t) do
pr... |
local com = require("component")
local debug = com.debug
local modem = com.modem
local module = require("ut3-gm.module")
local config = module.load("config")
local events = module.load("events")
local store = module.load("store")
local engine = events.engine
modem.setStrength(400)
engine:subscribe("debug-message"... |
local Suite = require "loop.test.Suite"
local Template = require "oil.dtests.Template"
local template = Template{"Client"} -- master process name
Server = [=====================================================================[
checks = oil.dtests.checks
Interceptor = {}
function Interceptor:receiverequest(request)
i... |
local Block = {}
Block.__index = Block
function Block.create(def, game)
local block = { x = def.x, y = def.y, width = def.width, height = def.height, game = game }
setmetatable(block, Block)
game.world:add(block, block.x, block.y, block.width, block.height)
return block
end
function Block:update... |
-- !!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!
-- This file is automaticly generated. Don't edit manualy!
-- !!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!
---@class C_ScenarioInfo
C_ScenarioInfo = {}
---@alias JailersTowerType number|"Enum.JailersTowerType.TwistingCorridors"|"Enum.JailersTowerTy... |
local server = require "nvim-lsp-installer.server"
local path = require "nvim-lsp-installer.path"
local zx = require "nvim-lsp-installer.installers.zx"
local root_dir = server.get_server_root_path "terraform"
return server.Server:new {
name = "terraformls",
root_dir = root_dir,
installer = zx.file "./inst... |
local AddonName, AddonTable = ...
AddonTable.freehold = {
-- Skycap'n Kragg
159633, -- Sharkbait's Fishhook
155884, -- Parrotfeather Cloak
159227, -- Silk Cuffs of the Skycap'm
159353, -- Chain-Linked Safety Cord
158360, -- Sharkbait Harness Girdle
155862, -- Kragg's Rigging Scalers
-- ... |
local awful = require("awful")
local wibox = require("wibox")
local wb = awful.wibar { position = 'top' }
wb:setup {
layout = wibox.layout.align.horizontal,
{
-- Rotate the widgets with the container
{
mytaglist,
direction = 'west',
widget = wibox.container.r... |
--[[
Licensed under GNU General Public License v2
* (c) 2014, Luke Bonham
--]]
local helpers = require("lain.helpers")
local textbox = require("wibox.widget.textbox")
local ... |
-- Copyright (C) by lework
local next = next
local type = type
local pairs = pairs
local lower = string.lower
local tostring = tostring
local ngx_re_find = ngx.re.find
local _M = {}
function _M.string_filter(str, filter)
local result = 0
if str ~= nil and filter ~= nil then
for _,subReg in pairs(filt... |
function ExistsInTbl(haystack, needle)
for i=1,#haystack do
if haystack[i] == needle then
return true
end
end
return false
end
Settings = GetSettings()
dofile(GetModPath() .. "/Resources/lib/P3D.lua")
dofile(GetModPath() .. "/Resources/lib/P3DFunctions.lua")
ModifierType = Settings.ModifierType
... |
--[[
Copyright (C) 2015 Real-Time Innovations, Inc.
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 agreed to in... |
if UI == nil then
UI = {}
end
---Deprecated since UIListeners were moved to the regular Listeners.
---Registers a function to call when a specific Lua LeaderLib UI event fires.
---@param event string OnTooltipPositioned
---@param callback function
function UI.RegisterListener(event, callback, ...)
RegisterListener(e... |
local l = {
"common.zproto",
}
return l
|
return
{
entities =
{
{"straight-rail", {x = -1, y = -3}, {dir = "southwest", }},
{"straight-rail", {x = -1, y = -1}, {dir = "northeast", }},
{"curved-rail", {x = 0, y = 0}, {dir = "southeast", }},
{"straight-rail", {x = 1, y = -1}, {dir = "southwest", }},
{"straight-rail", {x = 1, y = 1}, {dir ... |
MARS = {
onConnect = nil,
onDisconnect = nil,
onOutputEvent = nil,
peers = {},
interfaces = nil,
incoming_payload = nil,
}
function map (instFrom, evtFrom, instTo, evtTo, transform)
if instFrom.__mapping [evtFrom] == nil then
instFrom.__mapping [evtFrom] = {}
end
table.insert (instFrom.__mapping... |
-- mods/default/nodes.lua
minetest.register_node("default:stone", {
description = "Stone",
tiles = {"default_stone.png"},
is_ground_content = true,
groups = {cracky=3, stone=1},
drop = 'default:cobble',
legacy_mineral = true,
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:dese... |
----------------------------------------------------------------------------
-- @author Lucas de Vries <lucas@tuple-typed.org>
-- @copyright 2009-2010 Lucas de Vries
-- Licensed under the WTFPL
----------------------------------------------------------------------------
-- Load awful
require("awful")
-- Load be... |
SDL2_DIR = "sdl2"
SDL2_INCLUDE = SDL2_DIR.."/include"
local solution_name = _ACTION
if _ACTION == "ios" then
solution_name = _ACTION
_ACTION = "xcode4"
system "ios"
end
workspace "sdl2"
targetdir "bin/%{_ACTION}-%{cfg.platform}-%{cfg.buildcfg}/%{prj.name}"
objdir "temp/%{_ACTION}-%{cfg.platfo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.