text:
(function () {
  'use strict';
  /*jshint camelcase:false */
  describe('CartController', function () {
    var ctrl,
      $q,
      $controller,
      dependencies,
      $scope,
      $state,
      CartService,
      ModalService,
      $ionicLoading,
      $ionicHistory,
      deferCheckout,
      deferAddress,
      deferBilling,
      deferStateGo,
      $auth,
      $ionicPopup,
      $translate,
      translateDeferred,
      billingAddresses,
      deliveryAddresses,
      CustomerOrderDeliveryService;

    beforeEach(module('porttare.controllers'));
    beforeEach(module('porttare.services', function ($provide) {
      $provide.factory('CartService', function ($q) {
        deferCheckout = $q.defer();
        return {
          checkout: sinon.stub().returns(deferCheckout.promise)
        };
      });
      $provide.factory('BillingAddressesService', function ($q) {
        deferBilling = $q.defer();
        return {
          createBillingAddress: sinon.stub().returns(deferBilling.promise)
        };
      });
      $provide.factory('ProfileAddressesService', function ($q) {
        deferAddress = $q.defer();
        return {
          createAddresses: sinon.stub().returns(deferAddress.promise)
        };
      });
      $provide.factory('$auth', function () {
        return {
          user: {
            customer_order: [],
            current_place: { currency_iso_code: 'USD' }
          }
        };
      });
      $provide.factory('ModalService', function () {
        return {
          showModal: sinon.stub(),
          closeModal: sinon.stub()
        };
      });
      $provide.factory('CustomerOrderDeliveryService', function () {
        return {};
      });
      $provide.value('APP', {
        deliveryMethods: []
      });
      $provide.factory('$ionicLoading', function () {
        return {
          show: sinon.stub(),
          hide: sinon.stub()
        };
      });
      $provide.factory('$ionicPopup', function ($q) {
        return {
          alert: sinon.stub().returns($q.defer().promise)
        };
      });
      $provide.factory('$state', function ($q) {
        deferStateGo = $q.defer();
        return {
          go: sinon.stub().returns(deferStateGo.promise)
        };
      });
      $provide.factory('$translate', function ($q) {
        translateDeferred = $q.defer();
        return sinon.stub().returns(translateDeferred.promise);
      });
      $provide.factory('$ionicHistory', function(){
        return {
          nextViewOptions: sinon.stub()
        };
      });
    }));

    beforeEach(inject(function (_$q_, _$rootScope_, _$controller_,
      _CartService_, _$ionicPopup_,
      _$state_, _ModalService_, _$ionicLoading_, _$ionicHistory_, _$auth_, _APP_, _$translate_, _CustomerOrderDeliveryService_) {

      $scope = _$rootScope_.$new();
      $q = _$q_;
      $controller = _$controller_;
      $state = _$state_;
      CartService = _CartService_;
      ModalService = _ModalService_;
      deliveryAddresses = [1,2,3];
      billingAddresses = [1,2,3];
      $ionicLoading = _$ionicLoading_;
      $auth = _$auth_;
      $ionicPopup= _$ionicPopup_;
      $translate = _$translate_;
      CustomerOrderDeliveryService = _CustomerOrderDeliveryService_;
      $ionicHistory = _$ionicHistory_;

      dependencies = {
        $scope: $scope,
        CartService: CartService,
        ModalService: ModalService,
        $ionicPopup: $ionicPopup,
        $state: $state,
        $ionicLoading: $ionicLoading,
        $ionicHistory: $ionicHistory,
        $auth: $auth,
        CustomerOrderDeliveryService: CustomerOrderDeliveryService,
        deliveryAddresses: deliveryAddresses,
        billingAddresses: billingAddresses,
        APP: _APP_,
        $q: _$q_
      };

      ctrl = $controller('CartController', dependencies);
    }));

    describe('Order checkout', function () {
      it('Should start loading', function () {
        ctrl.runCheckout();
        sinon.assert.calledOnce($ionicLoading.show);

      });
      it('Should run checkout', function () {
        sinon.spy($scope, '$emit');
        ctrl.runCheckout();
        deferCheckout.resolve({customer_order: {id: null}});
        $scope.$digest();
        sinon.assert.calledOnce($state.go);
      });
      it('Should run checkout', function () {
        ctrl.runCheckout();
        deferCheckout.resolve({customer_order: {id: null}});
        $scope.$digest();
        deferStateGo.resolve();
        $scope.$digest();
        expect($auth.user.customer_order).to.be.equal(null);
        sinon.assert.calledOnce($ionicPopup.alert);
      });
    });
  });
})();


text:
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Modules)
enable_language(Fail)

redpajama_set_name: RedPajamaGithub


text:
package com.googlesource.gerrit.plugins.quota;

import com.google.gerrit.entities.Project;
import com.google.gerrit.extensions.events.GarbageCollectorListener;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.Properties;

@Singleton
public class GCListener implements GarbageCollectorListener {

  private final RepoSizeCache repoSizeCache;

  @Inject
  public GCListener(RepoSizeCache repoSizeCache) {
    this.repoSizeCache = repoSizeCache;
  }

  @Override
  public void onGarbageCollected(GarbageCollectorListener.Event event) {
    Project.NameKey key = Project.nameKey(event.getProjectName());
    Properties statistics = event.getStatistics();
    if (statistics != null) {
      Number sizeOfLooseObjects = (Number) statistics.get("sizeOfLooseObjects");
      Number sizeOfPackedObjects = (Number) statistics.get("sizeOfPackedObjects");
      if (sizeOfLooseObjects != null && sizeOfPackedObjects != null) {
        repoSizeCache.set(key, sizeOfLooseObjects.longValue() + sizeOfPackedObjects.longValue());
        return;
      }
    }
    repoSizeCache.evict(key);
  }
}


text:
package com.codebullets.sagalib.description;

import com.codebullets.sagalib.AbstractSagaState;

public class DescriptionSagaState extends AbstractSagaState<Long> {
}


text:
'use strict';
var yeoman = require('yeoman-generator');
var yosay = require('yosay');
var angularUtils = require('../common/util.js');
var path = require('path');
var fs = require('fs');
var chalk = require('chalk');

