text:
<?php

namespace Topxia\Api\Resource;

use Silex\Application;
use AppBundle\Common\SettingToolkit;
use Biz\CloudPlatform\CloudAPIFactory;
use Symfony\Component\HttpFoundation\Request;

class LessonReplay extends BaseResource
{
    public function get(Application $app, Request $request, $id)
    {
        $task = $this->getTaskService()->getTask($id);
        $activity = $this->getActivityService()->getActivity($task['activityId'], true);

        if (!$task) {
            return $this->error('500', '课时不存在!');
        }

        if (!$this->getCourseService()->canTakeCourse($task['courseId'])) {
            return array('message' => 'Access Denied');
        }

        if ($activity['ext']['replayStatus'] == 'videoGenerated') {
            return json_decode($this->sendRequest('GET', $this->getHttpHost() . $app['url_generator']->generate('get_lesson', array('id' => $task['id'])), array(sprintf('X-Auth-Token: %s', $request->headers->get('X-Auth-Token')))), true);
        }

        $device = $request->query->get('device');
        $copyId = empty($activity['copyId']) ? $activity['id'] : $activity['copyId'];
        $replays = $this->getLiveReplayService()->findReplayByLessonId($copyId);
        if (!$replays) {
            return $this->error('500', '课时回放不存在!');
        }

        $visibleReplays = array_filter($replays, function ($replay) {
            return empty($replay['hidden']);
        });

        $user = $this->getCurrentUser();
        $response = array(
            'url' => '',
            'extra' => array(
                'provider' => '',
                'lessonId' => $activity['id'],

            ),
            'device' => $device,
        );
        try {
            // if liveProvider is edusoho light live we you video as replay;
            if ($activity['ext']['liveProvider'] == 5) {
                //获取globalid
                $globalId = $visibleReplays[0]['globalId'];
                $options = array(
                    'fromApi' => !$this->isSetEncryption(),
                    'times' => 2,
                    'line' => $request->query->get('line', ''),
                    'format' => $request->query->get('format', ''),
                    'type' => 'apiLessonReplay',
                    'replayId' => $visibleReplays[0]['id'],
                    'duration' => '3600'
                );
                $response['url'] = $this->getEsLiveReplayUrl($globalId, $options);
                $response['extra']['provider'] = 'longinus';
            } else {
                $response = CloudAPIFactory::create('root')->get("/lives/{$activity['ext']['liveId']}/replay", array('replayId' => $visibleReplays[0]['replayId'], 'userId' => $user['id'], 'nickname' => $user['nickname'], 'device' => $device));
            }
        } catch (Exception $e) {
            return $this->error('503', '获取回放失败!');
        }

        return $response;
    }

    public function filter($res)
    {
        return $res;
    }

    protected function isSetEncryption()
    {
        $enable_hls_encryption_plus = SettingToolkit::getSetting('storage.enable_hls_encryption_plus');

        if ($enable_hls_encryption_plus) {
            return true;
        }

        return false;
    }

    protected function getEsLiveReplayUrl($globalId, $options)
    {
        $file = $this->getCloudFileService()->getByGlobalId($globalId);
        if (empty($file)) {
            throw new \RuntimeException('获取回放失败!');
        }

        if (!empty($file['metas2']) && !empty($file['metas2']['sd']['key'])) {
            if (isset($file['convertParams']['convertor']) && ($file['convertParams']['convertor'] == 'HLSEncryptedVideo')) {
                $tokenFields = array(
                    'data' => array(
                        'id' => $file['id'],
                        'fromApi' => $options['fromApi'],
                        'type' => $options['type'],
                        'replayId' => $options['replayId'],
                    ),
                    'times' => $options['times'],
                    'duration' => $options['duration'],
                );

                $token = $this->getTokenService()->makeToken('hls.playlist', $tokenFields);

                return $this->getHttpHost() . "/hls/0/playlist/{$token['token']}.m3u8?hideBeginning=1&format={$options['format']}&line=" . $options['line'];
            } else {
                throw new \RuntimeException('当前视频格式不能被播放!');
            }
        } else {
            if (!empty($file['metas']) && !empty($file['metas']['hd']['key'])) {
                $key = $file['metas']['hd']['key'];
            } else {
                $key = $file['hashId'];
            }

            if ($key) {
                $result = $this->getCloudFileService()->player($file['globalId']);
            }
        }

        return isset($result['url']) ? $result['url'] : '';
    }

    protected function getCourseService()
    {
        return $this->getServiceKernel()->createService('Course:CourseService');
    }

    protected function getMediaService()
    {
        return $this->getServiceKernel()->createService('Media:MediaService');
    }

    protected function getTaskService()
    {
        return $this->getServiceKernel()->createService('Task:TaskService');
    }

    protected function getActivityService()
    {
        return $this->getServiceKernel()->createService('Activity:ActivityService');
    }

    protected function getLiveReplayService()
    {
        return $this->getServiceKernel()->createService('Course:LiveReplayService');
    }

    protected function getCloudFileService()
    {
        return $this->getServiceKernel()->createService('CloudFile:CloudFileService');
    }

    protected function getTokenService()
    {
        return $this->getServiceKernel()->createService('User:TokenService');
    }

    protected function sendRequest($method, $url, $headers = array(), $params = array())
    {
        $curl = curl_init();

        curl_setopt($curl, CURLOPT_USERAGENT, 'Open EduSoho App Client 1.0');

        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
        curl_setopt($curl, CURLOPT_TIMEOUT, 5);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_HEADER, 0);
        curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

        if (strtoupper($method) == 'POST') {
            curl_setopt($curl, CURLOPT_POST, 1);
            $params = http_build_query($params);
            curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
        } else {
            if (!empty($params)) {
                $url = $url . (strpos($url, '?') ? '&' : '?') . http_build_query($params);
            }
        }
        curl_setopt($curl, CURLOPT_URL, $url);

        $response = curl_exec($curl);
        curl_close($curl);

        return $response;
    }
}


text:
/* -*-  mode: c++; c-default-style: "google"; indent-tabs-mode: nil -*- */
/*
  ATS is released under the three-clause BSD License.
  The terms of use and "as is" disclaimer for this license are
  provided in the top-level COPYRIGHT file.

  Authors: Ethan Coon (ecoon@lanl.gov)
*/
//! Evaluates the conductivity of surface flow.

/*!

This implements the conductivity of overland flow, which is the nonlinear
coefficient in the diffusion wave equation.  The term is given by:

.. math:
   k = \frac{\delta^{coef}}{n_{mann} \sqrt(| \nabla z |)}

Optionally, this may include a density factor, typically a molar density, which
converts the flow law to water flux rather than volumetric flux.

Also, this evaluator can be used in snow redistribution, and in that case needs
some extra factors (timestep size) to ensure the correct flow law in that case.

.. _overland-conductivity-evaluator-spec
.. admonition:: overland-conductivity-evaluator-spec

   * `"include density`" ``[bool]`` **true** Include the density prefactor,
     converting the flux from volumetric flux to water flux.
   * `"dt factor [s]`" ``[double]`` **-1** The artificial timestep size used in calculating
      snow redistribution, only used in that case.
   * `"swe density factor [-]`" ``[double]`` **10** Ratio of water to snow density.

   DEPENDENCIES:
   - `"mobile depth`" **DOMAIN-mobile_depth** Depth of the mobile water; delta
     in the above equation.
   - `"slope`" **DOMAIN-slope_magnitude** Magnitude of the bed surface driving
     flow; | \nabla z | above.
   - `"coefficient`" **DOMAIN-manning_coefficient** Surface roughness/shape
     coefficient; n_{mann} above.
   - `"molar density liquid`" **DOMAIN-molar_density_liquid** If `"include
     density`" is true, the density.

*/
#pragma once

#include "Factory.hh"
#include "EvaluatorSecondaryMonotype.hh"

namespace Amanzi {
namespace Flow {

class ManningConductivityModel;

class OverlandConductivityEvaluator : public EvaluatorSecondaryMonotypeCV {

 public:
  OverlandConductivityEvaluator(Teuchos::ParameterList& plist);
  OverlandConductivityEvaluator(const OverlandConductivityEvaluator& other) = default;
  Teuchos::RCP<Evaluator> Clone() const override;

  Teuchos::RCP<ManningConductivityModel> get_Model() { return model_; }

 protected:
  // Required methods from EvaluatorSecondaryMonotypeCV
  virtual void Evaluate_(const State& S,
          const std::vector<CompositeVector*>& result) override;
  virtual void EvaluatePartialDerivative_(const State& S,
          const Key& wrt_key, const Tag& wrt_tag, const std::vector<CompositeVector*>& result) override;

  virtual void EnsureCompatibility_ToDeps_(State& S) override;

private:
  Teuchos::RCP<ManningConductivityModel> model_;

  Key mobile_depth_key_;
  Key slope_key_;
  Key coef_key_;
  Key dens_key_;
  double dt_swe_factor_;
  bool dens_;

 private:
  static Utils::RegisteredFactory<Evaluator,OverlandConductivityEvaluator> factory_;
};

} //namespace
} //namespace

redpajama_set_name: RedPajamaGithub


text:
title: Pattern Lab 1 to Pattern Lab 2 Changes
tags:
  - docs
eleventyNavigation:
  title: Pattern Lab 1 to Pattern Lab 2 Changes
  order: 300
sitemapIgnore: true
---

The list of features is coming soon.


text:
package hudson.bugs;

import static org.junit.Assert.assertEquals;

import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import java.net.HttpURLConnection;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.JenkinsRule.WebClient;
import org.jvnet.hudson.test.recipes.PresetData;
import org.jvnet.hudson.test.recipes.PresetData.DataSet;

/**
 * Login redirection ignores the context path
 *
 * @author Kohsuke Kawaguchi
 */
@Issue("JENKINS-2290")
public class LoginRedirectTest {

    @Rule
    public JenkinsRule j = new JenkinsRule();

