content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
--[[
We can represent a polynomial an * x^n + an-1 * x^n-1 + ... + a1 * x^1 + ao in Lua as a list of its coefficients, such as {ao, a1, ..., an}.
Write a function that receives a polynomial (represented as a table) and a value for x and returns the polynomial value.
]]
function calc_poly(coeffs, x)
local sum = 0
... | nilq/small-lua-stack | null |
local default_package_path = package.path
package.path = package.path .. ";mods/noita-mp/files/lib/external/?.lua;"
local Logging = require("logging")
local appender = function(self, level, message)
-- add file name to logs: https://stackoverflow.com/a/48469960/3493998
local file_name = debug.getinfo(2, "S").sour... | nilq/small-lua-stack | null |
local require = require
local spec = require "cp.spec"
local expect = require "cp.spec.expect"
local describe, context, it = spec.describe, spec.context, spec.it
local args = require "cp.fn.args"
return describe "cp.fn.args" {
context "only" {
it... | nilq/small-lua-stack | null |
return require((...) .. '.jprof')
| nilq/small-lua-stack | null |
include("shared.lua")
function ENT:Initialize()
end
function ENT:CalcEngineSound()
local CurDist = (LocalPlayer():GetViewEntity() :GetPos() - self:GetPos()):Length()
self.PitchOffset = self.PitchOffset and self.PitchOffset + (math.Clamp((CurDist - self.OldDist) * FrameTime() * 300,-40,40) - self.PitchOffset) * Fra... | nilq/small-lua-stack | null |
local awful = require("awful")
local function get_percentage(out)
for k, v in string.gmatch(out, '([%a]+[%a|-]+):%s*([%a|%d]+[,|%a|%d]-)') do
if k == "percentage" then
return tonumber(v)
end
end
end
local cmd = "upower -i /org/freedesktop/UPower/devices/battery_BAT0"
local self = awful.widget.watch(cm... | nilq/small-lua-stack | null |
essence = 0.142
local screenPosX = 0.165 -- X coordinate (top left corner of HUD)
local screenPosY = 0.882 -- Y coordinate (top left corner of HUD)
local stade = 0
local lastModel = 0
local vehiclesUsed = {}
local isRadarExtended = false
local currentCans = 0
Citizen.CreateThread(... | nilq/small-lua-stack | null |
#!/usr/bin/env lua
local sc = require("moonsc")
print(sc._VERSION)
| nilq/small-lua-stack | null |
local signal = require("envel.signal")
local base_timer = _G.__core.timer
local timer = {}
-- Start the timer if it is not already running
-- This will also emit a "timer::started" signal
function timer:start()
if not self:is_started() then
--self:emit_signal("timer::started")
getmetatable(self)._... | nilq/small-lua-stack | null |
--region CStringBuilder.lua
--Author : jefflwq
--Date : 2015/2/19
--说明 : StringBuilder类
--endregion
using "Joop"
using "System.Collections.Generic"
namespace "System.Text"
{
class "CStringBuilder" : CList
{
BuildString =
function(self, separator, i, j)
r... | nilq/small-lua-stack | null |
--[[
Forward and backward combined.
]]--
require 'nn'
require 'nnx'
require 'cunn'
require 'cudnn'
require 'cutorch'
local DecompNet,_ = torch.class("nn.DecompNet",'nn.Container')
function DecompNet:__init(config,layer)
print("Decomp BaseNet from layer %d . Forward-Backward Combined. Naive." % layer)
sel... | nilq/small-lua-stack | null |
project "CherriesX"
kind "StaticLib"
language "C++"
cppdialect "C++20"
targetdir ("%{wks.location}/bin/" .. outputdir)
objdir ("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}")
pchheader "chxpch.h"
pchsource "src/chxpch.cpp"
files
{
"src/**.h",
"src/**.cpp",
"ve... | nilq/small-lua-stack | null |
--[[-------------------------------------------------------------------]]--[[
Copyright wiltOS Technologies LLC, 2020
Contact: www.wiltostech.com
----------------------------------------]]--
local MYSQL_DATABASE_PROVISION = 1
wOS = wOS or {}
wOS.ALCS = wOS.ALCS or {}
wOS.ALCS.GTN = wOS.ALCS.GTN... | nilq/small-lua-stack | null |
local class = require('opus.class')
local UI = require('opus.ui')
UI.Question = class(UI.MiniSlideOut)
UI.Question.defaults = {
UIElement = 'Question',
accelerators = {
y = 'question_yes',
n = 'question_no',
}
}
function UI.Question:postInit()
local x = self.label and #self.label + 3... | nilq/small-lua-stack | null |
#!/usr/bin/env luajit
-- -*- lua -*-
module(..., package.seeall)
local function Number() return math.random(0, 2^32-1) end
-- This is a trivial property file with a failing property, which is mainly
-- useful for testing pflua-quickcheck for obvious regressions
function property()
local n = Number()
return n, n... | nilq/small-lua-stack | null |
local model={}
local base_model=torch.reload("../Decode/decode_model")
setmetatable(model,{ __index = base_model })
function model:Distill()
self:ComputeTopResponse()
self:ComputeScore()
end
function model:ComputeScore()
self.score=torch.Tensor():cuda()
local open_train_file=io.open(self.params.Traini... | nilq/small-lua-stack | null |
-------------------------------------------------------------------------------
-- Spine Runtimes License Agreement
-- Last updated May 1, 2019. Replaces all prior versions.
--
-- Copyright (c) 2013-2019, Esoteric Software LLC
--
-- Integration of the Spine Runtimes into software or otherwise creating
-- derivat... | nilq/small-lua-stack | null |
local require = using("BodyEditor.Script")
local CCDirector = require("CCDirector")
local CCMenu = require("CCMenu")
local oVec2 = require("oVec2")
local oScale = require("oScale")
local oEase = require("oEase")
local Class = require("Class")
local oButton = require("oButton")
local property = require("property")
local... | nilq/small-lua-stack | null |
--[[ $%BEGINLICENSE%$
Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; version 2 of the
License.
This program is dis... | nilq/small-lua-stack | null |
include("terms")
include("names")
dimnames = 6
index = {}
for i=1,dimnames do
index[i] = i
end
r = lib.math.random_shuffle(index)
ime1 = zensko_ime_nom[r[1]]
ime2 = zensko_ime_nom[r[2]]
diff = {8, 7, 6, -6, -9}
ind = math.random(5)
t_town = 12 + diff[ind]
amint = {7, 8}
pmint = {15, 23}
bl = {}
br = {}
tl... | nilq/small-lua-stack | null |
function MarkGameStarted()
-- Main Frame.
local m_MainFrame = BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0)
--BlzFrameSetAlpha(m_MainFrame, 0)
--BlzFrameSetVisible(m_MainFrame, false)
-- Hero bar.
local m_HeroBar = BlzGetOriginFrame(ORIGIN_FRAME_HERO_BAR, 0)
BlzFrameSetVisible(m_HeroBar, false)
-- I... | nilq/small-lua-stack | null |
require('stubs.bootstrap')
describe("Timer", function()
it("should execute a single alarm", function()
local value
local t = tmr.create()
t:alarm(0, tmr.ALARM_SINGLE, function()
value = "been there"
end)
tmr.run_all_timers()
assert.are.equal("been there", value)
end)
it("should... | nilq/small-lua-stack | null |
SCRIPT_TYPE = "CA"
TAGS = {
{0, "Dead"},
{1, "Alive"}
}
NEIGHBORS_POS = { {1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {-1, -1}, {-1, 1}, {1, -1} }
STATES_NUM = 2
alive = 1
dead = 0
function get_next_state (neighbors, state)
local alive_cells = 0
for i, neighbor in pairs(neighbors) do
-- The cel... | nilq/small-lua-stack | null |
return {
minor_type = '设计图纸',
func_type = '使用设计图纸',
method = "使用",
close_bag_ui = false,
} | nilq/small-lua-stack | null |
CCapturePoint = {}
function CCapturePoint:constructor(thePed, theMarker, Defender, Attacker)
--Ped
self.Ped = thePed
setElementDimension(self.Ped, 60000)
setElementFrozen(self.Ped, true)
setElementData(self.Ped, "FactionPed", true)
setElementData(self.Ped, "FactionID", Defender:getID())
--Marker
self.Marker = ... | nilq/small-lua-stack | null |
TOOL.Name = "Resource Node"
TOOL.Category = "Resource Distribution"
TOOL.DeviceName = "Resource Node"
TOOL.DeviceNamePlural = "Resource Nodes"
TOOL.ClassName = "resourcenodes"
TOOL.DevSelect = true
TOOL.CCVar_type = "resource_node"
TOOL.CCVar_sub_type = "small_node"
TOOL.CCVar_model = "models/SnakeSVx/small_res_node... | nilq/small-lua-stack | null |
local util = require("spec.util")
describe("typecheck errors", function()
it("type errors include filename", util.check_type_error([[
local x: string = 1
]], {
{ filename = "foo.tl" }
}))
it("type errors in a required package include filename of required file", function ()
util.mock_io(f... | nilq/small-lua-stack | null |
-- supporting testfile; belongs to 'cl_spec.lua'
describe('Runs 2 failing tests', function()
it('is failing test 1 #err1', function()
assert(false, 'failed on test 1')
end)
it('is failing test 2 #err2', function()
assert(false, 'failed on test 2')
end)
end)
| nilq/small-lua-stack | null |
local isCustomizationScript=sim.getScriptAttribute(sim.getScriptHandle(sim.handle_self),sim.scriptattribute_scripttype)==sim.scripttype_customizationscript
if not sim.isPluginLoaded('Bwf') then
function sysCall_init()
if isCustomizationScript then
sim.msgBox(sim.msgbox_type_warning,sim.msgbox_b... | nilq/small-lua-stack | null |
--region CInfo.lua
--Author : jefflwq
--Date : 2016/08/14
--说明 : CInfo类
--endregion
using "Joop"
namespace "System.Diagnostics"
{
class "CInfo"
{
FatalError = 1000,
Exception = 2000,
Error = 3000,
Warning = 4000,
Info = 5000,
--Debug = 10000... | nilq/small-lua-stack | null |
-- Copyright 2017-2022 Jason Tackaberry
--
-- 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... | nilq/small-lua-stack | null |
local ev = require'ev'
local simplehttp = require'simplehttp'
local json = require'json'
local math = require'math'
local os = require'os'
local apiurl = 'http://sporing.bring.no/sporing.json?q=%s&%s'
local duration = 60
if(not ivar2.timers) then ivar2.timers = {} end
-- Abuse the ivar2 global to store out ephemeral... | nilq/small-lua-stack | null |
local protocol = vim.lsp.protocol
local if_nil = vim.F.if_nil
local DiagnosticSeverity = protocol.DiagnosticSeverity
local loclist_type_map = {
[DiagnosticSeverity.Error] = 'E',
[DiagnosticSeverity.Warning] = 'W',
[DiagnosticSeverity.Information] = 'I',
[DiagnosticSeverity.Hint] = 'I',
}
local to_severity = ... | nilq/small-lua-stack | null |
local LUAUtility = LUAUtility or {}
function LUAUtility.load_module(name)
return require (name)
end
function LUAUtility.try_load_module(name)
if not name then
print("ERROR: Trying to load nil script")
return nil
end
local success, loaded_module = pcall(LUAUtility.load_module, name)
if success then
return ... | nilq/small-lua-stack | null |
--[[
Italian Localization
]]--
local ADDON = ...
local L = LibStub('AceLocale-3.0'):NewLocale(ADDON, 'itIT')
if not L then return end
--keybinding text
L.ToggleBags = "Attiva l'Inventario"
L.ToggleBank = 'Attiva la Banca'
L.ToggleVault = 'Attiva la Banca Eterea'
--system messages
L.NewUser = 'Trovato un nuovo uten... | nilq/small-lua-stack | null |
--- @param ent GEntity
function DoPropSpawnedEffect(ent)
end
| nilq/small-lua-stack | null |
-- Copyright (C) 2018 The Dota IMBA Development Team
--
-- 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 ... | nilq/small-lua-stack | null |
local skynet = require "skynet"
local instance = (require "eureka.instance"):new()
local service = require "eureka.service"
local ip = skynet.getenv("http_ip") or skynet.getlocalip()
local name = skynet.getenv("register_name") or "skynet-eureka-client"
local port = skynet.getenv("http_port") or 80
local eureka_host = ... | nilq/small-lua-stack | null |
--[[-----------------------------------------------------------------------------
* Infected Wars, an open source Garry's Mod game-mode.
*
* Infected Wars is the work of multiple authors,
* a full list can be found in CONTRIBUTORS.md.
* For more information, visit https://github.com/JarnoVgr/InfectedWars
*
* Inf... | nilq/small-lua-stack | null |
--[[
MIT License
Copyright (c) 2021 Michael Wiesendanger
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, mod... | nilq/small-lua-stack | null |
return {
uiEffect = "",
name = "不灭之盾",
cd = 0,
picture = "0",
aniEffect = "",
desc = "",
painting = 0,
id = 12820,
castCV = "",
effect_list = {
{
type = "BattleSkillAddBuff",
casterAniEffect = "",
targetAniEffect = "",
target_choise = {
"TargetAllHelp",
"TargetShipTag"
},
arg_list ... | nilq/small-lua-stack | null |
object_static_worldbuilding_structures_mun_nboo_bank_destroyed = object_static_worldbuilding_structures_shared_mun_nboo_bank_destroyed:new {
}
ObjectTemplates:addTemplate(object_static_worldbuilding_structures_mun_nboo_bank_destroyed, "object/static/worldbuilding/structures/mun_nboo_bank_destroyed.iff") | nilq/small-lua-stack | null |
-- dk-grey, awesome3 theme, by bioe007 perrydothargraveatgmaildotcom
--{{{ Main
local awful = require("awful")
awful.util = require("awful.util")
theme = {}
home = os.getenv("HOME")
config = awful.util.getdir("config")
shared = "/usr/share/awesome"
if not awful.util.file_readable(shared .. "/i... | nilq/small-lua-stack | null |
-- Copyright (c) 2017-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the license found in the LICENSE file in
-- the root directory of this source tree. An additional grant of patent rights
-- can be found in the PATENTS file in the same directory.
--
--[[
--
-- init files for ... | nilq/small-lua-stack | null |
TOOL.Category = "Life Support"
TOOL.Name = "#Environmental Control"
TOOL.DeviceName = "Environmental Control"
TOOL.DeviceNamePlural = "Environmental Controls"
TOOL.ClassName = "ls3_environmental_control"
TOOL.DevSelect = true
TOOL.CCVar_type = "other_dispenser"
TOOL.CCVar_sub_type = "default_other_dispenser"
T... | nilq/small-lua-stack | null |
CaveBot.Extensions.ClearTile = {}
CaveBot.Extensions.ClearTile.setup = function()
CaveBot.registerAction("ClearTile", "#00FFFF", function(value, retries)
local pos = regexMatch(value, "\\s*([0-9]+)\\s*,\\s*([0-9]+)\\s*,\\s*([0-9]+)")
if not pos[1] then
warn("CaveBot[ClearTile]: invalid value. It should... | nilq/small-lua-stack | null |
local AddonName, AddonTable = ...
AddonTable.onyxia = {
49295,
49636,
49643,
49644,
-- Onyxia (10)
39299,
49322,
49318,
49319,
49315,
49316,
49317,
49320,
49332,
49333,
49303,
49321,
49305,
49308,
49297,
49307,
49298,
49302,
... | nilq/small-lua-stack | null |
local Signal = require(script.Parent.Parent.Parent.Signal)
local StatsService = game:GetService("Stats")
local StatsUtils = require(script.Parent.Parent.Parent.Parent.Stats.StatsUtils)
local CircularBuffer = require(script.Parent.Parent.Parent.CircularBuffer)
local Constants = require(script.Parent.Parent.Parent.Cons... | nilq/small-lua-stack | null |
local actions = require('telescope.actions')
local ignore = {
'.git/.*',
'lib',
'build',
'%.svg',
'%.png',
'%.jpeg',
'%.jpg',
'%.tif',
'%.ico',
'%.rar',
}
require('telescope').setup {
defaults = {
file_ignore_patterns = ignore,
previewer = true,
mappings = {
... | nilq/small-lua-stack | null |
local argcheck = require 'argcheck'
local EarlyStopper = torch.class('EarlyStopper')
EarlyStopper.__init = argcheck{
{name="self", type="EarlyStopper"},
{name="try_epochs", type="number"},
{name="closure", type="function", help="a function that returns copy of the current best net",
default=function(ne... | nilq/small-lua-stack | null |
PipePair = Class{}
function PipePair:init()
self.gapWidth = math.random(140, 210)
self.shift = math.random(-200, 200)
self.remove = false
self.scored = false
self.top = Pipe(-self.gapWidth/2+self.shift/2, true)
self.bottom = Pipe(self.gapWidth/2+self.shift/2)
end
function PipePair:update(dt)
... | nilq/small-lua-stack | null |
dependency 'vdk_inventory'
server_scripts {
'config.lua',
'server.lua'
}
client_script {
'vdkrec.lua'
} | nilq/small-lua-stack | null |
{data={name="", author="Magnus siiftun1857 Frankline"}, blocks={
{1881000, {-8.421, 0}},
{1881004, {-18.421, 0}, 1.571, bindingId=0},
{1881001, {1.579, 0}, 1.571},
{1881002, {1.579, 10}, -1.571},
{1881002, {1.579, -10}, 1.571},
{1881001, {11.579, 10}, 1.571},
{1881001, {11.579, -10}, -1.571... | nilq/small-lua-stack | null |
lootList = nil
local defaultWidth = 0
local defaultHeight = 0
--
function hide()
lootList:hide()
end
function show()
lootList:show()
end
function reset()
lootList:destroyChildren()
end
local function reallocateIcons()
local last
for k, v in pairs(lootList:getChildren()) do
v:breakAncho... | nilq/small-lua-stack | null |
require('polyglossia') -- just in case...
local add_to_callback = luatexbase.add_to_callback
local remove_from_callback = luatexbase.remove_from_callback
local priority_in_callback = luatexbase.priority_in_callback
local get_quad = luaotfload.aux.get_quad -- needs luaotfload > 20130516
local next, type = next, type
... | nilq/small-lua-stack | null |
-- Includes
#include 'include/internal_events.lua'
local g_InitCallbacks = {}
local _addEventHandler
g_InitPhase = 0
g_Init = true
g_SharedState = {}
function addInitFunc(func, prio)
assert(func)
table.insert(g_InitCallbacks, {func, prio or 0})
end
local function runInitCallbacks(minPrio, maxPrio)
... | nilq/small-lua-stack | null |
-- column
-- created on 2021/8/22
-- author @zoloypzuo
require("ui.ui_util")
local AWidget = require("ui.widget")
local WidgetContainerMixin = require("ui.mixins.widget_container_mixin")
local TreeNode = Class(AWidget, function(self, parent, name, arrowClickToOpen)
AWidget._ctor(self, parent)
WidgetContainerM... | nilq/small-lua-stack | null |
local skynet = require "skynet"
require "skynet.manager"
local io = require "io"
local fg_fnprefix
local everyDay = false
local function getFnPrefix()
if fg_fnprefix == nil then
if everyDay then
local fnprefix = skynet.getenv("logpath")
local tiTmp = os.time()
local dateTmp = os.date("*t",tiTmp)
local d... | nilq/small-lua-stack | null |
print(args[0])
local dir = string.match(args[0],'(.*)/.*')
if not math.pow then
math.pow = function(base,p)
return base ^ p
end
end
package.path = dir .. '/?.lua'
package.root = dir
require 'base'
local llae = require 'llae'
llae.set_handler()
local timer_sec = llae.newTimer()
local function funcion_test( a,b... | nilq/small-lua-stack | null |
COLOR_RED = discordia.Color.fromRGB(255, 0 , 0).value
COLOR_GREEN = discordia.Color.fromRGB(0, 255, 0).value
COLOR_BLUE = discordia.Color.fromRGB(0, 0, 255).value
COLOR_LIGHTRED = discordia.Color.fromRGB(240, 128, 128).value
COLOR_LIGHTGREEN = discordia.Color.fromRGB(144, 238, 144).value
COLOR_LIGHTBLUE = discor... | nilq/small-lua-stack | null |
function onCastSpell(creature, variant)
return creature:conjureItem(2260, 2262, 2)
end
| nilq/small-lua-stack | null |
local lsp = require "interrato.lsp"
require("lspconfig").vimls.setup {
on_attach = lsp.on_attach,
capabilities = lsp.capabilities,
flags = {
debounce_text_changes = 150,
}
}
| nilq/small-lua-stack | null |
Time = {}
Time.GetTimestamp = function(year, month, day, hour, minute, second)
local monthseconds = { 2678400, 2419200, 2678400, 2592000, 2678400, 2592000, 2678400, 2678400, 2592000, 2678400, 2592000, 2678400 }
local timestamp = 0
local datetime = getRealTime()
year, month, day = year or datetime.year ... | nilq/small-lua-stack | null |
VipList = {}
-- private variables
local vipWindow
local vipButton
local addVipWindow
-- public functions
function VipList.init()
connect(g_game, { onGameEnd = VipList.clear,
onAddVip = VipList.onAddVip,
onVipStateChange = VipList.onVipStateChange })
g_keyboard.bindKeyDown... | nilq/small-lua-stack | null |
---
-- @classmod StatsStorage
local middleclass = require("middleclass")
local flatdb = require("flatdb")
local types = require("lualife.types")
local Stats = require("models.stats")
local StatsStorage = middleclass("StatsStorage")
---
-- @table instance
-- @tfield FlatDB _db
---
-- @function new
-- @tparam string ... | nilq/small-lua-stack | null |
--- === plugins.finalcutpro.tangent.playback ===
---
--- Final Cut Pro Tangent Playback Group/Management
local require = require
local log = require "hs.logger".new "playback"
local dialog = require "cp.dialog"
local fcp = require "cp.apple.finalcutpro"
local i18n ... | nilq/small-lua-stack | null |
--------------------------------
-- @module EventListenerAcceleration
-- @extend EventListener
-- @parent_module cc
--------------------------------
-- / Overrides
-- @function [parent=#EventListenerAcceleration] clone
-- @param self
-- @return EventListenerAcceleration#EventListenerAcceleration ret (retur... | nilq/small-lua-stack | null |
------------------------------------------------------------------------------
-- Image Clipping Module
-- by boatbomber
--
-- For a detailed write-up, see here:
-- https://devforum.roblox.com/t/open-source-image-clipping-module/293014
--
-- API Overview:
--
-- module.new(<string> ID, <string> Type)
-- returns Viewpor... | nilq/small-lua-stack | null |
local flag = require("flag").new()
local opt = flag
:opt_str("f, file", "", "open audio file")
:opt_str("a, addr", "", "Remote service address")
:parse("-f ./tst.pcm -a 127.0.0.1:8080")
if #opt["f"] == 0 or
#opt["file"] == 0 or
#opt["a"] == 0 or
#opt["addr"] == 0 then... | nilq/small-lua-stack | null |
getglobal game
getfield -1 Workspace
getfield -1 Jewelrys
getfield -1 Jewelry
getfield -1 FloorLasers
getfield -1 Destroy
pushvalue -2
pcall 1 0 0
emptystack | nilq/small-lua-stack | null |
minetest.register_tool("twomt_tinker:minevisword", {
description = "The Sword with knowledge.",
inventory_image = "twomt_tinker_minevisword.png",
tool_capabilities = {
full_punch_interval = 1.5,
max_drop_level = 1,
groupcaps={
snappy={times={[1]=2.75, [2]=1.30, [3]=0.375}, u... | nilq/small-lua-stack | null |
return {
ru = {
hello = "привет",
}
} | nilq/small-lua-stack | null |
object_tangible_deed_vehicle_deed_military_transport_deed = object_tangible_deed_vehicle_deed_shared_military_transport_deed:new {
}
ObjectTemplates:addTemplate(object_tangible_deed_vehicle_deed_military_transport_deed, "object/tangible/deed/vehicle_deed/military_transport_deed.iff")
| nilq/small-lua-stack | null |
function onCreate()
-- background shit
makeLuaSprite('stageback', 'background/villagebg', -940, -500);
setScrollFactor('stageback', 0.8, 0.8);
scaleObject('stageback', 1, 1);
makeLuaSprite('stagefront', 'background/fore', -1300,-450);
setScrollFactor('stagefront', 1, 1);
scaleObject('stagefront', 2, 2);
... | nilq/small-lua-stack | null |
class 'ActiveRecord::Queue'
ActiveRecord.Queue.stored = {}
ActiveRecord.Queue.types = {}
function ActiveRecord.Queue:add(table_name, callback)
self.current_table = table_name
callback(self.types)
end
function ActiveRecord.Queue:run()
for k, v in pairs(self.stored) do
create_table(k, function(t)
for k... | nilq/small-lua-stack | null |
local FrameStyle = import("../Enum/FrameStyle")
local GuiObject = import("./GuiObject")
local InstanceProperty = import("../InstanceProperty")
local Frame = GuiObject:extend("Frame", {
creatable = true,
})
Frame.properties.Style = InstanceProperty.enum(FrameStyle, {
getDefault = function()
return FrameStyle.Custo... | nilq/small-lua-stack | null |
local member = param.get("member", "table")
ui.sidebar( "tab-whatcanido", function()
if not member.active then
ui.container{ attr = { class = "sidebarSection" }, content = function()
slot.put(" · ")
ui.tag{
attr = { class = "interest deactivated_member_info" },
content = _"Thi... | nilq/small-lua-stack | null |
local plyMeta = FindMetaTable("Player")
DarkRP.declareChatCommand{
command = "setspawn",
description = "Reset the spawn position for some job and place a new one at your position (use the command name of the job as argument)",
delay = 1.5,
condition = fn.Curry(fn.Flip(plyMeta.hasDarkRPPrivilege), 2)("rp_comm... | nilq/small-lua-stack | null |
-- luacheck: globals box
local checks = require('checks')
if rawget(_G, "_cluster_vars_defaults") == nil then
_G._cluster_vars_defaults = {}
end
if rawget(_G, "_cluster_vars_values") == nil then
_G._cluster_vars_values = {}
end
local function new_var(self, name, default_value)
checks("vars", "string", "... | nilq/small-lua-stack | null |
-- Waizza Gui
--
-- © 2020 Saw Yu Nwe, Waizza Studio
-- https://sawyunwe.com, https://waizza.com
local root = require 'waizza.internal.root'
local TYPE_OF = 'input' -- constant
--- Input module
-- @module M
local M = root:new()
local tab_index_table = {}
--- event message hashes
M.events = {
on_value_change = has... | nilq/small-lua-stack | null |
local _hx_print = print or (function()end)
| nilq/small-lua-stack | null |
local function a(b,c,d)if c==nil then return b elseif type(c)~='table'then return c elseif d[c]then return d[c]end;d[c]=b;for e,f in pairs(c)do e=a({},e,d)if b[e]==nil then b[e]=a({},f,d)end end;return b end;local function g(h,i)return a(h,i,{})end;local function j(i)return setmetatable(g({},i),getmetatable(i))end;loca... | nilq/small-lua-stack | null |
if SERVER then
util.AddNetworkString("psychedelicsSheetSkinUI") -- for client UI
util.AddNetworkString("psychedelicsSheetSkinMat") -- for server to receive the material
return
end
local function sendMaterial(material, sheet)
net.Start("psychedelicsSheetSkinMat")
net.WriteEntity(sheet)
net.WriteS... | nilq/small-lua-stack | null |
--[[ This file measures how generalizable the network model is.
Author: Olalekan Ogunmolu.
Date: Oct 20, 2016
Lab Affiliation: Gans' Lab
]]
require 'torch'
require 'data.dataparser'
require 'rnn'
require 'nngraph'
nn.LSTM.usenngraph = true -- faster
require 'optim'
local optnet = require 'op... | nilq/small-lua-stack | null |
function utils:log(inFilename, inMessage, inObject)
if inObject == nil then
inObject = " ";
else
inObject = " - " .. json.encode(inObject);
end
local logMessage = inFilename .. " - " .. inMessage .. inObject;
print(logMessage);
if logToFile == true then
if logFile == nil then
local path... | nilq/small-lua-stack | null |
--[[-----------------------------------------------------------------------------
Clicked read-only multi line edit box
-------------------------------------------------------------------------------]]
local Type, Version = "ClickedReadOnlyMultilineEditBox", 1
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if n... | nilq/small-lua-stack | null |
function love.load()
math.randomseed(os.time())
coreWidth=720
coreHeight=960
scale=1
shiftdown=0
pause=0
osString = love.system.getOS()
if osString == "Android" or osString == "iOS" then
scale = love.graphics.getWidth()/coreWidth
shiftdown = (love.graphics.g... | nilq/small-lua-stack | null |
local currentRsa
function g_game.getRsa()
return currentRsa
end
function g_game.findPlayerItem(itemId, subType)
local localPlayer = g_game.getLocalPlayer()
if localPlayer then
for slot = InventorySlotFirst, InventorySlotLast do
local item = localPlayer:getInventoryItem(slot)
... | nilq/small-lua-stack | null |
local ServerManagerScript = {}
-- Script properties are defined here
ServerManagerScript.Properties = {
--{name = "serverName", type = "string", default = "defaultServerName"},
{name = "container", type = "entity"},
{name = "destroySound", type = "entity"},
{name = "addSound", type = "entity"},
{name = "fence", t... | nilq/small-lua-stack | null |
local plist_set, plist_get = plist.set, plist.get
local getplayer = entity.get_players
local entity_isenemy = entity.is_enemy
local function resolve(player)
plist_set(player, "Correction Active", false)--skeetin resolveri yarak kapatgitsin
--resolver basliyor
plist_set(player, "Force b... | nilq/small-lua-stack | null |
-- This is the main dissector for all winshark based dissector
-- This dissector will parse all meta infos for ETW packet captured
-- throw the ETW backend for lib pcap
etw_proto = Proto("ETW","Event Trace for Windows");
local header_size = ProtoField.uint16("etw.header.Size", "Size", base.DEC);
local header_type = P... | nilq/small-lua-stack | null |
local conf = require("telescope.config").values
local finders = require "telescope.finders"
local make_entry = require "telescope.make_entry"
local pickers = require "telescope.pickers"
local diagnostics = {}
local convert_diagnostic_type = function(severities, severity)
-- convert from string to int
if type(seve... | nilq/small-lua-stack | null |
TOOL.Category = "Aperture Science"
TOOL.Name = "#tool.aperture_science_wall_projector.name"
TOOL.ClientConVar[ "startenabled" ] = "0"
if ( CLIENT ) then
//language.Add( "aperture_science_wall_projector", "Hard Light Bridge" )
language.Add( "tool.aperture_science_wall_projector.name", "Hard Light Bridge" )
languag... | nilq/small-lua-stack | null |
local printr = console.printr
local server = require('ssdp/server')
local request = 'M-SEARCH * HTTP/1.1\r\nHost:239.255.255.250:1900\r\nCache-Control:max-age=120\r\nLocation:http://192.168.77.101/desc.xml\r\nNT:upnp:rootdevice\r\nNTS:ssdp:alive\r\nServer:Linux/3.0, UPnP/1.0, Node.lua\r\nX-User-Agent:Vision\r\nUSN:uui... | nilq/small-lua-stack | null |
require("sources/lib/customFunctions")
Observee = {list_enemys = {}}
Observee.__index = Observee
function Observee:addObserver(enemy)
table.insert(self.list_enemys, enemy)
end
function Observee:removeObserver(enemy)
local index = nil
for i, en in pairs(self.list_enemys) do
if tostring(en) == tost... | nilq/small-lua-stack | null |
require 'busted'
require 'loxy'
describe("testing object syntax sugar behaviors", function()
local CIRCLE, circle
before_each(function()
CIRCLE = object({
radius = 0,
getArea = function(self)
return self.radius^2 * 3.14
end
})
circle = CIRCLE({ radius = 10 })
end)
descri... | nilq/small-lua-stack | null |
-- local config = require 'config'
-- local tools = require 'waf/tools'
-- local RULES_JSON = self.red:get(keyword)
-- if RULES_JSON == ngx.null then
-- RULES_JSON = get_rule(keyword)
-- self.red:set(keyword, RULES_JSON)
-- end
-- -- 0.14ms decode json
-- return cjson.decode(RULES_JSON)
-- config.set_to_cache... | nilq/small-lua-stack | null |
local Q = require 'Q'
local lDNN = require 'Q/RUNTIME/DNN/lua/lDNN'
require 'Q/UTILS/lua/strict'
local tests = {}
tests.t1 = function(n)
local n = n or 100000000
-- this is a ridiculously large number of layers
local npl = {}
local dpl = {}
local nl = 64
for i = 1, nl do npl[i] = nl - i + 1 end
for i = ... | nilq/small-lua-stack | null |
local style = require "core.style"
local common = require "core.common"
-- GitHub color palette
-- Ported by Andrey Proskurin (proskur1n)
local bg = { common.color "#22272e" }
local bg2 = { common.color "#2d333b" }
local fg = { common.color "#adbac7" }
local fgdim = { common.color "#768390" }
local red = { common.colo... | nilq/small-lua-stack | null |
local impatient, impatient = pcall(require, "impatient")
if impatient then
-- Broken
-- impatient.enable_profile()
end
local disabled_built_ins = {
"2html_plugin",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin... | nilq/small-lua-stack | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.