Learning Any Kind of Procedure

Do light skims and reviews of everything involved in procedure. (Repetition: Priming and Review)

Create brief summaries in your own words that describe each major topics in the procedure. (Summarization. Meaning Making. Chunking)
A goal is to create one word titles for each major part of the procedure. When you re-visit that one-word you should be able to re-call more details about that topic.

Order, Compare and Contrast all of the major topics in the procedure. (Critical Thought).

Go through each major topic in more detail – in-order and at random – each time making sure to not only understand the particulars of the new details but to also understand and simulate how these new details fit in with all of the other major topics. (Repetition: Rote work, Review, and Revising. Critical Thought. Meaning Making. Trial & Error. Chunking. Quantity Control)
Break up the details in each major topic and skip around – don’t do entire topic at once.

The idea is that you get the benefit of learning and experience the entire procedure each time you learn new details about a particular topic and permanently experiencing the full significance of each detail. You create many neural connections throughout the entire learning process, and each connection is strong.

If you did a single part in-order in its entirety, you’d forget the important details of each topic as you progress and also not benefit the full significance of that detail and how it fits in with the rest of the procedure topics.

You also get the benefit of being able to be effective and knowledgable in a practical way from essentially the very beginning of the learning process.

Sources:
*Teaching with the Brain in Mind by Eric Jensen

Compiling Cassandra DataStax PHP Driver on MAMP

DataStax PHP Driver

DataStax Driver PHP Docs

OSX w/ MAMP:
Following installation tutorial
Installed dependencies using brew …

brew install libuv cmake gmp

Had to add MAMP php bin to PATH …

export PATH="$PATH:/Applications/MAMP/bin/php/php5.6.2/bin/"

I added that to my ~./bash_profile.

Had to install autoconf …

brew install autoconf

Had to install pcre …

brew install pcre

In the end the full make install failed bcs it was trying to use native php paths instead of the MAMP ones….

+ make install
Installing shared extensions:     /usr/lib/php/extensions/no-debug-non-zts-20100525/
cp: /usr/lib/php/extensions/no-debug-non-zts-20100525/#INST@51524#: Permission denied
make: *** [install-modules] Error 1

I just manually copied the php module to the right place. i.e…

cp php-driver/ext/modules/cassandra.so /Applications/MAMP/bin/php/php5.6.2/modules/.

Then added the extension=cassandra.so to my php.ini

UPDATE:
The above compilation didn’t work. I got an error when php starts up (enable startup error displays in php.ini) that says module isn’t compiled right…

MacBook-Pro:code User$ php -v

Warning: PHP Startup: cassandra: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20131226
These options need to match
 in Unknown on line 0
PHP 5.6.2 (cli) (built: Oct 20 2014 16:21:27) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies

This is bcs we’re trying to use php that’s linked in MAMP (/Applications/MAMP/bin/php), but the module was compiled using the OSX php installation (/usr/bin/php).. and they’re different versions.
The fix is to download the correct php version source and make sure the module compilation uses the correct version’s source.
This link outlines compiling cassandra php extensions with correct source.
I also made sym-links for php, php-config, and phpize like this example.
This is some general background information on compiling php extensions on alternative configurations.
I also edit the ext/install.sh script with the following code…

echo "Compiling and installing the extension..."
phpdir=/Applications/MAMP/bin/php/php5.6.2
$phpdir/bin/phpize

`$phpsizecommand`

echo ./configure --with-php-config=$phpdir/bin/php-config --with-cassandra=$builddir --with-libdir=lib
LIBS="-lssl -lz -luv -lm -lstdc++" LDFLAGS="-L$builddir/lib" ./configure --with-cassandra=$builddir --with-libdir=lib --with-php-config=$phpdir/bin/php-config
make
make install

rm -Rf /tmp/php-driver-installation

Also don’t forget to do a clean between code changes

make clean

General Docs
DataStax PHP Driver

DataStax Driver PHP Docs