    /*
     * First sends HTTP 403, then redirects to the login page.
     */
    @PresetData(DataSet.NO_ANONYMOUS_READACCESS)
    @Test
    public void redirect1() throws Exception {
        WebClient wc = j.createWebClient();
        wc.getOptions().setThrowExceptionOnFailingStatusCode(false);

        HtmlPage loginPage = wc.goTo("");
        assertEquals(HttpURLConnection.HTTP_OK, loginPage.getWebResponse().getStatusCode());
        assertEquals(j.contextPath + "/login", loginPage.getUrl().getPath());

        HtmlForm form = loginPage.getFormByName("login");
        form.getInputByName("j_username").setValueAttribute("alice");
        form.getInputByName("j_password").setValueAttribute("alice");
        HtmlPage mainPage = j.submit(form);
        assertEquals(j.contextPath + "/", mainPage.getUrl().getPath());
    }

    /*
     * Verifies that HTTP 403 is sent first. This is important for machine agents.
     */
    @PresetData(DataSet.NO_ANONYMOUS_READACCESS)
    @Test
    public void redirect2() throws Exception {
        WebClient wc = j.createWebClient();
        wc.assertFails("", HttpURLConnection.HTTP_FORBIDDEN);
    }
}


text:
using Microsoft.Azure.Commands.Common.Authentication.Models;
using Microsoft.Azure.Commands.Sql.Backup.Services;
using Microsoft.Azure.Commands.Sql.Common;
using Microsoft.Azure.Commands.Sql.Database.Model;
using System;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Sql.Backup.Cmdlet
{
    [Cmdlet(VerbsData.Restore, "AzureRmSqlDatabase",
        ConfirmImpact = ConfirmImpact.None)]
    public class RestoreAzureRmSqlDatabase
        : AzureSqlCmdletBase<Database.Model.AzureSqlDatabaseModel, AzureSqlDatabaseBackupAdapter>
    {

        private const string FromPointInTimeBackupSetName = "FromPointInTimeBackup";
        private const string FromDeletedDatabaseBackupSetName = "FromDeletedDatabaseBackup";
        private const string FromGeoBackupSetName = "FromGeoBackup";
        private const string FromLongTermRetentionBackupSetName = "FromLongTermRetentionBackup";

        /// <summary>
        /// Gets or sets flag indicating a restore from a point-in-time backup.
        /// </summary>
        [Parameter(
            ParameterSetName = FromPointInTimeBackupSetName,
            Mandatory = true,
            HelpMessage = "Restore from a point-in-time backup.")]
        public SwitchParameter FromPointInTimeBackup { get; set; }

        /// <summary>
        /// Gets or sets flag indicating a restore of a deleted database.
        /// </summary>
        [Parameter(
            ParameterSetName = FromDeletedDatabaseBackupSetName,
            Mandatory = true,
            HelpMessage = "Restore a deleted database.")]
        public SwitchParameter FromDeletedDatabaseBackup { get; set; }

        /// <summary>
        /// Gets or sets flag indicating a geo-restore (recover) request
        /// </summary>
        [Parameter(
            ParameterSetName = FromGeoBackupSetName,
            Mandatory = true,
            HelpMessage = "Restore from a geo backup.")]
        public SwitchParameter FromGeoBackup { get; set; }

        /// <summary>
        /// Gets or sets flag indicating a restore from a long term retention backup
        /// </summary>
        [Parameter(
            ParameterSetName = FromLongTermRetentionBackupSetName,
            Mandatory = true,
            HelpMessage = "Restore from a long term retention backup backup.")]
        public SwitchParameter FromLongTermRetentionBackup { get; set; }

        /// <summary>
        /// Gets or sets the point in time to restore the database to
        /// </summary>
        [Parameter(
            ParameterSetName = FromPointInTimeBackupSetName,
            Mandatory = true,
            HelpMessage = "The point in time to restore the database to.")]
        [Parameter(
            ParameterSetName = FromDeletedDatabaseBackupSetName,
            Mandatory = false,
            HelpMessage = "The point in time to restore the database to.")]
        public DateTime PointInTime { get; set; }

        /// <summary>
        /// Gets or sets the deletion DateTime of the deleted database to restore.
        /// </summary>
        [Parameter(
            ParameterSetName = FromDeletedDatabaseBackupSetName,
            Mandatory = true,
            ValueFromPipelineByPropertyName = true,
            HelpMessage = "The deletion DateTime of the deleted database to restore.")]
        public DateTime DeletionDate { get; set; }

        /// <summary>
        /// The resource ID of the database to restore (deleted DB, geo backup DB, live DB, long term retention backup, etc.)
        /// </summary>
        [Alias("Id")]
        [Parameter(Mandatory = true,
                    ValueFromPipelineByPropertyName = true,
                    HelpMessage = "The resource ID of the database to restore.")]
        public string ResourceId { get; set; }

        /// <summary>
        /// Gets or sets the name of the database server to use.
        /// </summary>
        [Parameter(Mandatory = true,
            ValueFromPipelineByPropertyName = true,
            HelpMessage = "The name of the Azure SQL Server to restore the database to.")]
        [ValidateNotNullOrEmpty]
        public string ServerName { get; set; }

        /// <summary>
        /// Gets or sets the name of the target database to restore to
        /// </summary>
        [Parameter(Mandatory = true,
                    HelpMessage = "The name of the target database to restore to.")]
        public string TargetDatabaseName { get; set; }

        /// <summary>
        /// Gets or sets the target edition of the database to restore
        /// </summary>
        [Parameter(Mandatory = false,
            ValueFromPipelineByPropertyName = true,
            HelpMessage = "The database edition to use for the restored database.")]
        public DatabaseEdition Edition { get; set; }

        /// <summary>
        /// Gets or sets the SLO of the database to restore
        /// </summary>
        [Parameter(Mandatory = false,
            ValueFromPipelineByPropertyName = true,
            HelpMessage = "The service level objective to use for the restored database.")]
        public string ServiceObjectiveName { get; set; }

        /// <summary>
        /// Gets or sets the target elastic pool name
        /// </summary>
        [Parameter(Mandatory = false,
                    ValueFromPipelineByPropertyName = true,
                    HelpMessage = "The name of the elastic pool into which the database should be restored.")]
        public string ElasticPoolName { get; set; }

        /// <summary>
        /// Initializes the adapter
        /// </summary>
        /// <param name="subscription">The subscription ID to operate on</param>
        /// <returns></returns>
        protected override AzureSqlDatabaseBackupAdapter InitModelAdapter(AzureSubscription subscription)
        {
            return new AzureSqlDatabaseBackupAdapter(DefaultProfile.Context);
        }

        /// <summary>
        /// Send the restore request
        /// </summary>
        /// <returns>The list of entities</returns>
        protected override AzureSqlDatabaseModel GetEntity()
        {
            AzureSqlDatabaseModel model;
            DateTime restorePointInTime = DateTime.MinValue;
            string createMode;
            string location = ModelAdapter.GetServerLocation(ResourceGroupName, ServerName);
            switch (ParameterSetName)
            {
                case FromPointInTimeBackupSetName:
                    createMode = "PointInTimeRestore";
                    restorePointInTime = PointInTime;
                    break;
                case FromDeletedDatabaseBackupSetName:
                    createMode = "Restore";
                    restorePointInTime = PointInTime == DateTime.MinValue ? DeletionDate : PointInTime;
                    break;
                case FromGeoBackupSetName:
                    createMode = "Recovery";
                    break;
                case FromLongTermRetentionBackupSetName:
                    createMode = "RestoreLongTermRetentionBackup";
                    break;
                default:
                    throw new ArgumentException("No ParameterSet name");
            }

            model = new AzureSqlDatabaseModel()
            {
                Location = location,
                ResourceGroupName = ResourceGroupName,
                ServerName = ServerName,
                DatabaseName = TargetDatabaseName,
                Edition = Edition,
                RequestedServiceObjectiveName = ServiceObjectiveName,
                ElasticPoolName = ElasticPoolName,
                CreateMode = createMode
            };

            return ModelAdapter.RestoreDatabase(this.ResourceGroupName, restorePointInTime, ResourceId, model);
        }
    }
}


text:
from scipy.signal import convolve2d
import numpy as np
import graphics
import random
import driver
import game
import time

rows = 15
cols = 112

class Life(game.Game):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.start = time.time()
        self.randomize()

    def randomize(self):
        self.graphics.buffer = [[random.getrandbits(1) for y in range(cols)] for x in range(rows)]

    def recv_input(self, evt):
        self.randomize()

    def loop(self):
        while not self.input_queue.empty():
            evt = self.input_queue.get()
            self.recv_input(evt)

        nbrs_count = convolve2d(self.graphics.buffer, np.ones((3, 3)), mode='same', boundary='wrap') - self.graphics.buffer
        self.graphics.buffer =  (nbrs_count == 3) | (self.graphics.buffer & (nbrs_count == 2))

        self.graphics.draw(self.serial)
        time.sleep(1 / self.framerate)
        if time.time() > self.start+20:
            self.randomize()
            self.start = time.time()

GAME = Life


text:
./repoquery-recursive.py \
	tmux python-ipython-console python34 pssh clusterssh \
	inxi lshw \
	sysbench bonnie++ fio iperf3 \
	collectl glances atop statgrab-tools \
	htop iotop \
	iptraf-ng nethogs iftop vnstat jnettop ngrep nload \
	rh-git29-git-all \
	glibc-static devtoolset-6-gcc-c++ devtoolset-6-gdb \
	| wget -Ni - || exit 1

rm -f *i686*.rpm

wget -N 'http://www.slac.stanford.edu/~abh/bbcp/bin/amd64_rhel60/bbcp' || exit 1

wget -N 'https://downloads.sourceforge.net/project/nmon/nmon16e_x86_rhel65'||exit 1

wget -N 'https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip' || exit 1


text:
function varargout = chloCT_f(option,varia1,varia2,varia3)
% chloCT_f(option,varia1,varia2,varia3)
%   Functie voor afhandelen van blokafhankelijk gedrag in de
%   ParamterInputFigure.
%   Wordt aangeroepen door st_ParameterInput.m.
%
% Stimela, 2008

% © Kim van Schagen

% In UData wordt alles opgeslagen (userdata van deze figuur)
% UData.BlokNaam = Bloknaam
% Udata.Filenaam = Filenaam
% UData.handle(1) = FileNAam Handle
% UData.handle(2) = BlokNaam Handle
% UData.modif = Gewijzigd flag
% Udata.edit(:) = Editbox waarden Handles

option = upper(option);
varargout{1} = [];

