content stringlengths 5 1.05M |
|---|
local admin = game.Players.acb227
function onChatted(msg)
if string.sub(msg, 1, 5) == "beam/" then
said = string.sub(msg, 6)
look = game.Players:GetChildren()
for i = 1, #look do
if string.find(string.lower(look[i].Name), said) == 1 then
look[i].Character.Humanoid.WalkSpeed = 0
part = Instance.new("Part")
part... |
while false do
print ("Not going to print")
end
x = 10
repeat
print ("Repeat loop")
until x > 2 |
IsEvent=true
event={
Active=true,
CT=false,
tag={},
Events={},
EventTracker={},
Steps={},
--addAlarm=function(self,tag) end,
setAlarm=function(self,tag,set) event:new("Alarm_"..tag.."(\""..tag.."\")",[[GetCounter(event:getTracker("_Alarm_]]..tag..[["))>=]]..set,[[event:removeAlarm("]]..tag..[[")]]) event:addTracker("_... |
-- Class: Promise
-- This is a way to communicate with an asynchronous function call that
-- is modeled after the Promises/A CommonJS spec <http://wiki.commonjs.org/wiki/Promises/A>.
-- The main difference is that instead of then(), it uses andThen() as the connecting
-- method name, since 'then' is a reserved word... |
newoption { trigger = "verbose", description = "Build efsw with verbose mode." }
newoption { trigger = "strip-symbols", description = "Strip debugging symbols in other file ( only for relwithdbginfo configuration )." }
newoption { trigger = "no-atomics", description = "Build efsw without atomics" }
newoption { trigg... |
return {'muhamed','muhammad','muhammed','muhameds','muhammads','muhammeds'} |
height = 64
width = 64
position = {["x"] = 0, ["y"] = 0}
velocity = {["x"] = 1, ["y"] = 1}
function init()
return {"resources/missing.png"}, width, height
end
function tick(w, h)
position.x = position.x + velocity.x
position.y = position.y + velocity.y
if position.x + width == w or position.x == 0 then
velocit... |
-- create empty memory
resizable = memory.create()
assert(memory.type(resizable) == "resizable")
assert(memory.len(resizable) == 0)
-- create memory with zeros
memory.resize(resizable, 4)
assert(memory.tostring(resizable) == "\0\0\0\0")
-- increase memory with data
memory.resize(resizable, 8, "\xff")
assert(memory.to... |
local peiceVals = {"#", "@"}
local squareVals = {"■", "☐"}
local board = {}
local keeper = 1
local yes = false
for i = 1,8,1 do
for ii = 1,8,1 do
if not yes then
io.write(squareVals[1])
yes = true
board[keeper] = squareVals[1]
else
io.write(squareVals[2])
yes = false
board... |
-- @namespace foundation.com
function foundation.com.maybe_start_node_timer(pos, duration)
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
timer:start(duration)
end
end
|
--
-- Please see the readme.txt file included with this distribution for
-- attribution and copyright information.
--
widgets = {};
function update()
for k, v in ipairs(widgets) do
v.destroy();
end
widgets = {};
local holders = window.getViewers();
local p = 1;
setAnchoredWidth(#holders * portraitspacing... |
object_tangible_item_beast_converted_vir_vur_decoration = object_tangible_item_beast_shared_converted_vir_vur_decoration:new {
}
ObjectTemplates:addTemplate(object_tangible_item_beast_converted_vir_vur_decoration, "object/tangible/item/beast/converted_vir_vur_decoration.iff")
|
--文件上传处理类
--version:0.0.1
--Copyright (C) Yuanlun He.
local setmetatable = setmetatable
local len = string.len
local type = type
local match = ngx.re.match
local io_open = io.open
local upload = require "resty.upload"
local _M = {_VERSION='0.01'}
-- 接收上传文件,保存为savename
function _M.receive(key,savename)
local ch... |
local path = ...
if not path then
error( "Expected path", 2 )
end
path = shell.absolute(path)
if not disk.exists(path) then
error( "No such file", 2 )
elseif disk.info(path).type == "dir" and #disk.list(path) > 0 then
error( "Can't remove filled directories", 2 )
end
disk.remove(path) |
-- spec script. should NOT be bundled with final game.
-- for entitymanager.lua
-- load libraries. these can't all be mocked
require( "utils" )
require( "spec.spec_helper" )
EntityManager = require( "entitymanager" )
-- set up templates to use
local component_templates = {
identity = {
first_name = 'Bob',
... |
local ig = {}
--
-- C definitions ('cimgui.h' slightly modified to parse with `ffi.cdef`)
--
local cDefs = [[
// #include <stdio.h>
// #if defined _WIN32 || defined __CYGWIN__
// #ifdef CIMGUI_NO_EXPORT
// #define API
// #else
// #define API __declspec(dllexport)
// #endif
// #ifndef __GNUC__
// #define snprintf sp... |
local settings = {}
addEventHandler('onResourceStart', resourceRoot, function()
local allSettings = {'displayLines', 'drawMarginRight', 'drawMarginBottom', 'fadeTime', 'duration', 'outputConsole'}
for k, v in ipairs(allSettings) do
settings[v] = get(v)
end
end)
addEvent('requestKillMessagesSetting... |
--[[
Copyright (c) 2018-2021 The Forge Interactive Inc.
]]--
--[[
local loopSize = 500
local sleepSize = 10
local x = -6.12865686
local y = 12.2564745
local z = 59.3652649
for i = 1,loopSize do
luaCamera.MoveCamera(x, y, z)
x = x + math.sin(i * 3.141592653589793 / 180.0)
conffLib.sleep(sleepSize)
end
]]-... |
---------------------------------------------------
-- Licensed under the GNU General Public License v2
-- * (c) 2010, Greg D. <jabbas@jabbas.pl>
---------------------------------------------------
-- {{{ Grab environment
local tonumber = tonumber
local io = { popen = io.popen }
local setmetatable = setmetatable
loca... |
local AOEM = Grid2:GetModule("Grid2AoeHeals")
local L = Grid2Options.L
local select = select
local GetSpellInfo = GetSpellInfo
local classHeals = Grid2.isClassic and {
SHAMAN = { 1064 }, -- Chain Heal
PRIEST = { 596 }, -- Prayer of Healing
DRUID = { 740 }, -- Tranquility
} or {
SHAMAN = { 1064, ... |
local interiors = {
[1] = { ["xe"] = 1394.48278808594, ["ye"] = 1141.74035644531, ["ze"] = 114.606857299805, ["he"] = 0.000, ["xo"] = 1397.33056640625, ["yo"] = 1142.05017089844, ["zo"] = 114.333587646484, ["ho"] = 0.000, ["name"] = 'Ranch Main'},
[2] = { ["xe"] = 1400.36584472656, ["ye"] = 1127.14978027344, ["ze"] =... |
return {
dock= require( "widgets.dock" ),
devices= require( "widgets.devices" ),
keyboardSwitcher= require( "widgets.keyboardSwitcher" ),
keyboard= require( "widgets.keyboard" ),
spacer= require( "widgets.spacer" ... |
require'iuplua'
local label1 = iup.label{title = 'param 1'}
local label2 = iup.label{title = 'param 2 with long name'}
local norm = iup.normalizer{label1, label2}
norm.normalize = "HORIZONTAL"
norm:destroy()
local dialog = iup.dialog
{
title="a dialog", size="QUARTERxQUARTER",
iup.vbox
{
cgap = "5x5... |
local util = require("util")
local nodemap = require("util.nodemap")
local function get_test_backend_single()
return {
name = "access-router-production-web-80",
endpoints = {
{ address = "10.184.7.40", port = "8080", maxFails = 0, failTimeout = 0 }
}
}
end
local function get_test_backend_multi()... |
-- -*- lua -*-
whatis("Description: Lmod: An Environment Module System")
prepend_path('PATH','@PKG@/libexec')
|
local wibox = require("wibox")
local beautiful = require("beautiful")
local gears = require("gears")
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
local util = {
changewidgetbg = function(wi, color)
return wibox.container.background(wi, color)
end,
createicon = function... |
local xy2i = function(x, y)
return x + y * 4 - 4
end
shopAction = function()
local u = GetTriggerUnit()
local id = GetSpellAbilityId()
local name = GetShopItemName(u, id)
local first = string.sub(name, 1, 1)
if first == "#" then
--页面
... |
-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
--
-- This file is compatible with Lua 5.3
local class = require("class")
require("kaitaistruct")
local enum = require("enum")
EnumDeep = class.class(KaitaiStruct)
function EnumDeep:_init(io, parent, root)
KaitaiStr... |
------------------------------------------------------------------------------
-- LuaSec 0.7
--
-- Copyright (C) 2006-2018 Bruno Silvestre
--
------------------------------------------------------------------------------
local core = require("ssl.core")
local context = require("ssl.context")
local unpack = table.... |
--[[
Name: "sv_auto.lua".
Product: "nexus".
--]]
for k, v in pairs( file.Find("../materials/decals/flesh/blood*") ) do
resource.AddFile("materials/decals/flesh/"..v);
end;
for k, v in pairs( file.Find("../materials/decals/blood*") ) do
resource.AddFile("materials/decals/"..v);
end;
for k, v in pairs( file.Find("..... |
----------------------------------------
-- Group Calendar 5 Copyright (c) 2018 John Stephen
-- This software is licensed under the MIT license.
-- See the included LICENSE.txt file for more information.
----------------------------------------
----------------------------------------
GroupCalendar.UI._Partners... |
--[[
Copyright 2015 The Luvit Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... |
--// logic
local Info = {}
Info.Connections = {}
Info.Name = nil
Info.Creator = nil
Info.Version = nil
Info.Updated = nil
Info.Outdated = false
Info.Server = nil
--// services
local Services = setmetatable({}, {__index = function(cache, serviceName)
cache[serviceName] = game:GetService(serviceName)
return cach... |
if GetLocale()~='zhCN' then return end
local main= "7.3.0."
local minor = "689"
BIGFOOT_VERSION = "zhCN"..main..minor;
function GetMinorVersion()
return minor
end
BigFootChangelog_ah();
BigFootChangelog_at("2018/06/07 (7.3.0.689)")
BigFootChangelog_ar("集合石","升级至最新版本(70300.12)。")
BigFootChangelog_ar("竞技语音","升级至最新... |
speed = 10.0
function update(evt)
local upd8 = evt:to_update()
local dt = upd8.delta
local vel = speed * dt
local cur_cam = camera.current()
local cur_cam_pos = cur_cam.pos
if keyboard.is_pressed(key.W) then
cur_cam.pos = cur_cam_pos:add(cur_cam:front():smul(vel))
end
if keyboard... |
local utf8 = require('utf8')
local utils = {
default_font = love.graphics.newFont(14),
nodeTypes = {
LABEL = 1,
BUTTON = 2,
SLIDER = 3,
TOGGLE = 4,
TEXT = 5,
MULTI = 6,
PANEL = 7,
JOY = 8,
IMAGE = 9
},
textAlignments = {
LEFT = 'left',
CENTER = 'center',
RIGHT = 'right'
},
sx ... |
local KUI, E, L, V, P, G = unpack(select(2, ...))
local KC = KUI:NewModule("KuiChat", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0")
local CH = E:GetModule('Chat')
KC.SelectedStrings = {
["DEFAULT"] = "|cff%02x%02x%02x>|r %s |cff%02x%02x%02x<|r",
["SQUARE"] = "|cff%02x%02x%02x[|r %s |cff%02x%02x%02x]|r",
["BEND"] =... |
require("gameBase/gameLayer");
GameLayer.getControlInConfig = function(self,config)
if (not config) or (#config < 1) then
return nil;
end
local result = nil;
local itorNestValues = function(t)
local index = {1};
return function()
local getValue = function(t,idx)
local c = t;
for i=1,... |
local RC522 = {}
RC522.__index = RC522
RC522.mode_idle = 0x00
RC522.mode_auth = 0x0E
RC522.mode_transrec = 0x0C
RC522.mode_reset = 0x0F
RC522.mode_crc = 0x03
RC522.act_anticl = 0x93
RC522.reg_tx_control = 0x14
RC522.length = 16
RC522.num_write = 0
RC522.pin_ss = nil
RC522.pin_rst = nil
RC522.rc_timer = tmr.create()
RC5... |
simple = {
name = "Chris",
value = 10000,
taxed_value = function()
return value - (value * 0.4)
end,
in_ca = true
} |
-- Copyright 2008 Steven Barth <steven@midlink.org>
-- Copyright 2010-2015 Jo-Philipp Wich <jow@openwrt.org>
-- Licensed to the public under the Apache License 2.0.
local utl = require "luci.util"
m = Map("users", arg[1]:upper(), translate("User Configuration Options"))
local fs = require "nixio.fs"
local groups = {... |
local Tag = "xcppi"
module(Tag,package.seeall)
net.Receive(Tag,function()
local c = tobool(net.ReadBit())
if c then
local i = net.ReadDouble()
if i == 1 then
for k,v in pairs(ents.GetAll()) do
v.___owner = nil
end
Msg("[XPP] ")
print("Reset all entity ownership data")
end
return
end
local e... |
local helpers = require "spec.helpers"
describe("jest", function()
before_each(helpers.before_each)
after_each(helpers.after_each)
local filename = "spec/fixtures/js/name.test.js"
it("runner", function()
local runner = require "nvim-test.runners.jest"
assert.is.truthy(runner)
assert.is.equal("jes... |
require 'torch'
require 'nn'
require 'image'
require 'optim'
require 'csvigo'
data = torch.Tensor{ csvigo.load{path='ex1data1.txt', mode='raw'} }
data = data[1]
model = nn.Sequential()
ninputs = 1; noutputs = 1
model:add(nn.Linear(ninputs, noutputs))
criterion = nn.MSECriterion()
x, dl_dx = model:getParameters()
fe... |
return {
summary = 'Get the type of the Joint.',
description = 'Returns the type of the Joint.',
arguments = {},
returns = {
{
name = 'type',
type = 'JointType',
description = 'The type of the Joint.'
}
},
related = {
'JointType'
}
}
|
-- This script template has each of the script entry point functions.
-- They are described in detail in VR-Forces Configuration Guide.
-- Some basic VRF Utilities defined in a common module.
require "vrfutil"
-- Global Variables. Global variables get saved when a scenario gets checkpointed.
-- They get re-initialize... |
local local0 = 0.3
local local1 = 0.5 - local0
local local2 = 0.5 - local0
local local3 = 0.5 - local0
local local4 = 0.5 - local0
local local5 = 0.5 - local0
local local6 = 0.5 - local0
local local7 = 0.5 - local0
local local8 = 0.5 - local0
local local9 = 0.5 - local0
local local10 = 0.5 - local0
local local11 = 0.5 ... |
--[[
openwrt-dist-luci: ChinaDNS
]]--
local m, s, o
if luci.sys.call("pidof chinadns >/dev/null") == 0 then
m = Map("chinadns", translate("ChinaDNS"), translate("ChinaDNS is running"))
else
m = Map("chinadns", translate("ChinaDNS"), translate("ChinaDNS is not running"))
end
s = m:section(TypedSection, "chinadns", ... |
-------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------Simple Holster Animation-----------------------------------------------------
----------------------------------------------------... |
local CATEGORY_NAME = "PermWeapons"
function ulx.givepermweapon( calling_ply, target_plys, weapon_class )
local affected_plys = {}
for i=1, #target_plys do
local v = target_plys[ i ]
if ( PermWeapons.HasWeapon( v, weapon_class ) ) then continue end
if ( table.HasValue( PermWeapons.WeaponBlacklist, ... |
AddCSLuaFile("shared.lua")
include('shared.lua')
/*-----------------------------------------------
*** Copyright (c) 2012-2017 by DrVrej, All rights reserved. ***
No parts of this code or any of its contents may be reproduced, copied, modified or adapted,
without the prior written consent of the author, unless other... |
--- A lightweight container for @{Frame}s that will function as a dynamically resized bar.
-- @classmod Gauge
local Background = require("vyzor.component.background")
local Base = require("vyzor.base")
local Brush = require("vyzor.component.brush")
local Color = require("vyzor.component.color")
local ColorMode = requi... |
--------------------------------------------------------------------------------
-- transmission of a video via UDP for torch7
--------------------------------------------------------------------------------
-- Jonghoon, Jin, E. Culurciello, October 31, 2014
-------------------------------------------------------------... |
---@type Ellyb
local Ellyb = Ellyb:GetInstance(...);
-- Lua imports
local pairs = pairs;
-- WoW imports
local GetTimePreciseSec = GetTimePreciseSec;
local Threads = {};
Ellyb.Threads = Threads;
local DEFAULT_TICKER = 0.025;
---@type Thread[]
local threads = {};
---Execute the given function in a separate thread us... |
tutorial_quartermaster = Creature:new {
objectName = "@newbie_tutorial/system_messages:quarter_name",
socialGroup = "imperial",
faction = "imperial",
level = 15,
chanceHit = 0.31,
damageMin = 160,
damageMax = 170,
baseXp = 831,
baseHAM = 2400,
baseHAMmax = 3000,
armor = 0,
resists = {0,0,0,0,0,0,0,0,-1},
m... |
---------------------------------------------------
-- Bomb Toss - Suicide
-- Throws a bomb at an enemy. Sometimes backfires.
---------------------------------------------
require("scripts/globals/monstertpmoves")
require("scripts/globals/settings")
require("scripts/globals/status")
------------------------------------... |
-- local opt = vim.opt -- set-option
local bo = vim.bo -- buffer-scoped
bo.expandtab = true
bo.shiftwidth = 4
bo.softtabstop = 4
bo.tabstop = 4
|
local ngx = ngx;
local type = type;
local pairs = pairs;
local tostring = tostring;
local ipairs = ipairs;
local print = ngx.print;
-- local getmetatable = getmetatable;
-- local model = require ('model.AppLuaIo');
-- local table = table;
-- local setmetatable = setmetatable;
local cjson ... |
--shameless copy-pasta of Parakeet's micro_item_medkit.lua
AddCSLuaFile()
ENT.Base = "micro_item"
ENT.ItemName = "Armor Kit"
ENT.ItemModel = "models/items/battery.mdl"
ENT.MaxCount = 200
local sound_armorup = Sound("items/battery_pickup.wav")
function ENT:Use(ply)
local armor_needed = 200 - ply:Arm... |
local momo = {
"a",
"advanced-plastics",
"advanced-wire",
"atc",
"atomic-emission-point",
"atomic-fusion",
"b1",
"b2",
"b3",
"b4",
"b5",
"bio-desert",
"bio-grade-1",
"bio-grade-2",
"bio-grade-3",
"bio-swamp",
"bio-temp",
"bronze-pack",
"buildin... |
local skynet = require "skynet"
local netpack = require "netpack"
local socket = require "socket"
local sproto = require "sproto"
local sprotoloader = require "sprotoloader"
local host
local send_request
local CMD = {}
local REQUEST = {}
local client_fd
local mysqlservice = {}
local gate
function RE... |
-- Save hunger and thirst to database
RegisterServerEvent("saveHungerThirst")
AddEventHandler("saveHungerThirst", function(hunger, thirst)
TriggerEvent('es:getPlayerFromId', source, function(user)
local player = user.getIdentifier()
MySQL.Async.execute("UPDATE hungerthirst SET hunger=@hunger, thirst=@thirst ... |
FISH_ANIMATION_TYPE = {
FRAME = 0,
SKELETON = 1
}
slot0 = class("Fish", function ()
return fishgame.Fish:Create()
end)
slot0.ctor = function (slot0)
slot0.m_effects = {}
end
slot0.GetParticle = function (slot0)
if slot0.m_fishConfigData ~= nil then
if slot0.m_fishConfigData.Particle == nil then
return ""
... |
local util = require("genvdoc.util")
local plugin_name = vim.env.PLUGIN_NAME
local full_plugin_name = plugin_name .. ".nvim"
local example_path = ("./spec/lua/%s/example.lua"):format(plugin_name)
vim.o.runtimepath = vim.fn.getcwd() .. "," .. vim.o.runtimepath
local tool_names_text
do
local tools = require("gettest.... |
local Packer = {
author = "Ryan Schlesinger <ryan@ryanschlesinger.com>",
homepage = "https://github.com/ryansch/Packer.spoon",
name = "Packer",
version = "0.1.0",
license = "MIT",
spoonPath = hs.spoons.scriptPath()
}
local util = dofile(hs.spoons.resourcePath("util.lua"))
local Spoon = dofile(hs.spoons.res... |
-- Test the re-indent (=<motion>)
test.open('foo2.xml')
local assertEq = test.assertEq
assertEq(buffer.current_pos, 1)
-- indent the whole file
test.key('=')
test.key('G')
-- Get the indentation of each line
local function get_indents()
local indents = {}
for i=1,buffer.line_count do
-- line numbers 0-based
... |
object_ship_tieadvanced_tier7 = object_ship_shared_tieadvanced_tier7:new {
}
ObjectTemplates:addTemplate(object_ship_tieadvanced_tier7, "object/ship/tieadvanced_tier7.iff")
|
Log('SCAAMAmalgarmin >> Registering events');
g_mEventHandlers['SCAAMGPSInit'] = function(playerId, event, source_id, target_id)
local player = System.GetEntity(g_localActorId);
-- Assigns the battle royale custom keys
System.AddCCommand('SCAAMGPSMode', 'SCAAMGPSChangeMode(%1)', '');
System.AddCCommand... |
-- Rabin-Karp string searching algorithm implementation
-- See: http://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_string_search_algorithm
-- Note: This implementation is based on the Python implementation of Shivam Bansal
-- See : https://github.com/kennyledet/Algorithm-Implementations/blob/master/Rabin_Karp/Python/shiv... |
AddCSLuaFile()
SWEP.Base = "yawd_sniper_base"
SWEP.PrintName = "Sniper"
SWEP.Author = "YAWD Team"
SWEP.Category = "YAWD"
SWEP.Spawnable = true
SWEP.AdminOnly = true
SWEP.m_WeaponDeploySpeed = 1
SWEP.Slot = 0
SWEP.SlotPos = 0
SWEP.DrawCrosshair = true
SWEP.DrawAmmo = true
SWEP.Weight = 5
SWEP.ViewModelFOV = 74
SWEP.... |
ESX = nil
RaceData = {
InCreator = false,
InRace = false,
ClosestCheckpoint = 0,
}
CreatorData = {
RaceName = nil,
Checkpoints = {},
TireDistance = 3.0,
ConfirmDelete = false,
}
CurrentRaceData = {
RaceId = nil,
RaceName = nil,
Checkpoints = {},
Started ... |
-----------------------------------
-- Area: FeiYin
-- NPC: Underground Pool
-- Involved In Quest: Scattered into Shadow
-- Offset 0 (H-5) !pos 7 0 247 204
-- Offset 1 (F-5) !pos -168 0 247 204
-- Offset 2 (H-8) !pos 7 0 32 204
-----------------------------------
local ID = require("scripts/zones/FeiYin/IDs")
require(... |
local utils = {}
function utils.sub_global(name, constructor)
if not global[name] then
if constructor then
global[name] = constructor()
else
global[name] = {}
end
end
return global[name]
end
return utils
|
-- ********************************************************************************
-- Data Broker Volume Control (Broker_Volume)
-- A volume control for Data Broker.
-- By: Shenton
--
-- Locales-enUS.lua
-- ********************************************************************************
local L = LibStub("AceLocale-... |
-- =========================================================================
-- Licensed to Qualys, Inc. (QUALYS) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- QUALYS licenses this file to You under th... |
-- Spell management
-- spellName -> {spellID,bookType,castTime,actionSlot}
spellData={}
spellCastTime={
-- Priest
["Lesser Heal(Rank 1)"]=1.5,
["Lesser Heal(Rank 2)"]=2,
["Lesser Heal(Rank 3)"]=2.5,
["Heal"]=2.5,
["Greater Heal"]=2.5,
["Flash Heal"]=1.5,
-- Paladin
["Holy Light"]=2.5,
["Flash o... |
--[[
处理MQTT各消息的逻辑
下面的代码为我当前接待喵逻辑使用的代码,可以重写也可以按自己需求进行更改
详细请参考readme
]]
--对各个topic进行订阅
local function subscribe()
local topics = {
--"live/"..Utils.Setting.ClientID,
"/8266/test_online"
}
for i=1,#topics do
local result = Mqtt.Subscribe(topics[i], 0)
Log.Debug(... |
-- MIT License
-- Copyright (c) 2021 David Fletcher
-- 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, ... |
Emoji = {
{
{":grinning:"},
"😀"
},
{
{":grin:"},
"😁"
},
{
{":joy:"},
"😂"
},
{
{":smiley:"},
"😃"
},
{
{":smile:"},
"😄"
},
{
{":sweat_smile:"},
"😅"
},
{
{":laug... |
return {
texture = 'kenney-1bit.png',
frame_width = 16,
frame_height = 16,
gap_width = 1,
gap_height = 1,
sprites = {
invalid = {
frame = { 24, 25 },
color = 'red'
},
slime = {
frame = { 27, 8 },
color = 'green'
},
blue_slime = {
frame = { 27, 8 },
co... |
local inspect = require('inspect');
local NetworkSequential, parent = torch.class('nnst.NetworkSequential', 'nn.Sequential')
--
-- NetworkSequential
--
function NetworkSequential:__init()
parent.__init(self)
self.layers = {}
end
function NetworkSequential:_addPerceptonLayer(linearLayer, transferLaye... |
function love.keypressed(key)
if key == "space" then
hello()
end
end |
--------------------------------------------------------------------------------------------------------
--- @class ColorGradingAsset : Asset
--------------------------------------------------------------------------------------------------------
local ColorGradingAsset = {}
return ColorGradingAsset
|
-- Lock Component
--
local Base = require 'modern'
local Lock = Base:extend()
-- New
--
function Lock:new(host, data)
self.host = host
--
-- flags
self.isLocked = false
end
---- ---- ---- ----
-- Request locked
--
function Lock:onLock()
self.isLocked = true
end
-- Request unlocked
--
function Lock:offLock()... |
-- taken from http://luaforge.net/projects/luacairo/
local cairo = require"lcairo"
local CAIRO = cairo
print(cairo.version_string())
w = 320
h = 240
--outfile = 'cairo_test2.png'
outfile = 'cairo_test3.pdf'
--cs = cairo.image_surface_create(CAIRO.FORMAT_RGB24, w, h)
cs = cairo.pdf_surface_create(outfile, w, h)
cr = ... |
-- demlo script
help([[
Set the format and/or codec parameters of the audio stream.
Demlo uses FFmpeg for transcoding.
We set both the codec parameters and the container ("format" in FFmpeg speaking).
The input container is kept _only if supported_.
'output.parameters' contains commandline flags passed to FFmpeg. The... |
local config = require('scripts.config')
local util = require('util')
local VICTORY_SPICE_AMOUNT = config.VICTORY_SPICE_AMOUNT
force_created = function(event)
local force = event.force
local force_index = force.index
global.forces[force_index] = util.copy(config.default.forces)
global.forces[force_ind... |
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue (Storage.OutfitQuest.DruidHatAddon) >= 7 then
if item.itemid == 6261 then
player:teleportTo(toPosition, true)
item:transform(item.itemid + 1)
end
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door ... |
GlobalVar("MapLowestZ", {})
GlobalVar("MapHighestZ", {})
local function FillMapExtremeValues(map_id)
local map_data = ActiveMaps[map_id]
if not MapLowestZ[map_id] and not map_data.IsPrefabMap then
local tavg, tmin, tmax = GetTerrainByID(map_id):GetAreaHeight()
MapLowestZ[map_id] = tmin
MapHighestZ[map_id] = tm... |
local _G = _G;
local ABP_4H = _G.ABP_4H;
local debugOpts = {
-- If set, extra debug messages will be printed.
-- Verbose = true,
-- If set, "BROADCAST" will get rerouted to "WHISPER" even in a group.
-- PrivateComms = true,
-- If set, some extra logging will be printed for comms.
-- DebugComm... |
-- Copyright (c) 2017 Adobe Systems Incorporated. All rights reserved.
--
-- 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 r... |
RegisterNetEvent("gcPhone:tchat_receive")
AddEventHandler("gcPhone:tchat_receive", function(message)
SendNUIMessage({event = 'tchat_receive', message = message})
end)
RegisterNetEvent("gcPhone:tchat_channel")
AddEventHandler("gcPhone:tchat_channel", function(channel, messages)
SendNUIMessage({event = 'tchat_channe... |
local JSON = require('cjson')
local function apply(invoke)
local function HOST(node)
return node.host .. ':' .. (node.port or '80')
end
-- get services status (with/without clients deep discovery)
-- /channel_name/invoke?getServiceStat&selfOnly=1
invoke.getServiceStat = function(route, channel, arg)
local cl... |
project "esteidpkcs11"
location ("../../build/" .. _ACTION)
uuid "AD102339-1537-5F45-A19B-918DF2785A14"
language "C++"
kind "SharedLib"
files { "*.h","*.cpp" }
includedirs { "../.." , ".." }
if isWindows() then
includedirs "pkcs11"
files { "esteidpkcs11.rc" }
else
includedirs { "/usr/include... |
local apicast_balancer = require 'apicast.balancer'
local Upstream = require 'apicast.upstream'
describe('apicast.balancer', function()
describe('.call', function()
before_each(function ()
ngx.var = {
proxy_host = 'upstream'
}
end)
it('sets default port from scheme if no port is spe... |
local function revertCrystal(position, itemId, transformId)
local item = Tile(position):getItemById(itemId)
if item then
item:transform(transformId)
end
end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target.itemid ~= 18321 then
return false
end
if player:getStorageValue(Stor... |
local CanvasConstants = {
FONT_SIZE = 17,
PANEL_W = 520,
PADDING = 10,
KEY_W = 24,
KEY_LEFT_PADDING = 10,
ROW_HEIGHT = 26,
APP_ICON_W = 26,
APP_NAME_W = 160,
OUTLINE_RECTANGLE_ALPHA = 0.5,
INLINE_RECTANGLE_ALPHA = 0.7,
SELECTED_ROW_ALPHA = 0.2,
TEXT_ALPHA = 1,
TE... |
if ( SERVER ) then
AddCSLuaFile( "shared.lua" )
end
SWEP.BulletLength = 8.58
SWEP.CaseLength = 69.20
SWEP.MuzVel = 557.741
SWEP.Attachments = {
[1] = {"kobra", "riflereflex", "eotech", "aimpoint", "elcan", "acog", "ballistic"},
[2] = {"vertgrip", "bipod"},
[3] = {"laser"}}
SWEP.InternalParts = {
[1] = {{key =... |
--[[
Unit test for GlyphNet model component
Copyright 2015-2016 Xiang Zhang
--]]
local Model = require('model')
local cutorch = require('cutorch')
local os = require('os')
local sys = require('sys')
-- A Logic Named Joe
local joe = {}
function joe.main()
if joe.init then
print('Initializing testing environ... |
local class = require 'core.class'
local mixin = require 'core.mixin'
local web = require 'web'
local BaseHandler = mixin({}, web.mixins.routing)
--[[
lurl -v demos.web.redirect /
lurl -v -H "X-Requested-With: XMLHttpRequest" demos.redirect /
curl -v http://127.0.0.1:8080
curl -v -H "X-Requested-With... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.