content stringlengths 5 1.05M |
|---|
local ig = require 'ffi.imgui'
local tooltip = require 'tooltip'
local class = require 'ext.class'
local GuiVar = require 'guivar.guivar'
local clnumber = require 'cl.obj.number'
local GuiNumber = class(GuiVar)
function GuiNumber:init(args)
GuiNumber.super.init(self, args)
self.value = args.value or 0
end
function... |
kMatureCystHealth = 250 -- was 450 |
daemon = {}
config = {}
chan = {}
daemon.dummy = 0
daemon.busy_wait = 1
daemon.loop = 2
config.get_integer = _internal_get_integer
config.get_text = _internal_get_text
throw_exception = function (err)
return error("'LUA_EXC_" .. err)
end
print = _internal_log_info
sleep = _internal_sleep
function d... |
#!/usr/bin/env lua
require 'Test.Assertion'
plan(14)
package.loaded['socket.http'] = {
request = function (req)
if req.url:match "^http://proxy.myorg:8080/restapi/show" then
matches(req.url, "^http://proxy.myorg:8080/restapi/show", "proxy initial")
local host = req.headers['host']... |
object_tangible_wearables_cybernetic_cybernetic_crafted_s05_forearm_l = object_tangible_wearables_cybernetic_shared_cybernetic_crafted_s05_forearm_l:new {
}
ObjectTemplates:addTemplate(object_tangible_wearables_cybernetic_cybernetic_crafted_s05_forearm_l, "object/tangible/wearables/cybernetic/cybernetic_crafted_s05_f... |
--[[
-- Copyright(c) 2019, All Rights Reserved
-- Created: 2019/4/20
--
-- @file l_skdr_x.lua
-- @brief 内置库require("l_skdr_x"), 网络异步io驱动线程
-- \n require("l_skdr_x")
-- \n 必须在l_net_x.init之后, l_net_x.start之前完成所线程的l_skdr_x.create工作
-- \n 进程运行过程中, 不可动态修改
-- @version 0.1
-- @history 修改历史
-- \n 2019/14/20 0.1 创建文件
... |
---@meta
---@class cc.TMXTiledMap :cc.Node
local TMXTiledMap={ }
cc.TMXTiledMap=TMXTiledMap
---* Set the object groups. <br>
---* param groups The object groups.
---@param groups array_table
---@return self
function TMXTiledMap:setObjectGroups (groups) end
---* Return the value for the specific property name. <b... |
local csvishout = require 'csvishout'
local t = require 'testhelper'
t( csvishout{}, '' )
t( csvishout{{}}, '\n' )
t( csvishout{{},{}}, '\n\n' )
t( csvishout{{1}}, '1\n' )
t( csvishout{{'a'}}, 'a\n' )
t( csvishout{{1,2}}, '1;2\n' )
t( csvishout{{'',2}}, ';2\n' )
t( csvishout{{1,2,3}}, '1;2;3\n' )
t( csvishout{{1,2,3... |
require("helpers.helpers")
-- debug_messages: # = "Message"
if not debug_messages then debug_messages = {} end
script.on_init(init)
script.on_configuration_changed(init)
function init()
--math.randomseed(os.time())
end
-- Test gui control
script.on_event("Eco", function(event)
local player = game.players[event.p... |
includeFile("weapon/ranged/base/serverobjects.lua")
includeFile("custom_content/weapon/ranged/serverobjects.lua")
includeFile("custom_content/weapon/melee/serverobjects.lua")
-- Server Objects
|
INC_CLIENT()
function SWEP:PreDrawViewModel(vm)
return true
end
|
-- UTILITY AI
-- Switches to determine utility behavior
IsCollector = true
IsGatherer = true
-- Multiplied by max material storage to determine when to head out.
-- Should be <= 1. Goes collecting or gathering when on-board material
-- is < (max * FreeStorageThreshold).
FreeStorageThreshold = .9
-- Enemy avoidance s... |
--[[
© 2020 TERRANOVA do not share, re-distribute or modify
without permission of its author.
--]]
ix.entity = ix.entity or {}
if(SERVER) then
-- A function to make an entity flush with the ground after it has been spawned.
function ix.entity.MakeFlushToSurface(entity, position, normal)
entity:SetPos(positio... |
-- encoding: UTF-8
_CHAR_DIAGRAM = {
["smh"] = {"《","》",},
["yh"] = {"「","」","『","』",},
["kh"] = {"〖","〗","【","】",},
["wc"] = {"±",},
["cy"] = {"×","÷",},
["xs"] = {"∧","↑",},
["xx"] = {"∨","↓",},
["xz"] = {"←",},
["xy"] = {"→",},
["fx"] = {"←","→","↑","↓",},
["hj"] = {"∑",},
["y"] = {"∩",},
... |
local fn = vim.fn
-- Automatically install packer
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... |
local M_PI = math.pi
local s = DisplayShape.new(stage:getSize())
:arc(128.0, 128.0, 76.8, 0, 2 * M_PI)
:clip()
:newPath()
:rectangle(0, 0, 256, 256)
:fill()
:setSourceColor(0, 1, 0)
:moveTo(0, 0)
:lineTo(256, 256)
:moveTo(256, 0)
:lineTo(0, 256)
:setLineWidth(10.0)
:stro... |
--[[
author:{JanRoid}
time:2018-11-09 11:45:13
Description: 日志管理
]]
local Log = {}
Log.s_priveteKey = {
["__index"] = "priveteKey"; -- 这个已经过滤了
["class"] = "priveteKey";
["tolua_ubox"] = "priveteKey";
}
-- debug日志
function Log.d(tag, ...)
Log.pr("DEBUG",tag, ...)
end
-- 错误日志
function Log.e(tag,... |
--- Render manager.
-- @classmod l2df.manager.render
-- @author Abelidze
-- @author Kasai
-- @copyright Atom-TM 2020
local core = l2df or require(((...):match('(.-)manager.+$') or '') .. 'core')
assert(type(core) == 'table' and core.version >= 1.0, 'RenderManager works only with l2df v1.0 and higher')
local helper = ... |
-- Import Helpers
dofile(minetest.get_modpath("fractal_helpers").."/helpers.lua")
-- Parameters
local YWATER = -31000
local fractal_size = 4096 -- max value 62000
local base_iteration = 4 -- the iteration at which we should start placing blocks
local scale = -1.6 -- the mandelbox scale multiplier
local f... |
return function()
local keys = {
---@usage change or add keymappings for insert mode
insert_mode = {
["<A-i>"] = "<C-o>I",
["<A-a>"] = "<C-o>A",
["<C-e>"] = "<C-o>de",
["<C-h>"] = "<C-o>b",
["<C-l>"] = "<C-o>lw",
["<C-s>"] = "<cmd>lua vim.lsp.buf.signature_help()<cr>",
},
---@usage change or... |
---
--- File: lua_clx.lua
---
--- This file implements the tgs actions for CLX devices
---
---
---
---
clx_device_ftp = {}
clx_device_ftp.ssh_stream = {}
--
-- register common code drivers
--
clx_device_ftp.ECHO = common_device_code.ECHO
clx_device_ftp.TIME_DELAY = common_device_code.TIME_DELAY
clx_device_... |
-- Use a protected call so we don't error out on first use
local status_ok, _ = pcall(require, "nvim-treesitter")
if not status_ok then
return
end
require('nvim-treesitter.configs').setup {
ensure_installed = 'maintained',
highlight = {
enable = true,
additional_vim_regex_highlighting = false... |
require "data"
require "parse"
module( ..., package.seeall )
local mk_string = parse.mk_string
local bind = parse.bind
local unit = parse.unit
local endStream = parse.endStream
local alternative = parse.alternative
local zeroOrMore = parse.zeroOrMore
local oneOrMore = parse.oneOrMore
local get_string = parse.get_str... |
--[[
Copyright (c) 2007, 2010, Niels Martin Hansen, Rodrigo Braz Monteiro
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,... |
local ZonelimitN = false
local ZonelimitO = false
local closestZone = 1
Citizen.CreateThread(function()
for i = 1, #Agent.zones, 1 do
local blip = AddBlipForRadius(Agent.zones[i].x, Agent.zones[i].y, Agent.zones[i].z, Agent.radius)
SetBlipHighDetail(blip, true)
SetBlipColour(blip, 11)
SetBlipAlpha (blip,... |
function table_merge(first_table, second_table)
for k,v in pairs(second_table) do
first_table[k] = v
end
end
function table_count(table)
if table == nil then
return 0
end
local count = 0
for _ in pairs(table) do
count = count + 1
end
return count
end
function c... |
att.PrintName = "G36K"
att.Icon = Material("")
att.Description = ""
att.Slot = "firearms2_g36k"
att.Model = "models/weapons/fas2/attachments/g36k_hsp.mdl"
att.AdditionalSights = {
{
Pos = Vector(0, 2.4, 0),
Ang = Angle(0, 0, 0),
Magnification = 2,
ScrollFunc = ArcCW.NONE,
... |
chilSelectionStack = {itemCount=0}
chilSelectionStack.PushSelection = function (object)
chilSelectionStack.itemCount = chilSelectionStack.itemCount + 1;
local index = chilSelectionStack.itemCount;
chilSelectionStack[index] = object;
object.Select(object);
end
chilSelectionStack.Clear = function ... |
----------------------------------------------------------------------------------------------------
-- version module, controls addon version
--
--get the engine and create the module
local Engine = select(2,...)
local mod = Engine.AddOn:NewModule("version")
--debug
local debug = Engine.AddOn:GetModule("debug")
--g... |
object_tangible_furniture_ep3_rewards_hologram_tiefighter_01 = object_tangible_furniture_ep3_rewards_shared_hologram_tiefighter_01:new {
}
ObjectTemplates:addTemplate(object_tangible_furniture_ep3_rewards_hologram_tiefighter_01, "object/tangible/furniture/ep3_rewards/hologram_tiefighter_01.iff") |
--function onDrop(x, y, draginfo)
-- return NpcManager.onDrop(getDatabaseNode(), x, y, draginfo);
--end
function onInit()
registerMenuItem(Interface.getString("npc_vehicle_clear"), "erase", 4);
end
function onMenuSelection(selection)
if selection == 4 then
clearVehicleDetails();
end
end
function c... |
local Roact = require(script.Parent.Parent.Parent.Vendor.Roact)
local ThemedButton = require(script.Parent)
local function ThemedButtonStory()
return Roact.createElement("Frame", {
BackgroundTransparency = 1,
Size = UDim2.fromScale(1, 1),
}, {
ThemedButton = Roact.createElement(ThemedButton, {
AnchorPoint =... |
SCREEN_WIDTH = 640
SCREEN_HEIGHT = 480
TILE_WIDTH = 40
TILE_HEIGHT = 40
FOLLOW_DELAY = 0.4
BATTLE_LAYERS = {
[ "bottom"] = -1000,
["below_battlers"] = -200,
[ "battlers"] = -100,
["above_battlers"] = 0, --┰-- 0
[ "below_ui"] = 0, --┙
[ "ui"] = 100,
... |
return --[[This list is autogenerated by build_default_list.py. If you wish to edit it, please make changes to the files in the list subdirectory.]] [[
#Generic adjectives used in multiple lists
ScaryAdjective
{
"Scary",
"Nightmarish",
"Horrifying",
"Chilling",
"Horrendous",
"Screaming",
}
Col... |
---@diagnostic disable: undefined-global, undefined-field
add_repositories("my-repo https://github.com/45degree/personal-xmake-repo.git main")
add_rules("mode.debug", "mode.release")
add_requires("openmesh", {debug = true})
add_requires("libigl", "tbb")
add_requires("gtest")
add_requires("progressbar v2.1")
target("... |
return require("installer/integrations/ls/helpers").npm.builder({
install_package = "pyright",
lang = "pyright",
})
|
local Label = require("lib.classes.Label")
local Event = require("lib.classes.Event")
local InputForm = Label:subclass("InputForm")
function InputForm:init()
self.super:init()
self.focusGrabbed = Event:new()
self.focusDropped = Event:new()
self.inputEvent = Event:new()
self.isFocused = false
self.defaultTe... |
EXPORTS["357"] = { };
EXPORTS["357"].Name = ".357 Magnum";
EXPORTS["357"].Desc = "A gun that shoots people hard.";
EXPORTS["357"].Secondary = true;
EXPORTS["357"].Price = 14000;
EXPORTS["357"].Model = "models/weapons/w_357.mdl";
EXPORTS["357"].W = 2;
EXPORTS["357"].H = 2;
EXPORTS["357"].SWEP = "weapon_coi_357"; |
require 'torch'
require 'cutorch'
require 'nn'
require 'cunn'
require 'cudnn'
require 'optim'
require 'image'
require 'pl'
require 'paths'
require 'layers.LinearWP'
require 'layers.LinearGaussian'
require 'layers.LinearMix'
require 'layers.LinearMix2'
require 'layers.Reparametrize'
require 'layers.GaussianCriterion'
r... |
log("data-updates") |
function deg2rad(x)
return x * math.pi / 180
end
function drawBarWithPercent(cr, val, x, y, angle, w, h, color, bgColor, borderColor, padding, border)
drawBar(cr, tonumber(val) / 100, x, y, angle, w, h, color, bgColor, borderColor, padding, border)
drawLabel(cr, tostring(val) .. "%", x, y + 13.5, angle, c... |
require("__5dim_core__.lib.battlefield.generation-wall")
local revelado = 350
-- Stone wall 01
genStoneWalls {
number = "01",
subgroup = "defense-wall",
order = "a",
new = false,
health = revelado,
ingredients = {
{"stone-brick", 5}
},
nextUpdate = "5d-stone-wall-02",
tech ... |
-- Copyright (C) 2016 zhangzf@kunteng.org
-- Licensed to the public under the GNU General Public License v3.
module("luci.controller.apfree_wifidog", package.seeall)
function index()
entry({"admin", "services", "apfreeWifiDog"}, cbi("apfree_wifidog"), _("WifiDog"), 40).index = true
entry({"admin", "services", "apfr... |
local broker = require'zbus.broker'
local member = require'zbus.member'
local config = require'zbus.config'
module('zbus')
broker = broker
member = member
config = config
return {
broker = broker,
member = member,
config = config
}
|
BigWigs:AddColors("Sadana Bloodfury", {
[153153] = "green",
[153240] = {"blue","yellow"},
[164974] = "orange",
})
BigWigs:AddColors("Nhallish", {
[152801] = "yellow",
[152979] = "red",
[153067] = "orange",
[153623] = "yellow",
})
BigWigs:AddColors("Bonemaw", {
[153804] = "orange",
[154175] = "yellow",
})
B... |
require("rv_rename")
local CallOperator = RV.CallOperator
local isQuat = function(a)
return a._postfix == "Q"
end
return {
IsQuat = isQuat,
_postfix = "Q",
_metatable = {
__add = function(a,b)
assert(isQuat(b))
return a:addQ(b)
end,
__sub = function(a,b)
assert(isQuat(b))
return a:subQ(b)
end,
... |
---@class protocol
local protocol = {}
protocol.name = "text"
protocol.id = skynet.PTYPE_TEXT
protocol.pack = function(m) return tostring(m) end
protocol.unpack = skynet.tostring
---@param msg userdata
---@param sz number
---@return userdata, "data"|"more"
protocol.unpack = function(msg, sz)
local queue
local ... |
--------------------------------------------------------------------------------
-- Pneumatic rheostat controller (PKG-758V) for 81-702,
-- used on ground subway lines
--------------------------------------------------------------------------------
-- Copyright (C) 2013-2018 Metrostroi Team & FoxWorks Aerospace s.r.o.
... |
sptbl["voc"] = {
files = {
module = "voc.c",
header = "voc.h",
example = "ex_voc.c",
},
func = {
create = "sp_voc_create",
destroy = "sp_voc_destroy",
init = "sp_voc_init",
compute = "sp_voc_compute",
},
params = {
},
modtype = "mod... |
local RM = require "generators.modules"
local C = require "generators.examplescommon"
local types = require("types")
local S = require("systolic")
local harness = require "generators.harness"
W = 640
H = 480
T = 4
local ITYPE = types.array2d(types.uint(8),2)
local OTYPE = types.array2d(types.uint(8),4) -- RGB
local ... |
--- An ordered, linear @{Collection} of items.
-- Lists have a distinct, linear ordering of items that can be accessed by
-- index. Additionally, they have a first and last element, can be sorted,
-- and can be searched.
--
-- The List interface provides a base set of operations for interacting
-- with any abstract Lis... |
--Taiidan
supplyLimit("Frigate", 24);
supplyLimit("Resource", 28);
supplyLimit("ResourceCollector", 24);
supplyDesc("Battlecruiser", "HeavyCruiser");
|
--- === hs.deezer ===
---
--- Controls for Deezer music player.
---
--- Heavily inspired by 'hs.spotify', credits to the original author.
local deezer = {}
local alert = require "hs.alert"
local as = require "hs.applescript"
local app = require "hs.application"
--- hs.deezer.state_paused
--- Constant
--- Returned by... |
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
local condition = createConditionObject(CONDITION_DRUNK)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setCombatCondition(combat, condition)
local area = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1}... |
_addon.name = "popup"
_addon.author = "gwaeron"
_addon.version = "0.0.1"
_addon.language = "English"
_addon.command = "popup"
config = require("config")
texts = require("texts")
lib = require("lib")
line = require("line")
debug = false
local textLine
event = function(...)
local args = T{...}
local command
l... |
---@mod comment.api API functions
local U = require('Comment.utils')
local Ex = require('Comment.extra')
local Op = require('Comment.opfunc')
local Config = require('Comment.config')
local A = vim.api
local api = {}
--====================================
--============ CORE API ==============
--=====================... |
--
-- This file is part of the lgmp package for Lua 5.2.
--
-- Author: Wim Couwenberg
-- Date : 2012/1/15
--
-- The lgmp package is distributed under the MIT license. See the "COPYRIGHT"
-- file that came with the distribution of lgmp for license details.
--
local require = require
local type = type
local getm... |
local DPBR = require("love-DPBR")
local app = {info = "2D side.\n\nModel by Andrew Maximov.\n(http://artisaverb.info/PBT.html)"}
local sw, sh = 1280/100, 720/100
local scene = DPBR.newScene(1280, 720)
scene:setProjection2D(10, "log", sw, sh)
scene:setToneMapping("filmic")
scene:setAntiAliasing("FXAA")
scene:setAmbient... |
local util = require "test.util"
local sprite_test_layer = class("sprite_test_layer", function()
return go.node.new()
end)
local mode = "click" -- click
local function negative_or_positive()
return math.random(2) % 2 == 0 and 1 or -1
end
local function spawn(self, spawn_count, container)
for i = 1, spaw... |
require("strict")
--------------------------------------------------------------------------
-- Lmod License
--------------------------------------------------------------------------
--
-- Lmod is licensed under the terms of the MIT license reproduced below.
-- This means that Lmod is free software and can be used ... |
function onefnaf_fade(mode, type, timeIn, timeOut, speedTime, offsetTime)
local fadeInTimer = 0
local fadeOutTimer = 0
local offsetTimer = 0
local fadeTransp = 0
screen.print(0, 0, fadeTransp.."\n"..fadeInTimer)
if type == "black" then
blackfullscreen:blit(0, 0, fadeTransp)
... |
local Clockwork = Clockwork;
-- Prevent the plugin from being registered (due to GitHub issue #528)
PLUGIN.Register = function() end;
Clockwork.kernel:IncludePrefixed("sv_hooks.lua");
|
{{/*
This command is a game where users need to send numbers from 1 to 100. The winners win an amount of credits!
Recommended trigger: Regex trigger with trigger .*
V2 by Dav!dノᵈᶻ#8302 (555791735607787580)
To start the game just type 31
*/}}
{{/* CONFIGURATION VALUES START */}}
{{ $channel := 72255489861235... |
-- lua/rs/rs_predict.lua
-- - Dragon
-- Load shared defs
Script.Load("lua/rs/rs_shared.lua")
-- Load predict defs |
local ffi = require('ffi')
local phm = require("apps.lwaftr.podhashmap")
local stream = require("apps.lwaftr.stream")
local function test(rhh, count, stride, active)
print('streaming lookup speed test (hits, uniform distribution)')
local streamer = rhh:make_lookup_streamer(stride)
print(count..' lookups, '..(... |
require 'hdf5'
require "csvigo"
local t = require 'transforms'
local M = {}
local DataLoader = torch.class('resnet.DataLoader', M)
function DataLoader.create(batchSize, clOpt)
local train = M.DataLoader(batchSize, "training", clOpt)
local validation = M.DataLoader(batchSize, "validation", clOpt)
return tr... |
-- Copyright (C) 2012 by wubenqi
-- Distributable under the terms of either the Apache License (Version 2.0) or
-- the GNU Lesser General Public License, as specified in the COPYING file.
--
-- By: wubenqi<wubenqi@gmail.com>
--
-- 日志库
--
local debug = _G.debug
local string = _G.string
local os = _G.os
local i... |
local COMMAND = Clockwork.command:New("SetWeather");
COMMAND.tip = "Set the current Atmos weather.";
COMMAND.text = "<string clear|storm|snow>";
COMMAND.flags = CMD_DEFAULT;
COMMAND.access = "a";
COMMAND.arguments = 1;
-- Called when the command has been run.
function COMMAND:OnRun(player, arguments)
local atmos = At... |
local assets=
{
Asset("ANIM", "anim/shovel.zip"),
Asset("ANIM", "anim/goldenshovel.zip"),
Asset("ANIM", "anim/swap_shovel.zip"),
Asset("ANIM", "anim/swap_goldenshovel.zip"),
}
local function onfinished(inst)
inst:Remove()
end
local function onequip(inst, owner)
owner.AnimState:OverrideSymbol("swa... |
-------------------------------------------------------------------------------
-- Importing modules
-------------------------------------------------------------------------------
local Endpoint = require "elasticsearch.endpoints.Endpoint"
------------------------------------------------------------------------------... |
-- #######################
-- ## ##
-- ## Mass Send Items ##
-- ## ##
-- #######################
-- #### Mass Send Status Frame #####
function UMMMassSendItemsStatusItemTemplate_OnLoad(this)
this.SetData = function(self, recipient, mailObject, modeEdit)
getglobal(self:G... |
local spell = {}
spell = {}
spell["numericaltype"] = [[Percentage]]
spell["element"] = [[Support]]
--a function: cost
spell["desc"] = [[Watch me dance! Boosts evasion.
*CHAOS ONLY*]]
spell["numberofhits"] = 1
--a function: conditional
spell["hitchance"] = 100
spell["target"] = [[Self]]
spell["passive"] = false
--a fun... |
description = [[
Attempts to find the owner of an open TCP port by querying an auth
daemon which must also be open on the target system. The auth service,
also known as identd, normally runs on port 113.
]]
---
--@output
-- 21/tcp open ftp ProFTPD 1.3.1
-- |_ auth-owners: nobody
-- 22/tcp open ssh ... |
local playsession = {
{"mewmew", {1362900}},
{"flooxy", {1510962}},
{"siehdaaa", {220171}},
{"Akhrem", {1053873}},
{"Zorky", {1885584}},
{"dpoba", {1879927}},
{"Danzou", {456018}},
{"Spaceman-Spiff", {248979}},
{"westbroma", {1230922}},
{"Dr.MoonShine", {281814}},
{"TiTaN", {44464}},
{"jack9761", {1554}}
}
... |
function love.conf(t)
t.window.width = 800
t.window.height = 450
t.window.title = "Erik" -- The window title (string)
t.window.icon = "assets/erik_logo.png"
t.version = "11.3"
end
|
--[[
Copyright (c) 2014 Google Inc.
See LICENSE file for full terms of limited license.
]]
require "torch"
function recursive_map(module, field, func)
local str = ""
if module[field] or module.modules then
str = str .. torch.typename(module) .. ": "
end
if module[field] then
str = str... |
local old_CMFCS_init = CrimeSpreeTweakData.init
function CrimeSpreeTweakData:init(tweak_data)
old_CMFCS_init(self, tweak_data)
self.cost_per_level = 0
end
|
QhunCore.ErrorMessage = {}
QhunCore.ErrorMessage.__index = QhunCore.ErrorMessage
-- constructor
function QhunCore.ErrorMessage.new(text)
-- call super class
local instance = QhunCore.AbstractMessage.new()
-- set private vars
instance._channel = "CONSOLE"
instance._text = text
instance._sender ... |
--[[ This module contains all of the spec-specific constructs (except where specs and styles overlap. That is, where styles have to do spec-specific work).
This module has a function called GetSpec which is given the spec name and returns a table containing functions/data that can be evaluated to do different jobs. ... |
local function loadShit()
print("Updating groups and permissions..")
query("SELECT * FROM am_groups", function(tbl)
for k,v in pairs(tbl) do
am.admins[ v["uniqueid"] ] = {
Admin = v["admin"],
SuperAdmin = v["superadmin"],
Owner = v["owner"],
Director = v["server_director"],
Dev = v["develope... |
local AddonName, AddonTable = ...
AddonTable.jewelcrafting = {
-- Gems
36917, -- Bloodstone
36918, -- Scarlet Ruby
36919, -- Cardinal Ruby
36920, -- Sun Crystal
36921, -- Autumn's Glow
36922, -- King's Amber
36923, -- Chalcedony
36925, -- Majestic Zircon
36926, -- Shadow Crystal... |
return{
name = "banana",
} |
--string and comment
local x = 1 --Hello World
print('----- string and comment -----')
-- print('----- string and comment -----')
content = [[
"Hello World"
"God is a 'girl'"
"He's age is 25"
local cc='aa'..'bb'
local a=a+1
restore i-th element
restore i - th element
]]
local a = a + 1
loc... |
if Game.Version ~= 8 then
return
end
local i4, i2, i1, u4, u2, u1, pchar = mem.i4, mem.i2, mem.i1, mem.u4, mem.u2, mem.u1, mem.pchar
local BLASTER = const.Skills.Blaster
-- shoot
mem.autohook(0x42D8C8, function(d)
if Game.ItemsTxt[d.ecx].Skill == BLASTER then
i4[d.ebp - 0x10] = 2
end
end)
mem.asmhook(0x42DAA9, ... |
project("fmt")
targetdir(red4ext.paths.build("libs"))
kind("StaticLib")
language("C++")
includedirs(
{
red4ext.paths.deps("fmt", "include")
})
files(
{
red4ext.paths.deps("fmt", "src", "format.cc"),
red4ext.paths.deps("fmt", "src", "os.cc"),
red4ext.pat... |
include "openssl/crypto"
ffi.cdef[[
typedef struct comp_ctx_st COMP_CTX;
typedef struct comp_method_st
{
int type;
const char *name;
int (*init)(COMP_CTX *ctx);
void (*finish)(COMP_CTX *ctx);
int (*compress)(COMP_CTX *ctx,
unsigned char *out, unsigned int olen,
unsigned char *in, unsigned int ilen);
int (... |
html = require "html"
function GetPerformancePage()
return html.performance(
html.script(),
'["10:10", "10:15", "10:20", "10:25", "10:30", "10:35", "10:40"]',
"[270, 420, 390, 590, 610, 320, 800]",
"[280, 480, 400, 190, 860, 270, 900]",
"[310, 230, 511, 427, 160, 880, 50]"
)
end
... |
SETTING_SHADOW_COLOR = "shadow_color"
SETTING_OFFSET_X = "offset_x"
SETTING_OFFSET_Y = "offset_y"
SETTING_HIDE_IMAGE = "hide_image"
SETTING_HIDE_SHADOW = "hide_shadow"
TEXT_SHADOW_COLOR = "Shadow Color"
TEXT_OFFSET_X = "Shadow Offset X"
TEXT_OFFSET_Y = "Shadow Offset Y"
TEXT_HIDE_IMAGE = "Hide Image"
TEXT_HIDE_SHADOW ... |
local cwd = require('process').getcwd()
local exists = require('path').exists;
ifNotEqual( exists( './exists_try.lua' ), cwd .. '/exists_try.lua' );
ifNotNil( exists( './_exists_try.lua' ) );
|
local equipment = {
equiped = { -- items ids
right_hand = 0,
left_hand = 0
}
}
function equipment:possible(place)
local result = character.inventory:getEquippableIds()
for p, itemId in pairs(self.equiped) do
if p ~= place then
table.removeByValue(result, itemId)
end
end
table.insert(... |
print ([[
Set the environment variable GT_MEM_BOOKKEEPING=on to enable memory bookkeeping
(e.g., like this: env GT_MEM_BOOKKEEPING=on gt).
Set the environment variable GT_ENV_OPTIONS=-spacepeak to show a spacepeak after
program run (GT_ENV_OPTIONS=-help shows possible ``environment options'').]])
|
hs.hotkey.bind({"cmd", "alt", "control", "shift"}, "V", function() hs.eventtap.keyStrokes(hs.pasteboard.getContents()) end)
|
--- Updater to update loaded module.
-- Updating a table is to update metatable and sub-table of the old table,
-- and to update functions of the old table, keeping value fields.
-- Updating a function is to copy upvalues of old function to new function.
-- Functions will be replaced later after updating.
local M = ... |
--[[
Bubble sort, sometimes referred to as sinking sort, is a simple sorting
algorithm that repeatedly steps through the list to be sorted, compares
each pair of adjacent items and swaps them if they are in the wrong order.
The pass through the list is repeated until no swaps are needed, which
indicates that the list i... |
local function template_function(...)
local arg = {...}
local max = arg[1]
if arg[1] == 10 then
eval_scope.cell:set_error("10 is not a proper number")
return
end
for i=2,#arg do
if arg[i] > max then
max = arg[i]
end
end
return max
end
function arg1_helper()
return {"1", "3", "5"}
end
return func... |
local function createUseToggle(useCallback, useState)
return function(initialState)
if initialState == nil then
initialState = false
end
local state, setState = useState(initialState)
return state, useCallback(function()
setState(not state)
end, {})
end
end
return createUseToggle
|
local os = {}
local uv = vim.loop
os.OSes = {
Nothing = 0,
Windows = 1,
Unix = 2,
}
local current_os = os.OSes.Nothing
if uv.os_uname().sysname == "Windows_NT" then
current_os = os.OSes.Windows
else
current_os = os.OSes.Unix
end
os.get_os = function()
return current_os
end
return os
|
function myadd(x, y)
return x + y
end
function callForMe(name)
return name
end
|
-----------------------------------------
-- ID: 4545
-- Item: Bunch of Gysahl Greens
-- Food Effect: 5Min, All Races
-----------------------------------------
-- Agility +3
-- Vitality -5
-- Additional Effect with Chocobo Shirt
-- Agility +10
-----------------------------------------
require("scripts/globals/status")
... |
-- eval.lua
--[[
Experiment 1: Construct a vanilla neural network for learning on the chorales.
Adapted from harvardnlp/group/torch/rnn_lm/simple/main.lua.
--]]
-- Other libraries
require 'nn'
require 'hdf5'
--- Make the Model ---
function make_model(max_index, embedding_size, hidden_size, output_size)
-- Embed... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.