% option switch
switch option

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % Callback van de editvelden
  case 'WAARDE'
     % edit field changed
%    Invoer_fig=gcf;
%    UData=get(Invoer_fig,'UserData');
%    hEdit=UData.edit(varia1);

 case 'EXIT'
     % input field is closed

end % switch


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Thelidium juistense Erichsen

### Remarks
null


text:
import {
  async,
  fakeAsync,
  inject,
  tick
} from '@angular/core/testing';

// intellisense via shorthand
export interface TestApi {
  ae: Function;
  afterEach: Function;
  describe: Function;
  fdescribe: Function;
  xdescribe: Function;
  async(fn: Function): Function;
  fakeAsync(fn: Function): Function;
  be(fn: Function): void;
  beforeEach(fn: Function): void;
  e(actual: any): jasmine.Matchers<any>;
  expect(actual: any): jasmine.Matchers<any>;
  fail(e?: any): void;
  inject(tokens: Array<any>, fn: Function): Function;
  it(name: string, fn: Function, timeOut?: number): void;
  fit(name: string, fn: Function, timeOut?: number): void;
  xit(name: string, fn: Function, timeOut?: number): void;
  pending(reason?: string): void;
  spyOn(object: any, method: string): jasmine.Spy;
  tick(delay?: number): void;
}

// shorthand - reduces boilerplate in every test
export const Ng2Jasmine: TestApi = {
  ae: afterEach, // shorthand
  afterEach: afterEach,
  describe: describe,
  fdescribe: fdescribe,
  xdescribe: xdescribe,
  async: async,
  fakeAsync: fakeAsync,
  be: beforeEach,  // shorthand beforeEach
  beforeEach: beforeEach,
  e: expect, // shorthand expect
  expect: expect,
  fail: fail,
  inject: inject,
  it: it,
  fit: fit,
  xit: xit,
  pending: pending,
  spyOn: spyOn,
  tick: tick
};


text: lessc:ENOENT,open '/Applications/MAMP/htdocs/mixture.io/soapboxpetitions/public/css/less/theme.less'


text:
<?php

/* SonataAdminBundle:CRUD:base_edit_form.html.twig */
class __TwigTemplate_bb89b398776346f827a7e753ec14a9e7 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->blocks = array(
            'sonata_pre_fieldsets' => array($this, 'block_sonata_pre_fieldsets'),
            'sonata_post_fieldsets' => array($this, 'block_sonata_post_fieldsets'),
            'formactions' => array($this, 'block_formactions'),
            'form' => array($this, 'block_form'),
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        $this->displayBlock('form', $context, $blocks);
    }

    // line 17
    public function block_sonata_pre_fieldsets($context, array $blocks = array())
    {
    }

    // line 39
    public function block_sonata_post_fieldsets($context, array $blocks = array())
    {
    }

    // line 43
    public function block_formactions($context, array $blocks = array())
    {
        // line 44
        echo "

                ";
        // line 45
        if ($this->getAttribute($this->getAttribute($this->getContext($context, "app"), "request"), "isxmlhttprequest")) {
            // line 46
            echo "                    ";
            if ($this->getAttribute($this->getContext($context, "admin"), "id", array(0 => $this->getContext($context, "object")), "method")) {
                // line 47
                echo "                        <input type=\"submit\" class=\"btn primary\" name=\"btn_update\" value=\"";
                echo $this->env->getExtension('translator')->getTranslator()->trans("btn_update", array(), "SonataAdminBundle");
                echo "\"/>
                    ";
            } else {
                // line 49
                echo "                        <input type=\"submit\" class=\"btn\" name=\"btn_create\" value=\"";
                echo $this->env->getExtension('translator')->getTranslator()->trans("btn_create", array(), "SonataAdminBundle");
                echo "\"/>
                    ";
            }
            // line 51
            echo "                ";
        } else {
            // line 52
            echo "                    ";
            if ($this->getAttribute($this->getContext($context, "admin"), "supportsPreviewMode")) {
                // line 53
                echo "                        <input class=\"btn btn-info persist-preview\" name=\"btn_preview\" type=\"submit\" value=\"";
                echo $this->env->getExtension('translator')->getTranslator()->trans("btn_preview", array(), "SonataAdminBundle");
                echo "\"/>
                    ";
            }
            // line 55
            echo "                    ";
            if ($this->getAttribute($this->getContext($context, "admin"), "id", array(0 => $this->getContext($context, "object")), "method")) {
                // line 56
                echo "                        <input type=\"submit\" class=\"btn primary\" name=\"btn_update_and_edit\" value=\"";
                echo $this->env->getExtension('translator')->getTranslator()->trans("btn_update_and_edit_again", array(), "SonataAdminBundle");
                echo "\"/>

                        ";
                // line 58
                if (($this->getAttribute($this->getContext($context, "admin"), "hasroute", array(0 => "list"), "method") && $this->getAttribute($this->getContext($context, "admin"), "isGranted", array(0 => "LIST"), "method"))) {
                    // line 59
                    echo "                            <input type=\"submit\" class=\"btn\" name=\"btn_update_and_list\" value=\"";
                    echo $this->env->getExtension('translator')->getTranslator()->trans("btn_update_and_return_to_list", array(), "SonataAdminBundle");
                    echo "\"/>
                        ";
                }
                // line 61
                echo "
                        ";
                // line 62
                if (($this->getAttribute($this->getContext($context, "admin"), "hasroute", array(0 => "delete"), "method") && $this->getAttribute($this->getContext($context, "admin"), "isGranted", array(0 => "DELETE", 1 => $this->getContext($context, "object")), "method"))) {
                    // line 63
                    echo "                            ";
                    echo $this->env->getExtension('translator')->getTranslator()->trans("delete_or", array(), "SonataAdminBundle");
                    // line 64
                    echo "                            env, $this->getAttribute($this->getContext($context, "admin"), "generateObjectUrl", array(0 => "delete", 1 => $this->getContext($context, "object")), "method"), "html", null, true);
                    echo "\">";
                    echo $this->env->getExtension('translator')->getTranslator()->trans("link_delete", array(), "SonataAdminBundle");
                    echo "
                        ";
                }
                // line 66
                echo "                    ";
            } else {
                // line 67
                echo "                        <input class=\"btn primary\" type=\"submit\" name=\"btn_create_and_edit\" value=\"";
                echo $this->env->getExtension('translator')->getTranslator()->trans("btn_create_and_edit_again", array(), "SonataAdminBundle");
                echo "\"/>
                        <input class=\"btn\" type=\"submit\" name=\"btn_create_and_create\" value=\"";
                // line 68
                echo $this->env->getExtension('translator')->getTranslator()->trans("btn_create_and_create_a_new_one", array(), "SonataAdminBundle");
                echo "\"/>
                    ";
            }
            // line 70
            echo "                ";
        }
        // line 71
        echo "

            ";
    }

    // line 1
    public function block_form($context, array $blocks = array())
    {
        // line 2
        echo "    ";
        $context["url"] = (($this->getAttribute($this->getContext($context, "admin"), "id", array(0 => $this->getContext($context, "object")), "method")) ? ("edit") : ("create"));
        // line 3
        echo "
    ";
        // line 4
        if ((!$this->getAttribute($this->getContext($context, "admin"), "hasRoute", array(0 => $this->getContext($context, "url")), "method"))) {
            // line 5
            echo "

            ";
            // line 6
            echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("form_not_available", array(), "SonataAdminBundle"), "html", null, true);
            echo "

    ";
        } else {
            // line 9
            echo "        <form action=\"";
            echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "admin"), "generateUrl", array(0 => $this->getContext($context, "url"), 1 => array("id" => $this->getAttribute($this->getContext($context, "admin"), "id", array(0 => $this->getContext($context, "object")), "method"), "uniqid" => $this->getAttribute($this->getContext($context, "admin"), "uniqid"))), "method"), "html", null, true);
            echo "\" ";
            echo $this->env->getExtension('form')->renderEnctype($this->getContext($context, "form"));
            echo " method=\"POST\">

            ";
            // line 11
            if ((twig_length_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "form"), "vars"), "errors")) > 0)) {
                // line 12
                echo "

                    ";
                // line 13
                echo $this->env->getExtension('form')->renderErrors($this->getContext($context, "form"));
                echo "

            ";
            }
            // line 16
            echo "
            ";
            // line 17
            $this->displayBlock('sonata_pre_fieldsets', $context, $blocks);
            // line 18
            echo "
            ";
            // line 19
            $context['_parent'] = (array) $context;
            $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getContext($context, "admin"), "formgroups"));
            foreach ($context['_seq'] as $context["name"] => $context["form_group"]) {
                // line 20
                echo "                <fieldset ";
                if ($this->getAttribute($this->getContext($context, "form_group"), "collapsed")) {
                    echo "class=\"sonata-ba-fielset-collapsed\"";
                }
                echo ">
                    <legend>
                        ";
                // line 22
                if ($this->getAttribute($this->getContext($context, "form_group"), "collapsed")) {
                    // line 23
                    echo "                            env->getExtension('translator')->getTranslator()->trans("link_expand", array(), "SonataAdminBundle");
                    echo "\">";
                    echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans($this->getContext($context, "name"), array(), $this->getAttribute($this->getContext($context, "admin"), "translationdomain")), "html", null, true);
                    echo "
                        ";
                } else {
                    // line 25
                    echo "                            ";
                    echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans($this->getContext($context, "name"), array(), $this->getAttribute($this->getContext($context, "admin"), "translationdomain")), "html", null, true);
                    echo "
                        ";
                }
                // line 27
                echo "                    </legend>

                        ";
                // line 30
                $context['_parent'] = (array) $context;
                $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getContext($context, "form_group"), "fields"));
                foreach ($context['_seq'] as $context["_key"] => $context["field_name"]) {
                    // line 31
                    echo "                            ";
                    if ($this->getAttribute($this->getAttribute((isset($context["admin"]) ? $context["admin"] : null), "formfielddescriptions", array(), "any", false, true), $this->getContext($context, "field_name"), array(), "array", true, true)) {
                        // line 32
                        echo "                                ";
                        echo $this->env->getExtension('form')->renderRow($this->getAttribute($this->getContext($context, "form"), $this->getContext($context, "field_name"), array(), "array"));
                        echo "
                            ";
                    }
                    // line 34
                    echo "                        ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['field_name'], $context['_parent'], $context['loop']);
                $context = array_merge($_parent, array_intersect_key($context, $_parent));
                // line 35
                echo "

                </fieldset>
            ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['name'], $context['form_group'], $context['_parent'], $context['loop']);
            $context = array_merge($_parent, array_intersect_key($context, $_parent));
            // line 38
            echo "
            ";
            // line 39
            $this->displayBlock('sonata_post_fieldsets', $context, $blocks);
            // line 40
            echo "
            ";
            // line 41
            echo $this->env->getExtension('form')->renderRest($this->getContext($context, "form"));
            echo "

            ";
            // line 43
            $this->displayBlock('formactions', $context, $blocks);
            // line 73
            echo "        </form>
    ";
        }
        // line 75
        echo "
