This will guide you through setting up a replica set in a docker environment using.
- Docker Compose
- MongoDB Replica Sets
- Mongoose
- Mongoose Transactions
Thanks to https://gist.github.com/asoorm for helping with their docker-compose file!
<?php | |
use Illuminate\Database\Eloquent\Builder; | |
Builder::macro('toSqlWithBindings', function () { | |
$bindings = array_map( | |
fn ($value) => is_numeric($value) ? $value : "'{$value}'", | |
$this->getBindings() | |
); |
This will guide you through setting up a replica set in a docker environment using.
Thanks to https://gist.github.com/asoorm for helping with their docker-compose file!
{ | |
"apps": [ | |
{ | |
/* General */ | |
"name": "my-api", /* (string) application name (default to script filename without extension) */ | |
"script": "index.js", /* (string) script path relative to pm2 start */ | |
"cwd": "/var/www/", /* (string) the directory from which your app will be launched */ | |
"args": "-a 13 -b 12", /* (string) string containing all arguments passed via CLI to script */ | |
"interpreter": "/usr/bin/python", /* (string) interpreter absolute path (default to node) */ | |
"interpreter_args": "--harmony", /* (string) option to pass to the interpreter */ |
<?php | |
namespace console\controllers; | |
use yii\console\Controller; | |
use yii\helpers\Console; | |
class ProgressController extends Controller { | |
public function actionIndex(){ | |
$result = $this->prompt("запуск прогресс бара: "); |
With the availability of huge amount of data for research and powerfull machines to run your code on, Machine Learning and Neural Networks is gaining their foot again and impacting us more than ever in our everyday lives. With huge players like Google opensourcing part of their Machine Learning systems like the TensorFlow software library for numerical computation, there are many options for someone interested in starting off with Machine Learning/Neural Nets to choose from. Caffe, a deep learning framework developed by the Berkeley Vision and Learning Center (BVLC) and its contributors, comes to the play with a fresh cup of coffee.
The following section is divided in to two parts. Caffe's documentation suggest
<?php | |
class MyModel extends Eloquent { | |
public function getSql() | |
{ | |
$builder = $this->getBuilder(); | |
$sql = $builder->toSql(); | |
foreach($builder->getBindings() as $binding) | |
{ |
int *value = new int(3); | |
CCLog("*value = %d", *value); //=> I get 3 here => ok | |
_coinsLabel->runAction((CCSequence*)CCSequence::actions( | |
CCDelayTime::actionWithDuration(.05f), | |
CCCallFuncND::actionWithTarget(this, callfuncND_selector(GameLayer::addCoins),(void*) value), | |
NULL)); | |
//function to called | |
void GameLayer::addCoins((CCNode* sender, void* data) | |
{ |