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
local type = type; | |
local function deepcopy(obj) | |
local new = {}; | |
local type, constant = type, "table"; | |
for i,v in pairs(obj) do | |
if type(v) == constant then -- if type == "table" | |
new[i] = deepcopy(v); | |
else | |
new[i] = v; |
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
function copy(t) | |
local type, const = type, "table"; | |
local new = {}; | |
for i, v in next, t do | |
if type(v) == const then | |
new[i] = copy(v); | |
else | |
new[i] = v; | |
end | |
end |
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
function int(t) | |
return t:byte(1)+t:byte(2)*0x100+t:byte(3)*0x10000+t:byte(4)*0x1000000 | |
end | |
function num_args(func) | |
local ok, dump = pcall(string.dump,func) | |
if (not ok) then return -1 end | |
local cursor = 13 | |
local offset = int(dump:sub(cursor)) | |
cursor = cursor + offset + 13 |
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
--[[ | |
the Advanced Roblox CryptoSystem, or ARCS, is being designed to bring better security to roblox games, such as private servers. | |
While still in its infancy, hopefully one day, ARCS will become a suitable means of data encryption. | |
ARCS currently supplies 2 features. | |
A secure Hash function, | |
And secure encryption algorithm. |
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
-- Original Author: http://www.roblox.com/Crypt-item?id=40531920 | |
-- A readable mirror: http://roblox-asset.comoj.com/40531920 | |
-- | |
-- I have modified the final bxor() declaration at the bottom | |
-- for optimization (CSE via local k1, k2, k3, k4) | |
local ins=table.insert | |
local mf=math.floor | |
local bxor=function(a,b) |
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
-- ~/.textadept/modules/lua/debugger2.lua | |
-- My derived work, based on ~/.textadept/modules/lua/debugger.lua | |
require 'textadept.debugger' | |
local mobdebug = require 'lua.mobdebug' | |
local handle = mobdebug.handle; | |
local debugger = _M.textadept.debugger.new('lua'); | |
_M.lua.debugger = debugger; |
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
import Data.Numbers.Primes | |
p007 n = last $ take n $ filter isPrime [1..] | |
main = print $ p007 10001 |
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
set nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" let Vundle manage Vundle | |
" required! | |
Bundle 'gmarik/vundle' | |
Bundle 'leafo/moonscript-vim' |
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
struct Buffer<T> { | |
list: ~[Option<T>], | |
size: uint, | |
} | |
impl<T: Clone> Buffer<T> { | |
pub fn new(size: uint) -> Buffer<T> { | |
let mut list: ~[Option<T>] = ~[]; | |
list.reserve(size); | |
Buffer { | |
list: list, |
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
extern crate regexp; | |
static VARIANTS : [&'static str, ..9 ] = [ | |
"agggtaaa|tttaccct", | |
"[cgt]gggtaaa|tttaccc[acg]", | |
"a[act]ggtaaa|tttacc[agt]t", | |
"ag[act]gtaaa|tttac[agt]ct", | |
"agg[act]taaa|ttta[agt]cct", | |
"aggg[acg]aaa|ttt[cgt]ccct", | |
"agggt[cgt]aa|tt[acg]accct", |
OlderNewer