";
    }

    public function getTemplateName()
    {
        return "SonataAdminBundle:CRUD:base_edit_form.html.twig";
    }

}


text:
CATransform3D RTSpinKit3DRotationWithPerspective(CGFloat perspective,
                                                        CGFloat angle,
                                                        CGFloat x,
                                                        CGFloat y,
                                                        CGFloat z)
{
    CATransform3D transform = CATransform3DIdentity;
    transform.m34 = perspective;
    return CATransform3DRotate(transform, angle, x, y, z);
}

NSObject<RTSpinKitAnimating>* RTSpinKitAnimationFromStyle(RTSpinKitViewStyle style)
{
    switch (style) {
        case RTSpinKitViewStylePlane:
            return [[RTSpinKitPlaneAnimation alloc] init];

        case RTSpinKitViewStyleCircleFlip:
            return [[RTSpinKitCircleFlipAnimation alloc] init];

        case RTSpinKitViewStyleBounce:
            return [[RTSpinKitBounceAnimation alloc] init];

        case RTSpinKitViewStyleWave:
            return [[RTSpinKitWaveAnimation alloc] init];

        case RTSpinKitViewStyleWanderingCubes:
            return [[RTSpinKitWanderingCubesAnimation alloc] init];

        case RTSpinKitViewStylePulse:
            return [[RTSpinKitPulseAnimation alloc] init];

        case RTSpinKitViewStyleChasingDots:
            return [[RTSpinKitChasingDotsAnimation alloc] init];

        case RTSpinKitViewStyleThreeBounce:
            return [[RTSpinKitThreeBounceAnimation alloc] init];

        case RTSpinKitViewStyleCircle:
            return [[RTSpinKitCircleAnimation alloc] init];

        case RTSpinKitViewStyle9CubeGrid:
            return [[RTSpinKit9CubeGridAnimation alloc] init];

        case RTSpinKitViewStyleWordPress:
            return [[RTSpinKitWordPressAnimation alloc] init];

        case RTSpinKitViewStyleFadingCircle:
            return [[RTSpinKitFadingCircleAnimation alloc] init];

        case RTSpinKitViewStyleFadingCircleAlt:
            return [[RTSpinKitFadingCircleAltAnimation alloc] init];

        case RTSpinKitViewStyleArc:
            return [[RTSpinKitArcAnimation alloc] init];

		case RTSpinKitViewStyleArcAlt:
			return [[RTSpinKitArcAltAnimation alloc] init];

        default:
            NSCAssert(NO, @"Unicorns exist");
    }
}


text:
var argv = require('yargs').argv,
	gulp = require('gulp'),
	gulpPlugins = require('auto-plug')('gulp'),
	gutil = require('gulp-util'),
	lazypipe = require('lazypipe'),
	path = require('path');

// Badly named plugin
gulpPlugins.addsrc = require('gulp-add-src');

// Paths
var root = '.';
var paths = {
	handler: path.join(root, 'app', 'Exceptions'),
	view: path.join(root, 'resources', 'views')
};
// TODO: Clean up pipelines with paths

// Pipelines
var pipelines = {
	commands: lazypipe().pipe(gulpPlugins.addsrc.append, ['./app/Console/Kernel.php', './app/Console/Commands/*Command.php']),
	configurations: lazypipe().pipe(gulpPlugins.addsrc.append, [
		'./config/*.php', '!./config/{app,auth,broadcasting,cache,compile,database,filesystems,mail,queue,services,session,view}.php'
	]), // Avoid deleting other configurations until functionality in place
	controllers: lazypipe().pipe(gulpPlugins.addsrc.append, ['./app/Http/Controllers/Core/*Controller.php', './app/Http/Controllers/Resources/**/*Controller.php']),
	handlers: lazypipe().pipe(gulpPlugins.addsrc.append, [path.join(paths.handler, 'Handler.php')]),
	migrations: lazypipe().pipe(gulpPlugins.addsrc.append, ['./database/migrations/*.php']),
	models: lazypipe().pipe(gulpPlugins.addsrc.append, ['./app/*.php']),
	policies: lazypipe().pipe(gulpPlugins.addsrc.append, ['./app/Policies/*.php']),
	providers: lazypipe().pipe(gulpPlugins.addsrc.append, [
		'./app/Providers/*.php', '!./app/Providers/{App,Event,Route}ServiceProvider.php'
	]), // Avoid deleting other providers until functionality in place
	requests: lazypipe().pipe(gulpPlugins.addsrc.append, ['./app/Http/Requests/*.php', '!./app/Http/Requests/Request.php']),
	routes: lazypipe().pipe(gulpPlugins.addsrc.append, ['./app/Http/routes.php']),
	seeds: lazypipe().pipe(gulpPlugins.addsrc.append, ['./database/seeds/*.php']),
	views: lazypipe().pipe(gulpPlugins.addsrc.append, [
		path.join(paths.view, 'layouts', '**', '*.php'), path.join(paths.view, 'pages', '**', '**', '*.php'), path.join(paths.view, 'errors', '*.php')
	])
};

// Cleanse function
var cleanse = function(context) {
	if (whitelist.length == 0 || (whitelist.indexOf(context) > -1)) {
		gutil.log( gutil.colors.green(`Clearing ${context}`) );
		return gulp.src([]).pipe( pipelines[context]() ).pipe( gulpPlugins.rm() );
	}
	else {
		gutil.log( gutil.colors.yellow(`Not clearing ${context}, pass --${context} flag or run this task with no flags`) );
		return null;
	}
}

// Populate whitelist
var whitelist = [];
Object.keys(pipelines).forEach( function(pipeline) {
	if (argv[pipeline]) {
		whitelist.push(pipeline);
	}
});

/* Clean up generated files (useful for development) */
gulp.task('clear', [
		'clear-commands',
		'clear-configurations',
		'clear-controllers',
		'clear-handlers',
		'clear-migrations',
		'clear-models',
		'clear-policies',
		'clear-providers',
		'clear-routes',
		'clear-requests',
		'clear-seeds',
		'clear-views'
	], function() {
    return;
});

gulp.task('clear-commands', function() { return cleanse('commands') }); // Clear commands
gulp.task('clear-configurations', function() { return cleanse('configurations') }); // Clear configuration files
gulp.task('clear-controllers', function() { return cleanse('controllers') }); // Clear controllers
gulp.task('clear-handlers', function() { return cleanse('handlers') }); // Clear handlers
gulp.task('clear-migrations', function() { return cleanse('migrations') }); // Clear migrations
gulp.task('clear-models', function() { return cleanse('models') }); // Clear models
gulp.task('clear-policies', function() { return cleanse('policies') }); // Clear policies
gulp.task('clear-providers', function() { return cleanse('providers') }); // Clear policies
gulp.task('clear-requests', function() { return cleanse('requests') }); // Clear requests
gulp.task('clear-routes', function() { return cleanse('routes') }); // Clear routes
gulp.task('clear-seeds', function() { return cleanse('seeds') }); // Clear seeds
gulp.task('clear-views', function() { return cleanse('views') }); // Clear views


text:
This application makes use of the following third party libraries:

## CameraManager

Camera Manager

Copyright (c) 2014 ImaginaryCloud, imaginarycloud.com.

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.

## Firebase

Copyright 2016 Google

## FirebaseAnalytics

Copyright 2016 Google

## FirebaseAuth

Copyright 2016 Google

## FirebaseCore

Copyright 2016 Google

## FirebaseDatabase

Copyright 2016 Google

## FirebaseInstanceID

Copyright 2016 Google

## FirebaseMessaging

Copyright 2016 Google

## FirebaseStorage

Copyright 2016 Google

## GoogleIPhoneUtilities

Copyright 2015 Google Inc.

## GoogleInterchangeUtilities

Copyright 2016 Google

## GoogleNetworkingUtilities

Copyright 2016 Google

## GoogleSymbolUtilities

Copyright 2016 Google

## GoogleUtilities

Copyright 2016 Google

## JSQMessagesViewController

MIT License
Copyright (c) 2013-present Jesse Squires

http://www.jessesquires.com

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.

## JSQSystemSoundPlayer

MIT License
Copyright (c) 2013 Jesse Squires

http://www.hexedbits.com

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.

## KRProgressHUD

Copyright (c) 2016 krimpedance <krimpedance@gmail.com>

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.

## imglyKit

PHOTOEDITOR SOFTWARE DEVELOPMENT KIT LICENSE:

THIS LICENSE AGREEMENT DESCRIBES YOUR RIGHTS WITH RESPECT TO THE PHOTOEDITOR
SOFTWARE DEVELOPMENT KIT (SDK) AND ITS COMPONENTS FOR COMMERCIAL USE.

1. GRANT OF LICENSE.
Subject to your ("Licensee") full compliance with all of Terms of this agreement ("Agreement"), 9elements GmbH ("9elements")
grants Licensee a non-exclusive, revocable, nonsublicensable, nontransferable license to download and use the SDK solely to
embed a launchable img.ly application within Licensee's mobile or website application ("App"). Licensee may not install or
use the SDK for any other purpose without 9elements prior written consent.

2. PROHIBITED USES
Licensee may not, without prior written consent from 9elements, redistribute the SDK or Modifications other than by including the SDK or
a portion thereof within the Licensee's own product, which must have substantially different functionality than the SDK or
Modifications and must not allow any third party to use the SDK or Modifications in their own products.
You are explicitly not allowed to redistribute the SDK or Modifications as part of any product that can be described as a photo editor SDK or library.
You are not allowed to redistribute any part of the SDK documentation. You may not change or remove the copyright notice from
any of the files included in the SDK or Modifications. You may not redistribute the SDK on any server which is not directly under Your control.

