conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Set test env in ui test\n"
},
{
"from": "human",
"value": "\nassert(toggl.logout())\n\nlocal f = assert(io.open(\"testdata/me.json\", \"r\"))\nlocal json = assert(f:read(\"*all\"))\nf:close()\n\nassert(toggl.set_logged_in_user(json))\n\nlocal seconds = 2\n\ntoggl.sl... | lua | chosen |
[
{
"from": "system",
"value": "Update Greetings example to new headers API\n"
},
{
"from": "human",
"value": "--[[\n greetings.lua - Cadet example\n Christian Koch <cfkoch@sdf.lonestar.org>\n\n # /etc/inetd.conf:\n\n 8899\tstream\ttcp\tnowait:600\t_httpd\t/path/to/bozohttpd \\\n httpd -L... | lua | chosen |
[
{
"from": "system",
"value": "Fix support page when a group has no players\n"
},
{
"from": "human",
"value": "function get()\n local data = {}\n local groups = xml:unmarshalFile(serverPath .. \"/data/XML/groups.xml\")\n\n data.list = {}\n\n for _, group in pairs(groups.groups.group) ... | lua | chosen |
[
{
"from": "system",
"value": "Add '--enable-pasinterface' to PCL pkg\n"
},
{
"from": "human",
"value": "return {\n source = {\n type = 'git',\n location = 'https://github.com/GENIVI/persistence-client-library.git',\n branch = 'v1.1.0',\n },\n build = {\n type... | lua | chosen |
[
{
"from": "system",
"value": "Fix a typo in one of the samples\n"
},
{
"from": "human",
"value": "-- From the example for https://github.com/xyproto/permissions2\nprint(\"Has user bob: \" .. tostring(HasUser(\"bob\")))\nprint(\"Logged in on server: \" .. tostring(IsLoggedIn(\"bob\")))\nprint(\"I... | lua | chosen |
[
{
"from": "human",
"value": "Add a plugin to prune the Hindsight input logs after consumption\n"
},
{
"from": "gpt",
"value": "-- This Source Code Form is subject to the terms of the Mozilla Public\n-- License, v. 2.0. If a copy of the MPL was not distributed with this\n-- file, You can obtain o... | lua | chosen |
[
{
"from": "human",
"value": "Add test with new Lua syntax\n"
},
{
"from": "gpt",
"value": "-- reflect the request information as JSON\r\njson = require \"json\"\r\n\r\nresponse = json.encode(mg.request_info)\r\n\r\nmg.response.status = 200\r\nmg.response.http_headers[\"Content-Type\"] = \"applic... | lua | chosen |
[
{
"from": "human",
"value": "Add changed questlog for madeline\n"
},
{
"from": "gpt",
"value": "-- INSERT INTO \"quests\" (\"qst_id\", \"qst_script\") VALUES (334, 'quest.madeline_clarbelis_334_runewick');\n\nrequire(\"base.common\")\nmodule(\"quest.madeline_clarbelis_334_runewick\", package.see... | lua | chosen |
[
{
"from": "human",
"value": "Add specs for the 3scale batcher policy\n"
},
{
"from": "gpt",
"value": "local ThreescaleBatcher = require('apicast.policy.3scale_batcher')\nlocal AuthsCache = require('apicast.policy.3scale_batcher.auths_cache')\nlocal Usage = require('apicast.usage')\nlocal configu... | lua | chosen |
[
{
"from": "system",
"value": "Disable hammerspoon redshift in favour of Apple's built-in\n"
},
{
"from": "human",
"value": "require 'modules.autoloader'\n\n-- watches Lua files\n-- provides short-cuts to reload Hammerspoon config\nautoloader = Autoloader()\n\n-- for all notifications and messagi... | lua | chosen |
[
{
"from": "system",
"value": "Add some docs (to be processed later with LuaDoc or LDoc)\n"
},
{
"from": "human",
"value": "local hb = require(\"luaharfbuzz\")\n\nlocal Face = hb.Face\n\n-- Extend Face to accept a file name and optional font index\n-- in the constructor.\nFace.new = function(file... | lua | chosen |
[
{
"from": "system",
"value": "Fix (thanks to user \"cmd.exe\").\n"
},
{
"from": "human",
"value": "Macro {\n area=\"Shell Editor Viewer\"; key=\"/[LR]Alt[0-9]/\"; description=\"Use Alt-digit to switch between screens\"; action = function()\nKeys('F12', akey(1):sub(-1))\n end;\n}\n"
},
{
... | lua | chosen |
[
{
"from": "human",
"value": "Add test for setting with wrong state\n"
},
{
"from": "gpt",
"value": "\nlocal seedTest = {}\nlocal tester = torch.Tester()\n\nfunction seedTest.testStateBeforeRequire()\n local state = torch.getRNGState()\n require 'randomkit'\n tester:assertError(function(... | lua | chosen |
[
{
"from": "system",
"value": "Move non working tests to pending\n"
},
{
"from": "human",
"value": "describe( \"Date format using Babel #date\", function()\n\n local babel\n local test_date\n\n --- Initialize babel and load test translations from the\n -- tests/translations folder.\n ... | lua | chosen |
[
{
"from": "system",
"value": "Tidy a Lua example for the book\n"
},
{
"from": "human",
"value": "x = {1, 2, 3}\ny = {4, 5, 6}\n\nfunction f(a, b)\n a = 10 -- changing the parameter\n assert(x[1] == 1) -- ...does not affect the argument\n b[2] = 20 -- changing a fie... | lua | chosen |
[
{
"from": "human",
"value": "Add a helper loader module\n"
},
{
"from": "gpt",
"value": "local utils = require 'busted.utils'\n\nreturn function()\n local loadHelper = function(helper, hpath, options)\n local success, err = pcall(function()\n if helper:match('%.lua$') or helper:match('%... | lua | chosen |
[
{
"from": "system",
"value": "Use screensDidLock to trigger mute\n"
},
{
"from": "human",
"value": "function handler(type)\n if type == hs.caffeinate.watcher.screensDidSleep then\n return setMuted(true)\n end\n if type == hs.caffeinate.watcher.screensDidUnlock then\n retur... | lua | chosen |
[
{
"from": "system",
"value": "Allow callback to be set for notifications\n"
},
{
"from": "human",
"value": "utils = {}\nutils.__index = utils\n\nfunction utils.snapAll()\n for _, win in pairs(hs.window.visibleWindows()) do hs.grid.snap(win) end\nend\n\nfunction utils.isFullScreen(win)\n if not... | lua | chosen |
[
{
"from": "system",
"value": "Improve stability of VR Help scripts\n"
},
{
"from": "human",
"value": "---------------------------------------------------------------------------------------------------\n-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0122-New_... | lua | chosen |
[
{
"from": "human",
"value": "test(shaper): Add unit test for variable spaces\n\nCo-authored-by: Michael Brown <b89953f9b0cacf51de3838903be001f571321009@gmail.com>\n"
},
{
"from": "gpt",
"value": "SILE = require(\"core/sile\")\nSILE.backend = \"debug\"\nSILE.init()\n\ndescribe(\"SILE.shapers.base... | lua | chosen |
[
{
"from": "human",
"value": "Enable highdpi mode by default\n"
},
{
"from": "gpt",
"value": "--=========== Copyright © 2018, Planimeter, All rights reserved. =============--\n--\n-- Purpose:\n--\n--============================================================================--\n\nfunction framewo... | lua | chosen |
[
{
"from": "system",
"value": "Make sample app more interesting\n"
},
{
"from": "human",
"value": "local ffi = require('ffi')\nlocal tb = require('termbox')\ntb.tb_init()\nlocal width, height = tb.tb_width(), tb.tb_height()\np{tb=tb,width=width,height=height}\n\n\n\ntb.tb_select_output_mode(tb.TB... | lua | chosen |
[
{
"from": "system",
"value": "Support libraries are now loaded with love.filesystem.load rather than require; settings.lua is now copied to the user settings directory\n"
},
{
"from": "human",
"value": "emufun = {}\n\nrequire \"lfs\"\nrequire \"util\"\nrequire \"input\"\nrequire \"node\"\nrequir... | lua | chosen |
[
{
"from": "human",
"value": "Add rough cut of utility functions from Peter Billam.\n"
},
{
"from": "gpt",
"value": "--- Lua bindings for curses.\nmodule (\"curses\", package.seeall)\n\nrequire 'curses_c'\n\n-- These Lua functions detect number of args, like Unified Funcs in Perl Curses\n-- see h... | lua | chosen |
[
{
"from": "system",
"value": "Handle floating point in constant generation\n"
},
{
"from": "human",
"value": "#!/usr/bin/env lua\n\nlocal string_ex = require (\"string_ex\")\nlocal io = require (\"io\")\nlocal argv = arg\nlocal argc = table.maxn (argv)\n\nassert (argc == 1)\nloc... | lua | chosen |
[
{
"from": "human",
"value": "Add test for misc module\n"
},
{
"from": "gpt",
"value": "return require('lib/tap')(function (test)\n\n test(\"uv.guess_handle\", function (print, p, expect, uv)\n local types = {\n [0] = assert(uv.guess_handle(0)),\n assert(uv.guess_handle(1)),\n ... | lua | chosen |
[
{
"from": "human",
"value": "Implement coroutine that fetches emails from inbox.\n"
},
{
"from": "gpt",
"value": "require(\"email\")\n\nlocal function getLastEmailIdx(connection)\n local command = email.imapCommands.searchLast\n local response, err = connection:executeCommand(command)\n ... | lua | chosen |
[
{
"from": "system",
"value": "Fix the Wave Road disappearing instantly when entered\n\nBefore the Wave Road is hidden, we check if the player's HumanoidRootPart\nis inside of the Wave Road's region. Because there was no return, the\ncondition would evaluate to 'nil', hiding the Wave Road immediately.\n"
}... | lua | chosen |
[
{
"from": "system",
"value": "Add message pack (de)serialization for lua instances\n"
},
{
"from": "human",
"value": "local ffi = require 'ffi'\n\ngz = setmetatable({}, {__index = ffi.C})\n\ngz.string = ffi.string\n"
},
{
"from": "gpt",
"value": "local ffi = require 'ffi'\nlocal cmsg... | lua | chosen |
[
{
"from": "system",
"value": "Add debug information (FPS, frametime, memory).\n"
},
{
"from": "human",
"value": "local ScreenManager = require('lib/ScreenManager');\nlocal MainScreen = require('src/MainScreen');\n\nfunction love.load()\n ScreenManager.init(MainScreen.new());\nend\n\nfunction ... | lua | chosen |
[
{
"from": "human",
"value": "lua: Implement \"Hello world\" USDT example\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env bcc-lua\n--[[\nCopyright 2016 GitHub, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License... | lua | chosen |
[
{
"from": "system",
"value": "Remove explicit location directive on Generator project.\n"
},
{
"from": "human",
"value": "project \"CppSharp.Generator\"\n\n SetupManagedProject()\n\n kind \"SharedLib\"\n language \"C#\"\n location \".\"\n\n files { \"**.cs\", \"**verbs.txt\" }\n excludes... | lua | chosen |
[
{
"from": "system",
"value": "Use nn.Replicate to duplicate values\n"
},
{
"from": "human",
"value": "-- Creates aggregator module for a dueling architecture based on a number of discrete actions\nlocal DuelAggregator = function(m)\n local aggregator = nn.Sequential()\n local aggParallel = nn.... | lua | chosen |
[
{
"from": "human",
"value": "Add test case for tail recursion.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/lua\n\nrequire 'test'\n\nfunction fact_normal(x)\n local result = 1\n for i = 2, x do\n result = result * i\n end\n return result\nend\n\nfunction fact_recurse(x)\n if... | lua | chosen |
[
{
"from": "system",
"value": "Rewrite mkdir to be more portable\n"
},
{
"from": "human",
"value": "local path = require('path')\nlocal fs = require('fs')\n\nlocal exports = {}\n\nfunction exports.mkdirp(lpath, mode, callback)\n lpath = path.resolve('', lpath)\n fs.mkdir(lpath, mode, function(e... | lua | chosen |
[
{
"from": "human",
"value": "Add new promises for players service\n"
},
{
"from": "gpt",
"value": "--- Utility methods for async methods in Players service\n-- @module PlayersServicePromises.lua\n\nlocal require = require(game:GetService(\"ReplicatedStorage\"):WaitForChild(\"Nevermore\"))\n\nloc... | lua | chosen |
[
{
"from": "system",
"value": "Check for external URLs before adding to makefile.\n\nAlso adds linked URLs to the process, not just image URLs.\n"
},
{
"from": "human",
"value": "-- This filter adds all links to images in the document to the metadata.\n-- See https://pandoc.org/lua-filters.html\n... | lua | chosen |
[
{
"from": "human",
"value": "Implement query system in server\n"
},
{
"from": "gpt",
"value": "exports.name = \"creationix/coro-channel\"\nexports.version = \"1.0.0\"\n\nlocal uv = require('uv')\n\n-- Given a raw uv_stream_t userdara, return coro-friendly read/write functions.\nfunction exports.... | lua | chosen |
[
{
"from": "system",
"value": "Add speed changing to emulator script\n"
},
{
"from": "human",
"value": "prev = \"\";\nmsg = \"\";\n\nfunction write_file (filename, text)\n output = io.open(filename, \"w\");\n io.output(output);\n io.write(text);\n io.close(output);\nend;\n\nfunction r... | lua | chosen |
[
{
"from": "system",
"value": "Add error message when the CUDA module loading fails\n"
},
{
"from": "human",
"value": "local function load_nn()\n require 'torch'\n require 'nn'\nend\nlocal function load_cunn()\n require 'cutorch'\n require 'cunn'\nend\nlocal function load_cudnn()\n requ... | lua | chosen |
[
{
"from": "human",
"value": "Support for the Atlas Scientific EZO (tm) pH Circuit.\n\nSigned-off-by: Kalman Olah <aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d@kalmanolah.net>\n"
},
{
"from": "gpt",
"value": "-- Atlas Scientific EZO (tm) pH module\n-- http://atlas-scientific.com/product_pages/circuit... | lua | chosen |
[
{
"from": "system",
"value": "test(classes): Align specs with new class API\n"
},
{
"from": "human",
"value": "SILE = require(\"core/sile\")\n\nlocal tClass = SILE.classes.base {}\ntClass:declareFrame(\"a\", { left = \"1pt\", right = \"12pt\", top = \"1pt\", bottom = \"top(b)\" })\ntClass:declar... | lua | chosen |
[
{
"from": "human",
"value": "Add first part of test framework: parse tests.\n"
},
{
"from": "gpt",
"value": "--- Shallow table copy\nlocal function cp(t)\n local t1 = {}\n for k,v in pairs(t) do t1[k]=v end\n return t1\nend\n\n--- Path tokenizer, builds a table t for which t.token=true\n-- @p... | lua | chosen |
[
{
"from": "human",
"value": "Add test for m,',`\nFix jumping with ' (wasn't going to start of line)\nTidy up error output a little (remove extra newlines).\n"
},
{
"from": "gpt",
"value": "-- Test mark\ntest.open(\"ramps.txt\")\nlocal lineno = test.lineno\nlocal colno = test.colno\nlocal assertE... | lua | chosen |
[
{
"from": "system",
"value": "Make sure coroutines don't swallow errors\n\nChange-Id: Ic8692962a4442c9a727787703ae6becb31c17562\n"
},
{
"from": "human",
"value": "local UV = require('uv')\n\nfunction resume(...)\n coroutine.resume(co, ...)\nend\n\n-- Make functions work with coros or callbacks\... | lua | chosen |
[
{
"from": "system",
"value": "Add CPATH and LIBRARY_PATH to gmp module\n"
},
{
"from": "human",
"value": "help(\n[[\nThis module loads the Gnu Multi Precision Libraries into the environment.\n\n]])\n\nwhatis(\"Loads the Gnu Multi Precision Libraries\")\n\nlocal version = \"6.0.0\"\nlocal base = ... | lua | chosen |
[
{
"from": "system",
"value": "Add link to javadoc of the effect enum."
},
{
"from": "human",
"value": "--- Provides functions to spawn particles.\r\n-- @module rpgplus.particle\r\n\r\n--- Spawns particles at the given location\r\n-- @param location location\r\n-- @param effect effect as string\r... | lua | chosen |
[
{
"from": "system",
"value": "Use opt for keywordprg setting in md detect\n\nUsing opt should prevent the setting from persisting on other filetypes.\n"
},
{
"from": "human",
"value": "local map = require'utilities'.map\n\n-- Enable spell checking.\nvim.cmd('setlocal spell')\n\n-- Default to 4 s... | lua | chosen |
[
{
"from": "human",
"value": "chore(templates): Develop LPEG pattern to parse dropcap characters\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env lua\n\nlocal lpeg = require(\"lpeg\")\nlocal R, P, C = lpeg.R, lpeg.P, lpeg.C\n\nlocal D = require(\"pl.pretty\").dump\n\nlocal tests = {\n \"İbraniler... | lua | chosen |
[
{
"from": "system",
"value": "Move gl test before imgui test\n"
},
{
"from": "human",
"value": "-- Set the Lua module search path\npackage.path = './lua/?.lua'\n-- Load the game engine\nlocal viewport = require 'engine.viewport'\n-- Test module loading and binding. Must be called after the engin... | lua | chosen |
[
{
"from": "human",
"value": "Add test of ex commands with range.\n"
},
{
"from": "gpt",
"value": "-- Check that running :commands works.\n-- Add a dummy command\nlocal assertEq = test.assertEq\n\nlocal myvar = nil\nlocal vi_mode = require 'vi_mode'\nvi_mode.ex_mode.add_ex_command('tester', funct... | lua | chosen |
[
{
"from": "system",
"value": "Add asserts to socket logging test.\n"
},
{
"from": "human",
"value": "local log_sock = require\"logging.socket\"\n\nlocal logger = log_sock(\"localhost\", 5000)\n\nlogger:info(\"logging.socket test\")\nlogger:debug(\"debugging...\")\nlogger:error(\"error!\")\n\npri... | lua | chosen |
[
{
"from": "system",
"value": "feat: Hide some message on noice.\n\nSigned-off-by: Yoshio Sugiyama <d278fe5383150975c3f762683049de40f68a6e90@gmail.com>\n"
},
{
"from": "human",
"value": "local M = {}\n\nfunction M.config()\n require(\"noice\").setup({\n routes = {\n {\n ... | lua | chosen |
[
{
"from": "human",
"value": "Move sockets connection to separate file\n"
},
{
"from": "gpt",
"value": "local config = require 'config'\n\nlocal module = {}\n\nmodule.initSocket = function ()\n -- Create socket connection\n print('[WebSocket] Connecting to ws at ws://' .. config.ip .. ':' .. co... | lua | chosen |
[
{
"from": "system",
"value": "Fix output with lua 5.3"
},
{
"from": "human",
"value": "SILE.typesetter:typeset(SILE.toPoints(\"100%ph\") .. \" x \" .. SILE.toPoints(\"100%pw\"))\n"
},
{
"from": "gpt",
"value": "SILE.typesetter:typeset((\"%.0f x %.0f\"):format(SILE.toPoints(\"100%ph\"... | lua | chosen |
[
{
"from": "system",
"value": "Create cancellation tokens from maids\n"
},
{
"from": "human",
"value": "---\n-- @classmod CancelToken\n-- @author Quenty\n\nlocal require = require(game:GetService(\"ReplicatedStorage\"):WaitForChild(\"Nevermore\"))\n\nlocal Promise = require(\"Promise\")\nlocal Si... | lua | chosen |
[
{
"from": "system",
"value": "Apply an impulse instead of a force\n\nIt feels much nicer\n"
},
{
"from": "human",
"value": "local xacc = 2\nlocal yacc = 1\n\nfunction update(obj, current_time)\n\tlocal horinp = input.get('horizontal') * xacc\n\tlocal vertinp = input.get('vertical') * yacc\n\n\to... | lua | chosen |
[
{
"from": "system",
"value": "Use io.write instead of print\n"
},
{
"from": "human",
"value": "#!/usr/bin/env lua\ns = require(\"string\")\n\nfunction getRandomValue(lower, upper)\n return math.random(lower,upper)\nend\n\nfunction Main()\nlocal file = assert(io.popen('hostname', 'r'))\nlocal h... | lua | chosen |
[
{
"from": "human",
"value": "Add a lua playlist script for trailers.apple.com pages.\n\n"
},
{
"from": "gpt",
"value": "-- $Id$\n\n--[[\n Translate trailers.apple.com video webpages URLs to the corresponding\n movie URL\n--]]\n\n-- Probe function.\nfunction probe()\n return vlc.access =... | lua | chosen |
[
{
"from": "system",
"value": "Enhance seed file for Lua.\n"
},
{
"from": "human",
"value": "print(1)\nprint(1, 2)\n\ni = 0\nf(0 + 1 - 2 * 3 / 4 % 5)\n\nif i == 0 then\nelseif 1 < i then\nend\n\nwhile i ~= 0 do\nend\n\nrepeat\nuntil i == 0\n\nfor i = 0, 1, 1 do\nend\n\n;\n::L::\ni = 0\n\nif true ... | lua | chosen |
[
{
"from": "human",
"value": "Work on sequence rule rewrite\n"
},
{
"from": "gpt",
"value": "--[[\nCopyright 2015 Jeffrey Kegler\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the \"Software\"),\nto deal in the S... | lua | chosen |
[
{
"from": "system",
"value": "Select loadstring or load for Lua 5.1/5.2 respectively\n"
},
{
"from": "human",
"value": "socket = require(\"socket\");\nhost = host or \"localhost\";\nport = port or \"8383\";\nserver = assert(socket.bind(host, port));\nack = \"\\n\";\nwhile 1 do\n print(\"serve... | lua | chosen |
[
{
"from": "system",
"value": "Add new options for building: enable-big-endian and enable-ipv6\n"
},
{
"from": "human",
"value": "newoption {\n trigger = 'enable-big-endian',\n description = 'Enable big-endian byte order support (default is little-endian)'\n}\n\nsolution \"spillover\"\n... | lua | chosen |
[
{
"from": "system",
"value": "Add tests to the build\n"
},
{
"from": "human",
"value": "local cc = require \"rules.cc\"\n\ncc.binary {\n name = \"peclean\",\n srcs = glob \"src/*.cpp\",\n warnings = {\"all\", \"error\"},\n compiler_opts = {\"-g\"},\n}\n"
},
{
"from": "gpt",
... | lua | chosen |
[
{
"from": "human",
"value": "Add python module for image processing libs\n"
},
{
"from": "gpt",
"value": "help(\n[[\nThis module loads Python 2.7.7 with a set of packages for needed for the \nimage processing\n\n]])\n\nlocal version = \"2.7.7\"\nlocal base = \"/cvmfs/oasis.opensciencegrid.org/os... | lua | chosen |
[
{
"from": "human",
"value": "Add premake blueprint with commented out modules\n"
},
{
"from": "gpt",
"value": "solution('cgo')\nlanguage('C++')\n\ndefines({})\nincludedirs({\n 'include',\n 'external/boost/optional/include',\n 'external/boost/variant/include'\n})\nbuildoptions({\n '--pipe... | lua | chosen |
[
{
"from": "system",
"value": "Use extracted getPrintableValue helper instead of inline one\n"
},
{
"from": "human",
"value": "local function getPrintableValue(value)\n if value == nil then\n return 'nil'\n elseif type(value) == 'function' then\n return 'a function'\n elseif value == tru... | lua | chosen |
[
{
"from": "system",
"value": "Fix typo in speed tag\n"
},
{
"from": "human",
"value": "TagSpeed = {id = \"speed\", type=\"wide\"}\nTagSpeed.__index = TagSpeed\nfunction TagSpeed:Create(multiplier)\n local this =\n {\n mMultiplier = multiplier\n }\n\n setmetatable(this, self)\n... | lua | chosen |
[
{
"from": "system",
"value": "nvim: Add autocmd to run PackerSync on save\n"
},
{
"from": "human",
"value": "require(\"packer\").startup(function()\n use 'wbthomason/packer.nvim'\n\n use 'tpope/vim-sensible'\nend)\n\nvim.cmd [[autocmd BufWritePre * :%s/\\s\\+$//e]]\n\nvim.opt.fileencoding ... | lua | chosen |
[
{
"from": "system",
"value": "Fix minor issue with the pongo2 sample\n"
},
{
"from": "human",
"value": "title = \"This is the title\"\n\nfunction combine(a, b)\n return a .. \"&\" .. b\nend\n\nfunction times(a, b)\n return a * b\nend\n\nfunction moose()\n return \"MOOSE\"\nend\n"
},
{
... | lua | chosen |
[
{
"from": "system",
"value": "Add timeout in the coroutine mix to show it's not just FS operations\n\nChange-Id: I38e0d3af708d89aa3b158a3a1dfff0635f59da0b\n"
},
{
"from": "human",
"value": "local FS = require('fs');\nlocal Fiber = require('fiber')\n\nFiber.new(function (resume, wait)\n\n print(... | lua | chosen |
[
{
"from": "system",
"value": "Add the new model as resource\n\nForgot to do that in my last commit\n"
},
{
"from": "human",
"value": "AddCSLuaFile(\"autorun/client/sf_models.lua\")\n"
},
{
"from": "gpt",
"value": "AddCSLuaFile( \"autorun/client/sf_models.lua\" )\n\nresource.AddFile( ... | lua | chosen |
[
{
"from": "system",
"value": "Handle read errors properly in gumbo.parse_file() function\n"
},
{
"from": "human",
"value": "local have_ffi, ffi = pcall(require, \"ffi\")\nlocal want_ffi = os.getenv \"LGUMBO_USE_FFI\"\nlocal gumbo\n\nif have_ffi == true then\n if want_ffi == \"1\" then\n ... | lua | chosen |
[
{
"from": "system",
"value": "Fix all tests in /spec/spec.\n"
},
{
"from": "human",
"value": "-- mock application modules here\nApplication = { name = \"zebraapp\" }\n\n-- init\nrequire 'zebra.spec.init'\n"
},
{
"from": "gpt",
"value": "-- mock application modules here\npackage.loade... | lua | chosen |
[
{
"from": "human",
"value": "Add a new script for \"empty\" butterflies\n"
},
{
"from": "gpt",
"value": "--[[\r\nIllarion Server\r\n\r\nThis program is free software: you can redistribute it and/or modify it under\r\nthe terms of the GNU Affero General Public License as published by the Free\r\n... | lua | chosen |
[
{
"from": "human",
"value": "Add SILE page geometry for epub layout (for covers)\n"
},
{
"from": "gpt",
"value": "SILE.documentState.paperSize = SILE.paperSizeParser(1000 / 300 .. \"in x \" .. 1600 / 300 .. \"in\")\nSILE.documentState.orgPaperSize = SILE.documentState.paperSize\n"
}
] | lua | chosen |
[
{
"from": "human",
"value": "Add simple demo notepad application.\n"
},
{
"from": "gpt",
"value": "#! /usr/bin/env lua\n\n--[[--------------------------------------------------------------------------\n\n Sample GTK Application program, simple notepad implementation.\n\n Copyright (c) 2010 Pav... | lua | chosen |
[
{
"from": "system",
"value": "Update to new Roblox API (BREAKING CHANGE)\n"
},
{
"from": "human",
"value": "--- Utility functions for filtering text\n-- @module TextFilterUtils\n\nlocal require = require(game:GetService(\"ReplicatedStorage\"):WaitForChild(\"Nevermore\"))\n\nlocal TextService = g... | lua | chosen |
[
{
"from": "system",
"value": "Use current ressource as logger name\n"
},
{
"from": "human",
"value": "Logger = setmetatable({}, Logger)\nLogger.__index = Logger\nLogger.instance = clr.NLog.LogManager.GetLogger(\"MySQL\")\n\nfunction Logger.Trace(self, message)\n self:Get().Trace(message)\nend... | lua | chosen |
[
{
"from": "human",
"value": "Add missing leaky relu layer\n"
},
{
"from": "gpt",
"value": "--[[ from https://github.com/nagadomi/waifu2x/blob/master/lib/LeakyReLU.lua ]]--\nif nn.LeakyReLU then\n return\nend\nlocal LeakyReLU, parent = torch.class('nn.LeakyReLU','nn.Module')\n \nfunction LeakyR... | lua | chosen |
[
{
"from": "human",
"value": "Convert ECMWF precipitation form to FMI number space\n"
},
{
"from": "gpt",
"value": "-- Convert ECMWF precipitation form values to match FMI values.\n--\n-- 0: No precipitation form -------> missing\n-- 1: Rain -----> 1 rain\n-- 3: Freezing rain -----> 5 freezing ra... | lua | chosen |
[
{
"from": "system",
"value": "Revert \"Persistent replacements (might work)\"\n\nThis reverts commit 6a250e9ce78ec684683c3290065c010b53a2c06a.\n"
},
{
"from": "human",
"value": "local CircularBuffer = require (\"circularbuffer\")\n\nsed = sed or {}\nsed.messages = CircularBuffer (20)\n\nlocal pe... | lua | chosen |
[
{
"from": "system",
"value": "Improve output to be more readable when a test fails\n"
},
{
"from": "human",
"value": "-- This can hardly be called a proper test, but it should help refactoring the CLI functionality (no logic should be changed)\r\n\r\nlocal commands = {\r\n\t[\"luvi .\"] = \"lit.... | lua | chosen |
[
{
"from": "system",
"value": "Add \\href command for handling external hyperlinks\n"
},
{
"from": "human",
"value": "SILE.require(\"packages/verbatim\")\n\nlocal inputfilter = SILE.require(\"packages/inputfilter\").exports\n\nlocal urlFilter = function (node, content, breakpat)\n if type(node) ... | lua | chosen |
[
{
"from": "system",
"value": "Set USER_RAM0_F32 register with OutputVoltage"
},
{
"from": "human",
"value": "print(\"Output triangle wave centered on 2V. Analog output is DAC0. Update at 100Hz\")\nlocal OutputVoltage = 0\nlocal Step = 0.02\nlocal increasing = 1\n\nlocal checkInterval=LJ.CheckInt... | lua | chosen |
[
{
"from": "system",
"value": "Add toolchain dependency to hi-sdk\n"
},
{
"from": "human",
"value": "-- HiSilicon Linux SDK\n\npackage { 'make', 'host',\n source = 'make-3.81.tar.bz2'\n}\n\npackage { 'hi-kernel' }\n\npackage { 'hi-sdk', 'target',\n { 'tools' },\n { 'prepare',\n ... | lua | chosen |
[
{
"from": "system",
"value": "Add test and include directories for managing code.\n"
},
{
"from": "human",
"value": "-- (c) Derek Dupras 2017, All Rights Reserved.\n\n\n-- premake5.lua\nworkspace \"LibSort\"\n configurations { \"Debug\", \"Release\" }\n location \"build\"\n\nproject \"LibSor... | lua | chosen |
[
{
"from": "system",
"value": "Fix bug w/ lookup table exact matches & zero interpolation bugs\n"
},
{
"from": "human",
"value": "-- some utility methods for the space probe\n\nfunction log(message)\n\tprint(os.date() .. \" \" .. tostring(message))\nend\n\nfunction round(n)\n\treturn math.floor(n... | lua | chosen |
[
{
"from": "system",
"value": "Bump release version to v0.0.46\n"
},
{
"from": "human",
"value": "function love.conf(t)\n t.title = \"Journey to the Center of Hawkthorne v0.0.45\"\n t.author = \"Kyle Conroy\"\n t.version = \"0.8.0\"\n t.identity ... | lua | chosen |
[
{
"from": "system",
"value": "Use ffi bindings instead of box.info for uptime/version.\n"
},
{
"from": "human",
"value": "-- init.lua -- internal file\n\n-- Override pcall to support Tarantool exceptions\n\nlocal ffi = require('ffi')\nffi.cdef[[\nchar *\ntarantool_error_message(void);\n]]\n\nloc... | lua | chosen |
[
{
"from": "human",
"value": "Add test of c-^ to switch to the previous buffer.\n"
},
{
"from": "gpt",
"value": "test.open('words.txt')\nlocal assertEq = test.assertEq\nlocal key = test.key\nassertEq(buffer.filename, 'files/words.txt')\ntest.open('foo.xml')\nassertEq(buffer.filename, 'files/foo.x... | lua | chosen |
[
{
"from": "system",
"value": "Edit docgen to ignore the 'files' category.\n"
},
{
"from": "human",
"value": "\r\nrequire \"luadoc\"\r\n\r\nlocal outputdir = arg[1] or \"../doc/\"\r\nlocal sourcecode = arg[2] or \"../lua/starfall\"\r\n\r\nreturn luadoc.main({sourcecode}, {\r\n\toutput_dir = outpu... | lua | chosen |
[
{
"from": "system",
"value": "Use the putty.bat in the utils folder\n"
},
{
"from": "human",
"value": "-- Press F1 to set up a simple Io example\n\nfunction f3Pressed()\n local r,e = iolang(getBufferText())\n svrSend(r, sck2)\n svrSend(\"\\n\", sck2)\n svrSend(e, sck2)\n svrSend(\"\\n\", sc... | lua | chosen |
[
{
"from": "system",
"value": "Update to align with left screen edge\n"
},
{
"from": "human",
"value": "if (get_window_role() == \"desktop-term\") then\n set_window_geometry(84,14,1540,1032);\n undecorate_window();\n set_skip_pager(true);\n set_skip_tasklist(true);\n set_window_type(\"W... | lua | chosen |
[
{
"from": "system",
"value": "style(tests): Fix shadowed variable in busted test\n\n...yes CI should have caught this. And it did, but I thought I'd pushed\nan amended commit to the new-documentation branch with this fix. Turns\nout I forgot, and since I pushed that though in spite of CI because of\nthe anc... | lua | chosen |
[
{
"from": "human",
"value": "Add a package which provides info nodes, useful for index entries, page-specific running headers etc."
},
{
"from": "gpt",
"value": "-- Info nodes are used to store information about what actually ends up on which page.\n-- Index terms are an obvious use for this, as... | lua | chosen |
[
{
"from": "system",
"value": "Add aliases for diamond mod\n"
},
{
"from": "human",
"value": "-- Minetest 0.4 mod: external_legacy\n-- See README.txt for licensing and other information.\n\n-- Aliases to support moreores' ores\nminetest.register_alias(\"moreores:mineral_gold\", \"default:stone_wi... | lua | chosen |
[
{
"from": "system",
"value": "Use mac byte as exadecimal\n"
},
{
"from": "human",
"value": "#!/usr/bin/lua\n\nutils = {}\n\nfunction utils.split(string, sep)\n local ret = {}\n for token in string.gmatch(string, \"[^\"..sep..\"]+\") do table.insert(ret, token) end\n return ret\nend\n\nf... | lua | chosen |
[
{
"from": "system",
"value": "minor(Hammerspoon): Remove hardcoded internal audio, allow system to take over if not USB audio\n"
},
{
"from": "human",
"value": "-- Define audio device names for headphone/speaker switching\nlocal usbAudioSearch = \"VIA Technologies\" -- USB sound card\nlocal inte... | lua | chosen |
[
{
"from": "human",
"value": "Allow the player to stand up after being seated\n"
},
{
"from": "gpt",
"value": "--[[\n Temporarily enables players to jump when they're seated.\n\n Seats only allow you to stand up from them by jumping. Because we disable\n jumping globally in the DisableStates s... | lua | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.