Skip to content

Instantly share code, notes, and snippets.

View amacgregor's full-sized avatar
:shipit:
Working on Side Projects

Allan MacGregor amacgregor

:shipit:
Working on Side Projects
View GitHub Profile
from random import choice
from numpy import array, dot, random
# Declare activation function
def stepFunction(value):
if value <= 0:
return 0
else:
return 1
@amacgregor
amacgregor / dump-subset-of-magento-orders-and-customer-data.php
Created January 10, 2017 11:04 — forked from ceckoslab/dump-subset-of-magento-orders-and-customer-data.php
Proof of concept of script that does mysql dump of subset of Magento orders + related sales tables and customer's data of customer that did the orders. The script also attempts to import the data in local database. Currently the script gets last 1000 orders and customers data of customers that created the orders. Data anonymization is not implem…
<?php
$mysqlCommandPath = 'to be filled';
$mysqldumptCommandPath = 'to be filled';
$remoteDbUnsername = 'to be filled';
$remoteDbPassword = 'to be filled';
$remotePort = 'to be filled';
$remotHost = 'to be filled';
$remoteDb = 'to be filled';
@amacgregor
amacgregor / Product.php
Created January 5, 2014 23:55
Example Product class for using setter injection.
<?php
class Product {
private $stockItem;
private $sku;
public function __construct($sku){
$this->sku = $sku;
}
@amacgregor
amacgregor / instructions_hhvm
Created February 9, 2014 11:54
HVVM Installation Instructions
mkdir dev
cd dev
export CMAKE_PREFIX_PATH=`pwd`
git clone git://github.com/facebook/hhvm.git
cd hhvm
git submodule init
cd ../
## Required for builtin web-server support
@amacgregor
amacgregor / Observer.php
Created August 9, 2011 15:47
Observer.php
<?php
/**
* Demac Media
*
* NOTICE OF LICENSE
*
* This source file is subject to the EULA
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.demacmedia.com/LICENSE-Magento.txt
from numpy import exp, array, random, dot
ts_inputs = array([[0, 0, 0], [0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
ts_outputs = array([[0, 0, 0, 1, 1]]).T
#unknown input
un_input = array([1, 0, 0])
# initialize synapse_weights
random.seed(1)
sy_weights = 2 * random.random((3,1)) - 1
from numpy import exp, array, random, dot
ts_inputs = array([[0, 0, 0], [0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
ts_outputs = array([[0, 0, 0, 1, 1]]).T
#unknown input
un_input = array([1, 0, 0])
# initialize synapse_weights
random.seed(1)
sy_weights = 2 * random.random((3,1)) - 1
from numpy import exp, array, random, dot
ts_inputs = array([[0, 0, 0], [0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
ts_outputs = array([[0, 0, 0, 1, 1]]).T
#unknown input
un_input = array([1, 0, 0])
# initialize synapse_weights
random.seed(1)
sy_weights = 2 * random.random((3,1)) - 1
from numpy import exp, array, random, dot
ts_inputs = array([[0, 0, 0], [0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
ts_outputs = array([[0, 0, 0, 1, 1]]).T
#unknown input
un_input = array([1, 0, 0])
# initialize synapse_weights
random.seed(1)
sy_weights = 2 * random.random((3,1)) - 1
from numpy import exp, array, random, dot
ts_inputs = array([[0, 0, 0], [0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
ts_outputs = array([[0, 0, 0, 1, 1]]).T
#unknown input
un_input = array([1, 0, 0])
# initialize synapse_weights
random.seed(1)
sy_weights = 2 * random.random((3,1)) - 1