This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lookUp :: Char -> [(Char, Char)] -> Char | |
lookUp needle xs = if (null selected) then needle else snd $ selected !! 0 | |
where | |
selected = [x | x <- xs, fst x == needle] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: edf/edf.lua | |
=================================================================== | |
--- edf/edf.lua (revision 1024) | |
+++ edf/edf.lua (working copy) | |
@@ -408,7 +408,7 @@ | |
for dataField, dataDefinition in pairs(elementDefinition.data) do | |
local checkedData = edfCheckElementData(theElement, dataField, dataDefinition) | |
if checkedData == nil then | |
- outputDebugString('Failed validation for ' .. elementType .. '!' .. dataField) | |
+ exports.editor_gui:outputMessage("Unable to create element; validation failed for "..elementType.."!"..dataField) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate a 440 Hz square waveform in Pygame by building an array of samples and play | |
# it for 5 seconds. Change the hard-coded 440 to another value to generate a different | |
# pitch. | |
# | |
# Run with the following command: | |
# python pygame-play-tone.py | |
from array import array | |
from time import sleep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Developer: sbx320 | |
-- License: MIT | |
-- Github Repos: https://github.com/sbx320/lua_utils | |
--// classlib | |
--|| A library providing several tools to enhance OOP with MTA and Lua | |
--\\ | |
SERVER = triggerServerEvent == nil | |
CLIENT = not SERVER | |
DEBUG = DEBUG or false |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:gsub("&#%d%d%d%d;", decode) | |
function decode(str) | |
local num = tonumber(str:sub(3,6)) | |
local first = math.floor(num/4096) | |
num = num - 4096 * first | |
return string.char(first+224, math.floor(num/64)+128, num%64+128) | |
end |