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
<?php | |
//Object Oriented Programming in PHP Intro #2 | |
class bank { | |
private $name = ''; | |
public function __construct($name) { | |
echo "Starting the bank: $name."; | |
$this->name=$name; | |
} | |
public function iHaveThisMuchMoney(){ | |
$sum = 0; |
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
<?php | |
//PHP Object Oriented Programming Tutorial 3 | |
interface person { | |
function myName(); | |
function myPosition(); | |
} | |
class employee implements person { | |
public function myName(){ | |
return "Happy ". ucfirst(__CLASS__); | |
} |
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> | |
#include <OGRE/OgreRoot.h> | |
#include <OGRE/OgreRenderSystem.h> | |
#include <OGRE/OgreRenderWindow.h> | |
#include <OGRE/OgreSceneManager.h> | |
#include <OGRE/OgreColourValue.h> | |
#include <OGRE/OgreCamera.h> | |
#include <OGRE/OgreViewport.h> | |
#include <OGRE/OgreEntity.h> | |
#include <OGRE/OgreWindowEventUtilities.h> |
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 cleanDatabase() { | |
Log.warning("db_cleanup", "Attempting to clean Database") | |
_ = Iter.map(function(plant){ | |
//Db.remove(@/cactusdb/Plants[{id: plant.id}]) | |
Log.warning("db_cleanup", "Deleting Plant {plant.id}") | |
void | |
},Model.get_plants()) | |
_ = Iter.map(function(display){ | |
Log.warning("db_cleanup", "Deleting Plant Display {display.id}") |
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> | |
using namespace std; | |
unsigned long attrID2(const char * ls){ | |
const unsigned long golden = 0x9E3779B97f4A7C15; | |
unsigned long result = 0; | |
int offset = 0; | |
for(int i=0; ls[i] != 0; i++,offset = (offset + 1) % sizeof(long)){ | |
const unsigned long p = ((long)ls[i] << (offset*8)); | |
const unsigned long p2 = ((long)1 << (i%(sizeof(long)*8))) & golden; |
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
0x7fff721a6180: START LEAK DETECTED! | |
0x7fff721a6180: Meatless has 1 entries! | |
0x7fff721a6180: Meatless 0xbeef | |
0x7fff721a6180: BANANAS has 1 entries! | |
0x7fff721a6180: BANANAS 0xdead | |
0x7fff721a6180: Apples has 2 entries! | |
0x7fff721a6180: Apples 0xdeadbeef | |
0x7fff721a6180: Apples 0xdeadeeeeee |
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
-- No hiding Route | |
import Yesod as Import | |
-- ... | |
--Assumes that "App" is your context | |
type RouteRenderer = (Route App -> Text) |
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
class KVEntity a where | |
kvIdentity :: a -> KVIdentifier | |
kvProperties :: a -> Value | |
kvLastModified :: a -> UTCTime | |
kvClass :: a -> KVClass | |
kvRelations :: a -> [KVLink] | |
kvCachedRels :: a -> [a] | |
kvProperties _ = emptyObject | |
kvCachedRels _ = [] |
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
-- Suppose I have this type class | |
externalFunction :: SomeData -> Blah -> a -> SomethingElse | |
class Something a where | |
someConstant :: a -> SomeData | |
another :: Blah -> a -> SomethingElse | |
another b a = externalFunction (someConstant (undefined :: "This Type class instance")) b a |
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 DeriveDataTypeable #-} | |
module KV2 where | |
import qualified Solar.Data.KV as K | |
import System.IO.Unsafe(unsafePerformIO) | |
import Data.Time.Clock | |
import Data.Text(pack) | |
import Data.Typeable | |
import GHC.Generics as G | |
OlderNewer