Licensee shall not use the SDK in connection with or to promote any products, services, or materials that constitute, promote
or are used primarily for the purpose of dealing in: spyware, adware, or other malicious programs or code, counterfeit goods,
unsolicited mass distribution of email ("spam"), multi-level marketing proposals, hate
materials, hacking/surveillance/interception/descrambling equipment, libelous, defamatory, obscene, pornographic, abusive or
otherwise offensive content, prostitution, body parts and bodily fluids, stolen products and items used for theft, fireworks,
explosives, and hazardous materials, government IDs, police items, gambling, professional services regulated by state
licensing regimes, non-transferable items such as airline tickets or event tickets, weapons and accessories.

3. PROPRIETARY RIGHTS.
As between 9elements and Licensee, the SDK and all intellectual property rights in and to the SDK are and shall at all times
remain the sole and exclusive property of 9elements and are protected by applicable intellectual property laws and treaties.
Except for the limited license expressly granted herein, no other license is granted, no other use is permitted and 9elements
(and its licensors) shall retain all right, title and interest in and to the SDK and the 9elements logos.

4. OTHER RESTRICTIONS.
Except as expressly and unambiguously authorized under this Agreement, Licensee may not (i) sell, transfer, assign, or
sublicense; (ii) otherwise use the SDK on behalf of any third party.

5. WARRANTY DISCLAIMER.
The SDK is provided "as is" without warranty of any kind. Except to the extent required by applicable law, 9elements and its
vendors each disclaim all warranties, whether express, implied or statutory, regarding the API, including without limitation
any and all implied warranties of merchantability, accuracy, results of use, reliability, fitness for a particular purpose,
title, interference with quiet enjoyment, and non-infringement of third-party rights. Further, 9elements disclaims any warranty
that licensee's use of the SDK will be uninterrupted or error free.

6. LIABILITY LIMITATION.
Regardless of whether any remedy set forth herein fails of its essential purpose or otherwise, and except for bodily injury,
in no event will 9elements or its vendors, be liable to licensee or to any third party under any tort, contract, negligence,
strict liability or other legal or equitable theory for any lost profits, lost or corrupted data, computer failure or
malfunction, interruption of business, or other special, indirect, incidental or consequential damages of any kind arising
out of the use or inability to use the API, even if 9elements has been advised of the possibility of such loss or damages and
whether or not such loss or damages are foreseeable. Any claim arising out of or relating to this agreement must be brought
within one (1) year after the occurrence of the event giving rise to such claim. In addition, 9elements disclaims all liability
of any kind of 9elements's vendors.

