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
Index: ext/spl/spl_classloader.c | |
=================================================================== | |
--- ext/spl/spl_classloader.c (revision 0) | |
+++ ext/spl/spl_classloader.c (revision 0) | |
@@ -0,0 +1,464 @@ | |
+/* | |
+ +----------------------------------------------------------------------+ | |
+ | PHP Version 5 | | |
+ +----------------------------------------------------------------------+ | |
+ | Copyright (c) 1997-2009 The PHP Group | |
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 | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
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 | |
function checkUrl($url) { | |
if( !extension_loaded('curl')) { | |
trigger_error('The curl extension was not loaded.', E_USER_ERROR); | |
} | |
$status = preg_match('/^https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.\-?]*(\?\S+)?)?)?$/i', $url); | |
if( $status === false ) { |
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 | |
/** | |
* @see Zend_Session | |
*/ | |
require_once 'Zend/Session.php'; | |
/** | |
* @see Zend_Config | |
*/ |
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 | |
// Access a property with no restrictions | |
function stole($object,$property){ | |
$dict = (array)$object; | |
$class = get_class($object); | |
return isset($dict[$property])? | |
$dict[$property]:(isset($dict["\0*\0$property"])? | |
$dict["\0*\0$property"]:(isset($dict["\0$class\0$property"])? | |
$dict["\0$class\0$property"]:null)); |
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
''' listing 6: pi_mp.py | |
Multiprocessing based code to estimate the value of PI | |
using monte carlo sampling | |
Ref: http://math.fullerton.edu/mathews/n2003/montecarlopimod.html | |
Uses workers: | |
http://docs.python.org/library/multiprocessing.html#module-multiprocessing.pool | |
''' | |
import random |
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
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head |
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
/* Get size of viewport */ | |
layout.winWidth = $(window).width(); | |
layout.winHeight = $(window).height(); | |
/* Get available width by subtracting the size of the rest of the components */ | |
var dwidth = layout.winWidth - 63; | |
var dheight = layout.winHeight - 111; | |
/* Check if scrollbars are needed (cheight and cwidth are canvas element's height and width)*/ | |
var vScrollNeeded = dheight < app.cheight; |
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
var person = {}; | |
Object.defineProperty(person, 'firstName', { | |
get: function() { return firstName; }, | |
set: function(newName) { firstName = newName; }, | |
enumerable: true | |
}); | |
Object.defineProperty(person, 'lastName', { | |
get: function() { return lastName; }, |
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
./configure \ | |
--prefix=/usr/local \ | |
--disable-debug \ | |
--enable-pdo \ | |
--enable-inline-optimization \ | |
--enable-xml \ | |
--enable-fpm \ | |
--enable-ftp \ | |
--enable-gd-jis-conv \ | |
--enable-intl \ |
OlderNewer