This file contains hidden or 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
float4x4 gWorldViewProjection : WORLDVIEWPROJECTION; | |
struct VSInput | |
{ | |
float3 Position : POSITION0; | |
float4 Diffuse : COLOR0; | |
float2 TexCoord : TEXCOORD0; | |
}; | |
struct PSInput | |
{ | |
float4 Position : POSITION0; |
This file contains hidden or 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 KEY = "sampletext" | |
addEventHandler("onResourceStart", resourceRoot, function() | |
-- ENCODE | |
local file = File.open("test.txt") | |
local raw = file:read(file.size) | |
file:close() | |
local len = #raw | |
local lent = {} |
This file contains hidden or 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
package com.carloseduardo.model; | |
import com.carloseduardo.constants.KnownClasses; | |
import com.carloseduardo.exception.UnknownModelException; | |
import io.realm.RealmObject; | |
import io.realm.annotations.PrimaryKey; | |
import io.realm.annotations.Required; | |
/** |
This file contains hidden or 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 map_setSoundProperty = {["SampleRate"] = 1, ["Tempo"] = 2, ["Pitch"] = 3, ["Reversed"] = 4} | |
function setSoundProperty(sound, property, value) | |
-- Only handle sound elements | |
if (not isElement(sound) or getElementType(sound) ~= "sound") then return end | |
-- Get the current properties | |
local properties = { getSoundProperties(sound) } | |
-- Get the index by using the property parameter | |
local index = map_setSoundProperty[property] |
This file contains hidden or 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
// -*- compile-command: "clang++ -ggdb -o random_selection -std=c++0x -stdlib=libc++ random_selection.cpp" -*- | |
//Reference implementation for doing random number selection from a container. | |
//Kept for posterity and because I made a surprising number of subtle mistakes on my first attempt. | |
#include <random> | |
#include <iterator> | |
template <typename RandomGenerator = std::default_random_engine> | |
struct random_selector | |
{ | |
//On most platforms, you probably want to use std::random_device("/dev/urandom")() |