7. INDEMNITY.
Licensee agrees that 9elements shall have no liability whatsoever for any use Licensee makes of the SDK. Licensee shall
indemnify and hold harmless 9elements from any and all claims, damages, liabilities, costs and fees (including reasonable
attorneys' fees) arising from Licensee's use of the SDK.

8. TERMINATION
This License Agreement and the Licensee's right to use the Software and Modifications will terminate immediately without notice
if the Licensee fail to comply with the terms and conditions of this License Agreement. Upon termination, You agree to immediately cease
using and destroy the Software or Modifications, including all accompanying documents.
The provisions of sections 2, 5, 6, 7, 8, 10 and 12 will survive any termination of this License Agreement.

9. VERIFICATION
9elements or a certified auditor acting on 9elements' behalf, may, upon its reasonable request and at its expense,
audit the Licensee with respect to the use of the Software. Such audit may be conducted by mail, electronic means or
through an in-person visit to Your place of business. Any such in-person audit shall be conducted during regular business hours
at The Licensee's facilities and shall not unreasonably interfere with the Licensee's business activities.
We shall not remove, copy, or redistribute any electronic material during the course of an audit. If an audit reveals that the Licensee
is using the Software in a way that is in material violation of the terms of the License Agreement,
then the Licensee shall pay Our reasonable costs of conducting the audit. In the case of a material violation,
the Licensee agrees to pay Us any amounts owing that are attributable to the unauthorized use. In the alternative,
9elements reserves the right, at the sole option, to terminate the licenses for the Software.

10. PAYMENT AND TAXES
If credit has been extended to Licensee by 9elements, all payments under this License Agreement are due
within thirty (30) days of the date 9elements mails an invoice to the Licensee. If 9elements has not extended credit to You,
Licensee shall be required to make payment concurrent with the delivery of the SDK by 9elements.
All amounts payable are gross amounts but exclusive of any value added tax, use tax, sales tax or similar tax.
Licensee shall be entitled to withhold from payments any applicable withholding taxes and comply with all applicable tax and
employment legislation. Each party shall pay all taxes (including, but not limited to, taxes based upon its income) or
levies imposed on it under applicable laws, regulations and tax treaties as a result of this Agreement and
any payments made hereunder (including those required to be withheld or deducted from payments).
Each party shall furnish evidence of such paid taxes as is sufficient to enable the other party to obtain any credits available to it,
including original withholding tax certificates.

11. GOVERNMENT USE
If Licensee is part of an agency, department, or other entity of the United States Government ("Government"), the use,
duplication, reproduction, release, modification, disclosure or transfer of the API are restricted in accordance with the
Federal Acquisition Regulations as applied to civilian agencies and the Defense Federal Acquisition Regulation Supplement as
applied to military agencies. The API are a "commercial item," "commercial computer software" and "commercial computer
software documentation." In accordance with such provisions, any use of the API by the Government shall be governed solely by
the terms of this Agreement.

12. EXPORT CONTROLS
Licensee shall comply with all export laws and restrictions and regulations of the Department of Commerce, the United States
Department of Treasury Office of Foreign Assets Control ("OFAC"), or other United States or foreign agency or authority, and
Licensee shall not export, or allow the export or re-export of the API in violation of any such restrictions, laws or
regulations. By downloading or using the API, Licensee agrees to the foregoing and represents and warrants that Licensee is
not located in, under the control of, or a national or resident of any restricted country.

13. MISCELLANEOUS
The license granted herein applies only to the version of the Software available when purchased in connection with the terms
of this License Agreement. Any previous or subsequent license granted to You for use of the Software shall be governed by the
terms and conditions of the agreement entered in connection with purchase of that version of the Software. You agree that
you will comply with all applicable laws and regulations with respect to the Software, including without limitation all export and
re-export control laws and regulations.

While redistributing the Software or Modifications thereof, You may choose to offer acceptance of support,
warranty, indemnity, or other liability obligations and/or rights consistent with this License Agreement. However,
in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on our behalf.
You agree to indemnify, defend, and hold Us harmless from and against any liability incurred by, or claims asserted against,
Us (i) by reason of Your accepting any such support, warranty, indemnity or additional liability; or (ii) arising out of the use,
reproduction or distribution of Your Application, except to the extent such claim is solely based on the inclusion of the Software therein.

You agree to be identified as a customer of ours and You agree that We may refer to You by name, trade name and trademark,
if applicable, and may briefly describe Your business in our marketing materials and web site.

You may not assign this License Agreement without Our prior written consent, which will not be unreasonably withheld.
This License Agreement will inure to the benefit of Our successors and assigns.

You acknowledge that this License Agreement is complete and is the exclusive representation of our agreement.
No oral or written information given by Us or on our behalf shall create a warranty or collateral contract, or
in any way increase the scope of this License Agreement in any way, and You may not rely on any such oral or written information.
No term or condition contained in any purchase order shall apply unless expressly accepted by Us in writing,

There are no implied licenses or other implied rights granted under this License Agreement, and all rights,
save for those expressly granted hereunder, shall remain with Us and our licensors. In addition,
no licenses or immunities are granted to the combination of the Software and/or Modifications, as applicable,
with any other software or hardware not delivered by Us to You under this License Agreement.

If any provision in this License Agreement shall be determined to be invalid, such provision shall be deemed omitted;
the remainder of this License Agreement shall continue in full force and effect.
If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages
set forth in this License Agreement shall remain in effect.

This License Agreement may be modified only by a written instrument signed by an authorized representative of each party.

Generated by CocoaPods - http://cocoapods.org


text:
NS_ASSUME_NONNULL_BEGIN

@implementation DWDemoAdvancedSecurityViewController

- (instancetype)init {
    self = [super initWithModel:[[DWAdvancedSecurityModelStub alloc] init]];
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.userInteractionEnabled = NO;
}

@end

NS_ASSUME_NONNULL_END


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using Teradata.DBView;

namespace Teradata.Business
{
    public static class ManyToManyExtentions
    {
        public static void ForEach<T>(this IEnumerable<T> on,
                               Action<T> action)
        {
            foreach (T item in on)
                action(item);
        }

        public static IEnumerable<TRelationViewModel> AllManyToManyNoActiveFilter<TModel, TViewModel, TCachedModel, TCachedViewModel, TRelationModel, TRelationViewModel>(this TViewModel viewModel, IEnumerable<TRelationViewModel> listViewModel)
            where TViewModel : class
            where TCachedViewModel : class
            where TRelationViewModel : class, IManyToMany, new()
        {
            return
                AllManyToManyNoActiveFilter
                    <TModel, TViewModel, TCachedModel, TCachedViewModel, TRelationModel, TRelationViewModel>(viewModel,
                                                                                listViewModel,
                                                                                null, null,
                                                                                null);

        }

        public static IEnumerable<TRelationViewModel> AllManyToManyNoActiveFilter<TModel, TViewModel, TCachedModel, TCachedViewModel, TRelationModel, TRelationViewModel>(this TViewModel viewModel, IEnumerable<TRelationViewModel> listViewModel, Action<TCachedViewModel, TRelationViewModel> cumstomCachedMappings)
            where TViewModel : class
            where TCachedViewModel : class
            where TRelationViewModel : class, IManyToMany, new()
        {
            return AllManyToManyNoActiveFilter
                <TModel, TViewModel, TCachedModel, TCachedViewModel, TRelationModel, TRelationViewModel>(viewModel,
                                                                                listViewModel,
                                                                                cumstomCachedMappings, null, null);
        }

        public static IEnumerable<TRelationViewModel> AllManyToManyNoActiveFilter<TModel, TViewModel, TCachedModel, TCachedViewModel, TRelationModel, TRelationViewModel>(this TViewModel viewModel, IEnumerable<TRelationViewModel> listViewModel, Action<TCachedViewModel, TRelationViewModel> cumstomCachedMappings, Action<TViewModel, TRelationViewModel> customViewMappings)
            where TViewModel : class
            where TCachedViewModel : class
            where TRelationViewModel : class, IManyToMany, new()
        {
            return AllManyToManyNoActiveFilter<TModel, TViewModel, TCachedModel, TCachedViewModel, TRelationModel, TRelationViewModel>(viewModel, listViewModel, cumstomCachedMappings, customViewMappings, null);
        }

        public static IEnumerable<TRelationViewModel> AllManyToManyNoActiveFilter<TModel, TViewModel, TCachedModel, TCachedViewModel, TRelationModel, TRelationViewModel>(this TViewModel viewModel, IEnumerable<TRelationViewModel> listViewModel, Action<TCachedViewModel, TRelationViewModel> cumstomCachedMappings, Action<TViewModel, TRelationViewModel> customViewMappings, Action<TRelationViewModel, TRelationViewModel> customIncludedMappings)
            where TViewModel : class
            where TCachedViewModel : class
            where TRelationViewModel : class, IManyToMany, new()
        {
            if (listViewModel != null)
            {
                var relationViewModels = listViewModel as List<TRelationViewModel> ?? listViewModel.ToList();
                var fullList = new List<TRelationViewModel>();
                foreach (var cachedViewModel in (List<TCachedViewModel>)StaticCacheHelper.Cache.Get(typeof(TCachedViewModel).Name))
                {
                    var relationViewModel = Activator.CreateInstance<TRelationViewModel>();

                    if (cumstomCachedMappings != null)
                        cumstomCachedMappings(cachedViewModel, relationViewModel);
                    if (customViewMappings != null)
                        customViewMappings(viewModel, relationViewModel);

                    relationViewModel.ID1 =
                        (int)
                        (GetMappedProperty<TModel, TViewModel, TCachedModel, TCachedViewModel, TRelationViewModel>(
                            viewModel, cachedViewModel, "ID1") ?? 0);
                    relationViewModel.ID2 =
                        (int)
                        (GetMappedProperty<TModel, TViewModel, TCachedModel, TCachedViewModel, TRelationViewModel>(
                            viewModel, cachedViewModel, "ID2") ?? 0);
                    ;
                    relationViewModel.Name1 =
                        (String)
                        GetMappedProperty<TModel, TViewModel, TCachedModel, TCachedViewModel, TRelationViewModel>(
                            viewModel, cachedViewModel, "Name1");
                    relationViewModel.Name2 =
                        (String)
                        GetMappedProperty<TModel, TViewModel, TCachedModel, TCachedViewModel, TRelationViewModel>(
                            viewModel, cachedViewModel, "Name2");
                    var includedRelationViewModel =
                        relationViewModels.WhereVM<TRelationModel, TRelationViewModel>(relationViewModel);
                    relationViewModel.Included = includedRelationViewModel != null;
                    if (includedRelationViewModel != null && customIncludedMappings != null)
                        customIncludedMappings(includedRelationViewModel, relationViewModel);

                    fullList.Add(relationViewModel);
                }
                return fullList.OrderDBView();
            }
            return null;
        }

        private static Object GetMappedProperty<TModel, TViewModel, TCachedModel, TCachedViewModel, TRelationViewModel>(TViewModel viewModel, TCachedViewModel chachedViewModel, String property)
            where TViewModel : class
            where TCachedViewModel : class
            where TRelationViewModel : IManyToMany
        {
            var propAttr = (ViewMappingAttribute)typeof(TRelationViewModel).GetProperty(property).GetCustomAttributes(typeof(ViewMappingAttribute), true).SingleOrDefault();
            if (propAttr != null)
            {
                String modelNameProperty = propAttr.ColumnPropertyName.Replace(typeof(TModel).Name + ".", String.Empty);
                String cachedModelNameProperty = propAttr.ColumnPropertyName.Replace(typeof(TCachedModel).Name + ".", String.Empty);
                var viewModelInfo = typeof(TViewModel).GetPropertyByAttribute(modelNameProperty);
                var cachedViewModelInfo = typeof(TCachedViewModel).GetPropertyByAttribute(cachedModelNameProperty);

                return viewModelInfo != null
                           ? viewModelInfo.GetValue(viewModel, null)
                           : cachedViewModelInfo != null ? cachedViewModelInfo.GetValue(chachedViewModel, null) : null;
            }
            return null;
        }

        private static IEnumerable<PropertyInfo> GetKeyProperties<T>(this T t)
        {
            return (from info in typeof(T).GetProperties()
                    let viewMapping = (ViewMappingAttribute)info.GetCustomAttributes(true).SingleOrDefault(attr => attr is ViewMappingAttribute)
                    where
                        viewMapping != null
                        && viewMapping.Key
                    select info);
        }

        private static PropertyInfo GetPropertyByAttribute(this Type type, String propertyName)
        {
            return (from info in type.GetProperties()
                    let viewMapping = (ViewMappingAttribute)info.GetCustomAttributes(true).SingleOrDefault(attr => attr is ViewMappingAttribute)
                    where
                        viewMapping != null
                        && viewMapping.ColumnPropertyName == propertyName
                    select info).SingleOrDefault();
        }

        private static T ConvertToType<T>(this Object obj)
        {
            return (T)Convert.ChangeType(obj, typeof(T));
        }
    }
}


text:
const path = require("path");
const _ = require("lodash");
const moment = require("moment");
const siteConfig = require("./data/SiteConfig");

exports.onCreateNode = ({ node, actions, getNode }) => {
  const { createNodeField } = actions;
  let slug;
  if (node.internal.type === "MarkdownRemark") {
    const fileNode = getNode(node.parent);
    const parsedFilePath = path.parse(fileNode.relativePath);
    if (
      Object.prototype.hasOwnProperty.call(node, "frontmatter") &&
      Object.prototype.hasOwnProperty.call(node.frontmatter, "title")
    ) {
      slug = `/${_.kebabCase(node.frontmatter.title)}`;
    } else if (parsedFilePath.name !== "index" && parsedFilePath.dir !== "") {
      slug = `/${parsedFilePath.dir}/${parsedFilePath.name}/`;
    } else if (parsedFilePath.dir === "") {
      slug = `/${parsedFilePath.name}/`;
    } else {
      slug = `/${parsedFilePath.dir}/`;
    }

    if (Object.prototype.hasOwnProperty.call(node, "frontmatter")) {
      if (Object.prototype.hasOwnProperty.call(node.frontmatter, "slug"))
        slug = `/${_.kebabCase(node.frontmatter.slug)}`;
      if (Object.prototype.hasOwnProperty.call(node.frontmatter, "date")) {
        const date = moment(node.frontmatter.date, siteConfig.dateFromFormat);
        if (!date.isValid)
          console.warn(`WARNING: Invalid date.`, node.frontmatter);

        createNodeField({
          node,
          name: "date",
          value: date.toISOString()
        });
      }
    }
    createNodeField({ node, name: "slug", value: slug });
  }
};

exports.createPages = async ({ graphql, actions }) => {
  const { createPage } = actions;
  const postPage = path.resolve("src/templates/post.jsx");
  const tagPage = path.resolve("src/templates/tag.jsx");
  const categoryPage = path.resolve("src/templates/category.jsx");

  const markdownQueryResult = await graphql(
    `
      {
        allMarkdownRemark {
          edges {
            node {
              fields {
                slug
              }
              frontmatter {
                title
                tags
                category
                date
              }
            }
          }
        }
      }
    `
  );

  if (markdownQueryResult.errors) {
    console.error(markdownQueryResult.errors);
    throw markdownQueryResult.errors;
  }

  const tagSet = new Set();
  const categorySet = new Set();

  const postsEdges = markdownQueryResult.data.allMarkdownRemark.edges;

  postsEdges.sort((postA, postB) => {
    const dateA = moment(
      postA.node.frontmatter.date,
      siteConfig.dateFromFormat
    );

    const dateB = moment(
      postB.node.frontmatter.date,
      siteConfig.dateFromFormat
    );

    if (dateA.isBefore(dateB)) return 1;
    if (dateB.isBefore(dateA)) return -1;

    return 0;
  });

  postsEdges.forEach((edge, index) => {
    if (edge.node.frontmatter.tags) {
      edge.node.frontmatter.tags.forEach(tag => {
        tagSet.add(tag);
      });
    }

    if (edge.node.frontmatter.category) {
      categorySet.add(edge.node.frontmatter.category);
    }

    const nextID = index + 1 < postsEdges.length ? index + 1 : 0;
    const prevID = index - 1 >= 0 ? index - 1 : postsEdges.length - 1;
    const nextEdge = postsEdges[nextID];
    const prevEdge = postsEdges[prevID];

    createPage({
      path: edge.node.fields.slug,
      component: postPage,
      context: {
        slug: edge.node.fields.slug,
        nexttitle: nextEdge.node.frontmatter.title,
        nextslug: nextEdge.node.fields.slug,
        prevtitle: prevEdge.node.frontmatter.title,
        prevslug: prevEdge.node.fields.slug
      }
    });
  });

  tagSet.forEach(tag => {
    createPage({
      path: `/tags/${_.kebabCase(tag)}/`,
      component: tagPage,
      context: {
        tag
      }
    });
  });
  categorySet.forEach(category => {
    createPage({
      path: `/categories/${_.kebabCase(category)}/`,
      component: categoryPage,
      context: {
        category
      }
    });
  });
};


text:
cask 'wowdoge' do
  version :latest
  sha256 :no_check

  url 'http://www.wowdoge.org/download/WowDoge.dmg'
  name 'WowDoge'
  homepage 'http://www.wowdoge.org'

  app 'WowDoge.app'
end


text:
import React from 'react';
import styled from '@emotion/styled';
import { white } from '../../colors';
import { Experience } from '.';

interface ExperienceCircleProps {
  experience: Experience;
  className?: string;
}

const CircleStyled = styled.span({
  border: '1px solid #eee',
  borderRadius: '50%',
  backgroundColor: white,
  display: 'inline-flex',
  justifyContent: 'center',
  alignItems: 'center',
  flexDirection: 'column',
  width: 80,
  height: 80,
  position: 'relative',
  '@media (min-width: 768px)': {
    width: 100,
    height: 100,
  },
  '@media (min-width: 1024px)': {
    width: 150,
    height: 150,
  },
});

const Text = styled.span({
  fontSize: 12,
  textTransform: 'uppercase',
  '@media (min-width: 768px)': {
    fontSize: 14,
  },
  '@media (min-width: 1024px)': {
    fontSize: 18,
  },
});

export function Circle(props: ExperienceCircleProps) {
  const { experience } = props;
  return (
    <CircleStyled className={props.className}>
      <Text>{experience.to}</Text> <Text>-</Text> <Text>{experience.from}</Text>
    </CircleStyled>
  );
}


text:
/** \file ap_net/conn_pool_recv.c
 * \brief Part of AP's toolkit. Networking module, Connection pool: incoming conection's data storeage procedures
 */
#include "conn_pool_internals.h"

static const char *_func_name = "ap_net_conn_pool_recv()";

/* ********************************************************************** */
/** \brief receives available data into internal buffer
 *
 * \param pool struct ap_net_conn_pool_t*
 * \param conn_idx int
 * \return int count of bytes received, 0 if no space in buffer, -1 on error, -2 on connection shutdown
 *
 * this should be safe to call from outside of library,
 * but it's really internal thing
 */
int ap_net_conn_pool_recv(struct ap_net_conn_pool_t *pool, int conn_idx)
{
    int n;
    socklen_t slen;
    int space_left;
    struct ap_net_connection_t *conn;

    ap_error_clear();

    conn = &pool->conns[conn_idx];

    if ( conn_idx < 0 || conn_idx > pool->max_connections || ! bit_is_set(conn->state, AP_NET_ST_CONNECTED) )
    {
        ap_error_set_detailed(_func_name, AP_ERRNO_INVALID_CONN_INDEX, "%d", conn_idx);
        return -1;
    }

    if ( conn->bufpos < 0 || conn->buffill < 0 || conn->bufpos >= conn->bufsize || conn->bufpos >= conn->buffill )
    {
        conn->bufpos = 0;
        conn->buffill = 0;
    }

    if ( conn->bufpos > (conn->bufsize - conn->bufsize / 3) ) /*  take 2/3 fullness as signal to move data to beginning */
    {
       n = conn->buffill - conn->bufpos;
       memmove(conn->buf, conn->buf + conn->bufpos, n);
       conn->buffill = n;
       conn->bufpos = 0;
    }

    space_left = conn->bufsize - conn->buffill;

    if ( space_left == 0 )
    	return 0;

    conn->state |= AP_NET_ST_IN;

    if ( bit_is_set(conn->flags, AP_NET_CONN_FLAGS_UDP_IN) )
    {
        /* this UDP connection is outgoing only and we're doing trick with data moving from listener socket into this conn's buffer */
    	slen = (conn->remote.af == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in));

        n = recvfrom(pool->listener.sock, conn->buf + conn->buffill, space_left, MSG_DONTWAIT | MSG_NOSIGNAL,
        		(struct sockaddr*)&conn->remote, &slen
        	);
    }
    else
    {
       	n = ap_net_recv(conn->fd, conn->buf + conn->buffill, space_left, 0);
    }

    bit_clear(conn->state, AP_NET_ST_IN);

    if ( n == 0 && errno != EAGAIN && errno != EWOULDBLOCK )/* remote is orderly shut down */
        return -2;

    if ( n == -1 )
    {
        if (ap_log_debug_level)
            ap_log_debug_log("? Connection [%d] is dead prematurely. retcode %d, error %s\n", conn_idx, n, EBADF, ap_error_get_string());

        ap_net_conn_pool_close_connection(pool, conn_idx);

        return -1;
    }

    conn->buffill += n;

    return n;
}


