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
-- Creates an image | |
-- uses LuaPlayer as Framework | |
local image = Image.createEmpty(480,272) | |
local white = Color.new(255,255,255) | |
--Fractal Size | |
local size = 480 | |
--Draws Fractal |
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
--LUA Txt to PDF Converter | |
--Thanks to Takeshi Kanno (HaruFreePDF Lib) and LUAHPDF Module | |
--We load the library | |
require 'hpdf' | |
--Assuming filename 'input.txt' | |
local filename = 'input.txt' | |
--We seek the file to collect data inside a table |
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
--Custom function that collects ID3 tag from mp3 File | |
function getID3(filename) | |
local ID3 = {} | |
local file = assert(io.open(filename,"rb")) | |
file:seek("end") | |
file:seek("cur",-128) | |
ID3.TAG = file:read(3) | |
ID3.TITLE = file:read(30) | |
ID3.INTERPRET = file:read(30) |
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
-- Quick Sheet on How to load and draw MD2 model using IrrLua | |
-- IrrLua can be found at http://irrlua.sourceforge.net/ | |
require "irr" | |
local MyEventReceiver = {} | |
function MyEventReceiver:OnEvent(Event) | |
if Event.EventType == irr.EET_KEY_INPUT_EVENT then | |
return self:OnKeyEvent(Event.KeyInput.Key, Event.KeyInput.PressedDown, Event.KeyInput.Control, Event.KeyInput.Shift) |
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
---------------------------- | |
--LIB DOFILE | |
--Roland Yonaba (SeanPaul223) | |
--03/08/2010 | |
---------------------------- | |
----------------------------------------------------------------------------------------- | |
--The main purpose of this library is helping Lua coders to debug their apps bypassing the | |
--in-built error screen, which blocks the running process |
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
-- A Library that provides naive-implemented algorithms for image processing | |
-- All functions assumes 'img' is a reference to a Drawable object loaded onto memory. | |
--Flips vertically a picture | |
function getImageFlipVertical(img) | |
local w = img:width()-1 | |
local h = img:height()-1 | |
local flip = Image.createEmpty(w+1,h+1) | |
for y = h,0,-1 do | |
for x = 0,w,1 do |
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
-- A simple way to read .srt subtitles while streaming music! | |
-- This code uses LuaPlayer for PSP as framework. | |
local subs = {} | |
local _time = {} | |
local current_sub = 1 | |
function get_time(tm) | |
local startTime,endTime | |
local t1={} |
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
--Returns a binary string computed from a decimal arg | |
function dec2bin(dec) | |
local r,q | |
local str="" | |
repeat | |
q = math.modf(dec/2) | |
r= dec%2 | |
dec=q | |
str = str..tostring(r) |
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
-- Burrows-Wheeler Transform | |
-- Algorithm used for data compressing implemented through Lua | |
function encode(word) | |
local t={word} | |
local pos = 1 | |
local cat = string.len(word) | |
for i=cat-1,1,-1 do |
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
-- A function that return a fraction computed from a floating number. | |
function int(arg) | |
local e,d = math.modf(arg) | |
return e | |
end | |
function dec2fr(decimal,acc) | |
local acc = acc | |
if not acc then acc = 1E-4 end |
OlderNewer