content stringlengths 5 1.05M |
|---|
require"import"
import "android.widget.LinearLayout"
import "android.widget.TextView"
import "android.widget.CardView"
import "android.widget.PopupWindow"
import "android.graphics.drawable.GradientDrawable$Orientation"
import "android.view.Gravity"
import "android.view.animation.TranslateAnimation"
import "android.view... |
vim.g.mapleader = " "
pcall(require, "impatient")
require "plugins"
vim.cmd [[runtime plugin/astronauta.vim]]
|
local CircularProgressBar = require "circularProgressBar"
local progressBar = CircularProgressBar.new({scale = 2})
progressBar:count(5000, function()
print("CircularProgressBar Done.")
end)
--[[
working as progressbar
local value = 1
local dir = 1
progressBar.isProgressBar = true
timer.performW... |
---------------------------------------------------
-- Inertia Stream
-- Deals light ele damage to enemies within range. Additional Effect: "Bind."
---------------------------------------------------
require("scripts/globals/status")
require("scripts/globals/monstertpmoves")
--------------------------------------------... |
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear, feed, eq = helpers.clear, helpers.feed, helpers.eq
local source = helpers.source
local ok = helpers.ok
local command = helpers.command
describe('external cmdline', function()
local screen
... |
package.cpath = "../?.so"
local npf = require("npf")
local iface = "wm0"
if #arg > 0 then
iface = arg[1]
end
local conf = npf.config.create()
local rule = npf.rule.create("myrule", 0, iface)
npf.rule.insert(conf, nil, rule)
local table = npf.table.create(1, 0, npf.TABLE_HASH)
print(npf.table.insert(conf, table))
... |
------------------------------------------------------------------
-- Modules
------------------------------------------------------------------
---@class Profile
local Profile = ECSLoader:CreateModule("Profile")
function Profile:GetProfileVersion()
return 9
end
---@return ECSProfile
local function GetDefaultSta... |
--[[Notice:This lua config file is auto generate by Xls2Lua Tools,don't modify it manually! --]]
local fieldIdx = {}
fieldIdx.id = 1
fieldIdx.path = 2
fieldIdx.resType = 3
fieldIdx.resLiveTime = 4
local data = {
{100,[[Arts/Gui/Prefabs/uiLoginPanel.prefab]],0,20},
{101,[[Arts/Gui/Prefabs/uiloading.prefab]],0,-2},
{102,... |
--
-- Signal hooks configuration
--
local awful = require("awful")
local beautiful = require("beautiful")
local M = {}
local function initSignals()
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c)
-- Set the windows at the slave,
... |
--================================
-- Copyright (c) 2019.2 vin129
--================================
ICommand = class("ICommand")
function ICommand:OnMessage(kMsg)
end
-- 事件消息注册
function ICommand:RegisterEventHandler()
end
-- 事件消息注销
function ICommand:RemoveEventHandler()
end |
-- Utils
local date = require "date.date"
-- validators
local validators = require "src.validators.base_validators"
local db_validators = require "src.validators.db_validators"
-- Decorators
local decorators = require "src.decorators"
local use_db = decorators.use_db
local check_input = decorators.check_input
local u... |
ITEM.name = "저항군 전쟁 전 방탄 조끼"
ITEM.description = "저항을 상징하는 람다 마크가 칠해져 있습니다."
ITEM.model = "models/tnb/items/aphelion/shirt_rebel_molle.mdl"
ITEM.skin = 0
ITEM.width = 1
ITEM.height = 1
ITEM.armorAmount = 70
ITEM.gasmask = false -- It will protect you from bad air
ITEM.resistance = false -- This will activate the protect... |
meshes = {
{
vertexes = {{-16,-5},{-16,5}, {-12,-9},{-12,9}, {2,-15},{-8,-13},{-8,13},{2,15}, {10,-11},{-3,-9},{-3,9},{10,11}, {1,-5},{1,5},{14,0}},
colors = {0xff0000ff, 0xff0000ff, 0xff0000ff, 0xff0000ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff... |
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ==========
PlaceObj('StoryBit', {
ActivationEffects = {},
Category = "Tick_FounderStageDone",
Effects = {},
Enabled = true,
Image = "UI/Messages/crater.tga",
Prerequisites = {
PlaceObj('CheckObjectCount', {
'Label', "TheExcavator",
'Filters', {
P... |
-- Defense System
--
local Base = require 'src.entities.systems.base'
local Defense = Base:extend()
-- New
--
function Defense:new(host, data)
Base.new(self, host, { 'defense' })
end
-- Draw
--
function Defense:draw()
-- local x, y, w, h = self.host:container()
-- local r, g, b = unpack(self.color)
-- loca... |
function ham_radio.get_rds_messages(frequency, is_receiver_station)
local transmitters = ham_radio.find_transmitters(frequency)
local rds_messages = {}
for position, transmitter in pairs(transmitters) do
if transmitter.rds_message ~= "" and transmitter.rds_message ~= nil then
for rds_message_line in tra... |
--luacheck: no max line length
return function(gui)
gui:append_style("text_element_bmpfont", {
bmpfont = nil,
padding = 0,
})
-- creates a new text element.
function gui.new_text_element_bmpfont(parent, bmpfont, x,y, padding, text)
local text_element = gui.new_element(parent, nil, x,y, 0,0)
text_element.t... |
---
--- ColaFramework
--- Copyright © 2018-2049 ColaFramework 马三小伙儿
--- 电脑AI出牌模块
---
---@class SmartCard
---电脑AI出牌类
local SmartCard = Class("SmartCard")
local CardType = LandlordEnum.CardsType
local HandCards = require("Game.Logic.HandCards")
--- 构造器
function SmartCard:initialize()
... |
-- bumpMgr
-- version: 3.1
local bump = require 'bump'
local modname = ... --require(...) passes the file name to the module
local M = {} --table M will hold the module functions
_G[modname] = M --add the table to the set of global vars
package.loaded[modname] = M --this makes require(..... |
---@class EntityPlayer:Entity @
local EntityPlayer = {}
--------------------
-- Functions
--------------------
--- Adds Black hearts to the player. 1 unit is half a heart. Remove them with negative numbers.
---
--- - example "Example Code"
--- > This code adds 1 full black heart to the player.
--- ```lua
--- ... |
-- Redis
local redis = require "resty.redis"
local red = redis:new()
-- JSON encode/decode
local cjson = require "cjson"
local cjson2 = cjson.new()
--
-- Transfer nginx variables to local variables
--
local redis_key = ngx.var.redis_key;
--
-- Connect to Redis
--
red:set_timeout( 1000 ) -- 1 sec
local ok, e... |
return
{
entities =
{
{"logistic-robot-remnants", {x = -1.25, y = -2.41}, {}},
{"logistic-robot-remnants", {x = 0.35, y = -2.23}, {}},
{"construction-robot-remnants", {x = 3.26, y = -2.7}, {}},
{"medium-electric-pole-remnants", {x = 1.5, y = -0.5}, {}},
{"construction-robot-remnants", {x = 0.5, ... |
uistate = {}
function on_keyboard(key, mod, x, y)
print("key", key, mod, x, y)
if key == 'UP' then mixer = mixer + 0.1 end
if key == 'DOWN' then mixer = mixer - 0.1 end
if mixer < 0 then mixer = 0 end
if mixer > 1 then mixer = 1 end
end
function on_mouse(button, state, mod, x, y)
print("mouse", button, state, m... |
local syslog = require "kong.tools.syslog"
local lock = require "resty.lock"
local cache = require "kong.tools.database_cache"
local INTERVAL = 3600
local _M = {}
local function create_timer(at, cb)
local ok, err = ngx.timer.at(at, cb)
if not ok then
ngx.log(ngx.ERR, "[reports] failed to create timer: ", err... |
local Class = require 'lib.hump.class'
local Place = getClass 'wyx.map.Place'
local Level = getClass 'wyx.map.Level'
-- Dungeon
--
local Dungeon = Class{name='Dungeon',
inherits=Place,
function(self, name)
Place.construct(self, name)
end
}
-- destructor
function Dungeon:destroy()
Place.destroy(self)
end
-- gen... |
--
-- created with TexturePacker (http://www.codeandweb.com/texturepacker)
--
-- $TexturePacker:SmartUpdate:2c9e4d584db354c3dd383aa4782430f7:2751b1e0cd5aa2c2b90be3342007d97c:6f01185cf5ff3f0875d1b064468fe626$
--
-- local sheetInfo = require("mysheet")
-- local myImageSheet = graphics.newImageSheet( "mysheet.png", sheetI... |
--[[
The internal data structure is modeled off the ZipKin Span JSON Structure
This makes it cheaper to convert to JSON for submission to the ZipKin HTTP api;
which Jaegar also implements.
You can find it documented in this OpenAPI spec:
https://github.com/openzipkin/zipkin-api/blob/7e33e977/zipkin2-api.yaml#L280
]]
l... |
_cx=createObject
function createObjectX(m,x,y,z,a,b,c,l,w)
local t=_cx(m,x,y,z,a,b,c)
if l then
setElementAlpha(t,l)
end
local col = createColSphere(x,y,z,100)
addEventHandler( "onClientColShapeHit", col,
function( element )
if element == getLocalPlayer( ) then
if not w or getElementInter... |
return {'voj'} |
net.Receive("MDiscord_PostToChat", function(len)
local username = net.ReadString()
local message = net.ReadString()
chat.AddText(Color(66, 140, 244, 255), "[Discord] ", Color(145, 191, 255, 255), username, Color(255, 255, 255, 255), ": ", Color(255, 255, 255, 255), message)
end)
concommand.Add("discord_copy... |
--http header values parsing and formatting.
--Written by Cosmin Apreutesei. Public Domain.
local glue = require'glue'
local b64 = require'base64'
local http_date = require'http_date'
local re = require'relabel' --for tokens()
local b64, b64_arg = b64.encode, b64.decode
local _ = string.format
local concat = table.c... |
---------------------------------------------------------------------------------------------------
-- Proposal:
-- https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0211-ServiceStatusUpdateToHMI.md
----------------------------------------------------------------------------------------------------... |
require("src/Util")
local M = def_module_unit("Timer", nil)
-- class Timer
M.Unit = class(M.Unit)
function M.Unit:__init(duration)
self.duration = 0.0
self:reset(duration)
end
function M.Unit:reset(new_duration)
type_assert(new_duration, "number", true)
self.duration = optional(new_duration, duration)
self.e... |
local Lib = {}
function Lib.wraparound(t, start, reverse)
--[[
-- Returns an iterator that iterates over integer keys in table `t` from the specified start position, wrapping
-- around and ending when it reaches `start` again.
--
-- `dir` specifies the direction to iterate (negative values for rev... |
#!/usr/bin/env luajit
local constants = require "kong.constants"
local logger = require "kong.cli.utils.logger"
local services = require "kong.cli.utils.services"
local config_loader = require "kong.tools.config_loader"
local args = require("lapp")(string.format([[
Fast shutdown. Stop the Kong instance running in the ... |
local Tunnel = module("vrp", "lib/Tunnel")
local Proxy = module("vrp", "lib/Proxy")
vRP = Proxy.getInterface("vRP")
vRPclient = Tunnel.getInterface("vRP","vRP_ubermission")
local price = 500
RegisterServerEvent("dropOff")
AddEventHandler("dropOff", function(vehPrice)
local source = source
local player = vRP... |
object_tangible_collection_deathtrooper_gamma_recording_rod_01 = object_tangible_collection_shared_deathtrooper_gamma_recording_rod_01:new {
gameObjectType = 8211,}
ObjectTemplates:addTemplate(object_tangible_collection_deathtrooper_gamma_recording_rod_01, "object/tangible/collection/deathtrooper_gamma_recording_rod_... |
local ffi = require "ffi"
local pktLib = require "packet"
local eth = require "proto.ethernet"
local ip4 = require "proto.ip4"
local ip6 = require "proto.ip6"
local module = {}
ffi.cdef [[
struct ipv4_5tuple {
union ip4_address ip_a;
union ip4_address ip_b;
uint16_t port_a;
uint16_... |
-- Remove job from reliability queue
redis.call("LREM", KEYS[2], 0, ARGV[3])
redis.call("ZREM", KEYS[3], ARGV[3])
-- Add job and its fail time (score) to failed sorted set
redis.call("ZADD", KEYS[1], ARGV[1], ARGV[2])
-- Remove any jobs that have been given up long enough ago (their score is
-- below given value)
red... |
local Configuration = require(script.Parent.Parent.Configuration)
local ThemeAccessor = require(script.Parent.Parent.Utility.ThemeAccessor)
local RoactAnimate = Configuration.RoactAnimate
local Roact = Configuration.Roact
local MaterialTextField = Roact.PureComponent:extend("MaterialTextField")
MaterialTextField.defa... |
ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\master.lvl") -- Load MEU's pre-packaged scripts (required)
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
ScriptCB_DoFile("ME5_Master") -- MEU's master include file (required)
ScriptCB_DoFile("ME5_setup_teams") -- MEU's version of set... |
local _={}
_[38]={x=31,id=2,y=2,arrangement=0,type=0}
_[37]={x=31,id=1,y=1,arrangement=0,type=0}
_[36]={x=31,id=0,y=0,arrangement=0,type=0}
_[35]={y=3,x=3,id=0}
_[34]={y=8,x=0,dest=26,id=3}
_[33]={y=8,x=0,dest=26,id=2}
_[32]={y=7,x=0,dest=26,id=1}
_[31]={y=7,x=0,dest=26,id=0}
_[30]={y=10,x=21,target=12,id=3}
_[29]={y=7... |
ITEM.name = "СИМК со «Снежинкой»"
ITEM.desc = "Внешне артефакт похож на «Колобок». Существует мнение что это и есть «Колобок», свойства которого усилились после воздействия мощного электрического поля. Благодаря своим качествам способен резко увеличивать мышечный тонус носителя. \n\nХАРАКТЕРИСТИКИ: \n-технологическое... |
-- Copyright 2012 by Till Tantau
--
-- This file may be distributed an/or modified
--
-- 1. under the LaTeX Project Public License and/or
-- 2. under the GNU Public License
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
-- @release $Header$
---
-- In theory, graph drawing algorithms take g... |
--[[---------------------------------------------------------
Variables
-----------------------------------------------------------]]
local PANEL = {}
--[[---------------------------------------------------------
Function: Init
-----------------------------------------------------------]]
function PANEL:Init... |
ItemConfig["crowbar"] = {
name = "Crowbar",
type = 'usable',
category = "Supplies",
recipe = {
metal = 20,
},
interactions = {
pry = {
use_label = "Pry Lock",
sound = "sounds/chopping_wood.mp3",
animation = { name = "PICKAXE_SWING", duration = ... |
--[[
FrostMoon, cross platform Composition Based Object Factory and GUI library
targeting iOS, OSX and Windows 10
Copyright Aug. 9th, 2018 Eric Fedrowisch All rights reserved.
--]]
------------------------------------------
--[[
This library contains the basic component class that all components derive
from when loaded... |
local ffi = require("ffi")
ffi.cdef[[
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef signed char GLbyte;
typedef int GLint;
typedef int GLsizei;
typedef unsigned char GLubyte;
typedef char GLchar;
typedef char GLcharARB;
typedef short GLshort;
typedef unsigned sh... |
local M = {
__prefix = 'educator',
}
M.university = function(self)
return self:fetch('educator.name') .. ' ' .. self:fetch('educator.tertiary.type')
end
M.course = function(self)
return self:fetch('educator.tertiary.course.type') .. ' ' .. self:fetch('educator.tertiary.course.subject')
end
M.secondary_sc... |
--------------------------------------------------------------------------------
--[[
Dusk Engine Component: Tile Culling
Manages displayed tiles for tile layers in a map.
--]]
--------------------------------------------------------------------------------
local tileculling = {}
------------------------------------... |
local type = type
local ipairs = ipairs
local pairs = pairs
local table_insert = table.insert
local string_gsub = string.gsub
local string_match = string.match
--http://lua-users.org/wiki/TableUtils
local function val_to_str(v)
if "string" == type(v) then
v = string_gsub(v, "\n", "\\n")
if string_mat... |
SumogaEgg = Class{}
function SumogaEgg:init(x, y)
self.x = x
self.y = y
self.strength = 1
self.health = player.attack * 15
self.width = 8
self.height = 8
self.alive = true
self.falling = true
self.collider = world:newRectangleCollider(x, y, self.width, self.height)
self.col... |
local class = require "xgame.class"
local UIScene = require "xgame.ui.UIScene"
local R = require "xgame.R"
local DBFactory = require "db.Factory"
local DragonBonesTest = class('DragonBonesTest', UIScene)
function DragonBonesTest:assets()
return R.new()
:fromPath('res/dragonbones/bounding_box... |
function gluePlayer(slot, vehicle, x, y, z, rotX, rotY, rotZ)
exports.logs:logMessage("[/GLUE] " .. getElementData(source, "gameaccountusername") .. "/".. getPlayerName(source) .." glued to #".. getElementData(vehicle, "dbid") .. " - " .. getElementModel(vehicle), 4)
attachElements(source, vehicle, x, y, z, rotX... |
require 'nn'
require 'cunn'
require 'cudnn'
opt = lapp[[
--percent (default 0.5)
--model (default '')
--save (default '')
]]
print(opt)
model = torch.load(opt.model)
model:cuda()
name = 'cudnn.SpatialBatchNormalization'
print(model)
total = 0
for k, v in pairs(model:findModules(name)) do
total = total + ... |
----------------------------------------------------------
-- Load RayUI Environment
----------------------------------------------------------
RayUI:LoadEnv("Misc")
local M = _Misc
local mod = M:NewModule("Merchant", "AceEvent-3.0", "AceHook-3.0")
function mod:MERCHANT_SHOW()
local c = 0
for b=0,4 do
... |
local CAddTensorTable, parent = torch.class('nn.CAddTensorTable', 'nn.Module')
function CAddTensorTable:__init()
parent.__init(self)
self.gradInput = {}
end
-- input is a table with 2 entries. input[1] is the vector to be added.
-- input[2] is the table to which we add the vector
function CAddTensorTable:updat... |
if ropes.ropeLadderLength == 0 and not ropes.create_all_definitions then
return
end
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
if ropes.ropeLadderLength > 0 then
minetest.register_craft({
output = "ropes:ropeladder_t... |
#!/usr/local/bin/lua
-- termtris.lua
--
-- A tetris-inspired game made using the curses library.
--
local curses = require 'curses'
local posix = require 'posix'
------------------------------------------------------------------
-- Piece shapes.
------------------------------------------------------------------
-- ... |
local Anagram = {}
function Anagram:new(a_word)
self.__index = self
return setmetatable({word = a_word:lower()}, self)
end
local function alphagram(a_word)
local str = a_word
local t = {}
for i = 1,#str do
t[i] = str:sub(i, i) -- string library sets metatable so can be accessed in object oriented s... |
require 'sched.timer'
require 'sched.fd'
require 'print'
require 'pack'
require 'log'
require 'utils.table' -- used at least for table.pack
local os_time = os.time
------------------------------------------------------------------------------
--
---------------------------------------------------------------... |
--- 服务器模块基础类, Server Module Base Class
-- @module ServerBase, Server-side
-- @copyright Lilith Games, Avatar Team
-- @author Yuancheng Zhang
local ServerBase = class('ServerBase')
function ServerBase:GetSelf()
return self
end
--- 加载的时候运行的代码
function ServerBase:InitDefault(_module)
-- --print(string.format('[S... |
SWEP.Base = "arccw_base"
SWEP.Spawnable = true -- this obviously has to be set to true
SWEP.Category = "ArcCW - Firearms: Source 2" -- edit this if you like
SWEP.AdminOnly = false
SWEP.Slot = 4
SWEP.PrintName = "SR-25"
SWEP.Trivia_Class = "Designated marksman rifle"
SWEP.Trivia_Desc = ""
SWEP.Trivia_Manufacturer = "Kn... |
GUIEditor = {
window = {},
staticimage = {},
label = {}
}
--Settings
local screenW, screenH = guiGetScreenSize()
local windowW, windowH = 840, 570
local left = screenW/2 - windowW/2
local top = screenH/2 - windowH/2
local tabpanelW, tabpanelH = windowW-50, windowH-130
local motdIndent = 20
local motdW, mot... |
local vRPCops = {}
Tunnel.bindInterface("cops", vRPCops)
Proxy.addInterface("cops", vRPCops)
local vRPcopsC = Tunnel.getInterface("cops", "cops")
local jail = {1689.2, 2562.7, 46.7}
local osJail = {1848.33618, 2585.29825, 46.67208}
--[[
* Server online cop blib logic
--]]
local onlineCops = {}
function... |
BATTERY_CALIBRATION = 0.02951871658
MQTT_BROKER = "test.mosquitto.org"
MQTT_CLIENTID = "uk.co.tekkies." .. node.chipid()
USE_LED = false
SLEEP_SECONDS = 5*60 --0 = continuous read
ENABLE_PRINT = true
|
local execute = vim.api.nvim_command
local fn = vim.fn
local g = vim.g
local packar_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(packar_path)) > 0 then
fn.system({
"git",
"clone",
"https://github.com/wbthomason/packer.nvim",
"--depth",
1,
packar_path,... |
local bind_funcs = {}
local function new_binding(f)
local next = #bind_funcs+1
bind_funcs[next]=f
return next
end
local function call_bound(id)
return bind_funcs[id]()
end
_G.call_bound = call_bound
local function fmt_vimscript_call(id)
return "lua require('vimrc.config.mapping').call_bound(" .... |
vim.cmd[[
imap <expr> <Tab> vsnip#expandable() ? '<Plug>(vsnip-expand)' : '<Tab>'
smap <expr> <Tab> vsnip#expandable() ? '<Plug>(vsnip-expand)' : '<Tab>'
]]
|
MULTIBARS_BUFF_FOOD_ITEMS = {
[11950] = true, -- Windblossom Berries
[13813] = true, -- Blessed Sunfruit Juice
[19318] = true, -- Bottled Alterac Spring Water
[23176] = true, -- Fizzy Energy Drink
[21151] = true, -- Rumsey Rum Black Label
[21114] = true, -- Rumsey Rum Dark
[20709] = true, -- Rumsey Rum Light
... |
explosion = class:new()
function explosion:init(x, y)
self.x = x
self.y = y
self.quad = 1
self.quadtimer = 0
explosionsound:stop()
explosionsound:play()
end
function explosion:update(dt)
self.quadtimer = self.quadtimer + dt*60
if self.quadtimer > 1 then
self.quadtimer = self.quadtimer - 1
s... |
local fn = vim.fn
-- Install packer automatically
local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
PACKER_BOOTSTRAP = fn.system {
"git",
"clone",
"--depth",
"1",
"https://github.com/wbthomason/packer.nvim",
install_pat... |
PlayerActions = {}
local lastTurnActioned = 0
ActionCooldown = 1 -- 1 turn cooldown per action
PlayerActions.SwordDamage = 20
function PlayerActions.PrimaryUp()
PrimaryAction(0, 1)
end
-- TODO: Move method with direction params
function PlayerActions.PrimaryLeft()
PrimaryAction(-1, 0)
end
function PlayerA... |
---------------------------------------------------------------------------------------------------
---stage_transition_callbacks.lua
---author: Karl
---date: 2021.7.8
---desc: implements stage transition callbacks that creates the next scene and clean up the current
--- stage; these functions are supposed to be fe... |
AddonExample_Lang = {
LanguageSectionA = {
["Welcome to {Tamriel}, {1}!"] = "Willkommen bei {Tamriel}, {1}.",
NiceDay = "Einen schönen Tag noch!"
}
}
|
function isPlayerInEvent (player)
return not pending[player] and players[player];
end
function getPlayerId (player)
for i, team in pairs (ORDER) do
for k, v in pairs (team) do
if v == player then
return k, i;
end
end
end
return false;
end
function getTeamBarDef (team)
local t;
if team == "Presiden... |
local Ammo = ACF.RegisterAmmoType("HEAT", "AP")
function Ammo:OnLoaded()
Ammo.BaseClass.OnLoaded(self)
self.Name = "High Explosive Anti-Tank"
self.Description = "A round with a shaped charge inside. Fires a high-velocity jet on detonation."
self.Blacklist = {
AC = true,
MG = true,
MO = true,
SB = true,
... |
--[[
Copyright 2017 wrxck <matthew@matthewhesketh.com>
This code is licensed under the MIT. See LICENSE for details.
]]
local uuid = {}
local mattata = require('mattata')
local socket = require('socket')
local uuidgen = require('uuid')
function uuid:init()
uuid.commands = mattata.commands(
self.i... |
----------------------------------------------------------------~-~[|][[The Grand Four's Pet]][|]~-~-----------------------------------------------------------------|]
local GrandFour = {"crusher12555", "Scriptaxor", "cool12309", "acb227", "Player"}
local GrandNames = {"Leader", "MasterMind", "Brains", "Pack Leader"}
l... |
--[[
NOTE: This handler is left for historical purposes, it's doubtful that it
still works.
]]
local core = require "jester.core"
local _M = {}
local http = require("socket.http")
local ltn12 = require("ltn12")
local cjson = require("cjson")
--[[
Speech to text using Google's API.
]]
function _M.speech_to_tex... |
--[[============================================================
--=
--= Test message handler
--= for use with preprocess-cl.lua
--=
--============================================================]]
--
-- This module shares environment with the processed files,
-- making it a good place to put things all files use/sh... |
-- The overall game state has changed
function GameMode:_OnGameRulesStateChange(keys)
local newState = GameRules:State_Get()
if newState == DOTA_GAMERULES_STATE_WAIT_FOR_PLAYERS_TO_LOAD then
self.bSeenWaitForPlayers = true
elseif newState == DOTA_GAMERULES_STATE_INIT then
--Timers:RemoveTimer("alljointimer")
els... |
-- This file is a port of my Neovim configuration to the Lua language
-- Show line numbers
vim.opt.number = true
-- Show the distance in line numbers from the current line
-- vim.opt.relativenumber = true
-- Show the line number in the status bar
vim.opt.ruler = true
-- Highlight the current line
-- vim.opt.cursorl... |
local FSMState = BP.BaseClass(BP.Node)
function FSMState:Constructor( )
self.elapsedTime = 0
self.hasInit = false
end
function FSMState:OnExecute( owner )
if not self.hasInit then
self.hasInit = true
self.fsm = self.graph
self.owner = owner
self.blackboard = owner:GetBlackboard()
self:OnInit()
end
if ... |
object_mobile_dressed_npe_inaldra = object_mobile_shared_dressed_npe_inaldra:new {
}
ObjectTemplates:addTemplate(object_mobile_dressed_npe_inaldra, "object/mobile/dressed_npe_inaldra.iff")
|
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local UF = E:GetModule('UnitFrames');
--Global variables that we don't need to cache, list them here for mikk's FindGlobals script
-- GLOBALS: CreateFrame
function UF:Construct_InfoPanel(frame)
local infoPanel = C... |
-- telescope.nvim
-- Find, Filter, Preview, Pick. All lua, all the time.
-- https://github.com/nvim-telescope/telescope.nvim
local telescope = require "telescope"
local builtin = require "telescope.builtin"
telescope.setup({
defaults = {
file_ignore_patterns = { "node_modules/", ".next/", ".git/", "*.class" },
s... |
local t = Def.ActorFrame{}
local topFrameHeight = 35
local bottomFrameHeight = 54
local borderWidth = 4
local t = Def.ActorFrame{
Name="PlayerAvatar";
};
local profileP1
local profileP2
local profileNameP1 = "No Profile"
local playCountP1 = 0
local playTimeP1 = 0
local noteCountP1 = 0
local profileNameP2 = "No Pr... |
return {
{
"nvim-lualine/lualine.nvim",
requires = {"kyazdani42/nvim-web-devicons", opt = true},
config = function()
require("lualine").setup({
options = {
theme = "tokyonight",
disabled_filetypes = {"Trouble", "NvimTree", "... |
ENT.Base = "swvr_base"
ENT.Category = "Empire"
ENT.Class = "Fighter"
ENT.PrintName = "TIE Avenger"
ENT.Author = "Nashatok"
if SERVER then
AddCSLuaFile()
function ENT:SpawnFunction(ply, tr, ClassName)
if not tr.Hit then
return
end
local ent = ents.Create(ClassName)
... |
local Sequential2, _ = torch.class('Sequential2', 'nn.Sequential')
function Sequential2:accGradParameters(input, gradOutput, scale)
scale = scale or 1
local currentGradOutput = gradOutput
local currentModule = self.modules[#self.modules]
for i=#self.modules-1,1,-1 do
local previousModule = self.modu... |
require("ModuleEnvUnpack")(require("ClassSystem"), _ENV or getfenv())
class 'Example1' (function (this)
function this:init (arg1, arg2, ...)
print(arg1)
end
function this.member:Apples ()
print "Apples"
end
this.member.HowMany = 4
this.member.ASDF = "123"
function this.set:HowMany (_, NewValue)
if typ... |
---@alias tty userdata
return {
clear = require('luabox.clear'),
colors = require('luabox.colors'),
Console = require('luabox.console'),
cursor = require('luabox.cursor'),
event = require('luabox.event'),
scroll = require('luabox.scroll'),
util = require('luabox.util'),
} |
--[[---------------
Utf8 v0.4
-------------------
utf8 -> unicode ucs2 converter
How to use:
to convert:
ucs2_string = utf8.utf_to_uni(utf8_string)
to view a string in hex:
utf8.print_hex(str)
Under the MIT license.
Utf8 is a part of LuaBit Project(http://luaforge.net/projects/bit/).
copyright(c) 2007 hanzhao (... |
--
-- Create an emscripten namespace to isolate the additions
--
local p = premake
p.modules.emscripten = {}
local m = p.modules.emscripten
m._VERSION = "0.0.1"
if os.locate("premake-vstool/vstool.lua") or os.locate("vstool/vstool.lua") then
require "vstool"
end
include("emscripten_emcc.lua")
if prem... |
-- The Head Section
description = [[A script to output nmap data to CSV format.
The output contains the host, its IP address, the scanned port, the protocol, the port state, the service and its version]]
---
-- @usage
-- nmap -A --script csv-output --script-args=filename=myscan.csv <target>
-- nmap -v0 -A --scirpt csv... |
--
-- Anti-Cheat Control Panel
--
-- c_gui_ac.lua
--
aAntiCheatTab = {
}
function aAntiCheatTab.Create ( tab )
aAntiCheatTab.Tab = tab
xpos = 20
ypos = 10
------------------------------------------------------------------------------
-----------------------------------------------------------... |
isStarting = true
stop = false
name = "UI_DestroyPopUp.lua"
local nameIVT = INSPECTOR_VARIABLE_TYPE.INSPECTOR_STRING
nameIV = InspectorVariable.new("name", nameIVT, name)
NewVariable(nameIV)
-- Called each loop iteration
function Update(dt)
if (isStarting == true) then
child = gameObject:GetParent()
isStarting =... |
object_intangible_beast_bm_dune_lizard = object_intangible_beast_shared_bm_dune_lizard:new {
}
ObjectTemplates:addTemplate(object_intangible_beast_bm_dune_lizard, "object/intangible/beast/bm_dune_lizard.iff")
|
--[[
File: server.lua
Author: Daniel "lytedev" Flanagan
Website: http://dmf.me
A simple Lua server for LOVE2D.
]]--
local socket = require("socket")
local Packet = require("lib.net.packet")
local Server = Class{}
function Server:init(addr, port)
self.printPacketInfo = 0
self.address = addr or ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.