content stringlengths 5 1.05M |
|---|
local function ContextContains(context, find)
local findType = type(find)
for i,v in pairs(context) do
if findType == "string" and StringHelpers.Equals(find, v, true) then
return true
elseif findType == "table" and Common.TableHasEntry(find, v, true) then
return true
end
end
return false
end
---Applies... |
tile_grass_plains, tile_beach, tile_forest, tile_ocean, tile_mountain = 0, 1, 2, 3, 4
gamestate_menu, gamestate_game = 0, 1
technology_unit_settler, technology_unit_scout, technology_unit_builder, technology_unit_warrior = 0, 1, 2, 3
technology_building_wall, technology_building_bank = 30, 31 |
Aye = LibStub("AceAddon-3.0"):NewAddon("Aye");
local Aye = Aye;
-- libs
-- external /libs as Aye.libs objects
Aye.libs = {};
Aye.libs.Config = LibStub("AceConfig-3.0");
Aye.libs.ConfigDialog = LibStub("AceConfigDialog-3.0");
Aye.libs.ConfigRegistry = LibStub("AceConfigRegistry-3.0");
Aye.libs.DB = LibStub("AceDB-3.0")... |
--- === cp.web.text ===
---
--- Functions for managing text on the web.
local sbyte, schar = string.byte, string.char
local sfind, ssub, gsub = string.find, string.sub, string.gsub
local mod = {}
local function sub_hex_ent(s)
return schar(tonumber(s, 16))
end
local function sub_dec_ent(s)
return schar(tonumber(s)... |
local awful = require('awful')
local wibox = require('wibox')
local awful = require('awful')
local gears = require('gears')
local naughty = require('naughty')
local watch = awful.widget.watch
local apps = require('configuration.apps')
local clickable_container = require('widget.clickable-container')
local dpi = require... |
--[[
Adds a new config code.
False is the default setting, so that the value will be for standart settings "false"
--]]
local PLUGIN = PLUGIN
local Clockwork = Clockwork
Clockwork.config:Add("quick_raise_enable", false);
--[[
This function is a PLUGIN Hook. It checks if the code is 1 = true or 0 = false.
If its... |
local transmitter_options = {
["all_noise"] = {
{
["transmissionNoiseType"] = "identity",
},
{
["transmissionNoiseType"] = "dropout",
["transmissionDropout"] = 0.3,
},
{
["transmissionNoiseType"] = "dropout",
["transmissionDropout"] = 0.7,
},
{
["transmissionNoiseType"] = "cropout",
... |
local M = {}
local api = vim.api
local fn = vim.fn
local utils = require('bqf.utils')
local log = require('bqf.log')
local ffi = require('bqf.ffi')
-- Code in this file relates to source code
-- https://github.com/neovim/neovim/blob/master/src/nvim/window.c
-- bfraction: before scroll_to_fraction, afraction: after sc... |
-- factoids.lua - channel specific factoids
function factoid_get_channel(channel)
local chan = channel
if type(cfg.channel[channel].factoids) == "string" then
chan = "#" .. cfg.channel[channel].factoids
end
return chan
end
function forget_factoid(sender, channel, params)
if cfg.channel[cha... |
--require("timeline/timelineBase");
TLAType = {
Move = 1, --位移
Alpha = 2, --透明度
Scale = 3, --缩放
Rotate = 4, --旋转
-- Color = 5, --变色
-- Clip = 6, --剪辑
}
TimelineAnim = class();
function TimelineAnim.ctor(self,target,duration,delay)
self.m_target = target;
self.m_dur... |
--------------------------------------------------------------------------------
-- Statistical functions module.
--
-- Copyright (C) 2011-2016 Stefano Peluchetti. All rights reserved.
--------------------------------------------------------------------------------
-- Variances and covariances are computed accor... |
local Tunnel = module("vrp", "lib/Tunnel")
local Proxy = module("vrp", "lib/Proxy")
MySQL = module("vrp_mysql", "MySQL")
vRP = Proxy.getInterface("vRP")
vRPclient = Tunnel.getInterface("vRP","vRP_trucker")
vRPCtruck = Tunnel.getInterface("vRP_trucker","vRP_trucker")
vRPtruck = {}
Tunnel.bindInterface("vRP_trucker",vR... |
require "AutoreleasePool"
require "CommonUtils"
Object = {};
Object.__index = Object;
Object.__classname = "Object";
--class(Object);
function Object:get(objectId--[[option]])
local obj = {};
obj.__propertylist = {};
setmetatable(obj, self);
function self.__newindex(t, k, v)
--print(type(v).."... |
--[[--
by ALA @ 163UI/网易有爱, http://wowui.w.163.com/163ui/
CREDIT shagu/pfQuest(MIT LICENSE) @ https://github.com/shagu
--]]--
----------------------------------------------------------------------------------------------------
local __addon, __ns = ...;
_G.__ala_meta__ = _G.__ala_meta__ or { };
__ala_meta__.quest =... |
Peter = Player:extend("Peter")
function Peter:new(...)
Peter.super.new(self, ...)
self:setImage("peter", 31)
self.anim:add("run", "16>23", function () return 12 * AXIS[1].x end, nil, {{0, -3},{0, -1},{0, -1},{0, -3},{0, -3},{0, -1},{0, -1},{0, -3}})
self.anim:add("run_menu", "16>23")
self.anim:add("idle", "1>15",... |
local strings = {} -- internal array with translated strings
URL = require "socket.url"
JSON = (loadfile "./libs/dkjson.lua")()
function string:escape_hard(ft)
if ft == 'bold' then
return self:gsub('%*', '')
elseif ft == 'italic' then
return self:gsub('_', '')
elseif ft == 'fixed' then
return self:gsub('`', '... |
test_run = require('test_run').new()
SERVERS = {'election_replica1', 'election_replica2', 'election_replica3'}
test_run:create_cluster(SERVERS, 'replication')
test_run:wait_fullmesh(SERVERS)
is_leader_cmd = 'return box.info.election.state == \'leader\''
test_run:cmd("setopt delimiter ';'")
function get_leader_nr()
... |
#!/usr/bin/env tarantool
require('strict').on()
local log = require('log')
local ffi = require('ffi')
local clock = require('clock')
local watchdog = require('watchdog')
local t0 = clock.monotonic()
local enable_coredump = arg[1]
if enable_coredump == 'true' then
enable_coredump = true
elseif enable_coredump == ... |
-- LLL - Lua Low Level
-- September, 2015
-- Author: Gabriel de Quadros Ligneul
-- Copyright Notice for LLL: see lllcore.h
--
-- Obtained at:
-- qt.lua,15 (one edge vector)
-- Julia sets via interval cell-mapping (quadtree version)
local benchmark_util = require 'benchmarks/util'
benchmark_util(function()
... |
return {
summary = 'Different types of Source effects.',
description = 'Different types of effects that can be applied with `Source:setEffectEnabled`.',
values = {
{
name = 'absorption',
description = 'Models absorption as sound travels through the air, water, etc.'
},
{
name = 'fall... |
--[
-- RnWriter.lua
--
-- Este arquivo cria uma table contendo funções utilizadas pelo teste automático.
--
--]
RnWriter = {
readers = 0,
writers = 0,
wantToWrite = 0,
reader_blocked = function(self)
if(self.writers == 0 and self.wantToWrite == 0) then
print("Error: reader blocke... |
----------------------------------------------------------------
-- RC522 RFID Reader for NodeMCU LUA
-- By Ben Jackson
-- This is a port of:
-- https://github.com/ondryaso/pi-rc522 -> Python
-- https://github.com/ljos/MFRC522 -> Arduino
-- to be used with MFRC522 RFID reader and s50 tag (but c... |
local i = require('plenary.iterators')
dump(i.split(" hello person dude ", " "):tolist())
-- dump(("hello person"):find("person"))
|
local buffer = require('vgit.buffer')
local assert = require('vgit.assertion').assert
local pfiletype = require('plenary.filetype')
local M = {}
M.cwd_filename = function(filepath)
assert(type(filepath) == 'string', 'type error :: expected string')
local end_index = nil
for i = #filepath, 1, -1 do
local let... |
local select, type, tostring = select, type, tostring
local pairs, error, setmetatable = pairs, error, setmetatable
local format, io_stderr = string.format, io.stderr
local string_len, string_byte = string.len, string.byte
local sqrt, tonumber = math.sqrt, tonumber
local floor = math.floor
local collectgarbage = collec... |
-----------------------------------
-- Area: Davoi
-----------------------------------
require("scripts/globals/zone")
-----------------------------------
zones = zones or {}
zones[tpz.zone.DAVOI] =
{
text =
{
ITEM_CANNOT_BE_OBTAINED = 6382, -- You cannot obtain the <item>. Come back after sorting... |
-- inculdes
return {
width = 32,
height = 48,
greeting = 'Hello and welcome to {{teal}}Winter Wonderland{{white}}!',
animations = {
default = {
'loop',{'1,1','11,1'},.5,
},
walking = {
'loop',{'1,1','2,1','3,1'},.2,
},
},
stare = true,
talk_items = {
{ ['text']='i am do... |
-- Copyright (c) 2021 Trevor Redfern
--
-- This software is released under the MIT License.
-- https://opensource.org/licenses/MIT
local class = require "moonpie.class"
local list = require "moonpie.collections.list"
local qt_node = class({})
function qt_node:constructor(props)
self.x = props.x
self.y ... |
-----------------------------------------------------------------------------------------------
-- Client Lua Script for Gear_Armory
-- Copyright (c) NCsoft. All rights reserved
-----------------------------------------------------------------------------------------------
--------------------------------------------... |
local math = require("math")
math.randomseed(os.time())
return function()
return (''..math.random()):sub(3)
end
|
local args = love.arg.parseGameArguments(arg)
local processed, last = {}, nil
for i=1, #args do
local notFirstChar = args[i]:sub(1,1) ~= "-"
if last and notFirstChar then
if type(processed[last]) ~= "table" then
processed[last] = {args[i]}
else
processed[last][#processed[last]+1] = args[i]
... |
package("scons")
set_kind("binary")
set_homepage("https://scons.org")
set_description("A software construction tool")
add_urls("https://github.com/SCons/scons/archive/refs/tags/$(version).zip",
"https://github.com/SCons/scons.git")
add_versions("4.1.0", "106259e92ba001feae5b50175bcec9... |
local env = {}
for k, v in pairs(_G) do
env[k] = v
end
env._G = env
_MTA = env |
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ==========
PlaceObj('AmbientLife', {
group = "Work",
id = "WorkDefault",
param1 = "unit",
param2 = "bld",
PlaceObj('XPrgVisitSlot', {
'unit', "unit",
'bld', "bld",
'group', "Holder",
}),
})
|
slot0 = class("BackYardThemeTemplatePurchaseMsgbox", import("...Shop.msgbox.BackYardThemeMsgBoxPage"))
slot0.SetUp = function (slot0, slot1, slot2, slot3)
slot0.dorm = slot2
slot0.template = slot1
slot0.player = slot3
slot0.count = 1
slot0.maxCount = 1
slot0:UpdateMainInfo()
slot0:UpdateRes()
slot0:UpdateBtns... |
function DataShow_OnDragStart()
DataShow:StartMoving();
end
function DataShow_OnDragStop()
DataShow:StopMovingOrSizing();
end
function DataShow_OnLoad()
DataShow:RegisterForDrag("LeftButton");
--local button = CreateFrame("Button", "only_for_testing", DataShow)
-- button:SetPoint("CENTER", Data... |
vim.g.EditorConfig_exclude_patterns = {'fugitive://.*'}
vim.cmd [[
augroup editor_config
autocmd!
autocmd FileType gitcommit let b:EditorConfig_disable = 1
augroup end
]]
|
local IpBanCheck = true -- Script should check ip for banning?
local JoinCoolDown = {}
local DatabaseStuff = {}
local BannedAccounts = {}
local Admins = {
"steam:11000",
"example",
}
SendMessage = function(Source,Title,Color,Msg)
if Source == 0 then
print(Title,Msg)
else
Tr... |
local function Reply(source, message)
if source == 0 then
print(message)
else
TriggerClientEvent("chat:notify", source, {
class = "inform",
text = message,
})
end
end
local function DropItemsInCategory(source, ...)
local args = {...}
if #args == 0 then
return false, "No category!"
end
local ped =... |
dofile("GameUtil.lua");
dofile("GameWorld.lua");
local wareHouseFactory=dofile(getDefaultScriptPath() .. "\\WareHouse.lua");
local wareHouse=wareHouseFactory.create(getDefaultScriptPath());
local nbcFactory=dofile(getDefaultScriptPath() .. "\\NaiveBayseClassifier.lua");
classifier=nbcFactory.create();
--build C45
lo... |
local input_file = "input.txt"
local area = {}
local length = 0
local width = 1
for line in io.lines( input_file )
do
length = length + 1
area[ length ] = {}
for j = 1, string.len( line )
do
area[ length ][ j ] = string.sub( line, j, j )
width = j
end
end
function print_area()
... |
local R = require("../dist/lamda")
TestFunc = {}
local this = TestFunc
function TestFunc.test_always()
local v_zero = R.always(0)
this.lu.assertEquals(v_zero(), 0)
this.lu.assertEquals(v_zero(), v_zero())
local always_curried = R.always()
local v_two = always_curried(2)
this.lu.assertEquals(v_two()... |
return {
id = "cosmiccowboy",
name = "Cosmic Cowboy Hat",
description = "I am the yeehaw of the universe.",
type = "hat",
rarity = 6,
hidden = false,
}
|
require('plenary.reload').reload_module('telescope')
local ok, telescope = pcall(require, 'telescope')
if not ok then
return {}
end
local telescope_references = {}
telescope_references.request = function(opts)
vim.lsp.buf_request(0, 'textDocument/references', telescope_references.get_params(), telescope_referen... |
--
--
-- GaussianCriterion.lua
-- Created by Andrey Kolishchak on 2/14/16.
--
--
-- Gaussian log-likelihood Criterion
-- input = {mu, log(sigma^2)} = {mu, log_sq_sigma}
-- L = log(p(N(x,mu,sigma)) = 0.5*log_sq_sigma +0.5*log(2*pi) + 0.5*((x-mu)^2)/exp(log_sq_sigma)
--
--
require 'nn'
require 'test'
local GaussianCr... |
local function getRootName(name)
return string.sub(name, string.find(name, "/") + 1)
end
local function getFrameName(name, frameAction, frameSide, frameNumber)
local folderName = getRootName(name) .. "_" .. frameAction .. "_" .. frameSide
local fileName = folderName .. "_" .. string.format("%.5d", frameNumber)
re... |
t1 = oapi.get_simtime()
t0 = t1
dt = 0
function tstep()
proc.skip()
t1 = oapi.get_simtime()
dt = t1-t0
t0 = t1
end
d0 = 2215.664
ph0 = 0.853
th0 = -0.361
d1 = 54.110
ph1 = -1.264
th1 = -0.233
oapi.set_cameramode({mode='track',trackmode='relative',reldist=d0,phi=ph0,tht=th0})
while t1 < 20 do
tstep()
step = math... |
require "foo"
local name = "alo alo"
local x = 10
if x < 20 then
method1()
end
print(name) |
function init()
setName("Absolute")
setDesc("Gets absolute value")
setSize(100, 24+64+8+8+7+4)
addOutput(24+32)
addInput("Texture", 24+64+8+8)
end
function apply()
tileSize = getTileSize()
for i=0, tileSize*tileSize-1 do
x = i%tileSize
y = math.floor(i/tileSize)
cr, ... |
--Adds sprites and sounds for the gui elements
data:extend({
-- Sound
{
type = "sound",
name = "aircraft-realism-sound-master-warning",
variations = { filename = "__AircraftRealism__/sound/plane-warn.ogg", volume = 1.5 }
},
-- Sprites
{
type = "sprite",
name = "aircraft-realism-airspeed-... |
--[[
Copyright (C) 2018 HarpyWar (harpywar@gmail.com)
This file is a part of the plugin https://github.com/HarpyWar/ts3plugin_mybadges
]]--
--
-- Testmodule initialisation, this script is called via autoload mechanism when the
-- TeamSpeak 3 client starts.
--
local MODULE_NAME = "mybadges"
require("ts3init") ... |
--Plus d'infos ici : https://www.youtube.com/watch?v=INQPAgFHHA4
p = peripheral.wrap("top")
p.clear()
p.setTextScale(5)
text = {
"A",
"Y",
"R",
"O",
"B",
"O",
"T"
}
while true do
p.clear()
for k,v in ipairs(text) do
p.setCursorPos(1,8)
p.write(v)
os.sleep(0.5)
p.scroll(1)
end
os.sleep(0.5)
f... |
--[[
JsonParser.lua
Usage:
The function ParseJSON (jsonString) accepts a
string representation of a JSON object or array
and returns the object or array as a Lua table
with the same structure. Individual properties
can be referenced using either the dot notation
or the array notation... |
return {
desc_get = "",
name = "",
init_effect = "",
time = 2,
color = "red",
picture = "",
desc = "",
stack = 1,
id = 14153,
icon = 14153,
last_effect = "",
effect_list = {
{
type = "BattleBuffCleanse",
trigger = {
"onAttach"
},
arg_list = {
buff_id_list = {
14152
}
}
}
... |
--[[
Abstract base class for gamestates
Derive your class from it, define type and implement
callbacks to make your own gamestate for the flow.
Static attributes
type string type name used for transition queries
Instance external references
app gameapp game app instance
... |
local dragging = false;
function onInit()
--if User.isHost() then --make this usable by everyone, not just host.
-- set the mouse to a hand when over this control
setHoverCursor("hand");
-- register menu items
registerMenuItem("End of Turn Actions", "deletetoken", 4);
--end
end
function onB... |
---@class Router
Router = setmetatable({}, Router)
Router.__call = function()
return "Router"
end
Router.__index = Router
function Router.new()
local _Router = {
Paths = {},
Middlewares = {}
}
return setmetatable(_Router, Router)
end
---@param path string
---@param handler fun(req: ... |
return {
version = "1.1",
luaversion = "5.1",
tiledversion = "2018.01.23",
orientation = "orthogonal",
renderorder = "right-down",
width = 40,
height = 24,
tilewidth = 16,
tileheight = 16,
nextobjectid = 3,
properties = {
["collidable"] = "true"
},
tilesets = {
{
name = "Telhado"... |
--[[
A loosely based Material UI module
mui-slider.lua : This is for creating horizontal sliders (0..100 in percent or 0.20 = 20%).
The MIT License (MIT)
Copyright (C) 2016 Anedix Technologies, Inc. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a cop... |
object_tangible_loot_npc_loot_spice_droid_lube_generic = object_tangible_loot_npc_loot_shared_spice_droid_lube_generic:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_npc_loot_spice_droid_lube_generic, "object/tangible/loot/npc/loot/spice_droid_lube_generic.iff")
|
slot2 = "MJAnGangRightCcsPane"
MJAnGangRightCcsPane = class(slot1)
MJAnGangRightCcsPane.onCreationComplete = function (slot0)
slot4 = BaseMJCardGroupPane
ClassUtil.extends(slot2, slot0)
end
return
|
-----------------------------------
-- Area: Cloister of Storms
-- NPC: Lightning Protocrystal
-- Involved in Quests: Trial by Lightning
-- !pos 534.5 -13 492 202
-----------------------------------
require("scripts/globals/missions")
local ID = require("scripts/zones/Cloister_of_Storms/IDs")
require("scripts/globals/... |
data.raw["locomotive"]["locomotive"].burner.fuel_categories = {"chemical","rocket"}
data.raw["locomotive"]["locomotive"].burner.fuel_category = nil
data.raw["furnace"]["stone-furnace"].energy_source.fuel_categories = {"chemical","rocket"}
data.raw["furnace"]["stone-furnace"].energy_source.fuel_category = nil
data.raw... |
local type=type;local a={}for b=0,16 do a[2^b]=string.format("%x",b)end;local function c(d,e,f,g)local h,i=d.getSize()for j=1,i do e.setCursorPos(1,j)if f then e.blit(f(j))end end;local k,j=d.getCursorPos()e.setCursorPos(k,j-g)if d.getCursorBlink then e.setCursorBlink(d.getCursorBlink())end;e.setTextColour(d.getTextCol... |
require "module-loader"
METHODS =
{
HEAD = "HEAD";
GET = "GET";
PUT = "PUT";
DELETE = "DELETE";
PATCH= "PATCH";
POST= "POST";
}
local OS = love.system.getOS()
REST = {}
--Providing autocomplete
REST.head = function(url, requestHeader, methodOrOnLoad, onLoad)end
REST.get = function(url, requestH... |
module("resty.random", package.seeall)
_VERSION = '0.06'
local ffi = require "ffi"
local ffi_new = ffi.new
local ffi_str = ffi.string
local C = ffi.C
ffi.cdef[[
int RAND_bytes(unsigned char *buf, int num);
int RAND_pseudo_bytes(unsigned char *buf, int num);
]]
function bytes(len, strong)
local buf = ffi_new("c... |
require'nvim-web-devicons'.setup {}
|
local x = os.date()
local log = io.open("C:\\Program Files (x86)\\TeamViewer\\TeamViewer13_Logfile.log","r")
local file = log:read("*all")
print(file)
|
require "lunit"
module("tests.e3.e3features", package.seeall, lunit.testcase)
local settings
local function set_rule(key, value)
if value==nil then
eressea.settings.set(key, settings[key])
else
settings[key] = settings[key] or eressea.settings.get(key)
eressea.settings.set(key, value)... |
-- The MIT License (MIT)
--
-- Copyright (c) 2013 Jeremy Othieno.
--
-- 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,... |
return {
corwin = {
acceleration = 0,
activatewhenbuilt = true,
brakerate = 0,
buildcostenergy = 174,
buildcostmetal = 45,
builder = false,
buildinggrounddecaldecayspeed = 30,
buildinggrounddecalsizex = 5,
buildinggrounddecalsizey = 5,
buildinggrounddecaltype = "corwin_aoplane.dds",
buildpic = "c... |
--[[
Name: LibAbacus-3.0
Revision: $Rev: 50 $
Author(s): ckknight (ckknight@gmail.com)
Website: http://ckknight.wowinterface.com/
Documentation: http://www.wowace.com/wiki/LibAbacus-3.0
SVN: http://svn.wowace.com/wowace/trunk/LibAbacus-3.0
Description: A library to provide tools for formatting money and time.
L... |
--=========== Copyright © 2018, Planimeter, All rights reserved. ===========--
--
-- Purpose: Close Dialog class
--
--==========================================================================--
class "gui.closedialog" ( "gui.frame" )
local closedialog = gui.closedialog
function closedialog:closedialog( parent, name... |
-----------------------------------
-- Area: Carpenters' Landing
-- NM: Cryptonberry Executor
-- !pos 120.615 -5.457 -390.133 2
-----------------------------------
local ID = require("scripts/zones/Carpenters_Landing/IDs")
mixins = {require("scripts/mixins/job_special")}
require("scripts/globals/missions")
----------... |
local select = select
local w2l
local function unpack_flag(flag)
local tbl = {}
for i = 0, 64 do
local n = 1 << i
if n > flag then
break
end
if flag & n ~= 0 then
tbl[#tbl+1] = i + 1
end
end
return tbl
end
local functio... |
local AddonName, AddonTable = ...
AddonTable.auchindoun = {
-- Vigilant Kaathar
110045, -- Kamuis Crystalline Staff of Wizardry
-- Soulbinder Nyami
110046, -- Hammer of The Soulbinder
110047, -- Soulcutter Mageblade
-- Azzakel
109995, -- Blood Seal of Azzakel
110048, -- Azzakels Boltsli... |
-- When IO is disabled, loadfile and dofile return errors
runtime.callcontext({flags="iosafe"}, function ()
print(pcall(loadfile, "foo"))
--> ~false\t.*: missing flags: iosafe
print(pcall(dofile, "bar"))
--> ~false\t.*: missing flags: iosafe
end)
|
for index, force in pairs(game.forces) do
if force.technologies["useful-combinators"].researched then
force.recipes["random-combinator"].enabled = true
--force.recipes["logic-combinator"].enabled = true
force.recipes["comparator-combinator"].enabled = true
end
end |
--
-- vim: ts=4 sw=4 et
--
print('arg', arg)
box.cfg({
replication = os.getenv("MASTER"),
listen = os.getenv("LISTEN"),
memtx_memory = 107374182,
replication_timeout = 0.1,
replication_connect_timeout = 0.5,
read_only ... |
function gcd(x,y)
if y==0 then return x
else return gcd(y,x%y)
end
end
function extendedGCD(a,b)
local s=0;local old_s=1
local t=1;local old_t=0
local r=b;local old_r=a
local q=0
local fl=math.floor
while r ~= 0 do
q= fl(old_r/r)
old_r, r = r, old_r - q*r
old_s, s = s, old_... |
object_mobile_dressed_restuss_rebel_lt_grollo = object_mobile_shared_dressed_restuss_rebel_lt_grollo:new {
}
ObjectTemplates:addTemplate(object_mobile_dressed_restuss_rebel_lt_grollo, "object/mobile/dressed_restuss_rebel_lt_grollo.iff")
|
local dom = {}
dom.Config = doFile('./src/config.lua', dom)
dom.Project = doFile('./src/project.lua', dom)
dom.Root = doFile('./src/root.lua', dom)
dom.Workspace = doFile('./src/workspace.lua', dom)
return dom
|
slot0 = class_C("Effect", ClassLoader:aquireClass("Component"))
slot0.onCreate = function (slot0)
slot0.super.onCreate(slot0)
slot0:addProperty("effectType")
slot0:addProperty("effectParam")
slot0:addProperty("isDead")
end
slot0.onLoad = function (slot0)
slot0.super.onLoad(slot0)
slot0:bindSameName("isDead", sl... |
local function round( x )
if x >= 0 then
return math.floor( x + 0.5 )
else
return math.floor( x - 0.5 )
end
end
local function endsWith( str, pattern )
local index = string.find( str, pattern, 1, true )
return index and string.sub(str,index) == pattern
end
-- Ember doesn't like f... |
Map = {}
Map.__index = Map
function Map:Create(mapDef)
local layer = mapDef.layers[1]
local this =
{
mX = 0,
mY = 0,
mMapDef = mapDef,
mTextureAtlas = Texture.Find(mapDef.tilesets[1].image),
mTileSprite = Sprite.Create(),
mLayer = layer,
... |
ITEM.name = "Colt Python"
ITEM.description = "The Colt Python is a .357 Magnum caliber revolver formerly manufactured by Colt's Manufacturing Company of Hartford, Connecticut. It is sometimes referred to as a 'Combat Magnum'. It was first introduced in 1955, the same year as Smith & Wesson's M29 .44 Magnum."
ITEM.model... |
grid = {}
function grid.stack(images, nRow, nCol)
-- nBatch x Height x Width
if images:dim() == 3 then
local H = images:size(2)
local W = images:size(3)
local grid = torch.Tensor(nRow, nCol, H, W)
local idx = 0
for i = 1,nRow do
for j = 1,nCol do
idx = idx + 1
... |
for i = 0, 10 do
local j = 0
while j < 10 do
print ("j: " .. j) -- Will never be > 2
if j == 2 then
print ("j is: " .. j .. ", i is:" .. i)
break
end
j = j + 1
end
end |
-----------------------------------
-- Area: Aht Urhgan Whitegate
-- NPC: Gavrie
-- Standard Merchant NPC
-----------------------------------
local ID = require("scripts/zones/Aht_Urhgan_Whitegate/IDs")
require("scripts/globals/shop")
function onTrade(player, npc, trade)
end
function onTrigger(player, npc)
local... |
local boolean = imgui.Boolean.new(true)
local check_select = imgui.Boolean.new(false);
local sliderValue = imgui.Floater.new(0);
local integer = imgui.Integer.new(0);
local size = imgui.Floater.new(36)
local thickness = imgui.Floater.new(36)
local function main()
if boolean:getValue() then
imgui.Begin("title1"... |
#!/bin/luajit
-- optimalization
-- kindle - I execute 2 times, maybe I don't need title of the article, I can useos.tmpfile - but it remove file after end of the script
package.path = '/home/miro/Documents/dotfiles/common/scripts/.bin/' .. package.path
util = require('scriptsUtil')
HELP = [[
Utils for using URLs from... |
local L = BigWigs:NewBossLocale("Cordana Felsong", "deDE")
if not L then return end
if L then
L.kick_combo = "Kick Combo"
L.light_dropped = "%s hat das Licht fallen gelassen."
L.light_picked = "%s hat das Licht aufgenommen."
L.warmup_text = "Cordana Teufelsang aktiv"
L.warmup_trigger = "Ich habe, wofür ich gekom... |
--[[
openwrt-dist-luci: ChinaDNS
]]--
module("luci.controller.chinadns", package.seeall)
function index()
if not nixio.fs.access("/etc/config/chinadns") then
return
end
local page
page = node("admin", "wwbhl")
page.target = firstchild()
page.title = _("wwbhl")
page.order = 65
entry({"admin", "wwbhl", "chin... |
#!/usr/bin/env tarantool
test = require("sqltester")
test:plan(22)
--!./tcltestrunner.lua
-- 2014-04-21
--
-- The author disclaims copyright to this source code. In place of
-- a legal notice, here is a blessing:
--
-- May y ou do good and not evil.
-- May you find forgiveness for yourself and forgive others.
-... |
wait(1)
math.randomseed(tick() % 1 * 1e6)
sky = coroutine.create(function()
while wait(0.3) do
s = Instance.new("Sky",game.Lighting)
s.SkyboxBk,s.SkyboxDn,s.SkyboxFt,s.SkyboxLf,s.SkyboxRt,s.SkyboxUp = "rbxassetid://201208408","rbxassetid://201208408","rbxassetid://201208408","rbxassetid://201208408","rbxassetid://... |
-- Check that running :commands works.
-- Add a dummy command
local assertEq = test.assertEq
local myvar = nil
local vi_mode = require 'textadept-vi.vi_mode'
local cmd_errors = {}
local function save_errors(f)
return function(...)
ok, err = pcall(f, ...)
if ok then return err end
... |
local eva = require("eva.eva")
return function()
describe("Eva window", function()
before(function()
eva.init("/resources/tests/eva_tests.json")
end)
it("Window test", function()
end)
end)
end |
local TestCase = require "luv.dev.unittest".TestCase
module(...)
return TestCase:extend{
__tag = ...,
testAsserts = function (self) self.assertTrue(true) self.assertFalse(false) self.assertEquals(1, 1) self.assertNotEquals(1, 2) self.assertNil(nil) self.assertNotNil({}) end,
testThrows = function (self)
self.ass... |
local function get_computer_formspec(id,channel,displayChannel)
local formspec =
"size[14,1]"..
-- default.gui_bg..
-- default.gui_bg_img..
-- default.gui_slots..
"keyeventbox[0.3,0.4;1,1;proxy;keyboard.png;keyboardActive.png]"..
"field[1.3,0.7;6,1;input;;]"..
"field[7.3,0.7;2,1;channel;channel;"..channel.... |
-- Copyright 2011-2012 Jo-Philipp Wich <jow@openwrt.org>
-- Licensed to the public under the Apache License 2.0.
module("luci.tools.firewall", package.seeall)
local ut = require "luci.util"
local ip = require "luci.ip"
local nx = require "nixio"
local translate, translatef = luci.i18n.translate, luci.i18n.translatef... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.