text:
#include <qcompilerdetection.h>

#if defined(QUARTZ_CORE)
    #define QUARTZ_CORE_API Q_DECL_EXPORT
#else
    #define QUARTZ_CORE_API Q_DECL_IMPORT
#endif


text:
'''
charlie.py
---class for controlling charlieplexed SparkFun 8x7 LED Array with the Raspberry Pi

Relies upon RPi.GPIO written by Ben Croston

The MIT License (MIT)

Copyright (c) 2016 Amanda Cole

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.
'''

import RPi.GPIO as GPIO, time, random
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)

class Charlie:
    '''
    Class for control of the charlieplexed SparkFun 8x7 LED Array.
    '''
    def __init__(self, pins):
        '''
        pins: type 'list', list of ints for array pins a-h, in order [a,b,c,d,e,f,g,h]
        '''

        if len(pins) != 8:
            print("You must specify eight, and only eight, pins.")
            raise ValueError

        for pin in pins:
            if type(pin) != int:
                print("Pins must be of type int.")
                raise TypeError
            GPIO.setup(pin, GPIO.OUT, initial = False)

        a = pins[0]
        b = pins[1]
        c = pins[2]
        d = pins[3]
        e = pins[4]
        f = pins[5]
        g = pins[6]
        h = pins[7]
        self.array = [[[h,g],[g,h],[f,h],[e,h],[d,h],[c,h],[b,h],[a,h]], \
                     [[h,f],[g,f],[f,g],[e,g],[d,g],[c,g],[b,g],[a,g]], \
                     [[h,e],[g,e],[f,e],[e,f],[d,f],[c,f],[b,f],[a,f]], \
                     [[h,d],[g,d],[f,d],[e,d],[d,e],[c,e],[b,e],[a,e]], \
                     [[h,c],[g,c],[f,c],[e,c],[d,c],[c,d],[b,d],[a,d]], \
                     [[h,b],[g,b],[f,b],[e,b],[d,b],[c,b],[b,c],[a,c]], \
                     [[h,a],[g,a],[f,a],[e,a],[d,a],[c,a],[b,a],[a,b]]]

        self.ALL_PINS = [a,b,c,d,e,f,g,h]

    def switchOrigin(self):
        '''
        Places origin [0,0] in the diagonally opposite corner of where its current position.
        '''
        switched_array = self.array
        switched_array.reverse()
        for i in switched_array:
            i.reverse()
        self.array = switched_array

    def clearDisplay(self):
        '''
        Clears display.
        '''
        GPIO.setup(self.ALL_PINS, GPIO.IN)

    def displayPoint(self, coord):
        '''
        coord: type 'list', coordinates of single pixel to be lit
        Lights a single pixel.
        '''
        self.clearDisplay()
        GPIO.setup(self.array[coord[0]][coord[1]][0], GPIO.OUT, initial = 1)
        GPIO.setup(self.array[coord[0]][coord[1]][1], GPIO.OUT, initial = 0)

    def test(self):
        '''
        Displays all pixels in array, one at a time, starting with [0,0] and ending with [6,7].
        '''
        x = 0
        y = 0
        while y < 8:
            self.displayPoint([x,y])
            time.sleep(0.1)
            x += 1
            if x >= 7:
                x = 0
                y += 1
        self.clearDisplay()

    def display(self, pixels, duration):

        '''
        pixels: type 'list', list of pixels to be lit each in coordinate form [x,y]
        duration: type 'int', duration to display coordinates
        Lights specified pixels in array
        '''

        positives = []
        for coord in pixels:
            if self.array[coord[0]][coord[1]][0] not in positives:
                positives.append([self.array[coord[0]][coord[1]][0],[]])
        for i in positives: #[[a,[]],[b,[]],[h,[]]]
            for coord in pixels:
                if self.array[coord[0]][coord[1]][0] == i[0]:
                    if self.array[coord[0]][coord[1]][1] not in i[1]:
                        i[1].append(self.array[coord[0]][coord[1]][1])
        t = 0
        pause = 0.02/len(positives)
        while t < duration:
            for i in range(0, len(positives)):
                self.clearDisplay()
                GPIO.setup(positives[i][0], GPIO.OUT, initial = True)
                GPIO.setup(positives[i][1], GPIO.OUT, initial = False)
                time.sleep(pause)
                t += pause
        self.clearDisplay()

    def screensaver(self, duration, fill = .5):
        '''
        duration: type 'int', duration to keep screensaver on
        fill: type 'float', proportion of array to fill with pixels at any given time
        Randomly displays pixels on array.
        '''
        if fill > 1 or fill < 0:
            print("fill must be of type 'float' between 0 and 1...using default value instead.")
            fill = 0.5
        t = 0
        while t < duration:
            coords = []
            while len(coords) < fill*56:
                coord = [random.randint(0,6), random.randint(0,7)]
                if coord not in coords:
                    coords.append(coord)

            self.display(coords, 0.15)
            t += 0.1


text:
from wtforms import Form
from wtforms import TextField, SelectField
from wtforms.validators import DataRequired, ValidationError, Required
from ..base import BaseReactForm

class ReactForm(BaseReactForm):
    ''' Class that creates a Reaction form for the dashboard '''
    title = "Heroku: Restart All Dynos"
    description = """
    <P>
      This reaction provides the ability to restart all Dynos within the specified Heroku Application. This reaction will send an API request to Heroku to restart all Dynos, the Dyno will be restarted whether it is already running or not. This reaction should only be used in events that cover a full failure or within environments that can tolerate the time it takes to restart Dynos.
    </P>
    """
    placeholders = BaseReactForm.placeholders
    placeholders.update({
        'appname' : 'StormyWaters58',
        'cmd' : 'bash script.sh',
    })

    apikey = TextField(
        "API Key",
        description=BaseReactForm.descriptions['apikey'],
        validators=[DataRequired(message='API Key is a required field')]
    )
    appname = TextField(
        "Application Name",
        description=BaseReactForm.descriptions['heroku']['appname'],
        validators=[
          DataRequired(message='Application Name is a required field')
        ]
    )
    call_on = SelectField(
        "Call On",
        description=BaseReactForm.descriptions['callon'],
        choices=[
            ('false', 'False Monitors'),
            ('true', 'True Monitors')
        ],
        validators=[DataRequired(message='Call On is a required field')]
    )

if __name__ == '__main__':
    pass


