This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
namespace = {} | |
namespace.class = {} | |
namespace.class.__index=namespace.class | |
function namespace.class:create(name) | |
print("Create a class") | |
local l = {} | |
setmetatable(l, namespace.class) | |
l.m_name = name |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
---------------------------------------------------------------------------------------------------- | |
--- Making Lua look like Prolog: | |
--- | |
--- Let's use metatables for something other than emulating prototype-based OO. By making the | |
--- __index metamethod create values for undefined things, we can make Lua look like Prolog! | |
--- We create empty tables for anything starting with a capital letter, functions that populate | |
--- those tables for lowercase things (to assign relationships) and if a name begins with "is_" | |
--- then it becomes a function that queries those tables. | |
---------------------------------------------------------------------------------------------------- |
# Breif - A minimal working CMakeLists.txt for goggle unittesting | |
# Author - Fredrik Persson - [email protected] | |
# Licens - BSD | |
cmake_minimum_required (VERSION 2.6) | |
project(demo) | |
find_package (GTest REQUIRED) | |
include_directories(${GTest_INCLUDE_DIRS}) |
cmake_minimum_required (VERSION 2.6) | |
project(demo) | |
find_package(Boost 1.4.2) | |
include_directories(${Boost_INCLUDE_DIR}) | |
set(CORELIBS ${Boost_LIBRARIES}) | |
cmake_minimum_required (VERSION 2.6) | |
project(demo) | |
find_package(Boost 1.4.2) | |
include_directories(${Boost_INCLUDE_DIR}) | |
set(CORELIBS ${Boost_LIBRARIES}) | |
#!/bin/bash | |
#Desc: Ett mindre fint bashscript för att skapa en mpeg-film av ett gäng bilder | |
# med morphad övergång mellan bilderna. Scriptet kräver ffmpeg och ImageMagick. | |
#Version: 1.1 | |
#Coder: Fredrik Persson | |
#E-mail: [email protected] | |
#Download/webpage: | |
#Licens: BSD | |
#TODO: Exif-rotation? |
import java.io.File; | |
import java.io.RandomAccessFile; | |
import java.nio.channels.FileChannel; | |
import java.nio.channels.FileLock; | |
import java.nio.channels.OverlappingFileLockException; | |
import java.util.Date; | |
/** | |
* @author fredrik Persson |
package test.demo; | |
import java.io.File; | |
import java.io.RandomAccessFile; | |
import java.nio.channels.FileChannel; | |
import java.nio.channels.FileLock; | |
import java.util.Date; | |
import android.app.Activity; | |
import android.os.Bundle; |
package test.demo; | |
import java.io.File; | |
import java.io.RandomAccessFile; | |
import java.nio.channels.FileChannel; | |
import java.nio.channels.FileLock; | |
import java.util.Date; | |
import android.app.Activity; | |
import android.os.Bundle; |