Native Linux
Follow DataStax linux installation steps (after installing dependencies). It works if you have conventional setup. You will need to install a lot of c++ development libraries for the compilation to work. Running a package manager install for a popular application build-tools should give you everything you need. I used…

sudo apt-get install build-essential
apt-get build-dep nginx
apt-get install php5-dev

Make sure to add cassandra to php.ini
; DataStax PHP Driver
extension=cassandra.so
OSX w/ MAMP:
For MAMP we need to hack the extension compilation scripts to point to the correct php directories. If you don’t you’ll get an an error when php starts up (enable startup error displays in php.ini) like this…

MacBook-Pro:code User$ php -v

Warning: PHP Startup: cassandra: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20131226
These options need to match
 in Unknown on line 0
PHP 5.6.2 (cli) (built: Oct 20 2014 16:21:27) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies

This is bcs we’re trying to use php that’s linked in MAMP (/Applications/MAMP/bin/php), but the module was compiled using the OSX php installation (/usr/bin/php).. and they’re different versions.

The fix is to download the correct php version source and make sure the module compilation uses the correct version’s source.
This link outlines compiling cassandra php extensions with correct source.

I also made sym-links for php, php-config, and phpize like this example.
This is some general background information on compiling php extensions on alternative configurations.

I also edit the ext/install.sh script with the following code…

echo "Compiling and installing the extension..."
phpdir=/Applications/MAMP/bin/php/php5.6.2 {{put in your correct php version directory}}
$phpdir/bin/phpize

`$phpsizecommand`

echo ./configure --with-php-config=$phpdir/bin/php-config --with-cassandra=$builddir --with-libdir=lib
LIBS="-lssl -lz -luv -lm -lstdc++" LDFLAGS="-L$builddir/lib" ./configure --with-cassandra=$builddir --with-libdir=lib --with-php-config=$phpdir/bin/php-config
make
make install

rm -Rf /tmp/php-driver-installation

Also don’t forget to do a clean between code changes

make clean

Cassandra DataStax PHP Extension Setup

General Docs
DataStax PHP Driver

DataStax Driver PHP Docs

Native Linux
Follow DataStax linux installation steps (after installing dependencies). It works if you have conventional setup. You will need to install a lot of c++ development libraries for the compilation to work. Running a package manager install for a popular application build-tools should give you everything you need. I used…

sudo apt-get install build-essential
apt-get build-dep nginx
apt-get install php5-dev

Make sure to add cassandra to php.ini
; DataStax PHP Driver
extension=cassandra.so

 

OSX w/ MAMP:
For MAMP we need to hack the extension compilation scripts to point to the correct php directories. If you don’t you’ll get an an error when php starts up (enable startup error displays in php.ini) like this…

MacBook-Pro:code User$ php -v

Warning: PHP Startup: cassandra: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20131226
These options need to match
 in Unknown on line 0
PHP 5.6.2 (cli) (built: Oct 20 2014 16:21:27) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies

This is bcs we’re trying to use php that’s linked in MAMP (/Applications/MAMP/bin/php), but the module was compiled using the OSX php installation (/usr/bin/php).. and they’re different versions.

The fix is to download the correct php version source and make sure the module compilation uses the correct version’s source.
This link outlines compiling cassandra php extensions with correct source.

I also made sym-links for php, php-config, and phpize like this example.
This is some general background information on compiling php extensions on alternative configurations.

I also edit the ext/install.sh script with the following code…

echo "Compiling and installing the extension..."
phpdir=/Applications/MAMP/bin/php/php5.6.2 {{put in your correct php version directory}}
$phpdir/bin/phpize

`$phpsizecommand`

echo ./configure --with-php-config=$phpdir/bin/php-config --with-cassandra=$builddir --with-libdir=lib
LIBS="-lssl -lz -luv -lm -lstdc++" LDFLAGS="-L$builddir/lib" ./configure --with-cassandra=$builddir --with-libdir=lib --with-php-config=$phpdir/bin/php-config
make
make install

rm -Rf /tmp/php-driver-installation

Also don’t forget to do a clean between code changes

make clean