text:
require 'sensu-plugin/check/cli'
require 'rest-client'

class ChronosNodeStatus < Sensu::Plugin::Check::CLI
  option :server,
         description: 'Chronos hosts, comma separated',
         short: '-s SERVER',
         long: '--server SERVER',
         default: 'localhost'

  option :port,
         description: 'Chronos port',
         short: '-p PORT',
         long: '--port PORT',
         default: '80'

  option :timeout,
         description: 'timeout in seconds',
         short: '-t TIMEOUT',
         long: '--timeout TIMEOUT',
         proc: proc(&:to_i),
         default: 5

  def run
    servers = config[:server]
    failures = []
    servers.split(',').each do |server|
      begin
        r = RestClient::Resource.new("http://#{server}:#{config[:port]}/scheduler/jobs", timeout: config[:timeout]).get
        if r.code != 200
          failures << "Chronos on #{server} is not responding"
        end
      rescue Errno::ECONNREFUSED, RestClient::ResourceNotFound, SocketError
        failures << "Chronos on #{server} is not responding"
      rescue RestClient::RequestTimeout
        failures << "Chronos on #{server} connection timed out"
      end
    end
    if failures.empty?
      ok "Chronos is running on #{servers}"
    else
      critical failures.join("\n")
    end
  end
end


text:
define([
	'../models/RecipeModel',
    'backbone.paginator'
], function (RecipeModel) {

	'use strict';

	var RecipeCollection = Backbone.PageableCollection.extend({
		model : RecipeModel,
		url: Routing.generate('app.parcel.list'),

		initialize : function(models, options) {

		},

        state: {
            pageSize: 10
        },

        parseState: function (response, queryParams, state, options) {
            return {
                totalRecords: response.count,
                currentPage: response.currentPage,
                pageSize: response.limit
            };
        },

        parseRecords: function (responce, options) {
            return responce.items;
        }

	});

	return RecipeCollection;
});


text:
package iso20022

// Provides statement details such as the account owner identification (ie, the clearing member identification) and optionaly the non clearing member identification, the clearing account or the list of trade legs.
type Statement31 struct {

	// Identification that is common to all pages of a statement.
	StatementIdentification *Max35Text `xml:"StmtId"`

	// Date of the statement.
	StatementDateAndTime *DateAndDateTimeChoice `xml:"StmtDtAndTm"`

	// Indicates whether the statement is complete or contains changes only.
	UpdateType *StatementUpdateType1Code `xml:"UpdTp"`

	// Frequency of the statement.
	Frequency *EventFrequency6Code `xml:"Frqcy"`

	// Sequential number of the statement.
	ReportNumber *Exact5NumericText `xml:"RptNb,omitempty"`

	// Indicates whether there is activity or information update reported in the statement.
	ActivityIndicator *YesNoIndicator `xml:"ActvtyInd"`
}

func (s *Statement31) SetStatementIdentification(value string) {
	s.StatementIdentification = (*Max35Text)(&value)
}

func (s *Statement31) AddStatementDateAndTime() *DateAndDateTimeChoice {
	s.StatementDateAndTime = new(DateAndDateTimeChoice)
	return s.StatementDateAndTime
}

func (s *Statement31) SetUpdateType(value string) {
	s.UpdateType = (*StatementUpdateType1Code)(&value)
}

func (s *Statement31) SetFrequency(value string) {
	s.Frequency = (*EventFrequency6Code)(&value)
}

func (s *Statement31) SetReportNumber(value string) {
	s.ReportNumber = (*Exact5NumericText)(&value)
}

func (s *Statement31) SetActivityIndicator(value string) {
	s.ActivityIndicator = (*YesNoIndicator)(&value)
}


text:
<?php

class Cache {
   var $basedir;
   var $fileextension = '.cache';

   function &getInstance() {
      static $instance;
      if (!isset($instance)) {
         $instance =& new Cache();
      }
      return $instance;
   }

   function Cache() {
      $this->basedir = CACHE_DIR;
   }

   function Start($hash, $time = 300) {
      $cachefile = $this->basedir .'/'. $hash . $this->fileextension;
      if (file_exists($cachefile) && time() < filemtime($cachefile) + $time) {
         @readfile($cachefile);
         echo "\n<!-- Cached: ". date('r', filemtime($cachefile)) ." -->\n";
         unset($cachefile);
         exit;
      }
     //ob_start("ob_gzhandler");
     ob_start();
   }

   function End($hash) {
      $cachefile = $this->basedir .'/'. $hash . $this->fileextension;
      $handle = fopen($cachefile, 'w');
      fwrite($handle, ob_get_contents());
      fclose($handle);
      ob_flush();
   }
}
?>


text:
package com.cloudera.sqoop;

import com.cloudera.sqoop.hbase.TestHBaseImport;
import com.cloudera.sqoop.hbase.TestHBaseQueryImport;

import junit.framework.Test;
import junit.framework.TestSuite;

/**
 * All tests for Sqoop (com.cloudera.sqoop).
 */
public final class AllTests {

  private AllTests() { }

  public static Test suite() {
    TestSuite suite = new TestSuite("All tests for com.cloudera.sqoop");

    suite.addTest(SmokeTests.suite());
    suite.addTest(ThirdPartyTests.suite());
    suite.addTestSuite(TestHBaseImport.class);
    suite.addTestSuite(TestHBaseQueryImport.class);
    suite.addTestSuite(TestIncrementalImport.class);

    return suite;
  }

}


text:
<?php

declare(strict_types=1);

namespace App\Domain\User;

use App\Infrastructure\Doctrine\TimestampableTrait;
use FOS\UserBundle\Model\User as FOSUser;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Class User.
 */
class User extends FOSUser implements UserInterface
{
    use TimestampableTrait;

    protected $id;

    /**
     * @Assert\NotBlank
     */
    private $firstname;

    /**
     * @Assert\NotBlank
     */
    private $lastname;

    private $state;

    /**
     * @Assert\NotBlank(groups={"Create"})
     */
    protected $plainPassword;

    /**
     * @Assert\Email
     * @Assert\NotBlank
     */
    protected $email;

    /**
     * User constructor.
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * @return mixed
     */
    public function getFirstname(): ?string
    {
        return $this->firstname;
    }

    /**
     * @param string $firstname
     *
     * @return $this
     */
    public function setFirstname(?string $firstname)
    {
        $this->firstname = $firstname;

        return $this;
    }

    public function getLastname(): ?string
    {
        return $this->lastname;
    }

    /**
     * @param string $lastname
     *
     * @return $this
     */
    public function setLastname(?string $lastname)
    {
        $this->lastname = $lastname;

        return $this;
    }

    /**
     * @param string $email
     *
     * @return $this|\FOS\UserBundle\Model\UserInterface|FOSUser
     */
    public function setEmail($email)
    {
        return parent::setEmail($email);
    }

    public function getFullname(): string
    {
        return sprintf('%s %s', $this->getFirstname(), $this->getLastname());
    }

    /**
     * Set state.
     *
     * @param string $state
     *
     * @return User
     */
    public function setState(?string $state)
    {
        $this->state = $state;

        return $this;
    }

    /**
     * Get state.
     *
     * @return string
     */
    public function getState(): ?string
    {
        return $this->state;
    }
}


text:
/*===- InstrProfilingVersionVar.c - profile version variable setup  -------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

#include "InstrProfiling.h"

/* uint64 __llvm_profile_raw_version
 *
 * The runtime should only provide its own definition of this symbol when the
 * user has not specified one. Set this up by moving the runtime's copy of this
 * symbol to an object file within the archive.
 */
COMPILER_RT_WEAK uint64_t INSTR_PROF_RAW_VERSION_VAR = INSTR_PROF_RAW_VERSION;


text:
import os
import shutil
import sys

def run():
    from django.core.management import execute_from_command_line
    os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.app.settings'
    os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = "localhost:8000-8010,8080,9200-9300"
    try:
        execute_from_command_line([sys.argv[0], 'test'] + sys.argv[1:])
    finally:
        from tests.app.settings import STATIC_ROOT, MEDIA_ROOT
        shutil.rmtree(STATIC_ROOT, ignore_errors=True)
        shutil.rmtree(MEDIA_ROOT, ignore_errors=True)

if __name__ == '__main__':
    run()


text:
<?php
namespace Milk\Models;

use \Milk\Models\User as BaseUser;

/**
	Admin user model
		@package Milk
		@version 0.5.0
**/
class AdminUser extends BaseUser {
    public static $session_var = 'ADMIN';
	public static $cookie = '__admin_login_token';

	/**
		Log in user automatically with uuid and token
			@return mixed
			@param $userId double
			@param $token string
			@static
			@public
	**/
	public static function autoLogin($token) {
		$model = static::$token_model;
		if ($token = $model::byToken($token)) {
			if ($user = static::byUUID($token->uuid, false)) {
				if (!$user->isAdmin())
					return false;

				if ($token->uuid) {
					$uuid = $token->uuid;
					$token->erase();
				} else {
					$uuid = $user->uuid;
				}
				$token = new static::$token_model($uuid);
				$token->save();
				$user->login();
				return $user;
			}
		}
		setcookie(static::$cookie, '', time()-3600);
		return false;
	}
}


text:
package com.zang.api.it;

import com.zang.api.connectors.NotificationsConnector;
import com.zang.api.domain.list.NotificationsList;
import com.zang.api.exceptions.ZangException;
import org.junit.Test;

public class NotificationsIT extends BaseIntegrationTest {

    public NotificationsIT() throws ZangException {
    }

    @Test
    public void notifications() throws ZangException {
        NotificationsConnector conn = connectorFactory.getNotificationsConnector();
        NotificationsList list = conn.listNotifications();
        if (list.getTotal() > 0) {
            conn.viewNotification(list.iterator().next().getSid());
        }
    }

}


text:
{
  spawn: jest.fn((cmd, args) => {
    let closeCallback;
    return {
      stdout: {
        on: jest.fn().mockImplementation((event, callback) => {
          if (event === "data") {
            setTimeout(() => {
              callback(mockResponse);
              setTimeout(closeCallback, 0);
            }, 0);
          } else if (event === "close") {
            closeCallback = callback;
          }
        }),
        setEncoding: jest.fn()
      }
    };
  });
}