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 <UIKit/UIKit.h> | |
#import <QuartzCore/QuartzCore.h> | |
#import <OpenGLES/ES1/gl.h> | |
#import <OpenGLES/ES1/glext.h> | |
@interface OGLESView : UIView { | |
EAGLContext * glContext; | |
GLuint framebuffer; | |
GLuint renderbuffer; | |
} |
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
#include <iostream> | |
template <size_t N> | |
inline void foo(const char (&)[N]) | |
{ | |
std::cout << "strlen(x) = " << N << std::endl; | |
} | |
int main() | |
{ |
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
#include <iostream> | |
struct Foo | |
{ | |
void One(); | |
}; | |
struct Baz : Foo | |
{ | |
void Two(); |
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
#include <iostream> | |
struct Foo | |
{ | |
int one; | |
}; | |
struct Bar | |
{ | |
char one; |
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
-- Problem: Find the 51000000000-th character of the string (wordNumber Infinity) | |
-- where a wordNumber is defined as | |
-- | |
-- wordNumber 1 = "one" | |
-- wordNumber 2 = "onetwo" | |
-- wordNumber 3 = "onetwothree" | |
-- wordNumber 15 = "onetwothreefourfivesixseveneightnineteneleventwelvethirteenfourteenfifteen" | |
-- ... | |
-- | |
-- The answer should be presented as ( sum of all numbers up to that point |
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
{-# LANGUAGE OverlappingInstances #-} | |
{-# LANGUAGE TypeSynonymInstances #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
-- Type-level functions using functional dependencies |
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
-- Solitaire Cipher | |
-- http://www.rubyquiz.com/quiz1.html | |
module Solitaire where | |
import Data.Sequence ((><), (|>), (<|)) | |
import qualified Data.Sequence as S | |
import Debug.Trace | |
import Control.Arrow |
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
{-# LANGUAGE RecordWildCards #-} | |
{-# LANGUAGE NamedFieldPuns #-} | |
-- Chris Yuen <chris@kizzx2.com> | |
-- ITA Software's "Word Numbers" puzzle (http://www.itasoftware.com/careers/puzzle_archive.html) | |
import Data.Function | |
import Data.List | |
-- | For this problem we'll trie like structure. An "umbrella" value is |
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
# Usage: | |
# In premake4.lua use StaticLib for libraries; ConsoleApp for applications. | |
# Then run `rake xcode && rake xcodebuild` | |
ENV_DEFAULTS = { | |
'CONFIGURATION' => "Debug", | |
'SDK' => "iphonesimulator", | |
} | |
SDK_TO_ARCH = { |
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
// fun.cpp | |
extern "C" | |
{ | |
#include <lua.h> | |
#include <lauxlib.h> | |
#include <lualib.h> | |
} | |
#include <iostream> |
OlderNewer