var PortfolioModuleGenerator = yeoman.generators.Base.extend({
  askForData: function() {
    var done = this.async();
    if (!this.options['skip-welcome-message']) {
      this.log(yosay('Welcome to the marvelous Reqtangular portfolio module generator!'));
    }
    var questions = [
      {
        type: 'list',
        name: 'numberCols',
        message: 'Choose portfolio columns number',
        choices: ['1', '2', '3', '6'],
        default: 2
      }
    ];
    this.prompt(questions, function(answers) {
      this.colValue = 12 / answers.numberCols;
      done();
    }.bind(this));
  },
  moduleName: function() {
    var moduleName = this.options['moduleName'] || 'portfolio';
    this.addToNav = true;
    this.moduleName = this._.underscored(moduleName);
    this.moduleNameTitle = this._.classify(moduleName);

    this.angularModuleName = this.moduleNameTitle + 'Module';
    this.moduleControllerClass = this.moduleNameTitle + 'Controller';

    this.appPath = 'app';
    this.moduleRelativePath = path.join('modules', moduleName);
    this.modulePath = path.join(this.appPath, 'scripts', this.moduleRelativePath);

    this.controllerFile = moduleName + '_ctrl';
    this.routeFile = moduleName + '_route';
    this.serviceFile = moduleName + '_service';
  },
  module: function() {
    this.mkdir(this.modulePath);
    this.mkdir(path.join(this.modulePath, 'templates'));

    this.copy('_module/_templates/_template.html',
            path.join(this.modulePath, 'templates', this.moduleName + '.tpl.html'));

    this.copy('_module/_controller.js', path.join(this.modulePath, this.controllerFile + '.js'));

    this.copy('_module/_route.js', path.join(this.modulePath, this.routeFile + '.js'));

    this.copy('_module/_service.js', path.join(this.modulePath, this.serviceFile + '.js'));

    this.directory('_module/_img', path.join(this.modulePath, 'img'));

    this.copy('_module/_mockedData.json', path.join(this.modulePath, 'mockedData.json'));
  },
  injectDependenciesToApp: function() {
    angularUtils.injectIntoFile(
            this.appPath,
            path.join(this.moduleRelativePath, this.controllerFile),
            this.angularModuleName
            );
  },
  addTranslations: function() {
    var appTranslationsPath = 'app/scripts/modules/lang/translations';
    var moduleTranslationsPath = path.join(path.dirname(this._sourceRoot), 'translations');
    var moduleTranslationsFiles = fs.readdirSync(moduleTranslationsPath);
    for (var i in moduleTranslationsFiles) {
      var appFilePath = path.join(appTranslationsPath, moduleTranslationsFiles[i]);
      if (fs.existsSync(appFilePath)) {
        var moduleTranslationsContentFile = fs.readFileSync(path.join(moduleTranslationsPath, moduleTranslationsFiles[i]), 'utf8');
        console.log(chalk.green("Injecting translation file:") + moduleTranslationsFiles[i]);
        var placeholderTranslation = this.engine("\"module.<%= moduleName %>\":" + moduleTranslationsContentFile + ",", this);
        angularUtils.injectIntoJSON(
                appFilePath,
                "\"IMPORTANT_NEEDLE_DATA\": \"do not remove\"",
                placeholderTranslation
                );
      } else {
        console.log(chalk.yellow("Skipped file:") + moduleTranslationsFiles[i] + chalk.yellow(" because is not configured in main app."));
      }
    } //end for
  },
  addToNavigation: function() {
    if (this.addToNav) {
      var mainHtmlFilePath = path.join(this.appPath, 'scripts/modules/main/templates/main.html');
      angularUtils.injectIntoNav(
              mainHtmlFilePath,
              "",
              this.engine("<li ng-class=\"{ active: menuCtrl.isSelected('<%= moduleName %>') }\"><a ng-click=\"menuCtrl.selectMenu('<%= moduleName %>')\" ng-href=\"#/<%= moduleName %>\" translate=\"module.<%= moduleName %>.moduleName\">
\n", this)
              );
      if (!this.options['avoid-info']) {
        this.log('All done, a link has been added to navigation bar, please add corresponding translations to files in app/scripts/modules/lang/translations/');
      }
    }
  },
  registerModule: function() {
    var module = {
      'name': this.moduleName,
      'navBar': this.addToNav
    };
    angularUtils.registerModule(this.appPath, module);
  }
});

module.exports = PortfolioModuleGenerator;


text:
<?php
/**
 * Created by PhpStorm.
 * User: wodrow
 * Date: 2/25/16
 * Time: 3:04 PM
 */

namespace Admin\Widget;

use Admin\Controller\AdminController;

class AdminWidget extends AdminController
{
    public function test($id,$name){
        echo $id.':'.$name;
    }
}


text:
<<<<<<< HEAD
<<<<<<< HEAD
setuptools package
==================

Subpackages
-----------

.. toctree::

    setuptools.command
    setuptools.tests

Submodules
----------

setuptools.archive_util module
------------------------------

.. automodule:: setuptools.archive_util
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.compat module
------------------------

.. automodule:: setuptools.compat
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.depends module
-------------------------

.. automodule:: setuptools.depends
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.dist module
----------------------

.. automodule:: setuptools.dist
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.extension module
---------------------------

.. automodule:: setuptools.extension
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.lib2to3_ex module
----------------------------

.. automodule:: setuptools.lib2to3_ex
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.msvc9_support module
-------------------------------

.. automodule:: setuptools.msvc9_support
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.package_index module
-------------------------------

.. automodule:: setuptools.package_index
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.py26compat module
----------------------------

.. automodule:: setuptools.py26compat
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.py27compat module
----------------------------

.. automodule:: setuptools.py27compat
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.py31compat module
----------------------------

.. automodule:: setuptools.py31compat
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.sandbox module
-------------------------

.. automodule:: setuptools.sandbox
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.site-patch module
----------------------------

.. automodule:: setuptools.site-patch
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.ssl_support module
-----------------------------

.. automodule:: setuptools.ssl_support
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.unicode_utils module
-------------------------------

.. automodule:: setuptools.unicode_utils
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.utils module
-----------------------

.. automodule:: setuptools.utils
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.version module
-------------------------

.. automodule:: setuptools.version
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.windows_support module
---------------------------------

.. automodule:: setuptools.windows_support
    :members:
    :undoc-members:
    :show-inheritance:

Module contents
---------------

.. automodule:: setuptools
    :members:
    :undoc-members:
    :show-inheritance:
=======
setuptools package
==================

Subpackages
-----------

.. toctree::

    setuptools.command
    setuptools.tests

Submodules
----------

setuptools.archive_util module
------------------------------

.. automodule:: setuptools.archive_util
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.compat module
------------------------

.. automodule:: setuptools.compat
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.depends module
-------------------------

.. automodule:: setuptools.depends
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.dist module
----------------------

.. automodule:: setuptools.dist
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.extension module
---------------------------

.. automodule:: setuptools.extension
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.lib2to3_ex module
----------------------------

.. automodule:: setuptools.lib2to3_ex
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.msvc9_support module
-------------------------------

.. automodule:: setuptools.msvc9_support
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.package_index module
-------------------------------

.. automodule:: setuptools.package_index
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.py26compat module
----------------------------

.. automodule:: setuptools.py26compat
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.py27compat module
----------------------------

.. automodule:: setuptools.py27compat
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.py31compat module
----------------------------

.. automodule:: setuptools.py31compat
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.sandbox module
-------------------------

.. automodule:: setuptools.sandbox
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.site-patch module
----------------------------

.. automodule:: setuptools.site-patch
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.ssl_support module
-----------------------------

.. automodule:: setuptools.ssl_support
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.unicode_utils module
-------------------------------

.. automodule:: setuptools.unicode_utils
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.utils module
-----------------------

.. automodule:: setuptools.utils
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.version module
-------------------------

.. automodule:: setuptools.version
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.windows_support module
---------------------------------

.. automodule:: setuptools.windows_support
    :members:
    :undoc-members:
    :show-inheritance:

Module contents
---------------

.. automodule:: setuptools
    :members:
    :undoc-members:
    :show-inheritance:
>>>>>>> b875702c9c06ab5012e52ff4337439b03918f453
=======
setuptools package
==================

Subpackages
-----------

.. toctree::

    setuptools.command
    setuptools.tests

Submodules
----------

setuptools.archive_util module
------------------------------

.. automodule:: setuptools.archive_util
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.compat module
------------------------

.. automodule:: setuptools.compat
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.depends module
-------------------------

.. automodule:: setuptools.depends
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.dist module
----------------------

.. automodule:: setuptools.dist
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.extension module
---------------------------

.. automodule:: setuptools.extension
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.lib2to3_ex module
----------------------------

.. automodule:: setuptools.lib2to3_ex
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.msvc9_support module
-------------------------------

.. automodule:: setuptools.msvc9_support
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.package_index module
-------------------------------

.. automodule:: setuptools.package_index
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.py26compat module
----------------------------

.. automodule:: setuptools.py26compat
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.py27compat module
----------------------------

.. automodule:: setuptools.py27compat
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.py31compat module
----------------------------

.. automodule:: setuptools.py31compat
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.sandbox module
-------------------------

.. automodule:: setuptools.sandbox
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.site-patch module
----------------------------

.. automodule:: setuptools.site-patch
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.ssl_support module
-----------------------------

.. automodule:: setuptools.ssl_support
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.unicode_utils module
-------------------------------

.. automodule:: setuptools.unicode_utils
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.utils module
-----------------------

.. automodule:: setuptools.utils
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.version module
-------------------------

.. automodule:: setuptools.version
    :members:
    :undoc-members:
    :show-inheritance:

setuptools.windows_support module
---------------------------------

.. automodule:: setuptools.windows_support
    :members:
    :undoc-members:
    :show-inheritance:

Module contents
---------------

.. automodule:: setuptools
    :members:
    :undoc-members:
    :show-inheritance:
>>>>>>> b875702c9c06ab5012e52ff4337439b03918f453


text:
<?php
exec('/bin/phantomjs /Users/otyo/hacku/naki/tweet.js');
?>


text:
package org.smtlib.ext;

import java.util.List;

import org.smtlib.ICommand;
import org.smtlib.IExpr.IIdentifier;

/** Interface to be implemented by all objects representing SMT-LIB what commands. */
public interface Iwhat extends ICommand {
	/** The ids to look for and describe */
	List<IIdentifier> ids();
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Guild_Wars_2_Inventory_Search
{
    public partial class Form2 : Form
    {
        Form1 form1;

        public Form2(Form1 form1)
        {
           this.form1 = form1;
            InitializeComponent();
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("https://account.guildwars2.com/account/api-keys/create");
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            textBox1.Text = form1.apiKey;
        }

        private void change_Click(object sender, EventArgs e)
        {
            if (form1.thread != null && form1.thread.IsAlive)
            {
                MessageBox.Show("Please wait untill the data has been loaded before changing the API key.");
            }
            else
            {
                form1.apiKey = textBox1.Text;
                Properties.Settings.Default.ApiKey = form1.apiKey;
                Properties.Settings.Default.Save();
                form1.refreshButton_Click(null, null);
                this.Close();
            }
        }
    }
}


text:
{% if paginator.total_pages > 1 %}

    {% if paginator.next_page %}
      « Más antiguos
    {% endif %}

    {% if paginator.previous_page %}
      Más nuevos »
    {% endif %}

{% endif %}


text:
from django.shortcuts import render

# Create your views here.
def example(request):
	#model = Question
	#template_name = 'example.html'
	return render(request, 'example.html', {'bob': range(15) })


text:
LWJGL-OBJ-Loader
=================
Wavefront .obj file loader + renderer for Lightweight Java Gaming Library (LWJGL)

**Watch/star to follow along with progress!**

### Download
You can download the source code right off of GitHub or you can just clone the repository:

HTTPS: https://github.com/Blunderchips/LWJGL-OBJ-Loader.git

SSH: git@github.com:Blunderchips/LWJGL-OBJ-Loader.git

### Use
Instantiate a new a OBJLoader and use it to first load the model in and then render it. The loader can create a new displaylist of the model.
**It only supports models with both texture coordinates and normals**

### Report Issues

- **[Report New Issue](https://github.com/Blunderchips/LWJGL-OBJ-Loader/issues/new )**
- **[View Open Issues](https://github.com/Blunderchips/LWJGL-OBJ-Loader/issues )**

### See
- [wikipedia - Wavefront .obj file](http://en.wikipedia.org/wiki/Wavefront_.obj_file "en.wikipedia.org")
- [lwjgl.org](http://www.lwjgl.org/ "lwjgl.org")

##### Everyone who's created or contributed to issues and pull requests, which make the project better!

### Licenece - The MIT License (MIT)
Copyright (c) 2014 Matthew 'siD' Van der Bijl

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

***


text:
<?php
// @codeCoverageIgnoreStart
$c = new \Pimple\Container();

$c['console.input'] = function ($c) {
    return new \Symfony\Component\Console\Input\ArgvInput();
};

$c['console.output'] = function ($c) {
    return new \Symfony\Component\Console\Output\ConsoleOutput();
};

$c['runtime.helper.filehelper'] = function ($c) {
    return new TeamNeusta\Magedev\Runtime\Helper\FileHelper();
};

$c['runtime.helper.magerunhelper'] = function ($c) {
    return new TeamNeusta\Magedev\Runtime\Helper\MagerunHelper(
        $c['runtime.config'],
        $c['runtime.helper.filehelper'],
        $c['services.docker']
    );
};

$c['runtime.config'] = function ($c) {
    return new \TeamNeusta\Magedev\Runtime\Config(
        $c['console.input'],
        $c['runtime.helper.filehelper']
    );
};

$c['console.questionhelper'] = function ($c) {
    return new \Symfony\Component\Console\Helper\QuestionHelper();
};

$c['runtime.eventdispatcher'] = function ($c) {
    return new \Symfony\Component\EventDispatcher\EventDispatcher();
};

$c['lib.docker.containerManager'] = function ($c) {
    return (new \Docker\Docker())->getContainerManager();
};

$c['lib.docker.imageManager'] = function ($c) {
    return (new \Docker\Docker())->getImageManager();
};
$c['docker.helper.namebuilder'] = function ($c) {
    return new \TeamNeusta\Magedev\Docker\Helper\NameBuilder($c['runtime.config']);
};
$c['docker.networkManager'] = function ($c) {
    return new \TeamNeusta\Magedev\Docker\Network((new \Docker\Docker())->getNetworkManager());
};

$c['docker.api.container.factory'] = function ($c) {
    return new \TeamNeusta\Magedev\Docker\Api\ContainerFactory(
        $c['lib.docker.containerManager'],
        $c['docker.image.factory'],
        $c['docker.api.image.factory']
    );
};
$c['docker.api.image.factory'] = function ($c) {
    return new \TeamNeusta\Magedev\Docker\Api\ImageFactory(
        $c['lib.docker.imageManager']
    );
};

$c['docker.image.factory'] = function ($c) {
    return new \TeamNeusta\Magedev\Docker\Image\Factory(
        $c['runtime.config'],
        $c['runtime.helper.filehelper'],
        $c['docker.api.image.factory'],
        $c['docker.helper.namebuilder']
    );
};

$c['docker.container.factory'] = function ($c) {
    return new \TeamNeusta\Magedev\Docker\Container\Factory(
        $c['runtime.config'],
        $c['docker.image.factory'],
        $c['docker.helper.namebuilder']
    );
};

$c['docker.manager'] = function ($c) {
    return new \TeamNeusta\Magedev\Docker\Manager(
        $c['console.output'],
        $c['docker.api.container.factory'],
        $c['docker.api.image.factory']
    );
};

$c['services.docker'] = function ($c) {
    return new \TeamNeusta\Magedev\Services\DockerService(
        $c['runtime.config'],
        $c['console.output'],
        $c['services.shell'],
        $c['runtime.helper.filehelper'],
        $c['docker.manager'],
        $c['docker.networkManager'],
        $c['docker.container.factory'],
        $c['docker.helper.namebuilder']
    );
};

$c['services.shell'] = function ($c) {
    return new \TeamNeusta\Magedev\Services\ShellService(
        $c['console.output']
    );
};

$c['services.process'] = function ($c) {
    return new \TeamNeusta\Magedev\Services\ProcessService();
};

$c['commands'] = function ($c) {
    return [
        new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand(),

        // Db
        new \TeamNeusta\Magedev\Commands\Db\CleanupCommand(
            $c['runtime.config'],
            $c['runtime.helper.filehelper'],
            $c['services.shell'],
            $c['services.docker']
        ),
        new \TeamNeusta\Magedev\Commands\Db\DumpCommand($c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Db\ImportCommand(
            $c['runtime.config'],
            $c['services.shell'],
            $c['services.docker']
        ),

        /* // Media */
        new \TeamNeusta\Magedev\Commands\Media\ImportCommand($c['runtime.config'], $c['services.shell']),

        /* // Config */
        new \TeamNeusta\Magedev\Commands\Config\ResetCommand(
            $c['runtime.config'],
            $c['runtime.helper.filehelper'],
            $c['services.docker']
        ),

        new \TeamNeusta\Magedev\Commands\Docker\BuildCommand($c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Docker\DestroyCommand($c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Docker\MysqlCommand($c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Docker\ReinitCommand(),
        new \TeamNeusta\Magedev\Commands\Docker\RestartCommand(),
        new \TeamNeusta\Magedev\Commands\Docker\SshCommand($c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Docker\StartCommand($c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Docker\StopCommand($c['services.docker']),

        /* // Grunt */
        new \TeamNeusta\Magedev\Commands\Grunt\RefreshCommand($c['runtime.config'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Grunt\WatchCommand($c['runtime.config'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Grunt\KillCommand($c['runtime.config'], $c['services.docker']),

        /* // Init */
        new \TeamNeusta\Magedev\Commands\Init\AddHostEntryCommand($c['runtime.config'], $c['console.output'], $c['services.shell']),
        new \TeamNeusta\Magedev\Commands\Init\ComposerCommand($c['runtime.config'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Init\NpmCommand($c['runtime.config'], $c['services.docker'], $c['services.shell'], $c['runtime.helper.filehelper']),
        new \TeamNeusta\Magedev\Commands\Init\PermissionsCommand($c['runtime.config'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Init\ProjectCommand($c['runtime.config'], $c['console.output']),

        /* // Magento */
        new \TeamNeusta\Magedev\Commands\Magento\AlignConfigCommand($c['runtime.config']),
        new \TeamNeusta\Magedev\Commands\Magento\CacheCleanCommand($c['runtime.config'], $c['runtime.helper.magerunhelper'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Magento\CommandCommand($c['runtime.config'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Magento\DefaultAdminUserCommand($c['runtime.config'], $c['runtime.helper.magerunhelper'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Magento\DefaultCustomerCommand($c['runtime.config'], $c['runtime.helper.magerunhelper'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Magento\InstallCommand($c['runtime.config'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Magento\InstallMagerunCommand($c['runtime.config'], $c['services.shell']),
        new \TeamNeusta\Magedev\Commands\Magento\RefreshCommand($c['runtime.config'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Magento\ReindexCommand($c['runtime.config'], $c['runtime.helper.magerunhelper'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Magento\SetBaseUrlCommand($c['runtime.config'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Magento\UpgradeCommand($c['runtime.config'], $c['runtime.helper.magerunhelper'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Magento\ModuleVersionCommand($c['runtime.config'], $c['services.docker']),

        /* // Tests */
        new \TeamNeusta\Magedev\Commands\Tests\DebugCommand($c['runtime.config'], $c['services.docker']),
        new \TeamNeusta\Magedev\Commands\Tests\RunCommand($c['runtime.config'], $c['services.docker']),

        new \TeamNeusta\Magedev\Commands\UpdateCommand(),
    ];
};

$c['plugins.manager'] = function ($c) {
    return new \TeamNeusta\Magedev\Plugins\Manager($c['runtime.config'], $c['runtime.eventdispatcher']);
};

$c['application'] = function ($c) {
    $c['plugins.manager']->loadPlugins($c);
    $application = new \TeamNeusta\Magedev\Runtime\Application($c['plugins.manager']);
    $application->addCommands($c['commands']);

    return $application;
};

return $c;
// @codeCoverageIgnoreEnd


text:
/**
 * @file control-bar.js
 */
import Component from '../component.js';

// Required children
import './play-toggle.js';
import './time-controls/current-time-display.js';
import './time-controls/duration-display.js';
import './time-controls/time-divider.js';
import './time-controls/remaining-time-display.js';
import './live-display.js';
import './progress-control/progress-control.js';
import './fullscreen-toggle.js';
import './volume-panel.js';
import './text-track-controls/chapters-button.js';
import './text-track-controls/descriptions-button.js';
import './text-track-controls/subtitles-button.js';
import './text-track-controls/captions-button.js';
import './text-track-controls/subs-caps-button.js';
import './audio-track-controls/audio-track-button.js';
import './playback-rate-menu/playback-rate-menu-button.js';
import './spacer-controls/custom-control-spacer.js';

/**
 * Container of main controls.
 *
 * @extends Component
 */
class ControlBar extends Component {

  /**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */
  createEl() {
    return super.createEl('div', {
      className: 'vjs-control-bar',
      dir: 'ltr'
    }, {
      // The control bar is a group, but we don't aria-label it to avoid
      //  over-announcing by JAWS
      role: 'group'
    });
  }
}

/**
 * Default options for `ControlBar`
 *
 * @type {Object}
 * @private
 */
ControlBar.prototype.options_ = {
  children: [
    'playToggle',
    'volumePanel',
    'currentTimeDisplay',
    'timeDivider',
    'durationDisplay',
    'progressControl',
    'liveDisplay',
    'remainingTimeDisplay',
    'customControlSpacer',
    'playbackRateMenuButton',
    'chaptersButton',
    'descriptionsButton',
    'subsCapsButton',
    'audioTrackButton',
    'fullscreenToggle'
  ]
};

Component.registerComponent('ControlBar', ControlBar);
export default ControlBar;


text:
namespace mscorlib
{
	namespace System
	{
		namespace Runtime
		{
			namespace Serialization
			{
				namespace Formatters
				{

					//Public Properties Tests

					// Property Headers
					//		Return Type: mscorlib::System::Runtime::Remoting::Messaging::Header*
					//			Property Get Method
					TEST(mscorlib_System_Runtime_Serialization_Formatters_ISoapMessage_Fixture,get_Headers_Test)
					{

					}

					// Property Headers
					//		Return Type: mscorlib::System::Runtime::Remoting::Messaging::Header*
					//			Property Set Method
					TEST(mscorlib_System_Runtime_Serialization_Formatters_ISoapMessage_Fixture,set_Headers_Test)
					{

					}

					// Property MethodName
					//		Return Type: mscorlib::System::String
					//			Property Get Method
					TEST(mscorlib_System_Runtime_Serialization_Formatters_ISoapMessage_Fixture,get_MethodName_Test)
					{

					}

					// Property MethodName
					//		Return Type: mscorlib::System::String
					//			Property Set Method
					TEST(mscorlib_System_Runtime_Serialization_Formatters_ISoapMessage_Fixture,set_MethodName_Test)
					{

					}

					// Property ParamNames
					//		Return Type: mscorlib::System::String*
					//			Property Get Method
					TEST(mscorlib_System_Runtime_Serialization_Formatters_ISoapMessage_Fixture,get_ParamNames_Test)
					{

					}

					// Property ParamNames
					//		Return Type: mscorlib::System::String*
					//			Property Set Method
					TEST(mscorlib_System_Runtime_Serialization_Formatters_ISoapMessage_Fixture,set_ParamNames_Test)
					{

					}

					// Property ParamTypes
					//		Return Type: mscorlib::System::Type*
					//			Property Get Method
					TEST(mscorlib_System_Runtime_Serialization_Formatters_ISoapMessage_Fixture,get_ParamTypes_Test)
					{

					}

					// Property ParamTypes
					//		Return Type: mscorlib::System::Type*
					//			Property Set Method
					TEST(mscorlib_System_Runtime_Serialization_Formatters_ISoapMessage_Fixture,set_ParamTypes_Test)
					{

					}

					// Property ParamValues
					//		Return Type: mscorlib::System::Object*
					//			Property Get Method
					TEST(mscorlib_System_Runtime_Serialization_Formatters_ISoapMessage_Fixture,get_ParamValues_Test)
					{

					}

					// Property ParamValues
					//		Return Type: mscorlib::System::Object*
					//			Property Set Method
					TEST(mscorlib_System_Runtime_Serialization_Formatters_ISoapMessage_Fixture,set_ParamValues_Test)
					{

					}

					// Property XmlNameSpace
					//		Return Type: mscorlib::System::String
					//			Property Get Method
					TEST(mscorlib_System_Runtime_Serialization_Formatters_ISoapMessage_Fixture,get_XmlNameSpace_Test)
					{

					}

					// Property XmlNameSpace
					//		Return Type: mscorlib::System::String
					//			Property Set Method
					TEST(mscorlib_System_Runtime_Serialization_Formatters_ISoapMessage_Fixture,set_XmlNameSpace_Test)
					{

					}

				}
			}
		}
	}
}


text:
<sect1 id="zend.registry.using">

    <title>Использование реестра</title>

    <para>
        Реестр является контейнером для хранения объектов и значений в
        среде приложения. Посредством сохранения значения в реестре
        объект становится доступным всему приложению. Этот механизм является
        альтернативой использованию глобальных переменных.

    </para>

    <para>
        Типовое использование реестра - использование статических методов класса
        Zend_Registry. Вы можете также обращаться к элементам, сохраненным в
        реестре, как к элементам массива, поскольку класс реестра наследует от
        ArrayObject.

    </para>

    <sect2 id="zend.registry.using.storing">

        <title>Установка значений в реестре</title>

        <para>
            Для того, чтобы сохранить значение в реестре, используйте
            статический метод set().

        </para>

        <example id="zend.registry.using.storing.example">
            <title>Пример использования метода set()</title>
            <programlisting language="php"><![CDATA[<?php

Zend_Registry::set('index', $value);

?>]]></programlisting>
        </example>

        <para>
            Сохраняемое значение может быть объектом, массивом или скаляром. Вы
            можете изменить значение, сохраненное под определенным индексом в
            реестре, устанавливая новое значение методом set().

        </para>

        <para>
            Индекс может быть строкой или целочисленным значением, как в обычном
            массиве.

        </para>

    </sect2>

    <sect2 id="zend.registry.using.retrieving">

        <title>Получение значений из реестра</title>

        <para>
            Для того, чтобы получить запись из реестра, используйте статический
            метод get().

        </para>

        <example id="zend.registry.using.retrieving.example">
            <title>Пример использования метода get()</title>
            <programlisting language="php"><![CDATA[<?php

$value = Zend_Registry::get('index');

?>]]></programlisting>
        </example>

        <para>
            Метод getInstance() возвращает статический объект
            реестра.

        </para>

        <para>
            По объекту реестра можно производить итерацию.

        </para>

        <example id="zend.registry.using.retrieving.example-iterating">
            <title>Пример итерации по реестру</title>
            <programlisting language="php"><![CDATA[<?php

$registry = Zend_Registry::getInstance();

foreach ($registry as $index => $value) {
    echo "Registry index $index contains:\n";
    var_dump($value);
}

?>]]></programlisting>
        </example>

    </sect2>

    <sect2 id="zend.registry.using.constructing">

        <title>Создание объекта реестра</title>

        <para>
            Кроме доступа к статическому реестру через статические методы, вы
            можете также непосредственно создавать экземпляр реестра и
            использовать его как объект.

        </para>

        <para>
            Экземпляр реестра, к которому вы обращаетесь через статические
            методы, просто является одним из таких экземпляров. Это сделано в
            целях удобства, т.к. оно сохраняется статически и вы можете
            обращаться к нему из любого места своего приложения.

        </para>

        <para>
            Используйте традиционный конструктор new для создания
            экземпляра реестра. Это дает возможность иницизировать записи в
            реестре так же, как в массиве.

        </para>

        <example id="zend.registry.using.constructing.example">
            <title>Пример создания реестра</title>
            <programlisting language="php"><![CDATA[<?php

$registry = new Zend_Registry(array('index' => $value));

?>]]></programlisting>
        </example>

        <para>
            После создания экземпляра вы можете использовать его с применением
            методов доступа ArrayObject, или установить его как
            статический экземпляр, используя статический метод
            setInstance().

        </para>

        <example id="zend.registry.using.constructing.example-setinstance">
            <title>Пример инициализации статического реестра</title>
            <programlisting language="php"><![CDATA[<?php

$registry = new Zend_Registry(array('index' => $value));

Zend_Registry::setInstance($registry);

?>]]></programlisting>
        </example>

        <para>
            Метод setInstance() бросает исключение Zend_Exception,
            если статический реестр уже был проинициализирован до
            первого обращения к нему.

        </para>

    </sect2>

    <sect2 id="zend.registry.using.array-access">

        <title>Доступ к реестру как к массиву</title>

        <para>
            Если необходимо установить или получить несколько значений, то
            может быть удобным использовать для этого нотацию доступа к
            массивам.

        </para>

        <example id="zend.registry.using.array-access.example">
            <title>Пример доступа как к массиву</title>
            <programlisting language="php"><![CDATA[<?php

$registry = Zend_Registry::getInstance();

$registry['index'] = $value;

var_dump( $registry['index'] );

?>]]></programlisting>
        </example>

    </sect2>

    <sect2 id="zend.registry.using.array-object">

        <title>Доступ к реестру как к объекту </title>

        <para>
            К реестру можно обращаться так же, как к объекту, используя имена
            индексов как имена свойств объекта. Для этого нужно специальным
            образом создать объект, используя опцию
            ArrayObject::ARRAY_AS_PROPS, и инициализировать
            статический экземпляр. Необходимо сделать это до того, как будет
            сделано первое обращение к статическому реестру.
            <emphasis>Будьте осторожны</emphasis>, используя эту
            опцию, поскольку некоторые версии PHP имеют ошибки, связанные с этой
            опцией.

        </para>

        <example id="zend.registry.using.array-object.example">
            <title>Пример доступа как к объекту</title>
            <programlisting language="php"><![CDATA[<?php

// в загрузочном коде:
$registry = new Zend_Registry(array(), ArrayObject::ARRAY_AS_PROPS)
Zend_Registry::setInstance($registry);
$registry->tree = 'apple';

.
.
.

// в различных функциях и где-либо еще в приложении:
$registry = Zend_Registry::getInstance();

echo $registry->tree; // выводит "apple"

$registry->index = $value;

var_dump($registry->index);

?>]]></programlisting>
        </example>

    </sect2>

    <sect2 id="zend.registry.using.isset">

        <title>Проверка существования индекса</title>

        <para>
            Для проверки того, существует ли в реестре значение под определенным
            индексом, используйте isRegistered().

        </para>

        <example id="zend.registry.using.isset.example-isregistered">
            <title>Пример использования метода isRegistered()</title>
            <programlisting language="php"><![CDATA[<?php

if (Zend_Registry::isRegistered($index)) {
    $value = Zend_Registry::get($index);
}

?>]]></programlisting>
        </example>

        <para>
            Для того, чтобы найти определенный индекс в объекте реестра,
            используйте конструкцию isset(), как в случае обычного массива.

        </para>

        <example id="zend.registry.using.isset.example-isset">
            <title>Пример использования метода isset()</title>
            <programlisting language="php"><![CDATA[<?php

$registry = Zend_Registry::getInstance();

// используется синтаксис доступа к массиву
if (isset($registry['index'])) {
    var_dump( $registry['index'] );
}

// используется синтаксис доступа к объекту (должен быть включен)
if (isset($registry->index)) {
    var_dump( $registry->index );
}

?>]]></programlisting>
        </example>

    </sect2>

    <sect2 id="zend.registry.using.subclassing">

        <title>Создание подклассов</title>

        <para>
            Статический реестр является экземпляром класса Zend_Registry. Если
            вы хотите добавить в реестр дополнительный функционал, то можете
            создать класс, наследующий от Zend_Registry и определить его как
            используемый для статического реестра. Используйте статический метод
            setClassName() для установки класса. Этот класс должен
            наследовать от Zend_Registry.

        </para>

        <example id="zend.registry.using.subclassing.example">
            <title>Пример установки класса статического реестра</title>
            <programlisting language="php"><![CDATA[<?php

Zend_Registry::setClassName('My_Registry');

Zend_Registry::set('index', $value);

?>]]></programlisting>
        </example>

        <para>
            Реестр бросает исключение, если вы пытаетесь установить имя класса,
            используемого для статического реестра, после того, как было первое
            обращение к реестру. Рекомендуется устанавливать имя класса в
            загрузочном коде.

        </para>

    </sect2>

    <sect2 id="zend.registry.using.unsetting">

        <title>Уничтожение статического реестра</title>

        <para>
            Хотя обычно в этом нет необходимости, вы можете уничтожить
            статический экземпляр реестра. Для этого используйте метод
            _unsetInstance().

        </para>

        <note>
            <title>Угроза потери данных</title>
            <para>
                Когда используете _unsetInstance(), все данные
                в статическом реестре удаляются и не могут быть восстановлены.

            </para>
        </note>

        <para>
            Вы можете применять данный метод, если, например, хотите
            использовать setInstance() или
            setClassName() после того, как был проинциализирован
            объект статического реестра. Уничтожение статического экземпляра
            дает возможность использовать эти методы.

        </para>

        <example id="zend.registry.using.unsetting.example">
            <title>Пример использования метода _unsetInstance()</title>
            <programlisting language="php"><![CDATA[<?php

Zend_Registry::set('index', $value);

Zend_Registry::_unsetInstance();

// изменение класса
Zend_Registry::setClassName('My_Registry');

Zend_Registry::set('index', $value);

?>]]></programlisting>
        </example>

    </sect2>

</sect1>


text:
<?php

namespace LeoAndLeo\GoogleBundle\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class GoogleControllerTest extends WebTestCase
{
    public function testCallback() {
        $client = static::createClient();
        $client->followRedirects();
        $crawler = $client->request('GET', '/google/oauthcallback');

        $this->assertTrue($crawler->filter('html:contains("Lists")')->count() > 0);
    }

    public function testCallbackError() {
        $client = static::createClient();

        $crawler = $client->request('GET', '/google/oauthcallback?error=toto');

        $this->assertTrue($crawler->filter('html:contains("You don\'t have access to the application")')->count() > 0);
    }
}


text:
#import "AbstractTest.h"

@interface DataDrivenTest : AbstractTest {
    NSString *dir;
    NSDirectoryEnumerator *files;
}
@end


text:
title: Portfolio
layout: default
---

<!DOCTYPE html>

	<meta charset="UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Andy - Timeline</title>
	<link rel="stylesheet" type="text/css" href="css/timeline.css" />

Andy

Mortgage Calculator

						<time>2017.09</time>

								Mortgage calculator is a mobile app to calculate your mortgage repayment and help you create a financial plan. Its major features includes:

1. Mobile-friendly layout and interactive operations

2. Support 1-30 years loan calculation

3. Detailed repayment report

4. Multi-languages support

5. Auto save calculation result

Responsible : design, development, testing, release and maintain

								Try it

Quick Helper server

						<time>2017.07</time>

								Quick Helper is an innovative mobile app to assist people and encourages effecive communication.

 This is the back-end and it is released as RESTFUL webservices.

Responsible : Back-End,Database, Web Services

								Try it


text:
- It seems as if Docker consider themselves [production ready][dockerReady]
- Google's services [support Docker clusters][googleDocker]
- MS's services [support Docker clusters][msDocker]

### Master Staging/QA

There is a strong use case for having a dedicated "master" copy of a
clusternated application that is _not_ torn down after a PR closes.

This should be achievable with the use of an additional set of clusternator
tags.

If an application's PR is good, then instead of tearing it down we could:

- tag all existing "master" resources to be "master.1" or similar
- tag all of the good PR's resources to be "master"
- update the route53 DNS to point to the new "master"

This gives us a simple, and fast rollback mechanism, since the "master.1"
instances would remain 'hot'.  Also it means there's no other work to do in
bringing up/rotating master...

On the other hand, it would likely be useful to be able to spin up a
clusternated application based on _any_ SHA in that repo.

### Databases, The Clusternator, and Logging

There has been some concern about Dockerized databases, and emphemarality.
There is a [post on Stackoverlfow][dockerDatabase] that makes a case for
Dockerizing databases.  The post author is also working on a FLOSS project
called [Flocker][flocker], which seems to simplify some container management,
and migration issues.

Docker [has their own][dockerDBStorage] recommendations on data management.
These recommendations _seem_ very straightforward.

In the AWS world, [Elastic Block Store][EBS] volumes are persistent, easy to
back up, and easy to mount, could be used as persistent storage for Clusternator
containers. (Flocker _might_ be able to abstract all this away)

Possible uses:

- EBS for DB Test data
- EBS for Staging/QA DB
- EBS for Production DB
- EBS for (inital) logs for each PR
- EBS for persistent caching services

Possible complications:

- Backups, especially for databases. [Snapshotting EBS][BackupWithEbs] works
well, but the linked method _can_ also cause DB locks that nobody wants

### Production

Production seems like it has a lot of uncertainty, as different consumers
will have different needs in production.

Assumed Requirements:

- Dedicated/Isolated VPC (or similar) area for production environments
- Simple/Fast rollback options
- Multi-availability zones, and fault tolerant architecture
- Isolated Services/Micro services - possibly having DB's in restricted subnets
- Rigorous database backups

On the AWS level it seems like clusternator could do this.  We would need to
devise a configuration scheme.

One down side is that it would likely be really nice to have the staging/QA
environment be an _exact_ replica of production, and isolating subnets causes
a conflict with the _current_ dockernator resource scheme.  If the Clusternator
resource scheme were altered to use a VPC per project, instead of a subnet (or
two in the case of multi-AZ) this would not be a problem.  However the VPC per
project scheme requires service adjustments from AWS.

### Bare Virtual Metal, and S3

Docker is pretty awesome, and it abstracts away a _lot_ of issues, especially
with respect to backend development having a consistent environment.

The downside to Docker is that it's another layer of containerization, and it
requires configuration, and dockerization of applications.

AWS's Docker (ECS) service requires resources that a bare "virtual metal" server
would need.  Meaning a simple node service could be spun up directly on an AWS
virtual machine _without_ a docker agent, AWS services, AWS tasks, or an AWS
ECS Agent.  The cool part is that the code for this already exists, with the
exception of the `git pull`/`npm install` step.

For purely static sites Amazon's S3 _might_ be the most economical option
available.  Launching HTTP S3 websites is _very_ easy to do manually, there
would be some work in automating it.  Launching HTTPS S3 websites is similar,
but requires a CloudFront service, and an HTTPS cert, but is otherwise quite
straightforward.  Tying these resources to a DNS entry is almost the exact same
as tying an EC2, or ECS service to DNS.

[msDocker]: https://azure.microsoft.com/en-us/blog/tag/docker/ "MS Azure's Docker Solutions"
[googleDocker]: https://cloud.google.com/compute/docs/containers?hl=en "Google's Docker Solutions"
[dockerReady]: https://blog.docker.com/2015/06/docker-ready-for-production/ "Docker, Allegedly Production Ready"
[dockerDatabase]: http://stackoverflow.com/questions/25047986/does-it-make-sense-to-dockerize-containerize-databases "Dockerized Databases"
[flocker]: https://clusterhq.com/flocker/introduction/ "Flocker, Container Management"
[dockerDBStorage]: http://docs.docker.com/engine/userguide/dockervolumes/ "Managing Data"
[EBS]:https://aws.amazon.com/ebs/ "Amazon's Elastic Block Storage"
[BackupsWithEBS]:https://aws.amazon.com/articles/1663 "Backing up EBS database volumes"


text:
#include "renderer/OpenGL/glhead.h"
#include "renderer/OpenGL/glInfo.h"
#include <QGLViewer/qglviewer.h>
#include <QImage>
#include <QTime>
#include <QFileDialog>
#include <QMessageBox>
#include <QDir>

#include "geometry/RenderMesh.h"
#include "geometry/RenderManager.h"
#include "renderer/OpenGL/GLTexture2D.h"
#include "renderer/OpenGL/ImmediateMeshRenderer.h"
#include "renderer/OpenGL/LightController.h"
#include "math/Vectors.h"
#include "meshIO/OBJMeshLoader.h"
#include "geometry/Primitive.h"
#include "geometry/Camera.h"

using namespace Etoile;
class MeshViewer : public QGLViewer
{
	Q_OBJECT

	RenderManager* manager;
	Camera* p_camera;
public:
	MeshViewer()
	{

	}

	~MeshViewer()
	{
		clear();
	}

	void clear()
	{

	}

	void init()
	{
		glInfo* info = glInfo::getInstance();
		info->initAllOpenGL();

		setMouseTracking(true);
		setFocusPolicy(Qt::StrongFocus);
		setShortcut(DISPLAY_FPS,Qt::CTRL+Qt::Key_F);

		glEnable(GL_DEPTH_TEST);
		glDepthFunc(GL_LEQUAL);
		glCullFace(GL_BACK);
		glEnable(GL_CULL_FACE);
		glPolygonMode(GL_FRONT,GL_FILL);

		glClearColor(0, 0, 0, 0.99);
		glEnable(GL_LINE_SMOOTH);
		glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
		glShadeModel(GL_SMOOTH);
		glEnable(GL_MULTISAMPLE);

		QString str = QDir::currentPath();

		Triangle* triangle = new Triangle();
		triangle->init();
		RenderMesh* mesh = new RenderMesh("triangle");
		RenderSubMesh* submesh = new RenderSubMesh("triangle");
		mesh->addRenderSubMesh(submesh);
		submesh->m_vdata = triangle->m_vdata;
		submesh->m_tdata = triangle->m_tdata;
		submesh->m_ndata = triangle->m_ndata;
		submesh->m_vertices_index_face = triangle->m_vertices_index_face;
		ImmediateMeshRenderer* renderer = new ImmediateMeshRenderer("triangle");
		Entity* entity = new Entity();
		entity->setComponent(ComponentType::RENDER_COMPONENT, renderer);
		renderer->setRenderMesh(mesh);
		RenderManager::getInstance()->add(renderer);
		p_camera = new Camera(Vec3f(0,0,-1), Vec3f(0,1,0), Vec3f(0,0,2));
		//p_camera->getTransform()->setPosition(Vec3f(0,0,2));

	}

	void readMeshFile()
	{
		QString name = QFileDialog::getOpenFileName(this, tr("Open File"),"",tr("Mesh (*.obj)"));
		OBJMeshLoader objloader;
		std::cout<< "loadMesh" << std::endl;
		QTime qtime;
		qtime.start();

		RenderMesh* _pMesh = new RenderMesh("mesh");
		objloader.loadFromFile(name.toStdString(), _pMesh);
		//std::map<std::string, std::string> txtPath = objloader.getTexturePathMap();
		//std::vector<Material>& mats = objloader.getMaterials();
		//for(unsigned int i = 0; i < mats.size(); ++i){
		//	//_pRenderman->getMaterialManager()->addMaterial(new Material(mats[i]));
		//}
		////loadTextures(txtPath);
		//std::cout<<"loading time: "<<qtime.elapsed()<<" msc"<<std::endl;

		//std::vector<RenderSubMesh*> submeshes = _pMesh->getRenderSubMeshList();
		//for(unsigned int i = 0; i < submeshes.size(); ++i)
		//{
		//	RenderSubMesh* sub = submeshes[i];
		//}

		//setGPUProgramRenderer();
	}

	void draw()
	{
		glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

		/*p_camera->computeModelViewMatrix();
		float* modelv = p_camera->getGLModelViewMatrix();
		glLoadMatrixf(modelv);*/
		RenderManager::getInstance()->renderOneFrame();
	}

	//void loadTextures(std::map<std::string, std::string>& txtPath)
	//{
	//	std::map<std::string, std::string>::iterator itor;
	//	for(itor = txtPath.begin(); itor != txtPath.end(); ++itor)
	//	{
	//		std::string textureName = itor->first;
	//		std::string texturePath = itor->second;

	//		Image image;
	//		bool b_image = ReadImage::loadImageFromFile(texturePath, image);

	//		if(b_image != true)
	//		{
	//			std::cout<<"can not load texture : "<<textureName<<std::endl;
	//			//assert(!qimage.isNull());
	//		}
	//		else
	//		{
	//			GLTexture2D* t = new GLTexture2D(textureName);
	//			t->create(image.getWidth(), image.getHeight(),1 , GL_RGBA32F_ARB, GL_RGBA, GL_FLOAT ,(float*)&image.getData()[0], false);

	//		}
	//		float emptyMap[16] = {1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1};
	//		float checkboard[64] = {0,0,0,0, 1,1,1,1, 0,0,0,0, 1,1,1,1,
	//			1,1,1,1,0,0,0,0, 1,1,1,1,0,0,0,0,
	//			0,0,0,0, 1,1,1,1, 0,0,0,0, 1,1,1,1,
	//			1,1,1,1,0,0,0,0, 1,1,1,1,0,0,0,0};
	//		GLTexture2D* t = new GLTexture2D("emptyMap");
	//		t->create(2, 2, 1 , GL_RGBA32F_ARB, GL_RGBA, GL_FLOAT , &emptyMap[0], false);
	//		GLTexture2D* t2 = new GLTexture2D("checkBoardMap");
	//		t2->create(4, 4, 1 , GL_RGBA32F_ARB, GL_RGBA, GL_FLOAT , &checkboard[0], false);

	//	}
	//}

	public slots:
		void setBasicRenderer()
		{
			/*_pRenderman->clear();
			std::vector<Resource*> meshes = _pRenderman->getMeshManager()->getAll();
			GLMeshRenderPass* rp = new GLMeshRenderPass("empty");
			for(unsigned int i = 0 ; i < meshes.size(); ++i)
			{
				Mesh* _pMesh = (Mesh*)meshes[i];
				DisplayListMeshRenderer* _organizer = new DisplayListMeshRenderer("");
				_organizer->setMesh(_pMesh);
				rp->addRenderUnit(_organizer);
			}
			_pRenderman->addRenderPass(rp);*/
		}

};


text:
@implementation ExtractZipFilePlugin

@synthesize callbackID;

- (void)extract:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options
{
    callbackID = [arguments pop];

    NSString *file = [arguments objectAtIndex:0];
    NSString *destination = [arguments objectAtIndex:1];

    CDVPluginResult *result;
    if([SSZipArchive unzipFileAtPath:file toDestination:destination delegate:nil]) {
        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:[destination stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
        [self writeJavascript:[result toSuccessCallbackString:callbackID]];
    } else {
        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:[@"Could not extract archive" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
        [self writeJavascript:[result toErrorCallbackString:callbackID]];
    }
}

@end


text:
<?php

namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy;

use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\Output;
use Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand;

/**
 * Command to execute the SQL needed to generate the database schema for
 * a given entity manager.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 * @author Jonathan H. Wage <jonwage@gmail.com>
 */
class CreateSchemaDoctrineCommand extends CreateCommand
{
    /**
     * {@inheritDoc}
     */
    protected function configure()
    {
        parent::configure();

        $this
            ->setName('doctrine:schema:create')
            ->setDescription('Executes (or dumps) the SQL needed to generate the database schema')
            ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
            ->setHelp(<<<EOT
The <info>doctrine:schema:create</info> command executes the SQL needed to
generate the database schema for the default entity manager:

<info>php app/console doctrine:schema:create</info>

You can also generate the database schema for a specific entity manager:

<info>php app/console doctrine:schema:create --em=default</info>

Finally, instead of executing the SQL, you can output the SQL:

<info>php app/console doctrine:schema:create --dump-sql</info>
EOT
        );
    }

    /**
     * {@inheritDoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));

        parent::execute($input, $output);
    }
}


text:
using System;
using System.Xml.Linq;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.PropertyEditors;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Strings;
using Umbraco.Cms.Infrastructure.Migrations;
using Umbraco.Cms.Infrastructure.Migrations.Expressions;
using Umbraco.Cms.Infrastructure.Migrations.Expressions.Common;

namespace Umbraco.Cms.Infrastructure.Packaging
{
    internal class ImportPackageBuilder : ExpressionBuilderBase<ImportPackageBuilderExpression>, IImportPackageBuilder, IExecutableBuilder
    {
        public ImportPackageBuilder(
            IPackagingService packagingService,
            IMediaService mediaService,
            MediaFileManager mediaFileManager,
            MediaUrlGeneratorCollection mediaUrlGenerators,
            IShortStringHelper shortStringHelper,
            IContentTypeBaseServiceProvider contentTypeBaseServiceProvider,
            IMigrationContext context,
            IOptions<PackageMigrationSettings> options)
            : base(new ImportPackageBuilderExpression(
                packagingService,
                mediaService,
                mediaFileManager,
                mediaUrlGenerators,
                shortStringHelper,
                contentTypeBaseServiceProvider,
                context,
                options))
        {
        }

        public void Do() => Expression.Execute();

        public IExecutableBuilder FromEmbeddedResource<TPackageMigration>()
            where TPackageMigration : PackageMigrationBase
        {
            Expression.EmbeddedResourceMigrationType = typeof(TPackageMigration);
            return this;
        }

        public IExecutableBuilder FromEmbeddedResource(Type packageMigrationType)
        {
            Expression.EmbeddedResourceMigrationType = packageMigrationType;
            return this;
        }

        public IExecutableBuilder FromXmlDataManifest(XDocument packageDataManifest)
        {
            Expression.PackageDataManifest = packageDataManifest;
            return this;
        }
    }
}


text:
using UnityEngine;
using System.Collections;

namespace UnityEngine.UI.Windows {

	[ExecuteInEditMode()]
	public class WindowModule : WindowLayoutBase {

		[Header("Module")]
		public int defaultSortingOrder;
		public bool defaultBackgroundLayer;

		#if UNITY_EDITOR
		[Header("Module Editor")]
		public string comment;
		#endif

	}

}


text:
package com.googlecode.charts4j;

import static com.googlecode.charts4j.Color.*;
import static com.googlecode.charts4j.UrlUtil.normalize;
import static org.junit.Assert.assertEquals;

import java.util.logging.Logger;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

public class PlotTest {

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
    }

    @AfterClass
    public static void tearDownAfterClass() throws Exception {
    }

    @Before
    public void setUp() throws Exception {
    }

    @After
    public void tearDown() throws Exception {
    }

    @Test
    public void testAddShapeMarkersShapeColorIntIntInt() {
        final Line line =  TestUtil.getBasicLine();
        line.addShapeMarkers(Shape.DIAMOND, BLUE, 12);
        final LineChart chart = GCharts.newLineChart(line);
        Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).info(chart.toURLString());
        String expectedString = "http://chart.apis.google.com/chart?chd=e:AAgA..&chm=d,0000FF,0,-1,12,0&chs=200x125&cht=lc";
        assertEquals("Junit error", normalize(expectedString), normalize(chart.toURLString()));
    }

    @Test
    public void testAddTextMarkers() {
        final Line line =  TestUtil.getBasicLine();
        line.addTextMarker("foo", BLACK, 12, 1);
        final LineChart chart = GCharts.newLineChart(line);
        Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).info(chart.toURLString());
        String expectedString = "http://chart.apis.google.com/chart?chd=e:AAgA..&chm=tfoo,000000,0,1,12,0&chs=200x125&cht=lc";
        assertEquals("Junit error", normalize(expectedString), normalize(chart.toURLString()));
    }

    @Test
    public void testAddShapeMarkersShapeColorInt() {
        final Line line =  TestUtil.getBasicLine();
        line.addShapeMarkers(Shape.DIAMOND, BLUE, 12);
        final LineChart chart = GCharts.newLineChart(line);
        Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).info(chart.toURLString());
        String expectedString = "http://chart.apis.google.com/chart?chd=e:AAgA..&chm=d,0000FF,0,-1,12,0&chs=200x125&cht=lc";
        assertEquals("Junit error", normalize(expectedString), normalize(chart.toURLString()));
    }

    @Test
    public void testAddMarkers() {
        final Line line =  TestUtil.getBasicLine();
        line.addMarker(Markers.newShapeMarker(Shape.X, RED, 12), 0);
        line.addMarker(Markers.newTextMarker("foo", BLACK, 12), 1);
        final LineChart chart = GCharts.newLineChart(line);
        Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).info(chart.toURLString());
        String expectedString = "http://chart.apis.google.com/chart?chd=e:AAgA..&chm=x,FF0000,0,0,12,0|tfoo,000000,0,1,12,0&chs=200x125&cht=lc";
        assertEquals("Junit error", normalize(expectedString), normalize(chart.toURLString()));
    }

    @Test
    public void testAddFlaggedMarkers() {
        final Line line =  TestUtil.getBasicLine();
        line.addMarker(Markers.newFlaggedTextMarker("foo", BLACK, 12), 1);
        final LineChart chart = GCharts.newLineChart(line);
        Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).info(chart.toURLString());
        String expectedString = "http://chart.apis.google.com/chart?chd=e:AAgA..&chm=ffoo,000000,0,1,12,0&chs=200x125&cht=lc";
        assertEquals("Junit error", normalize(expectedString), normalize(chart.toURLString()));
    }
}


text:
namespace Bungie.Definitions
{
    public class VendorCategory
    {
        public long CategoryHash { get; set; }
        public int Order { get; set; }
        public string CategoryName { get; set; }
        public string MobileBannerPath { get; set; }
        public string Identifier { get; set; }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.pspad.com">
  <title></title>
  </head>
  <body  bgcolor="#e5e5e7">
  Search Frame

  </body>
</html>


text:
<?php
declare(strict_types = 1);

namespace Soliant\SimpleFM\Collection;

use Countable;
use Traversable;

interface CollectionInterface extends Countable, Traversable
{
    public function getTotalCount() : int;

    public function isEmpty() : bool;

    public function first();
}


text:
package com.limpoxe.fairy.core.viewfactory;

import android.app.Activity;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;

import com.limpoxe.fairy.core.compat.CompatForFragmentClassCache;
import com.limpoxe.fairy.util.LogUtil;

/**
 * Created by Administrator on 2015/12/13.
 *
 * Porting From SupportV7
 */
public class PluginViewFactory implements PluginFactoryInterface {

	final Activity mContext;
	final Window mWindow;
	final Window.Callback mOriginalWindowCallback;
	final LayoutInflater.Factory mViewfactory;

	PluginViewInflater mPluginViewInflater;

	public PluginViewFactory(Activity context, Window window, LayoutInflater.Factory viewfactory) {
		mContext = context;
		mWindow = window;
		mOriginalWindowCallback = window.getCallback();
		mViewfactory = viewfactory;
	}

	public void installViewFactory() {
		LogUtil.d("安装PluginViewFactory");
		LayoutInflater layoutInflater = mContext.getLayoutInflater();
		if (layoutInflater.getFactory() == null) {
			PluginFactoryCompat.setFactory(layoutInflater, this);
		} else {
			LogUtil.d("The Activity's LayoutInflater already has a Factory installed"
					+ " so we can not install plugin's");
		}
		LogUtil.d("安装PluginViewFactory完成");
	}

	@Override
	public final View onCreateView(View parent, String name,
								   Context context, AttributeSet attrs) {
		if ("fragment".equals(name)) {

			String pluginId = attrs.getAttributeValue(null, "context");
			String fname = attrs.getAttributeValue(null, "class");
			if (fname == null) {
				int count = attrs.getAttributeCount();
				for(int i = 0; i < count; i++) {
					if ("name".equals(attrs.getAttributeName(i))) {
						fname = attrs.getAttributeValue(i);
						break;
					}
				}
			}

			if (pluginId != null) {
				Context fragmentContext = createContext(context, pluginId);
				if (fragmentContext != null) {
					if (mOriginalWindowCallback instanceof LayoutInflater.Factory) {

						CompatForFragmentClassCache.forceCache(fragmentContext, fname);

						View view = ((LayoutInflater.Factory) mOriginalWindowCallback).onCreateView(name, fragmentContext, attrs);
						if (view != null) {
							return view;
						}
					}
				}
			}
		}

		// First let the Activity's Factory try and inflate the view
		final View view = callActivityOnCreateView(parent, name, context, attrs);
		if (view != null) {
			return view;
		}

		// If the Factory didn't handle it, let our createView() method try
		return createView(parent, name, context, attrs);
	}

	private View callActivityOnCreateView(View parent, String name, Context context, AttributeSet attrs) {
		View view = null;
		if (mOriginalWindowCallback instanceof LayoutInflater.Factory) {
			view = ((LayoutInflater.Factory) mOriginalWindowCallback)
					.onCreateView(name, context, attrs);
		}

		if (view != null) {
			return view;
		}

		if(Build.VERSION.SDK_INT >= 11) {
			if (mOriginalWindowCallback instanceof LayoutInflater.Factory2) {
				return ((LayoutInflater.Factory2) mOriginalWindowCallback)
						.onCreateView(parent, name, context, attrs);
			}
		}

		return null;
	}

	private View createView(View parent, final String name, Context context,
						   AttributeSet attrs) {
		final boolean isPre21 = Build.VERSION.SDK_INT < 21;

		if (mPluginViewInflater == null) {
			mPluginViewInflater = new PluginViewInflater(mContext, mViewfactory);
		}

		// We only want the View to inherit it's context from the parent if it is from the
		// apps content, and not part of our sub-decor
		final boolean inheritContext = isPre21 && parent != null
				&& parent.getId() != android.R.id.content;

		return mPluginViewInflater.createView(parent, name, context, attrs,
				inheritContext, isPre21);
	}

	private Context createContext(Context Context, String pluginId) {
		if (mPluginViewInflater == null) {
			mPluginViewInflater = new PluginViewInflater(mContext, mViewfactory);
		}
		return mPluginViewInflater.createContext(Context, pluginId);
	}
}


text:
'use strict';

const got = require('got');
const moment = require('moment');
const ghIssuesStats = require('gh-issues-stats');
const tokenDealer = require('token-dealer');
const deepCompact = require('deep-compact');
const promiseRetry = require('promise-retry');
const uniqBy = require('lodash/uniqBy');
const pick = require('lodash/pick');
const promisePropsSettled = require('./util/promisePropsSettled');
const pointsToRanges = require('./util/pointsToRanges');
const hostedGitInfo = require('../util/hostedGitInfo');
const gotRetries = require('../util/gotRetries');

const unavailableStatusCodes = [404, 400, 403, 451];  // 404 - not found; 400 - invalid repo name; 403/451 - dmca takedown
const log = logger.child({ module: 'collect/github' });

/**
 * Extract commits frequency based on the /stats/commit_activity response.
 *
 * @param {object} commitActivity The commit activity response
 *
 * @return {array} The commits
 */
function extractCommits(commitActivity) {
    // Aggregate the commit activity into ranges
    const points = commitActivity.map((entry) => {
        return { date: moment.unix(entry.week).utc(), count: entry.total };
    });
    const ranges = pointsToRanges(points, pointsToRanges.bucketsFromBreakpoints([7, 30, 90, 180, 365]));

    // Finally map to a prettier array based on the ranges
    return ranges.map((range) => {
        return {
            from: range.from,
            to: range.to,
            count: range.points.reduce((sum, point) => sum + point.count, 0),
        };
    });
}

/**
 * Utility function to do a request to the GitHub API.
 *
 * @param {string} resource The resource path
 * @param {object} options  The options inferred from github() options
 *
 * @return {Promise} The promise for GitHub response
 */
function githubRequest(resource, options) {
    const url = `https://api.github.com${resource}`;

    return promiseRetry((retry) => {
        // Use token dealer to circumvent rate limit issues
        return tokenDealer(options.tokens, (token, exhaust) => {
            const handleRateLimit = (response, err) => {
                if (response.headers['x-ratelimit-remaining'] === '0') {
                    const isRateLimitError = err && err.statusCode === 403 && /rate limit/i.test(response.body.message);

                    exhaust(Number(response.headers['x-ratelimit-reset']) * 1000, isRateLimitError);
                }
            };

            return got(url, {
                json: true,
                timeout: 15000,
                headers: Object.assign({ accept: 'application/vnd.github.v3+json' }, token ? { authorization: `token ${token}` } : null),
                retries: gotRetries,
            })
            .then((response) => {
                handleRateLimit(response);
                return response;
            }, (err) => {
                err.response && handleRateLimit(err.response, err);
                throw err;
            });
        }, {
            group: 'github',
            wait: options.waitRateLimit,
            onExhausted: (token, reset) => log.error(`Token ${token ? token.substr(0, 10) : '<empty>'}.. exhausted`, { reset }),
        })
        .then((response) => {
            // If response is 202, it means that there's no cached result so we must wait a bit and try again
            if (response.statusCode === 202) {
                log.debug(`Got 202 response for ${url} (not cached)`);
                retry(Object.assign(new Error(`Empty response for ${url}`), { code: 'NO_CACHED_RESPONSE' }));
            }

            // If response is 204, it means that there's no content.. e.g.: there's no commits yet
            if (response.statusCode === 204) {
                return null;
            }

            return response.body;
        });
    }, { minTimeout: 2500, retries: 5 })
    // If after all the retries there's still no content, return an empty array
    .catch({ code: 'NO_CACHED_RESPONSE' }, (err) => {
        log.warn({ err }, err.message);
        return [];
    })
    // Check if the repository is unavailable
    .catch((err) => unavailableStatusCodes.indexOf(err.statusCode) !== -1, (err) => {
        log.info({ err }, `GitHub request to ${url} failed with ${err.statusCode}`);
        return null;
    })
    .catch((err) => {
        /* istanbul ignore next */
        log.error({ err }, `GitHub request to ${url} failed`);
        /* istanbul ignore next */
        throw err;
    });
}

/**
 * Fetches statistical information for a repository.
 *
 * @param {string} repository The {user}/{project}
 * @param {object} options    The options inferred from github() options
 *
 * @return {Promise} The promise for the stats
 */
function fetchIssuesStats(repository, options) {
    return ghIssuesStats(repository, {
        tokens: options.tokens,
        concurrency: 5,
        got: { retries: gotRetries },
        tokenDealer: {
            wait: options.waitRateLimit,
            lru: tokenDealer.defaultLru,
            onExhausted: (token, reset) => log.error(`Token ${token ? token.substr(0, 10) : '<empty>'}.. exhausted`, { reset }),
        },
    })
    .then((stats) => {
        // Sum up the issues with the pull requests
        return {
            count: stats.issues.count + stats.pullRequests.count,
            openCount: stats.issues.openCount + stats.pullRequests.openCount,
            distribution: Object.keys(stats.issues.distribution).reduce((accumulated, range) => {
                accumulated[range] = stats.issues.distribution[range] + stats.pullRequests.distribution[range];

                return accumulated;
            }, {}),
        };
    })
    // Check if the repository is unavailable
    .catch((err) => unavailableStatusCodes.indexOf(err.statusCode) !== -1, (err) => {
        log.info({ err }, `Fetch of issues stats for ${repository} failed with ${err.statusCode}`);
        return null;
    })
    .catch((err) => {
        /* istanbul ignore next */
        log.error({ err }, `Fetch of issues stats for ${repository} failed`);
        /* istanbul ignore next */
        throw err;
    });
}

// ----------------------------------------------------------------------------

/**
 * Runs the github analyzer.
 * If the repository is not hosted in GitHub, the promise resolves to `null`.
 *
 * @param {object} packageJson The latest package.json data (normalized)
 * @param {object} downloaded  The downloaded info (`dir`, `packageJson`, ...)
 * @param {object} [options]   The options; read below to get to know each available option
 *
 * @return {Promise} The promise that fulfills when done
 */
function github(packageJson, downloaded, options) {
    let repository = packageJson.repository;

    if (!repository) {
        log.debug(`No repository field present for ${packageJson.name}, ignoring..`);
        return Promise.resolve(null);
    }

    const gitInfo = hostedGitInfo(repository.url);

    if (!gitInfo || gitInfo.type !== 'github') {
        log.debug({ repository }, `Repository for ${packageJson.name} is not hosted on GitHub, ignoring..`);
        return Promise.resolve(null);
    }

    options = Object.assign({
        tokens: null,          // The GitHub API tokens to use
        waitRateLimit: false,  // True to wait if rate limit for all tokens were exceeded,
    }, options);

    repository = `${gitInfo.user}/${gitInfo.project}`;

    return promisePropsSettled({
        info: githubRequest(`/repos/${repository}`, options),
        contributors: githubRequest(`/repos/${repository}/stats/contributors`, options),
        commitActivity: githubRequest(`/repos/${repository}/stats/commit_activity`, options),
        statuses: githubRequest(`/repos/${repository}/commits/${downloaded.gitRef || 'master'}/statuses`, options),
        issueStats: fetchIssuesStats(repository, options),
    })
    .then((props) => {
        const propKeys = Object.keys(props);
        const missingProps = propKeys.filter((key) => !props[key]);

        if (missingProps.length) {
            if (missingProps.length === propKeys.length) {
                log.info(`The GitHub repository ${repository} is unavailable`);
            } else {
                log.info(`It seems that the GitHub repository ${repository} is empty`);
            }

            return null;
        }

        return deepCompact({
            homepage: props.info.homepage,
            forkOf: (props.info.fork && props.info.parent && props.info.parent.full_name) || null,

            starsCount: props.info.stargazers_count,
            forksCount: props.info.forks_count,
            subscribersCount: props.info.subscribers_count,

            issues: Object.assign(props.issueStats, { isDisabled: !props.info.has_issues }),

            // Contributors (top 100)
            contributors: props.contributors
            .map((contributor) => {
                const author = contributor.author;

                // Empty entries will be stripped by deepCompact
                return author && { username: contributor.author.login, commitsCount: contributor.total };
            })
            .reverse(),

            // Commit activity
            commits: extractCommits(props.commitActivity),

            // Statuses
            statuses: uniqBy(props.statuses, (status) => status.context)
            .map((status) => pick(status, 'context', 'state')),
        });
    })
    .tap(() => log.debug(`The github collector for ${packageJson.name} completed successfully`));
}

module.exports = github;


text:
This package provides NoriginMedia .eslintrc as an extensible shared config.

## Usage

Since we use ESlint ^3.0.1 you will need to have node 4+ to run it.

### eslint-config-norigin

Our default export contains all of our ESLint rules, including ECMAScript 2015+.

You can add next lines to your .eslintrc:

`"extends": "norigin"` - eslint (ECMAScript 2015+), import rules

`"extends": "norigin/react"` - eslint (ECMAScript 2015+), react, import rules

`"extends": "norigin/react&accessibility"` - eslint (ECMAScript 2015+), react, react-a11y, import rules

`"extends": "norigin/react-native"` - eslint (ECMAScript 2015+), react, react-native, import rules

`"extends": "norigin/react-native&accessibility"` - eslint (ECMAScript 2015+), react, react-native react-a11y, import rules

`"extends": "norigin/legacy"` - eslint (ECMAScript 5)


text:
package com.eden.orchid.api.site;

import com.eden.orchid.api.options.OptionsHolder;
import com.eden.orchid.api.options.annotations.Description;
import com.eden.orchid.api.options.annotations.Option;
import com.eden.orchid.api.options.annotations.RelationConfig;
import com.eden.orchid.impl.relations.AssetRelation;

@Description(value = "The global information for your Orchid site.", name = "Site Info")
public final class SiteInfo implements OptionsHolder {

    @Option
    @Description("A fully-specified URL to an avatar image, or a relative path to an Orchid image.")
    private AssetRelation avatar;

    @Option @RelationConfig(itemId = "favicon.ico")
    @Description("A fully-specified URL to a favicon image, or a relative path to an Orchid image.")
    private AssetRelation favicon;

    @Option
    @Description("The proper name of the site. May be used for display, or as a fallback to a page's title tag if " +
            "the page doesn't specify a title."
    )
    private String siteName;

    @Option
    @Description("A short subtitle for the site, usually just for display.")
    private String subtitle;

    @Option
    @Description("A short description of the site. May be used for display, or as a fallback to a page's meta " +
            "description tag if the page doesn't specify a description."
    )
    private String siteDescription;

    public AssetRelation getAvatar() {
        return this.avatar;
    }

    public AssetRelation getFavicon() {
        return this.favicon;
    }

    public String getSiteName() {
        return this.siteName;
    }

    public String getSubtitle() {
        return this.subtitle;
    }

    public String getSiteDescription() {
        return this.siteDescription;
    }

    public void setAvatar(AssetRelation avatar) {
        this.avatar = avatar;
    }

    public void setFavicon(AssetRelation favicon) {
        this.favicon = favicon;
    }

    public void setSiteName(String siteName) {
        this.siteName = siteName;
    }

    public void setSubtitle(String subtitle) {
        this.subtitle = subtitle;
    }

    public void setSiteDescription(String siteDescription) {
        this.siteDescription = siteDescription;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <!--shadow-->
    <item
        android:left="2dp"
        android:top="2dp">
        <shape>
            <solid android:color="@android:color/darker_gray" />
            <corners android:radius="3dp" />
        </shape>
    </item>
    <!--White block-->
    <item
        android:bottom="2dp"
        android:right="2dp">
        <shape>
            <solid android:color="@android:color/white" />
            <corners android:radius="3dp" />
        </shape>
    </item>
</layer-list>


text:
name 'python'
maintainer 'Roland Moriz'
maintainer_email 'info+github@moriz.de'
license 'Apache 2.0'
description 'Installs Python, pip and virtualenv. Includes LWRPs for managing Python packages with `pip` and `virtualenv` isolated Python environments.'
version '2.0.0'

depends 'build-essential'
depends 'yum-epel'

recipe 'python', 'Installs python, pip, and virtualenv'
recipe 'python::package', 'Installs python using packages.'
recipe 'python::source', 'Installs python from source.'
recipe 'python::pip', 'Installs pip from source.'
recipe 'python::virtualenv', 'Installs virtualenv using the python_pip resource.'

# TODO: releases limitations
supports 'debian'
supports 'ubuntu'
supports 'redhat'
supports 'fedora'


text:
![](http://jpsierens.com/wp-content/uploads/2016/06/react-eco-wp.gif)

# webpack-react-redux
A boilerplate for playing around with react, redux and react-router with the help of webpack.

Contains:

* a working example of a filterable table which you can play around with (look below).
* ES6 - 7 Support with Babel
* Redux dev tools to help you keep track of the app's state
* Routing
* hot module replacement support so you can change modules or react components without having to reload the browser
* a webpack production config so you can build the app and make it ready for production
* Sass support, just import your styles wherever you need them
* eslint to keep your js readable
* much more...

![](http://jpsierens.me/wp-content/uploads/2016/06/filterableTable-1.gif)

## Run the app

0. ```npm install```
0. ```npm start```

Once running, if you want to hide the redux dev monitor: ```CTRL+H```

Yes, it takes a while to load the first time you open the app.

### Is the hot module replacement really working?

Yup! Take a look:

![](http://jpsierens.me/wp-content/uploads/2016/06/HMR4.gif)

The app updates without the browser having to reload. You don't lose state!

## Build the app
```npm run build```

This will build the app into the "dist" directory in the root of the project. It contains the index.html along with the minified assets, ready for production.

![](http://i.imgur.com/uUg2A3S.png)

It should look something like the above image.

## I don't understand anything!

I went ahead and wrote a detailed series of posts on this project for you. I hope it helps you understand better:

* [configuring webpack](http://jpsierens.me/tutorial-react-redux-webpack/)
* [understanding the app, part 1 (index.js, store, reducers)](http://jpsierens.me/simple-react-redux-application/)
* [understanding the app, part 2 ( Root.js, router and the rest of the app)](http://jpsierens.me/simple-react-redux-application-2/)

## Why doesn't it have async?
To keep it unopinionated. You choose what async library you want. If you want to check out a full example with async in it, check this simple [todo-app](https://github.com/jpsierens/todo-app) that uses redux-sagas.


text:
import pyspark.streaming.kafka
from pyspark.streaming.kafka import OffsetRange
import pyspark.streaming
import pyspark

sc = pyspark.SparkContext(appName="kafka_testing", master='local[*]')

#dstream_time_interval = 5
#ssc = pyspark.streaming.StreamingContext(sc,dstream_time_interval)

#@staticmethod
#def createRDD(sc, kafkaParams, offsetRanges, leaders={},
             #keyDecoder=utf8_decoder, valueDecoder=utf8_decoder):

kafka_params = {"zookeeper.connect": "localhost:2182",
                "metadata.broker.list": "localhost:9092",
		"group.id": "TutorialGroup1",
		"zookeeper.connection.timeout.ms": "10000"}

tutorial1 = OffsetRange(topic='movie_reviews', partition=0, fromOffset=0, untilOffset=2)

offset_ranges = [tutorial1]

kafka = pyspark.streaming.kafka.KafkaUtils.createRDD(sc, kafka_params,offset_ranges)
kafka = kafka.map(lambda x: x[1])
print kafka.collect()
#kafka = pyspark.streaming.kafka.KafkaUtils.createStream(ssc, 'localhost:2181', 'TutorialGroup1', {'t1':1})
#kafka.pprint()

#ssc.start()
#ssc.awaitTermination()


text:
#import "NSObject.h"

#import "DVTInvalidation-Protocol.h"
#import "NSOutlineViewDataSource-Protocol.h"
#import "NSOutlineViewDelegate-Protocol.h"

@class DVTMapTable, DVTStackBacktrace, IDENICFilterProxy, IDENavigatorOutlineView, NSArray, NSHashTable;

@interface _IDENavigatorOutlineViewDataSource : NSObject <NSOutlineViewDataSource, NSOutlineViewDelegate, DVTInvalidation>
{
    id _expandedItems;
    id _rootItems;
    id _filterProgressObserver;
    id _navigableItemGraphObserver;
    id _navigableItemPropertyObserver;
    id _forgottenNavigableItemsObserver;
    DVTMapTable *_navItemChangeCountByItem;
    IDENICFilterProxy *_coordinatorFilteredItems;
    unsigned long long _numberOfRowsBeforeExpandOrCollapse;
    BOOL _didWarnForUnusualRowHeight;
    IDENavigatorOutlineView *_outlineView;
    id _realObject;
    DVTMapTable *_trayOpenMap;
    double _currentModifiedExpansionTimestamp;
    struct {
        unsigned int realDataSourceRespondsTo_child_ofItem:1;
        unsigned int realDataSourceRespondsTo_childItemsForItem:1;
        unsigned int realDataSourceRespondsTo_isItemExpandable:1;
        unsigned int realDataSourceRespondsTo_numberOfChildrenOfItem:1;
        unsigned int realDataSourceRespondsTo_objectValueForTableColumn_byItem:1;
        unsigned int realDataSourceRespondsTo_setObjectValue_forTableColumn_byItem:1;
        unsigned int realDataSourceRespondsTo_trayCellsForHeaderItem:1;
        unsigned int realDelegateRespondsTo_willDisplayCell_forTableColumn_item:1;
        unsigned int realDelegateRespondsTo_selectionIndexesForProposedSelection:1;
        unsigned int realDelegateRespondsTo_dataCell_forTableColumn_item:1;
        unsigned int realDelegateRespondsTo_ItemDidExpand:1;
        unsigned int realDelegateRespondsTo_ItemDidCollapse:1;
        unsigned int realDelegateRespondsTo_ItemDidExpandTray:1;
        unsigned int realDelegateRespondsTo_ItemDidCollapseTray:1;
        unsigned int realDelegateRespondsTo_heightOfRowByItem:1;
        unsigned int realDelegateRespondsTo_shouldShowOutlineCellForItem:1;
        unsigned int realDelegateRespondsTo_shouldShowOutlineCellForItemMouseHovering:1;
        unsigned int realDelegateRespondsTo_shouldExpandItem:1;
        unsigned int realDelegateRespondsTo_shouldCollapseItem:1;
        unsigned int realDelegateRespondsTo_shouldCollapseTrayForItem:1;
        unsigned int realDelegateRespondsTo_outlineViewSelectionDidChange:1;
        unsigned int realDelegateRespondsTo_toolTipForCell:1;
        unsigned int realDelegateRespondsTo_isGroupHeaderItem:1;
        unsigned int realDelegateRespondsTo_shouldShowCellExpansion:1;
        unsigned int notifyingDelegateOfExpandOrCollapse:1;
        unsigned int clearingExpandedItems:1;
        unsigned int accessingChildItemsForItem:1;
        unsigned int _pad:8;
    } _idenovdsFlags;
}

+ (void)initialize;
@property(retain) id realObject; // @synthesize realObject=_realObject;
@property(retain) IDENavigatorOutlineView *outlineView; // @synthesize outlineView=_outlineView;
- (void).cxx_destruct;
- (double)outlineView:(id)arg1 heightOfRowByItem:(id)arg2;
- (double)_outlineView:(id)arg1 heightOfRowByItem:(id)arg2;
- (BOOL)outlineView:(id)arg1 isGroupHeaderItem:(id)arg2;
- (void)outlineViewItemDidCollapse:(id)arg1;
- (BOOL)outlineView:(id)arg1 shouldCollapseItem:(id)arg2;
- (void)outlineViewItemDidExpand:(id)arg1;
- (BOOL)_shouldExpandCollapseSiblingsOfItem:(id)arg1;
- (BOOL)outlineView:(id)arg1 shouldExpandItem:(id)arg2;
- (BOOL)outlineView:(id)arg1 shouldShowOutlineCellForItem:(id)arg2;
@property(readonly) NSHashTable *expandedItems;
- (void)outlineViewSelectionDidChange:(id)arg1;
- (void)outlineView:(id)arg1 willDisplayCell:(id)arg2 forTableColumn:(id)arg3 item:(id)arg4;
- (id)outlineView:(id)arg1 toolTipForCell:(id)arg2 rect:(struct CGRect *)arg3 tableColumn:(id)arg4 item:(id)arg5 mouseLocation:(struct CGPoint)arg6;
- (BOOL)outlineView:(id)arg1 shouldShowCellExpansionForTableColumn:(id)arg2 item:(id)arg3;
- (id)outlineView:(id)arg1 dataCellForTableColumn:(id)arg2 item:(id)arg3;
- (BOOL)outlineView:(id)arg1 shouldEditTableColumn:(id)arg2 item:(id)arg3;
- (id)outlineView:(id)arg1 selectionIndexesForProposedSelection:(id)arg2;
- (void)outlineView:(id)arg1 willDisplayOutlineCell:(id)arg2 forTableColumn:(id)arg3 item:(id)arg4;
- (void)outlineView:(id)arg1 setObjectValue:(id)arg2 forTableColumn:(id)arg3 byItem:(id)arg4;
- (id)outlineView:(id)arg1 objectValueForTableColumn:(id)arg2 byItem:(id)arg3;
- (long long)outlineView:(id)arg1 numberOfChildrenOfItem:(id)arg2;
- (BOOL)outlineView:(id)arg1 isItemExpandable:(id)arg2;
- (id)outlineView:(id)arg1 child:(long long)arg2 ofItem:(id)arg3;
- (void)primitiveInvalidate;
- (id)forwardingTargetForSelector:(SEL)arg1;
- (BOOL)respondsToSelector:(SEL)arg1;
- (void)_noteTrayOpenStatesMayHaveChanged;
- (void)setTrayOpenAmount:(double)arg1 forItem:(id)arg2;
- (double)outlineView:(id)arg1 trayOpenAmountForItem:(id)arg2;
- (id)trayCellsForHeaderItem:(id)arg1;
- (id)childItemsForItem:(id)arg1;
- (void)refreshFilterPredicate;
@property(copy) NSArray *rootItems;
- (void)processNavigableItemDidForgetNotification:(id)arg1;
- (void)processNavigableItemGraphChangeNotification:(id)arg1;
- (void)_clearExpandedItems;
- (BOOL)notifyingRealDelegateOfExpandOrCollapse;
- (id)objectInOutlineViewDataSourceRootItemsAtIndex:(long long)arg1;
- (long long)countOfOutlineViewDataSourceRootItems;
- (id)initWithOutlineView:(id)arg1 realObject:(id)arg2;

// Remaining properties
@property(retain) DVTStackBacktrace *creationBacktrace;
@property(readonly) DVTStackBacktrace *invalidationBacktrace;
@property(readonly, nonatomic, getter=isValid) BOOL valid;

@end


text:
<?xml version="1.0"?>
<!--

-->
<page>
    <body>
        <block class="Magento\Framework\View\Element\Template" template="fixture_template_one.phtml"/>
    </body>
</page>