text:
using UnityEngine;
using System.IO;
using System;
using StatMaster.Data;
using System.Collections;
using System.Collections.ObjectModel;
using System.Collections.Generic;

namespace StatMaster
{
    class Behaviour : MonoBehaviour
    {
        private GameData _data = new GameData();

        private uint eventsCallCount = 0;

        private uint tsSessionStart = 0;

        private bool validPark = true;

        private Settings _settings;

        private Notice _notice = new Notice();

        private IEnumerator _updateProgressionDataCoroutine;

        private void Awake()
        {
            Parkitect.UI.EventManager.Instance.OnStartPlayingPark += onStartPlayingParkHandler;

            StartCoroutine(loadSettingsProp());
        }

        void Start()
        {
            if (_settings.updateGameData)
            {
                Parkitect.UI.EventManager.Instance.OnStartPlayingPark -= onStartPlayingParkHandler;
                validPark = (GameController.Instance.park.guid != null);

                Debug.isEnable = _settings.devMode;

                initSession(false);
                if (validPark && _settings.updateParkData)
                {
                    GameController.Instance.park.OnNameChanged += onParkNameChangedHandler;
                    Parkitect.UI.EventManager.Instance.OnGameSaved += onGameSaved;

                    if (_settings.updateParkSessionData)
                    {
                        _updateProgressionDataCoroutine = updateProgressionData();
                        StartCoroutine(_updateProgressionDataCoroutine);
                    }
                }
                else if (!validPark)
                {
                    _notice.addText("The current park is not compatible with StatMaster!");
                    _notice.addText("No park data logging available, regular game data logging only!");
                    _notice.addText("We are working on a solution, please wait for the next pre-alpha 5 release!");
                    _notice.showWindow = true;

                    Debug.LogMT("No valid park found, park stats disabled!");
                }
                if (_data.oldDataVersion)
                {
                    _notice.addText("Detected old data version, old data files have been removed!");
                    _notice.addText("Main game data have been converted to new data version!");
                    _notice.addText("If you need old park / park session data have a look into:");
                    _notice.addText("persistentDataFolder/statMaster/backup_dv_num");
                    _notice.showWindow = true;
                    _data.oldDataVersion = false;

                    Debug.LogMT("Old data version detected!");
                }
            }
        }

        private IEnumerator loadSettingsProp()
        {
            while (_settings == null)
            {
                _settings = FindObjectOfType<Settings>();
                yield return new WaitForSeconds(1);
            }
        }

        private IEnumerator updateProgressionData()
        {
            while (true)
            {
                if (_settings.updateGameData &&
                    _settings.updateParkData && _settings.updateParkSessionData &&
                    _settings.updateProgressionData)
                {

                    if (_settings.hasProgressionOldChanged("updateInterval"))
                        _data.currentPark.sessions[_data.currentPark.sessionIdx].initNewProgressionRange(_settings);

                    uint cTs = Main.getCurrentTimestamp();

                    Debug.LogMT("Update progression data with interval " + _settings.progressionDataUpdateInterval);
                    // park progression count values
                    _data.currentPark.sessions[_data.currentPark.sessionIdx].progressionCountData.updateRange();
                    // further park info values
                    _data.currentPark.sessions[_data.currentPark.sessionIdx].progressionFurtherData.updateRange();

                    if (_settings.updatePeopleData)
                    {
                        Debug.LogMT("Update people progression data");
                        _data.currentPark.sessions[_data.currentPark.sessionIdx].progressionPeopleData.updateRange();
                    }

                    // attractions values
                    if (_settings.updateAttractionsData)
                    {
                        Debug.LogMT("Update attractions progression data");
                        _data.currentPark.sessions[_data.currentPark.sessionIdx].progressionAttractionsData.updateRange();
                    }

                    if (_settings.updateShopsData)
                    {
                        Debug.LogMT("Update shops progression data");
                        _data.currentPark.sessions[_data.currentPark.sessionIdx].progressionShopsData.updateRange();
                    }
                }

                yield return new WaitForSeconds(_settings.progressionDataUpdateInterval);
            }
        }

        private void onGameSaved()
        {
            Debug.LogMT("Game saved");
            addParkFile("save");

            if (_settings.updateAutoSaveData)
                addAutoSaveParkFileToData(getParkFileName(), "save");

            eventsCallCount++;
        }

        private void onParkNameChangedHandler(string oldName, string newName)
        {
            Debug.LogMT("Park name change to " + newName);
            addParkName(newName);
            eventsCallCount++;
        }

        private void onStartPlayingParkHandler()
        {
            tsSessionStart = Main.getCurrentTimestamp();
            _data.currentGameStart = tsSessionStart;
            Debug.LogMT("Started playing at ", tsSessionStart);
            eventsCallCount++;
        }

        private void initSession(bool resetGameData) {
            Debug.LogMT("Init session");
            if (tsSessionStart == 0) tsSessionStart = Main.getCurrentTimestamp();
            if (resetGameData) _data = new GameData();
            _data.currentGameStart = tsSessionStart;
            if (validPark) _data.currentParkGuid = GameController.Instance.park.guid.ToLower();
            Debug.LogMT(_data.loadByHandles());

            _data.init(_settings);

            Debug.LogMT("New data? " + !(_data.sessionIdx > 0));

            Debug.LogMT("Current session start time ",
                _data.tsSessionStarts[_data.tsSessionStarts.Count - 1]);

            updateData("load");
        }

        private bool addParkFileToData(string name, string mode = "load")
        {
            bool success = false;
            string cName = (_data.currentPark.files.Count > 0)
                ? _data.currentPark.files[_data.currentPark.files.Count - 1] : null;
            if (cName != name)
            {
                _data.currentPark.files.Add(name);
                if (_settings.updateParkSessionData)
                {
                    if (mode == "save")
                    {
                        _data.currentPark.sessions[_data.currentPark.sessionIdx].saveFiles.Add(name);
                    }
                    else
                    {
                        _data.currentPark.sessions[_data.currentPark.sessionIdx].loadFile = name;
                    }
                }
                success = true;
            }
            return success;
        }

        private bool addAutoSaveParkFileToData(string name, string mode = "load")
        {
            bool success = false;
            if (name.IndexOf("QuickSave-") != -1 || name.IndexOf("AutoSave-") != -1)
            {
                bool isAutoSave = (name.IndexOf("AutoSave-") != -1);
                Debug.LogMT("AutoSave file to data " + name);

                if (isAutoSave) _data.currentPark.autoSavesCount++;
                if (!isAutoSave) _data.currentPark.quickSavesCount++;

                if (_settings.updateParkSessionData)
                {
                    if (isAutoSave) _data.currentPark.sessions[_data.currentPark.sessionIdx].autoSavesCount++;
                    if (!isAutoSave) _data.currentPark.sessions[_data.currentPark.sessionIdx].quickSavesCount++;
                }
                success = true;
            }

            return success;
        }

        private string getParkFileName()
        {
            string[] parkSaveFileElements = GameController.Instance.loadedSavegamePath.Split(
                    (Application.platform == RuntimePlatform.WindowsPlayer) ? '\\' : '/'
                );
            return parkSaveFileElements[parkSaveFileElements.Length - 1];
        }

        private void addParkFile(string mode = "load")
        {
            bool updated = false;
            Debug.LogMT("Add park file");
            if (File.Exists(GameController.Instance.loadedSavegamePath))
            {
                string dFile = getParkFileName();

                if ((!_settings.ignoreQuickSaveFileNames ||
                     (_settings.ignoreQuickSaveFileNames && dFile.IndexOf("QuickSave-") == -1)) &&
                    (!_settings.ignoreAutoSaveFileNames ||
                     (_settings.ignoreAutoSaveFileNames && dFile.IndexOf("AutoSave-") == -1)))
                {
                    updated = addParkFileToData(dFile, mode);
                    if (updated) Debug.LogMT("New park file " + dFile + " mode (" + mode + ")");
                }
            }
            if (updated == false) Debug.LogMT("No new park file");
        }

        private bool addParkName(string name)
        {
            ParkData pd = _data.currentPark;
            bool success = false;
            if (name != "Unnamed Park" &&
                (pd.names.Count == 0 || pd.names[pd.names.Count - 1] != name))
            {
                Debug.LogMT("New park name " + name);
                pd.names.Add(name);
                if (_settings.updateParkSessionData)
                    pd.sessions[pd.sessionIdx].names.Add(name);
                success = true;
            }
            else
            {
                Debug.LogMT("No new park name");
            }
            return success;
        }

        private void updateData(string mode = "load")
        {
            Debug.LogMT("Update game data");

            uint cTs = Main.getCurrentTimestamp();
            _data.tsEnd = cTs;

            if (validPark && _settings.updateParkData)
            {
                Debug.LogMT("Update park data with session " + _data.currentPark.sessionIdx);

                _data.currentPark.tsEnd = cTs;
                Debug.LogMT("Current session end time ", _data.tsEnd);

                Debug.LogMT("New park time " + ParkInfo.ParkTime.ToString());
                _data.currentPark.time = Convert.ToUInt32(ParkInfo.ParkTime);

                if (_settings.updateParkSessionData)
                {
                    _data.currentPark.sessions[_data.currentPark.sessionIdx].update(
                        _data.currentPark.time
                    );
                }

                string parkName = GameController.Instance.park.parkName;
                addParkName(parkName);
                addParkFile(mode);
           }
        }

        private void OnGUI()
        {
            if (Application.loadedLevel != 2 || _settings.devMode != true)
                return;

            _notice.OnGUI();

            if (GUI.Button(new Rect(Screen.width - 200, 0, 200, 20), "Save Data"))
            {
                updateData("save");
                Debug.LogMT(_data.saveByHandles());
            }
            if (GUI.Button(new Rect(Screen.width - 200, 30, 200, 20), "Next Session"))
            {
                updateData("save");
                Debug.LogMT(_data.saveByHandles());
                tsSessionStart = 0;
                initSession(true);
            }
            if (GUI.Button(new Rect(Screen.width - 200, 60, 200, 20), "Reset Data"))
            {
                FilesHandler fh = new FilesHandler();
                fh.deleteAll();
                Debug.LogMT("All data files have been deleted");
                tsSessionStart = 0;
                initSession(true);
            }
            if (GUI.Button(new Rect(Screen.width - 200, 90, 200, 20), "Debug Data"))
            {
                updateData("save");
                Debug.LogMT("Current session data");
                Debug.LogMT("Events proceed " + eventsCallCount.ToString());
                string[] names = { "gameTime", "sessionTime" };
                long[] values = {
                    Convert.ToInt64(_data.tsEnd - _data.tsStart) * 1000,
                    Convert.ToInt64(_data.tsEnd - _data.tsSessionStarts[_data.sessionIdx]) * 1000
                };
                Debug.LogMT(names, values, 2);

            }
        }

        void OnDisable()
        {
            if (_settings.updateGameData) {
                if (validPark && _settings.updateParkData)
                {
                    if (_settings.updateParkSessionData)
                        StopCoroutine(_updateProgressionDataCoroutine);

                    GameController.Instance.park.OnNameChanged -= onParkNameChangedHandler;
                    Parkitect.UI.EventManager.Instance.OnGameSaved -= onGameSaved;
                }
                updateData("save");
                _data.saveByHandles();
            }
        }

    }
}


text: export { LetterDd24 as default } from "../../";

redpajama_set_name: RedPajamaGithub


text:
APPLICATION

using namespace Permute;

class BlockTranslate : public Application {
private:
  BestOutput bestOutput_;
  Core::Timer timer_;
public:
  BlockTranslate () :
    Application ("block-translate"),
    bestOutput_ (),
    timer_ ()
  {}

  int main (const std::vector <std::string> & args) {
    this -> getParameters ();

    std::cerr << "Reading PV: [" << LOP_FILE << "]" << std::endl;
    timer_.start ();
    PV pv;
    if (! this -> readPV (pv)) {
      return EXIT_FAILURE;
    }
    timer_.stop ();
    std::cerr << "Done: [" << timer_.user () << "s]" << std::endl;

    Permutation source, target, pos, labels;
    std::vector <int> parents;

    std::istream & in = this -> input ();
    std::ostream & out = this -> output ();

    std::cerr << "Reading LM: [" << LMODEL_FILE << "]" << std::endl;
    timer_.start ();
    Fsa::ConstAutomatonRef language = this -> lmodel ();
    timer_.stop ();
    std::cerr << "Done: [" << timer_.user () << "s]" << std::endl;

    while (readPermutationWithAlphabet (source, in)) {
      readPermutationWithAlphabet (pos, in);
      if (DEPENDENCY) {
	readParents (parents, in);
	readPermutationWithAlphabet (labels, in);
      }
      target = source;
      readAlignment (target, in);

      std::cerr << "Translating: ["
		<< source
		<< "]" << std::endl;
      timer_.start ();

      SumBeforeCostRef bc (new SumBeforeCost (source.size (), "block-translate"));
      this -> sumBeforeCost (bc, pv, source, pos, parents, labels);

      Fsa::ConstAutomatonRef
	//	distortion = this -> distortion (source),
	channel = this -> ttable (source, language -> getInputAlphabet ()),
	a = Fsa::cache (Fsa::composeMatching (channel, language, false));
// 	a = Fsa::cache (Fsa::composeMatching (distortion,
// 					      Fsa::composeMatching (channel,
// 								    language,
// 								    false),
// 					      false));

      FsaCellMap * cellMapP = new FsaCellMap (a);
      CellMapRef cellMap (cellMapP);
      ConstCellRef closure (cellMapP -> epsilonClosure ());
      CellRef topCell (new StartEndCell (a, closure));

      while (blockSearch (source, bc, WINDOW, a, cellMap, topCell, closure) > 0.0);

      Fsa::ConstAutomatonRef
	sentence = fsa (source, Fsa::TropicalSemiring),
	best = bestOutput_ (sentence, a);
      Fsa::writeLinear (best, out);
      out << std::endl;

      timer_.stop ();
      std::cerr << "Done: [" << timer_.user () << "s]" << std::endl;
    }

    return EXIT_SUCCESS;
  }

} app;


text:
package credential

import (
	"pharmer.dev/cloud/apis"
	v1 "pharmer.dev/cloud/apis/cloud/v1"

	"github.com/spf13/pflag"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type Vultr struct {
	CommonSpec

	token string
}

func (c Vultr) Token() string { return get(c.Data, VultrAPIToken, c.token) }

func (c *Vultr) LoadFromEnv() {
	c.CommonSpec.LoadFromEnv(c.Format())
}

func (c Vultr) IsValid() (bool, error) {
	return c.CommonSpec.IsValid(c.Format())
}

func (c *Vultr) AddFlags(fs *pflag.FlagSet) {
	fs.StringVar(&c.token, apis.Vultr+"."+VultrAPIToken, c.token, "Vultr token")
}

func (_ Vultr) RequiredFlags() []string {
	return []string{apis.Vultr + "." + VultrAPIToken}
}

func (_ Vultr) Format() v1.CredentialFormat {
	return v1.CredentialFormat{
		ObjectMeta: metav1.ObjectMeta{
			Name: apis.Vultr,
			Labels: map[string]string{
				apis.KeyCloudProvider: apis.Vultr,
			},
			Annotations: map[string]string{
				apis.KeyClusterCredential: "",
				apis.KeyDNSCredential:     "",
			},
		},
		Spec: v1.CredentialFormatSpec{
			Provider:      apis.Vultr,
			DisplayFormat: "field",
			Fields: []v1.CredentialField{
				{
					Envconfig: "VULTR_TOKEN",
					Form:      "vultr_token",
					JSON:      VultrAPIToken,
					Label:     "Personal Access Token",
					Input:     "password",
				},
			},
		},
	}
}


text: OWIN specification compliance tests for implementors


text:
/* @flow */

import { display } from '../display';
import { DefineScale } from '../data/define';

export default function(settings: Object, _this: Global): GraghShape {
  const draw = function() {
    const canvas = _this.canvas;
    const scale = _this.scale;

    if(!this.fixed) {
      DefineScale.call(this, scale, 'x', 'y', 'width', 'height', 'moveX', 'moveY', 'radius');
    }

    canvas.save();
    if(this.fixed) {
      canvas.translate(-_this.transX, -_this.transY);
    }
    canvas.translate(this.scaled_moveX, this.scaled_moveY);
    canvas.translate(this.scaled_x, this.scaled_y);
    if(!this.hide) {
      canvas.beginPath();
      if(!isNaN(this.startAngle) && !isNaN(this.endAngle)) {
        canvas.arc(0, 0, this.scaled_radius, Math.PI / 180 * this.startAngle, Math.PI / 180 * this.endAngle, false);
        canvas.save();
        canvas.rotate(Math.PI / 180 * this.endAngle);
        canvas.moveTo(this.scaled_radius, 0);
        canvas.lineTo(0, 0);
        canvas.restore();
        canvas.rotate(Math.PI / 180 * this.startAngle);
        canvas.lineTo(this.scaled_radius, 0);
      } else {
        canvas.arc(0, 0, this.scaled_radius, 0, Math.PI*2);
      }
      if(this.style === 'fill') {
        canvas.fillStyle = this.color;
        canvas.fill();
      } else {
        canvas.strokeStyle = this.color;
        canvas.stroke();
      }
      canvas.closePath();
    }
    canvas.restore();
  };

  return Object.assign({}, display(settings, _this), {
    type: 'arc',
    draw: draw,
    style: settings.style,
    startAngle: settings.startAngle,
    endAngle: settings.endAngle,
    radius: settings.radius,
    scaled_radius: settings.radius * _this.scale
  });
}


text:
<?php

namespace Kunstmaan\TranslatorBundle\Service\Command\Exporter;

use Kunstmaan\TranslatorBundle\Model\Export\ExportFile;

/**
 * Responsible for exporting translations into files
 */
class Exporter
{
    /**
     * Array of all translation exporter
     *
     * @var array
     */
    private $exporters = [];

    public function getExportedContent(ExportFile $exportFile)
    {
        return $this->getExporterByExtension($exportFile->getExtension())->export($exportFile->getArray());
    }

    public function getExporterByExtension($extension)
    {
        foreach ($this->exporters as $exporter) {
            if ($exporter->supports($extension)) {
                return $exporter;
            }
        }

        throw new \Exception(sprintf('No %s file exporter found or defined.', $extension));
    }

    public function setExporters($exporters)
    {
        $this->exporters = $exporters;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shared.Core.Attributes
{
    public enum CompareOperator
    {
        EQUAL,
        NON_EQUAL,
        GREATER_THAN,
        LESS_THAN,
        GREATER_OR_EQUAL_THAN,
        LESS_OR_EQUAL_THAN,
        CONTAINS,
        IS_IN_COLLECTION
    };

    public class FilterAttribute : Attribute
    {
        public string TargetProperty { get; set; }
        public CompareOperator Operator { get; set; }
        //public int? EnumAttribute { get; set; }

        public FilterAttribute(string targetProperty, CompareOperator compareOperator)
        {
            TargetProperty = targetProperty;
            Operator = compareOperator;
        }
    }
}


text:
package website.automate.jwebrobot.context;

import org.openqa.selenium.WebDriver;
import website.automate.waml.io.model.main.Scenario;
import website.automate.waml.io.model.main.action.Action;

import java.util.HashMap;
import java.util.Map;

public class ScenarioExecutionContext {

    private Integer stepCount = -1;

    private Scenario scenario;

    private WebDriver driver;

    private Map<String, Object> memory = new HashMap<>();

    private ScenarioExecutionContext parent;

    private GlobalExecutionContext globalContext;

    public ScenarioExecutionContext(GlobalExecutionContext globalContext,
            Scenario scenario,
            WebDriver driver) {
        this.globalContext = globalContext;
        this.scenario = scenario;
        this.driver = driver;
    }

    public ScenarioExecutionContext createChildContext(Scenario scenario){
        return new ScenarioExecutionContext(getGlobalContext(), scenario, getDriver(), getMemory(), this);
    }

    private ScenarioExecutionContext(GlobalExecutionContext globalContext,
            Scenario scenario,
            WebDriver driver, Map<String, Object> memory,
            ScenarioExecutionContext parent) {
        this(globalContext, scenario, driver);
        this.memory = memory;
        this.parent = parent;
    }

    public Scenario getScenario() {
        return scenario;
    }

    public WebDriver getDriver() {
        return driver;
    }

    public Map<String, Object> getMemory() {
        return memory;
    }

    public Map<String, Object> getTotalMemory(){
    	Map<String, Object> totalMemory = new HashMap<>();
    	totalMemory.putAll(memory);
    	totalMemory.putAll(getGlobalContext().getMemory());
    	return totalMemory;
    }

    public ScenarioExecutionContext getParent() {
        return parent;
    }

    public GlobalExecutionContext getGlobalContext() {
        return globalContext;
    }

    public String getScenarioInclusionPath(){
        String result = scenario.getName();
        if(parent != null){
            return parent.getScenarioInclusionPath() + "/" + result;
        }
        return result;
    }

    public Scenario getRootScenario(){
        return getRoot().getScenario();
    }

    public ScenarioExecutionContext getRoot(){
        if(parent == null){
            return this;
        }
        return parent.getRoot();
    }

    public boolean containsScenario(Scenario scenario){
        if(this.getScenario().equals(scenario)){
            return true;
        }
        ScenarioExecutionContext parentContext = this.getParent();
        if(parentContext == null){
            return false;
        }
        return parentContext.containsScenario(scenario);
    }

    public void countStep(Action action){
        this.stepCount++;
        if(this.getParent() != null){
            this.getParent().countStep(action);
        }
    }

    public void setScenario(Scenario scenario) {
        this.scenario = scenario;
    }

    public Integer getStepCount() {
        return stepCount;
    }
}


text:
<readable><title>3711826708_bba64fb1e1</title><content>
A brown dog is walking on a wooded path with white flowers .
A corgi is walking down a path in a forest .
A dog is running through a very wooded area with large white flowers .
A dog is walking through an area of heavy foliage along a dirt path .
a dog runs across the path .
</content></readable>


text:
// g2o - General Graph Optimization
// Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright notice,
//   this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
//   notice, this list of conditions and the following disclaimer in the
//   documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#ifndef G2O_OPENMP_MUTEX
#define G2O_OPENMP_MUTEX

#include "../../config.h"

#ifdef G2O_OPENMP
#include <omp.h>
#else
#include <cassert>
#endif

namespace g2o {

#ifdef G2O_OPENMP

  /**
   * \brief Mutex realized via OpenMP
   */
  class OpenMPMutex
  {
    public:
      OpenMPMutex() { omp_init_lock(&_lock); }
      ~OpenMPMutex() { omp_destroy_lock(&_lock); }
      void lock() { omp_set_lock(&_lock); }
      void unlock() { omp_unset_lock(&_lock); }
    protected:
      omp_lock_t _lock;
  };

#else

  /*
   * dummy which does nothing in case we don't have OpenMP support.
   * In debug mode, the mutex allows to verify the correct lock and unlock behavior
   */
  class OpenMPMutex
  {
    public:
#ifdef NDEBUG
      OpenMPMutex() {}
#else
      OpenMPMutex() : _cnt(0) {}
#endif
      ~OpenMPMutex() { assert(_cnt == 0 && "Freeing locked mutex");}
      void lock() { assert(++_cnt == 1 && "Locking already locked mutex");}
      void unlock() { assert(--_cnt == 0 && "Trying to unlock a mutex which is not locked");}
    protected:
#ifndef NDEBUG
      char _cnt;
#endif
  };

#endif

  /**
   * \brief lock a mutex within a scope
   */
  class ScopedOpenMPMutex
  {
    public:
      explicit ScopedOpenMPMutex(OpenMPMutex* mutex) : _mutex(mutex) { _mutex->lock(); }
      ~ScopedOpenMPMutex() { _mutex->unlock(); }
    private:
      OpenMPMutex* const _mutex;
      ScopedOpenMPMutex(const ScopedOpenMPMutex&);
      void operator=(const ScopedOpenMPMutex&);
  };

}

#endif


text:
CREATE PROCEDURE [dbo].[People_SelectAll]
AS
/*
EXECUTE [dbo].[People_SelectAll]
*/
BEGIN
	SELECT
		[Id],
		[FirstName],
		[MiddleInitial],
		[LastName],
		[DateOfBirth],
		[CreatedDate],
		[ModifiedDate],
		[ModifiedBy]
	FROM
		[dbo].[People]
END


text:
/* eslint-env node */
'use strict';

module.exports = {
  name: 'ember-stripify',

  contentFor: function(type) {
    // we use body since Stripe must be available before
    if (type === 'body') {
      return '<script type="text/javascript" src="https://js.stripe.com/v3/"></script>';
    }
  },

  isDevelopingAddon: function() {
    return false;
  }
};


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace CJia.CheckRegOrder.Presenters
{
    public class PatientSelectPresenter : CJia.Presenter<Views.IPatientSelectView>
    {
        private Models.PatientSelectModel Model
        {
            get;
            set;
        }
        public PatientSelectPresenter(Views.IPatientSelectView view)
            : base(view)
        {
            Model = new Models.PatientSelectModel();
        }
        protected override void OnViewSet()
        {
            View.Load += View_Load;
            View.OnSelectByNO += View_OnSelectByNO;
            View.OnSelectByName += View_OnSelectByName;
            View.OnSelect += View_OnSelect;
        }

        void View_OnSelect(object sender, Views.PatientSelectArgs e)
        {
            if (BindByNO(e.PatientNO))
            {
                View.TxtPatientNOFocus();
                return;
            }
            if (BindByName(e.PatientName))
            {
                View.TxtPatientNameFocus();
                return;
            }
            View.ShowMessage("无此病人就诊信息");
            View.TxtPatientNOFocus();
        }

        void View_OnSelectByName(object sender, Views.PatientSelectArgs e)
        {
            if (!BindByName(e.PatientName))
            {
                View.ShowMessage("无此病人就诊信息");
            }
            View.TxtPatientNameFocus();
        }

        void View_OnSelectByNO(object sender, Views.PatientSelectArgs e)
        {
            if (!BindByNO(e.PatientNO))
            {
                View.ShowMessage("无此病人就诊信息");
            }
            View.TxtPatientNOFocus();
        }

        void View_Load(object sender, EventArgs e)
        {
            DataTable data = Model.GetPatient();
            View.ExeBindPatient(data);
        }

        #region 内部调用函数
        /// <summary>
        /// 根据病人工号查询是否能返回data
        /// </summary>
        /// <param name="patientNO"></param>
        /// <returns></returns>
        public bool BindByNO(string patientNO)
        {
            DataTable data = Model.GetPatientByNO(patientNO);
            if (data != null && data.Rows.Count > 0)
            {
                View.ExeBindPatient(data);
                return true;
            }
            return false;
        }
        /// <summary>
        /// 根据病人姓名查询是否能返回data
        /// </summary>
        /// <param name="patientName"></param>
        /// <returns></returns>
        public bool BindByName(string patientName)
        {
            DataTable data = Model.GetPatientByName(patientName);
            if (data != null && data.Rows.Count > 0)
            {
                View.ExeBindPatient(data);
                return true;
            }
            return false;
        }
        #endregion
    }
}


text:
package org.pantsbuild.testproject;

import org.junit.Test;

import static org.junit.Assert.assertTrue;

public class DummyTest {
    @Test
    public void alwaysWorks() {
        Dummy x = new Dummy();
        System.out.println(x.hashCode());
        assertTrue(true);
    }
}


text:
<?php

    use Jairovsky\GeoPlugin\Factory;

    class FactoryTest extends PHPUnit_Framework_TestCase
    {

        public function testFactoryWithDefaults()
        {
            $factory = new Factory;
            $geo = $factory->getGeolocation('173.194.118.24');
            $this->assertTrue(is_object($geo));
        }

        public function testGeolocation_getProperty_shouldReturnUnitedStatesAsCountryName()
        {
            $factory = new Factory;
            $geo = $factory->getGeolocation('173.194.118.24');
            $this->assertEquals('United States', $geo->getProperty('countryName'));
        }
    }


text:
'use strict';

var React;
var ReactDOM;
var ReactTestUtils;

function StatelessComponent(props) {
  return
{props.name}
;
}

describe('ReactStatelessComponent', function() {

  beforeEach(function() {
    React = require('React');
    ReactDOM = require('ReactDOM');
    ReactTestUtils = require('ReactTestUtils');
  });

  it('should render stateless component', function() {
    var el = document.createElement('div');
    ReactDOM.render(<StatelessComponent name="A" />, el);

    expect(el.textContent).toBe('A');
  });

  it('should update stateless component', function() {
    var Parent = React.createClass({
      render() {
        return <StatelessComponent {...this.props} />;
      },
    });

    var el = document.createElement('div');
    ReactDOM.render(<Parent name="A" />, el);
    expect(el.textContent).toBe('A');

    ReactDOM.render(<Parent name="B" />, el);
    expect(el.textContent).toBe('B');
  });

  it('should unmount stateless component', function() {
    var container = document.createElement('div');

    ReactDOM.render(<StatelessComponent name="A" />, container);
    expect(container.textContent).toBe('A');

    ReactDOM.unmountComponentAtNode(container);
    expect(container.textContent).toBe('');
  });

  it('should pass context thru stateless component', function() {
    var Child = React.createClass({
      contextTypes: {
        test: React.PropTypes.string.isRequired,
      },

      render: function() {
        return
{this.context.test}
;
      },
    });

    function Parent() {
      return <Child />;
    }

    var GrandParent = React.createClass({
      childContextTypes: {
        test: React.PropTypes.string.isRequired,
      },

      getChildContext() {
        return {test: this.props.test};
      },

      render: function() {
        return <Parent />;
      },
    });

    var el = document.createElement('div');
    ReactDOM.render(<GrandParent test="test" />, el);

    expect(el.textContent).toBe('test');

    ReactDOM.render(<GrandParent test="mest" />, el);

    expect(el.textContent).toBe('mest');
  });

  it('should support module pattern components', function() {
    function Child({test}) {
      return {
        render() {
          return
{test}
;
        },
      };
    }

    var el = document.createElement('div');
    ReactDOM.render(<Child test="test" />, el);

    expect(el.textContent).toBe('test');
  });

  it('should throw on string refs in pure functions', function() {
    function Child() {
      return
;
    }

    expect(function() {
      ReactTestUtils.renderIntoDocument(<Child test="test" />);
    }).toThrow(
      'Stateless function components cannot have refs.'
    );
  });

  it('should warn when given a ref', function() {
    spyOn(console, 'error');

    var Parent = React.createClass({
      displayName: 'Parent',
      render: function() {
        return <StatelessComponent name="A" ref="stateless"/>;
      },
    });
    ReactTestUtils.renderIntoDocument(<Parent/>);

    expect(console.error.argsForCall.length).toBe(1);
    expect(console.error.argsForCall[0][0]).toContain(
      'Stateless function components cannot be given refs ' +
      '(See ref "stateless" in StatelessComponent created by Parent). ' +
      'Attempts to access this ref will fail.'
    );
  });

  it('should provide a null ref', function() {
    function Child() {
      return
;
    }

    var comp = ReactTestUtils.renderIntoDocument(<Child />);
    expect(comp).toBe(null);
  });

  it('should use correct name in key warning', function() {
    function Child() {
      return
{[]}
;
    }

    spyOn(console, 'error');
    ReactTestUtils.renderIntoDocument(<Child />);
    expect(console.error.argsForCall.length).toBe(1);
    expect(console.error.argsForCall[0][0]).toContain('a unique "key" prop');
    expect(console.error.argsForCall[0][0]).toContain('Child');
  });

  it('should support default props and prop types', function() {
    function Child(props) {
      return
{props.test}
;
    }
    Child.defaultProps = {test: 2};
    Child.propTypes = {test: React.PropTypes.string};

    spyOn(console, 'error');
    ReactTestUtils.renderIntoDocument(<Child />);
    expect(console.error.argsForCall.length).toBe(1);
    expect(console.error.argsForCall[0][0]).toBe(
      'Warning: Failed propType: Invalid prop `test` of type `number` ' +
      'supplied to `Child`, expected `string`.'
    );
  });

  it('should receive context', function() {
    var Parent = React.createClass({
      childContextTypes: {
        lang: React.PropTypes.string,
      },
      getChildContext: function() {
        return {lang: 'en'};
      },
      render: function() {
        return <Child />;
      },
    });
    function Child(props, context) {
      return
{context.lang}
;
    }
    Child.contextTypes = {lang: React.PropTypes.string};

    var el = document.createElement('div');
    ReactDOM.render(<Parent />, el);
    expect(el.textContent).toBe('en');
  });

  it('should work with arrow functions', function() {
    // TODO: actually use arrow functions, probably need node v4 and maybe
    // a separate file that we blacklist from the arrow function transform.
    // We can't actually test this without native arrow functions since the
    // issues (non-newable) don't apply to any other functions.
    var Child = function() {
      return
;
    };
    // Will create a new bound function without a prototype, much like a native
    // arrow function.
    Child = Child.bind(this);

    expect(() => ReactTestUtils.renderIntoDocument(<Child />)).not.toThrow();
  });
});


text:
Sparks.calendar = function calendar(options) {
	options = options || {};
	var that = Sparks.month_viewer(options);

	that.page_viewer = Sparks.recycling_page_viewer();

	that.processor = function processor(result) {
		var color = Sparks.random_color();
		return function selector(telescope) {
			return telescope.add("background-color:"+color);
		}
	}

	that.page_viewer.add_preprocessor(function prepxr(results, month) {
		var years = Sparks.epoch.year + Math.floor(month / 12);
		var months = Sparks.epoch.month + (month % 12);
		that.set_date(Sparks.date(years, months));
		var list_mirror = Sparks.list_mirror(results,
			function list_mirror(result) {
				return that.select_range(
					result.start, result.duration, that.processor(result)
				);
			}
		);
		return list_mirror.detach;
	});

	that.view = that.page_viewer.view;

	that.presenter.add_postdrawer(function() {
		that.page_viewer.view(0);
	});

	return that;
}


text:
class Character : public PhysicsBody {
    public:
        Character();
        void KeyPressed(KEY);
        void Update();
};

#endif // CHARACTER_HPP


text:
<resources>
    <string name="app_name">TinyApp</string>
    <string name="action_settings">Settings</string>
    <string name="result">Result</string>
    <string name="winner"></string>
</resources>


text:
package org.onosproject.bgpmonitoring;

/**
 * Enum to Provide the Different types of BMP messages.
 */
public enum BmpType {

    ROUTE_MONITORING((byte) 0x0),

    STATISTICS_REPORT((byte) 0x1),

    PEER_DOWN_NOTIFICATION((byte) 0x2),

    PEER_UP_NOTIFICATION((byte) 0x3),

    INITIATION_MESSAGE((byte) 0x4),

    TERMINATION_MESSAGE((byte) 0x5),

    ROUTE_MIRRORING_MESSAGE((byte) 0x6);

    private final byte value;

    /**
     * Assign value with the value val as the types of BMP message.
     *
     * @param val type of BMP message
     */
    BmpType(byte val) {
        value = val;
    }

    /**
     * Returns value as type of BMP message.
     *
     * @return value type of BMP message
     */
    public byte getType() {
        return value;
    }
}


text:
Build Systems may refer to low-level tools, like CMake, or larger systems that run on servers, like Jenkins or TeamCity. This page will talk about both.

# Continuous Integration systems

Probably the most important aspect to using Catch with a build server is the use of different reporters. Catch comes bundled with three reporters that should cover the majority of build servers out there - although adding more for better integration with some is always a possibility (currently we also offer TeamCity, TAP and Automake reporters).

Two of these reporters are built in (XML and JUnit) and the third (TeamCity) is included as a separate header. It's possible that the other two may be split out in the future too - as that would make the core of Catch smaller for those that don't need them.

## XML Reporter
```-r xml```

The XML Reporter writes in an XML format that is specific to Catch.

The advantage of this format is that it corresponds well to the way Catch works (especially the more unusual features, such as nested sections) and is a fully streaming format - that is it writes output as it goes, without having to store up all its results before it can start writing.

The disadvantage is that, being specific to Catch, no existing build servers understand the format natively. It can be used as input to an XSLT transformation that could covert it to, say, HTML - although this loses the streaming advantage, of course.

## JUnit Reporter
```-r junit```

The JUnit Reporter writes in an XML format that mimics the JUnit ANT schema.

The advantage of this format is that the JUnit Ant schema is widely understood by most build servers and so can usually be consumed with no additional work.

The disadvantage is that this schema was designed to correspond to how JUnit works - and there is a significant mismatch with how Catch works. Additionally the format is not streamable (because opening elements hold counts of failed and passing tests as attributes) - so the whole test run must complete before it can be written.

## Other reporters
Other reporters are not part of the single-header distribution and need to be downloaded and included separately. All reporters are stored in `include/reporters` directory in the git repository, and are named `catch_reporter_*.hpp`. For example, to use the TeamCity reporter you need to download `include/reporters/catch_reporter_teamcity.hpp` and include it after Catch itself.

```
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include "catch_reporter_teamcity.hpp"
```

### TeamCity Reporter
```-r teamcity```

The TeamCity Reporter writes TeamCity service messages to stdout. In order to be able to use this reporter an additional header must also be included.

Being specific to TeamCity this is the best reporter to use with it - but it is completely unsuitable for any other purpose. It is a streaming format (it writes as it goes) - although test results don't appear in the TeamCity interface until the completion of a suite (usually the whole test run).

### Automake Reporter
```-r automake```

The Automake Reporter writes out the [meta tags](https://www.gnu.org/software/automake/manual/html_node/Log-files-generation-and-test-results-recording.html#Log-files-generation-and-test-results-recording) expected by automake via `make check`.

### TAP (Test Anything Protocol) Reporter
```-r tap```

Because of the incremental nature of Catch's test suites and ability to run specific tests, our implementation of TAP reporter writes out the number of tests in a suite last.

# Low-level tools

## CMake

You can use the following CMake script to automatically fetch Catch from github and configure it as an external project:

```CMake
cmake_minimum_required(VERSION 2.8.8)
project(catch_builder CXX)
include(ExternalProject)
find_package(Git REQUIRED)

ExternalProject_Add(
    catch
    PREFIX ${CMAKE_BINARY_DIR}/catch
    GIT_REPOSITORY https://github.com/philsquared/Catch.git
    TIMEOUT 10
    UPDATE_COMMAND ${GIT_EXECUTABLE} pull
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ""
    INSTALL_COMMAND ""
    LOG_DOWNLOAD ON
   )

# Expose required variable (CATCH_INCLUDE_DIR) to parent scope
ExternalProject_Get_Property(catch source_dir)
set(CATCH_INCLUDE_DIR ${source_dir}/single_include CACHE INTERNAL "Path to include folder for Catch")
```

If you put it in, e.g., `${PROJECT_SRC_DIR}/${EXT_PROJECTS_DIR}/catch/`, you can use it in your project by adding the following to your root CMake file:

```CMake
# Includes Catch in the project:
add_subdirectory(${EXT_PROJECTS_DIR}/catch)
include_directories(${CATCH_INCLUDE_DIR} ${COMMON_INCLUDES})
enable_testing(true)  # Enables unit-testing.
```

---

[Home](Readme.md)


text:
'''This module provides precalculated values, mathematical functions and an
interface for the built-in math library.'''

__all__ = []

from batma.util import is_iterable
from math import *

# CONSTANTS ===================================================================
pi = pi
e = e
pi_over_2 = pi/2.0
pi_over_4 = pi/4.0
two_pi = 2*pi
log10e = log10(e)
log2e = log(e, 2)
# =============================================================================

# SHORTCUTS FUNCTIONS =========================================================
abs = abs
max = max
min = min
pow = pow
round = round
# =============================================================================

def inversesqrt(value):
    '''Returns ``1/sqrt(x)``.'''
    return 1.0/sqrt(value)

def mod(a, b):
    '''Returns ``a%b``. This is just an equivalent for the %-operator.'''
    return a%b

def sign(value):
    '''Returns -1 with a negative argument, +1 with a positive argument, and 0
    if its argument is zero.'''
    if value == 0: return 0
    elif value > 0: return 1
    else: return -1

def step(value, threshold):
    '''Returns 0 if ``value < threshold``, otherwise 1.'''
    return 1 if value >= threshold else 0

def clamp(value, min_value, max_value):
    '''Restricts a value to be within a specified range'''
    return max(min_value, min(value, max_value))

def wrap_angle(angle):
    '''Reduces a given angle to a value between pi and -pi'''
    if angle > 0:
        result = fmod(angle+pi, two_pi) - pi;
    else:
        result = fmod(angle-pi, two_pi) + pi;

    return result

def distance(value1, value2):
    '''Calculates the absolute value of the difference of two values'''
    if not is_iterable(value1): value1 = [value1]
    if not is_iterable(value2): value2 = [value2]

    return sqrt(sum((v1-v2)**2 for v1, v2 in zip(value1, value2)))


text:
<extend name="Layout/page_detail" />
<block name="content">
	{:W('PageHeader/simple',array('name'=>'修改任务','search'=>'N'))}

	<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"   class="well form-horizontal">
		<input type="hidden" id="id" name="id" value="{$vo.id}">
		<input type="hidden" id="ajax" name="ajax" value="0">
		<input type="hidden" id="executor" name="executor" value="{$vo.executor}">
		<input type="hidden" id="add_file" name="add_file" value="{$vo.add_file}">
		<input type="hidden" id="assign_user" name="assign_user" value="{$vo.assign_user}">
		<input type="hidden" id="opmode" name="opmode" value="edit">

			标题:

				<input class="form-control" type="text" id="name" name="name" value="{$vo.name}"  check="require" msg="请输入文件名">

			谁来执行:

						{$vo.executor|show_contact="edit"}

							<input class="letter" type="text"  >

			期望完成时间:

				<input class="input-date-time" type="text" id="expected_time" name="expected_time" value="{$vo.expected_time}" >

			任务说明:

				<textarea class="editor" id="content" name="content" style="width:100%;height:300px;" check="require" msg="请输入内容">{$vo.content}</textarea>

			附件:

				{:W('FileUpload/edit',array('add_file'=>$vo['add_file'],'mode'=>'add'))}

			<input class="btn btn-sm btn-primary" type="button" value="保存" onclick="save();">
			<input class="btn btn-sm btn-default" type="button" value="取消" onclick="go_return_url();">

	</form>
</block>
<block name="js">

</block>


text:
package herddb.mem;

import herddb.core.*;
import herddb.model.Column;
import herddb.model.Projection;
import herddb.model.StatementEvaluationContext;
import herddb.model.StatementExecutionException;
import herddb.model.Tuple;
import herddb.model.TupleComparator;
import herddb.utils.DataAccessor;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import herddb.model.ScanLimits;

/**
 * a Simple MaterializedRecordSet held in memory
 *
 * @author enrico.olivelli
 */
public class MemoryRecordSet extends MaterializedRecordSet {

    private List<DataAccessor> buffer = new ArrayList<>();

    MemoryRecordSet(String[] fieldNames, Column[] columns, RecordSetFactory factory) {
        super(-1, fieldNames, columns, factory);
    }

    MemoryRecordSet(int size, String[] fieldNames, Column[] columns, RecordSetFactory factory) {
        super(size, fieldNames, columns, factory);
    }

    @Override
    public Iterator<DataAccessor> iterator() {
        if (!writeFinished) {
            throw new IllegalStateException("RecordSet is still in write mode");
        }
        return buffer.iterator();
    }

    @Override
    public void add(DataAccessor record) {
        if (writeFinished) {
            throw new IllegalStateException("RecordSet in read mode");
        }
        buffer.add(record);
        size++;
    }

    @Override
    public void sort(TupleComparator comparator) {
        if (!writeFinished) {
            throw new IllegalStateException("RecordSet is still in write mode");
        }
        if (comparator != null) {
            buffer.sort(comparator);
        }
    }

    @Override
    public void applyProjection(Projection projection, StatementEvaluationContext context) throws StatementExecutionException {
        if (!writeFinished) {
            throw new IllegalStateException("RecordSet is still in write mode");
        }
        this.columns = projection.getColumns();
        this.fieldNames = projection.getFieldNames();

        List<DataAccessor> projected = new ArrayList<>(size);
        for (DataAccessor record : buffer) {
            projected.add(projection.map(record, context));
        }
        this.buffer = projected;
    }

    @Override
    public void applyLimits(ScanLimits limits, StatementEvaluationContext context) throws StatementExecutionException {
        if (!writeFinished) {
            throw new IllegalStateException("RecordSet is still in write mode");
        }
        if (limits == null) {
            return;
        }
        int offset = limits.computeOffset(context);
        if (offset > 0) {
            int maxlen = buffer.size();
            if (offset >= maxlen) {
                buffer.clear();
                return;
            }
            int samplesize = maxlen - offset;
            buffer = buffer.subList(offset, offset + samplesize);
        }
        int maxRows = limits.computeMaxRows(context);
        if (maxRows > 0) {
            int maxlen = buffer.size();
            if (maxlen < maxRows) {
                return;
            }
            buffer = buffer.subList(0, maxRows);
        }
    }

}


text:
<?php
if (!$categories = get_categories()):
  return;
endif;
?>

<?php _e('Categories', 'wb') ?>

<?php
foreach ($categories as $category):
  $label  = $category->name;
  $url    = get_category_link($category->cat_ID);
  $active = is_category() && get_queried_object()->term_id == $category->cat_ID;
 ?>
      <li<?php echo ($active ? ' class="active"' : '') ?>>
<?php if ($active && get_option('show_on_front') === 'page'): ?>
        <a href="<?php echo get_permalink(get_option('page_for_posts')) ?>" class="close">
<?php endif ?>
        <a href="<?php echo $url ?>"><?php echo $label ?>

<?php endforeach ?>


text:
layout: post
title: Adding Approved Vendor Logo to WooCommerce Product Vendors
description: Woocommerce and Product Vendors are a great way to build a marketplace on top of WordPress, however, I think it is missing the ability to display an approved vendor logo next to the vendors that are selling product which are approved.
tags: [Woocommerce, Product Vendors]
categories: ['Woocommerce']
---

Woocommerce and Product Vendors are a great way to build a marketplace on top
of WordPress, however, I think it is missing the ability to display an
approved vendor logo next to the vendors that are selling product which are
approved.

In order to do this, we are going to use User Capability Manager plugin to create
custom capabilities such as approved vendor and assign it to the respective vendors.

After assigning the capability to a user that is managing a specific vendor, we can
check if that vendor is containing a user that is an approved vendor by using the
code below

{% highlight php %}
<?php
$vendor_id_no = WC_Product_Vendors_Utils::get_vendor_id_from_product( $post->ID );
$vendor_data = get_term_meta( absint( vendor_id_no ), 'vendor_data', true );

$vendor_term = get_term_by( 'id', $vendor_id, WC_PRODUCT_VENDORS_TAXONOMY );

if ( $vendor_data && $vendor_term ) {
	$vendor_data['term_id'] = $vendor_term->term_id;
	$vendor_data['name'] = $vendor_term->name;
	$vendor_data['slug'] = $vendor_term->slug;
	$vendor_data['term_group'] = $vendor_term->term_group;
	$vendor_data['term_taxonomy_id'] = $vendor_term->term_taxonomy_id;
	$vendor_data['taxonomy'] = $vendor_term->taxonomy;
	$vendor_data['description'] = $vendor_term->description;
	$vendor_data['parent'] = $vendor_term->parent;
	$vendor_data['count'] = $vendor_term->count;
	$vendor_data['admins'] = $vendor_term->admins;
}

$user = new WP_User( $vendor_data['admins'] );

foreach ( $user->roles as $role ) {
  if ( $role == 'ROLE_SLUG_HERE') {
	echo '<img style="display:inline-block;" alt="Approved Vendor" title="Approved Vendor" src="IMAGE_LINK_HERE" width="20" height="20">';
	}
};
?>
{% endhighlight %}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <title>ANDROID_GUI — CMake 3.7.2 Documentation</title>

    <link rel="stylesheet" href="../_static/cmake.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
    <link rel="top" title="CMake 3.7.2 Documentation" href="../index.html" />
    <link rel="up" title="cmake-properties(7)" href="../manual/cmake-properties.7.html" />
    <link rel="next" title="ANDROID_JAR_DEPENDENCIES" href="ANDROID_JAR_DEPENDENCIES.html" />
    <link rel="prev" title="ANDROID_ASSETS_DIRECTORIES" href="ANDROID_ASSETS_DIRECTORIES.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.7.2 Documentation »

cmake-properties(7) »

ANDROID_GUI¶

When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio Edition, this property specifies whether to build an executable as an
application package on Android.

When this property is set to true the executable when built for Android
will be created as an application package.  This property is initialized
by the value of the CMAKE_ANDROID_GUI variable if it is set
when a target is created.

Add the AndroidManifest.xml source file explicitly to the
target add_executable() command invocation to specify the
root directory of the application package source.

Previous topic

ANDROID_ASSETS_DIRECTORIES

Next topic

ANDROID_JAR_DEPENDENCIES

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          next |

          previous |

    CMake »

    3.7.2 Documentation »

cmake-properties(7) »

        © Copyright 2000-2016 Kitware, Inc. and Contributors.
      Created using Sphinx 1.4a0+.


text:
assertEq("abc".startsWith("abc"), true);
assertEq("abcd".startsWith("abc"), true);
assertEq("abc".startsWith("a"), true);
assertEq("abc".startsWith("abcd"), false);
assertEq("abc".startsWith("bcde"), false);
assertEq("abc".startsWith("b"), false);
assertEq("abc".startsWith("abc", 0), true);
assertEq("abc".startsWith("bc", 0), false);
assertEq("abc".startsWith("bc", 1), true);
assertEq("abc".startsWith("c", 1), false);
assertEq("abc".startsWith("abc", 1), false);
assertEq("abc".startsWith("c", 2), true);
assertEq("abc".startsWith("d", 2), false);
assertEq("abc".startsWith("dcd", 2), false);
assertEq("abc".startsWith("a", 42), false);
assertEq("abc".startsWith("a", Infinity), false);
assertEq("abc".startsWith("a", NaN), true);
assertEq("abc".startsWith("b", NaN), false);
assertEq("abc".startsWith("ab", -43), true);
assertEq("abc".startsWith("ab", -Infinity), true);
assertEq("abc".startsWith("bc", -42), false);
assertEq("abc".startsWith("bc", -Infinity), false);
var myobj = {toString : (function () "abc"), startsWith : String.prototype.startsWith};
assertEq(myobj.startsWith("abc"), true);
assertEq(myobj.startsWith("bc"), false);
var gotStr = false, gotPos = false;
myobj = {toString : (function () {
    assertEq(gotPos, false);
    gotStr = true;
    return "xyz";
}),
startsWith : String.prototype.startsWith};
var idx = {valueOf : (function () {
    assertEq(gotStr, true);
    gotPos = true;
    return 42;
})};
myobj.startsWith("elephant", idx);
assertEq(gotPos, true);


text:
package ru.dionisius;

import java.util.Iterator;

/**
 * Created by Dionisius on 11.02.2017.
 * Interfaxe for SimpleSet classes.
 */
public interface ISet <E> {
    /**
     * Adds specified element to the set.
     * Only unique elements can be adde to  this set.
     * @param e
     */
    void add(E e);

    /**
     * Returns the iterator for this set.
     * @return the iterator for this set.
     */
    Iterator<E> iterator();
}


text:
from django.conf import settings
from django.db import models

from cms.extensions import PageExtension, TitleExtension
from cms.extensions.extension_pool import  extension_pool

class MyPageExtension(PageExtension):
    extra = models.CharField(blank=True, default='', max_length=255)
    favorite_users = models.ManyToManyField(settings.AUTH_USER_MODEL, blank=True)

    def copy_relations(self, other, language):
        for favorite_user in other.favorite_users.all():
            favorite_user.pk = None
            favorite_user.mypageextension = self
            favorite_user.save()

extension_pool.register(MyPageExtension)

# extension_pool.register can be used also as a decorator
@extension_pool.register
class MyTitleExtension(TitleExtension):
    extra_title = models.CharField(blank=True, default='', max_length=255)

class MultiTablePageExtensionParent(models.Model):
    extension_parent_field = models.CharField(blank=True, default='', max_length=255)

class MultiTablePageExtension(MultiTablePageExtensionParent, PageExtension):
    multitable_extra = models.CharField(blank=True, default='', max_length=255)

extension_pool.register(MultiTablePageExtension)

class MultiTableTitleExtensionParent(models.Model):
    extension_title_parent_field = models.CharField(blank=True, default='', max_length=255)

class MultiTableTitleExtension(MultiTableTitleExtensionParent, TitleExtension):
    multitable_extra_title = models.CharField(blank=True, default='', max_length=255)

extension_pool.register(MultiTableTitleExtension)


text:
package com.microsoft.azure.management.servicebus.v2017_04_01.implementation;

import com.microsoft.azure.management.servicebus.v2017_04_01.OperationDisplay;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * A ServiceBus REST API operation.
 */
public class OperationInner {
    /**
     * Operation name: {provider}/{resource}/{operation}.
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /**
     * The object that represents the operation.
     */
    @JsonProperty(value = "display")
    private OperationDisplay display;

    /**
     * Get operation name: {provider}/{resource}/{operation}.
     *
     * @return the name value
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the object that represents the operation.
     *
     * @return the display value
     */
    public OperationDisplay display() {
        return this.display;
    }

    /**
     * Set the object that represents the operation.
     *
     * @param display the display value to set
     * @return the OperationInner object itself.
     */
    public OperationInner withDisplay(OperationDisplay display) {
        this.display = display;
        return this;
    }

}


text:
<?php
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
	exit ("Do not access this file directly.");
?>

<a href="http://%%item%%.%%vendor%%.pay.clickbank.net/?cbskin=%%cbskin%%&cbfid=%%cbfid%%&cbur=%%cbur%%&cbf=%%cbf%%&tid=%%tid%%&vtid=%%vtid%%&s2_invoice=%%invoice%%&s2_desc=%%desc%%&s2_custom=%%custom%%&s2_customer_ip=<?php echo "<?php echo S2MEMBER_CURRENT_USER_IP; ?>"; ?>%%referencing%%">


text:
default[:memcached][:memory] = 64
default[:memcached][:port] = 11211
default[:memcached][:user] = "nobody"
default[:memcached][:listen] = "0.0.0.0"
default[:memcached][:maxconn] = 65000
default[__TRANSCEND__DATABAG__] = ""


text:
#import <XCTest/XCTest.h>

#import "FBSimulatorControlTestCase.h"

@class FBSimulator;
@class FBSimulatorControl;
@class FBSimulatorPool;
@protocol FBInteraction;

NS_ASSUME_NONNULL_BEGIN

/**
 FBSimulatorControl Assertion Helpers.
 */
@interface XCTestCase (FBSimulatorControlAssertions)

#pragma mark Interactions

/**
 Assertion Failure if the Interaction Fails.
 */
- (void)assertInteractionSuccessful:(id<FBInteraction>)interaction;

/**
 Assertion Failure if the Interaction Succeeds.
 */
- (void)assertInteractionFailed:(id<FBInteraction>)interaction;

#pragma mark Sessions

/**
 Assertion failure if the Session fails to terminate
 */
- (void)assertShutdownSimulatorAndTerminateSession:(FBSimulator *)simulator;

#pragma mark Strings

/**
 Assertion failure if the needle can't be found in the haystack.
 */
- (void)assertNeedle:(NSString *)needle inHaystack:(NSString *)haystack;

#pragma mark Simulators

/**
 Assertion failure if the Simulator isn't booted.
 */
- (void)assertSimulatorBooted:(FBSimulator *)simulator;

/**
 Assertion failure if the Simulator isn't shutdown.
 */
- (void)assertSimulatorShutdown:(FBSimulator *)simulator;

#pragma mark Processes

/**
 Assertion failure if there isn't a last launched application or launchctl isn't aware of the process.
 */
- (void)assertLastLaunchedApplicationIsRunning:(FBSimulator *)simulator;

@end

/**
 Assertion helpers for FBSimulatorControlTestCase.
 */
@interface FBSimulatorControlTestCase (FBSimulatorControlAssertions)

/**
 Asserts that a Simulator with the default configuration can be obtained

 @return a Simulator if succesful, nil otherwise.
 */
- (nullable FBSimulator *)assertObtainsSimulator;

/**
 Asserts that a Simulator with the provided configuration can be obtained

 @param configuration the configiuration of the Simulator to obtain.
 @return a Simulator if succesful, nil otherwise.
 */
- (nullable FBSimulator *)assertObtainsSimulatorWithConfiguration:(FBSimulatorConfiguration *)configuration;

/**
 Asserts that a booted Simulator with the default configuration can be obtained.

 @return a Simulator if succesful, nil otherwise.
 */
- (nullable FBSimulator *)assertObtainsBootedSimulator;

/**
 Asserts that a booted Simulator with the provided configurations can be obtained.

 @param configuration the Simulator Configuration to obtain.
 @param launchConfiguration the Launch configuration to boot with.
 @return a Simulator if succesful, nil otherwise.
 */
- (nullable FBSimulator *)assertObtainsBootedSimulatorWithConfiguration:(FBSimulatorConfiguration *)configuration launchConfiguration:(FBSimulatorLaunchConfiguration *)launchConfiguration;

/**
 An Assertion for:
 - Installing the Application (if relevant).
 - Launching the Application with the given configuration.

 @param simulator the booted Simulator.
 @param application the Application to install.
 @param applicationLaunchConfiguration the Application to then launch.
 @return a Simulator if successful, nil otherwise.
 */
- (nullable FBSimulator *)assertSimulator:(FBSimulator *)simulator launchesApplication:(FBApplicationDescriptor *)application withApplicationLaunchConfiguration:(FBApplicationLaunchConfiguration *)applicationLaunchConfiguration;

/**
 An Assertion for:
 - Obtaining a Simulator with a given configuration.
 - Launching it with the launch configuration.
 - Installing the Application (if relevant).
 - Launching the Application with the given configuration.

 @param simulatorConfiguration the Configuration of the Simulator to launch.
 @param simulatorLaunchConfiguration the Launch Configuration for the Simulator.
 @param application the Application to install.
 @param applicationLaunchConfiguration the Application to then launch.
 @return a Simulator if successful, nil otherwise.
 */
- (nullable FBSimulator *)assertSimulatorWithConfiguration:(FBSimulatorConfiguration *)simulatorConfiguration launches:(FBSimulatorLaunchConfiguration *)simulatorLaunchConfiguration thenLaunchesApplication:(FBApplicationDescriptor *)application withApplicationLaunchConfiguration:(FBApplicationLaunchConfiguration *)applicationLaunchConfiguration;

/**
 An Assertion for:
 - Obtaining a Simulator with a given configuration.
 - Launching it with the launch configuration.
 - Installing the Application (if relevant).
 - Launching the Aplication with the given configuration.
 - Relaunching the same Application.

 @param simulatorConfiguration the Configuration of the Simulator to launch.
 @param simulatorLaunchConfiguration the Launch Configuration for the Simulator.
 @param application the Application to install.
 @param applicationLaunchConfiguration the Application to then launch.
 @return a Simulator if successful, nil otherwise.
 */
- (nullable FBSimulator *)assertSimulatorWithConfiguration:(FBSimulatorConfiguration *)simulatorConfiguration relaunches:(FBSimulatorLaunchConfiguration *)simulatorLaunchConfiguration thenLaunchesApplication:(FBApplicationDescriptor *)application withApplicationLaunchConfiguration:(FBApplicationLaunchConfiguration *)applicationLaunchConfiguration;

@end

/**
 Assertion Helpers for FBSimulatorControl Notifications.
 */
@interface FBSimulatorControlNotificationAssertions : NSObject

/**
 Create a Notification Assertions Instance for the provided test case & pool
 */
+ (instancetype)withTestCase:(XCTestCase *)testCase pool:(FBSimulatorPool *)pool;

/**
 Assertion Failure if a notification of the given name isn't the first in the list of received notifications.
 */
- (NSNotification *)consumeNotification:(NSString *)notificationName;

/**
 Assertion Failure if a notification of the given name isn't the first in the list of received notifications.
 Will wait timeout seconds for the notification to appear if there isn't a notification recieved.
 */
- (NSNotification *)consumeNotification:(NSString *)notificationName timeout:(NSTimeInterval)timeout;

/**
 Assertion Failure if all of the notifications don't appear in the list of notifications recieved.s
 Ordering doesn't matter but the notifications must be contiguous.
 */
- (NSNotification *)consumeNotifications:(NSArray *)notificationNames;

/**
 Assertion failure if there are pending notifications.
 */
- (void)noNotificationsToConsume;

/**
 Removes all pending notifications
 */
- (void)consumeAllNotifications;

/**
 Assertion failure if the Notifications that fire on booting haven't been recieved;
 */
- (void)bootingNotificationsFired:(FBSimulatorLaunchConfiguration *)launchConfiguration;

/**
 Assertion failure if the Notifications that fire on shutdown haven't been recieved;
 */
- (void)shutdownNotificationsFired:(FBSimulatorLaunchConfiguration *)launchConfiguration;

@end

NS_ASSUME_NONNULL_END


text:
using System;

namespace Org.BouncyCastle.Asn1.Esf
{
	/// <remarks>
	/// <code>
	/// SignaturePolicyIdentifier ::= CHOICE {
	///		SignaturePolicyId		SignaturePolicyId,
	///		SignaturePolicyImplied	SignaturePolicyImplied
	/// }
	///
	/// SignaturePolicyImplied ::= NULL
	/// </code>
	/// </remarks>
	public class SignaturePolicyIdentifier
		: Asn1Encodable, IAsn1Choice
	{
		private readonly SignaturePolicyId sigPolicy;

		public static SignaturePolicyIdentifier GetInstance(
			object obj)
		{
			if (obj == null || obj is SignaturePolicyIdentifier)
				return (SignaturePolicyIdentifier) obj;

			if (obj is SignaturePolicyId)
				return new SignaturePolicyIdentifier((SignaturePolicyId) obj);

			if (obj is Asn1Null)
				return new SignaturePolicyIdentifier();

			throw new ArgumentException(
				"Unknown object in 'SignaturePolicyIdentifier' factory: "
					+ obj.GetType().Name,
				"obj");
		}

		public SignaturePolicyIdentifier()
		{
			this.sigPolicy = null;
		}

		public SignaturePolicyIdentifier(
			SignaturePolicyId signaturePolicyId)
		{
			if (signaturePolicyId == null)
				throw new ArgumentNullException("signaturePolicyId");

			this.sigPolicy = signaturePolicyId;
		}

		public SignaturePolicyId SignaturePolicyId
		{
			get { return sigPolicy; }
		}

		public override Asn1Object ToAsn1Object()
		{
			return sigPolicy == null
				?	DerNull.Instance
				:	sigPolicy.ToAsn1Object();
		}
	}
}


text:
from django.conf import settings
from django.utils import translation
from celery.task import task

from .models import Subscription

@task
def send_daily_update():
    translation.activate(settings.LANGUAGE_CODE)
    for subscription in Subscription.objects.filter(frequency='daily',confirmed_at__isnull=False):
        subscription.send_email()

@task
def send_weekly_update():
    translation.activate(settings.LANGUAGE_CODE)
    for subscription in Subscription.objects.filter(frequency='weekly',confirmed_at__isnull=False):
        subscription.send_email()


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace TesseractBoxCreator.Converters
{
    public class ZoomLevelConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return ((double)value) * 100;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            double output = 0;
            Double.TryParse((string)value, out output);
            return output / 100;
        }
    }
}


text:
% Copyright 2020 Makani Technologies LLC
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
%      http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.

function [out] = ins_log_innovation(Pzz, dz, dz_avg, dx_plus, like2, valid, ...
                                    time, out, mm)
if mm <= length(out.innov) && ~isempty(out.innov{mm})
  i = length(out.innov{mm}.t) + 1;
else
  i = 1;
end
out.innov{mm}.t(i, :) = time;
out.innov{mm}.Pzz(i, :) = diag(Pzz)';
out.innov{mm}.dz(i, :) = dz';
out.innov{mm}.dz_avg(i, :) = dz_avg';
out.innov{mm}.dx_plus(i, :) = dx_plus';
out.innov{mm}.like2(i, :) = like2;
out.innov{mm}.valid(i, :) = valid;


text:
package com.socrata.pg.store

import com.rojoma.json.v3.util.JsonUtil
import com.socrata.datacoordinator.common.{DataSourceConfig, DataSourceFromConfig}
import com.socrata.pg.Schema._
import com.socrata.pg.query.PGQueryTestBase
import com.socrata.pg.server.{PGQueryServerDatabaseTestBase, QueryServerTest}
import com.socrata.pg.store.PGSecondaryUtil._

import scala.io.Source
import scala.language.reflectiveCalls

class SchemaTest extends PGSecondaryTestBase with PGQueryServerDatabaseTestBase with PGQueryTestBase {
  override def beforeAll: Unit = createDatabases()

  test("schema json codec") {
    val dsConfig = new DataSourceConfig(config, "database")
    val ds = DataSourceFromConfig(dsConfig)
    ds.map { dsInfo =>
      withPgu() { pgu =>
      val f = columnsCreatedFixture
      f.pgs.doVersion(pgu, f.datasetInfo, f.dataVersion + 1, f.dataVersion + 1, None, f.events.iterator)
      val qs = new QueryServerTest(dsInfo, pgu)
      val schema = qs.getSchema(f.datasetInfo.internalName, None).get
      val schemaj = JsonUtil.renderJson(schema)
      val schemaRoundTrip = JsonUtil.parseJson[com.socrata.datacoordinator.truth.metadata.Schema](schemaj)
        .right.toOption.get
      schema should be (schemaRoundTrip)
      val expected = Source.fromURL(getClass.getResource("/fixtures/schema.json"))
      val expectedSchema = JsonUtil.readJson[com.socrata.datacoordinator.truth.metadata.Schema](expected.reader())
        .right.toOption.get
      schema should be (expectedSchema)
      }
    }
  }
}


text:
<?php

namespace fpoirotte\XRL\Types;

/**
 * \brief
 *      The XML-RPC "i8" type.
 *
 * The "i8" type extension, as described in
 * http://ws.apache.org/xmlrpc/types.html
 *
 * \authors François Poirotte <clicky@erebot.net>
 */
class I8 extends \fpoirotte\XRL\Types\AbstractInteger
{
    /// XML-RPC type for this class.
    const XMLRPC_TYPE   = '{http://ws.apache.org/xmlrpc/namespaces/extensions}i8';

    /// Integer size in bits.
    const INTEGER_BITS  = 64;

    /// \copydoc fpoirotte::XRL::Types::AbstractType::set()
    public function set($value)
    {
        try {
            // Try to use PHP's integer type to hold the value.
            // This will only work on 64-bit versions of PHP.
            parent::set($value);
        } catch (\InvalidArgumentException $e) {
            // Try to use a GMP resource/object instead,
            // but make sure the value does not overflow/underflow.
            $value  = new \fpoirotte\XRL\Types\BigInteger($value);
            $gmp    = $value->get();
            if (gmp_cmp($gmp, "-9223372036854775808") < 0 || gmp_cmp($gmp, "9223372036854775807") > 0) {
                throw $e;
            }
            $this->value = $value;
        }
    }
}


text:
name             'test_chef_server'
maintainer       'go-chef/chef project maintainers'
license          'All Rights Reserved'
description      'Test the chef server api'
version          '0.1.0'
chef_version     '>= 13'
depends          'chef-server'
depends          'line'


text:
<!--
id: 18568844
link: http://tumblr.atmos.org/post/18568844/the-real-adam-anthropomorphized-gems
slug: the-real-adam-anthropomorphized-gems
date: Tue Nov 06 2007 11:25:21 GMT-0800 (PST)
publish: 2007-11-06
tags:
title: The Real Adam –   Anthropomorphized Gems
-->

The Real Adam –   Anthropomorphized Gems
========================================

[http://therealadam.com/archive/2007/11/05/anthropomorphized-gems/](http://therealadam.com/archive/2007/11/05/anthropomorphized-gems/)


text:
/*
 * Configuration Options
 */

#define BUTTON_DEBOUNCE 25      //time in ms that must pass before multiplexed buttons are considered pressed
#define AnalogResolution 12     //used when reading multiplexed buttons
#define EEPROM_storage_loop 320 // update EEPROM at most every n seconds
#define KeyboardEnabled true    // true sends key presses, false does not
#define JoystickEnabled true    // true sends key presses, false does not

/*
 * Buttons
 * This programm supports upto 13 momentary (non latching) buttons
 * You may specify the pin each button is connected to.
 * The arduino will send the number of the button once it has been pressed
 */
 #define Shifter_1_Pin 0
 #define Shifter_1_Key 'v'
 #define Shifter_1_Mod ""

 #define Shifter_2_Pin 1
 #define Shifter_2_Key 'u'
 #define Shifter_2_Mod ""

 #define Button_1_Pin 4
 #define Button_1_Key 'a'
 #define Button_1_Mod ""

 #define Button_2_Pin 5
 #define Button_2_Key 'b'
 #define Button_2_Mod ""

 #define Button_3_Pin 6
 #define Button_3_Key 'c'
 #define Button_3_Mod ""

 #define Button_4_Pin 7
 #define Button_4_Key 'e'
 #define Button_4_Mod ""

 #define Button_5_Pin 8
 #define Button_5_Key 'f'
 #define Button_5_Mod ""

 #define Button_6_Pin 9
 #define Button_6_Key 'h'
 #define Button_6_Mod ""

 #define Button_7_Pin 10
 #define Button_7_Key 'i'
 #define Button_7_Mod ""

 #define Button_8_Pin 14
 #define Button_8_Key 'j'
 #define Button_8_Mod ""

 #define Button_9_Pin 15
 #define Button_9_Key 'k'
 #define Button_9_Mod ""

 #define Button_10_Pin 16
 #define Button_10_Key 'l'
 #define Button_10_Mod ""

 #define Button_11_Pin A2
 #define Button_11_Key 'm'
 #define Button_11_Mod ""

 #define Button_12_Pin A3
 #define Button_12_Key 'n'
 #define Button_12_Mod ""

/*
 * The Joystick is defined below, Each axis uses one pin.
 * Testing has shown that some do not center properly and that the resistor value will change more in
 * one direction. Use the config options below to adjust values to your joystick.
 */
 #define Joystick_1_Pin A0
 #define Joystick_1_KeyA KEY_UP_ARROW
 #define Joystick_1_ModA ""
 #define Joystick_1_KeyB KEY_DOWN_ARROW
 #define Joystick_1_ModB ""
 #define Joystick_1_Center 515   // Center value for your joystick
 #define Joystick_1_Move_Min 450 // Stick must move this far of center to trigger a button press

 #define Joystick_2_Pin A1
 #define Joystick_2_KeyA KEY_RIGHT_ARROW
 #define Joystick_2_ModA ""
 #define Joystick_2_KeyB KEY_LEFT_ARROW
 #define Joystick_2_ModB ""
 #define Joystick_2_Center 515   // Center value for your joystick
 #define Joystick_2_Move_Min 450 // Stick must move this far of center to trigger a button press

 /*
  ###############################
  # Debug Options Configuration #
  ###############################
*/
#define DebugSerialOut false           // controls all non specific debugging messages - MUST BE ENABLED FOR SERIAL TO WORK
#define DebugSendKey false             // Output key presses to seril - does NOT disable the keyboard
#define DebugJoysticksGetValues false  //will send analog readings to serial instead of pressing keys
#define EEPROMWrite 1                  //set to 1 to enable writes to eeprom (update stored values) - default: 1


text:
"use strict";

var Client = require("./../lib/index");
var testAuth = require("./../testAuth.json");

var github = new Client({
    debug: true
});

github.authenticate({
    type: "oauth",
    token: testAuth["token"]
});

github.gitdata.updateReference({
    owner: "kaizensoze",
    repo: "test2",
    ref: "heads/master",
    sha: "81c559e2e8551982235bc86594cd86ffb135b053",
    // force: true
}, function(err, res) {
    console.log(err, res);
});


text:
/*!
 * angular-incremental-list
 * @see https://github.com/tfoxy/angular-incremental-list
 * @version 0.4.3 - 2015-10-10T21:20:16.529Z
 * @author Tomás Fox <tomas.c.fox@gmail.com>
 * @license MIT
 */

(function() {
  'use strict';

  var SCOPE_PROP_NAME = '$$ilListScope';

  ilListController.$inject = ['$scope', '$attrs', '$timeout'];

  function ilListController($scope, $attrs, $timeout) {
    /* jshint validthis: true */
    var vm = this;

    var $ilList = {
      emptyModel: listInputsHelper(false, true),
      emptyView: listInputsHelper(false, false),
      fullModel: listInputsHelper(true, true),
      fullView: listInputsHelper(true, false),
      hasFocus: hasFocus,
      modelExists: modelExists,
      viewExists: viewExists
    };

    var localScope = {
      $ilList: $ilList
    };

    vm.blurTimeout = null;
    vm.cancelBlurTimeout = cancelBlurTimeout;
    vm.checkDecreaseConditions = angular.noop;
    vm.createItem = createItem;
    vm.enableMiddleDecrease = enableMiddleDecrease;
    vm.evalWithCurrentScope = evalWithCurrentScope;
    vm.focusIndex = -1;
    vm.list = $scope.$eval($attrs.ilList);
    vm.listenToEvents = angular.noop;
    vm.listItemChanged = listItemChanged;
    vm.localScope = localScope;
    vm.maxLength = 9007199254740991;
    vm.minLength = 1;
    vm.mustDecrement = $ilList.emptyView;
    vm.mustIncrement = modelExists;
    vm.notifyParentList = angular.noop;
    vm.postInitialize = postInitialize;
    vm.scopeCreatedAt = scopeCreatedAt;

    initialize();

    ////////////////

    function initialize() {
      var list = vm.list;

      if (angular.isUndefined(list) || list === null) {
        throw Error('ilList is ' + list + ': ' + $attrs.ilList);
      }

      $scope.$on('$destroy', cancelBlurTimeout);
    }

    function cancelBlurTimeout() {
      if (vm.blurTimeout) {
        $timeout.cancel(vm.blurTimeout);
        vm.blurTimeout = null;
      }
    }

    function listItemChanged(index, changed) {
      if (typeof index !== 'number') {
        throw new Error('scope.$index is not a number. Got: ' + index);
      }

      var length = vm.list.length;
      var scope = getScope(index);

      $ilList.currentScope = scope;
      $ilList.changed = changed;

      if (index === length - 1 && length < vm.maxLength) {
        lastItemChanged();
      } else if (index === length - 2 && length > vm.minLength) {
        checkLastItemsDecreaseConditions();
      } else if (length > vm.minLength) {
        vm.checkDecreaseConditions();
      }

      delete $ilList.currentScope;
      delete $ilList.changed;

      vm.notifyParentList(scope, changed);
    }

    function enableMiddleDecrease() {
      vm.checkDecreaseConditions = checkDecreaseConditions;

      function checkDecreaseConditions() {
        removeEmptyItems($ilList.currentScope, $ilList.currentScope.$index);
      }
    }

    function getScope(index) {
      if (index >= vm.list.length || index < 0) {
        return null;
      }
      return vm.list[index][SCOPE_PROP_NAME];
    }

    function prevScope(scope) {
      return getScope(scope.$index - 1);
    }

    function nextScope(scope) {
      return getScope(scope.$index + 1);
    }

    function lastItemChanged() {
      if (vm.mustIncrement()) {
        vm.list.push(vm.createItem());
      } else if (!$ilList.currentScope.$first) {
        checkLastItemsDecreaseConditions();
      }
    }

    function checkLastItemsDecreaseConditions() {
      var scope = $ilList.currentScope;
      var otherScope = scope.$last ? prevScope(scope) : nextScope(scope);

      if (vm.mustDecrement() &&
          mustDecrementWithScope(otherScope)) {
        if (!scope.$last) {
          vm.list.pop();
        }

        removeEmptyItems(prevScope(scope));
      }
    }

    function mustDecrementWithScope(scope) {
      $ilList.currentScope = scope;
      return vm.mustDecrement();
    }

    function removeEmptyItems(scope, endIndex) {
      var minFrom = vm.minLength - 1;
      var auxScope = scope;
      var from, to;
      from = to = endIndex >= 0 ? endIndex : vm.list.length - 2;
      for (; from >= minFrom; --from, auxScope = prevScope(auxScope)) {
        if (!mustDecrementWithScope(auxScope)) {
          break;
        }
      }

      vm.list.splice(from + 1, to - from);
    }

    function evalWithCurrentScope(expression) {
      return $ilList.currentScope.$eval(expression, localScope);
    }

    function createItem() {
      return {};
    }

    function hasFocus() {
      return vm.focusIndex === $ilList.currentScope.$index;
    }

    function postInitialize() {
      var length = vm.list.length;

      var scope = getScope(length - 1) || $scope;

      if (length < vm.minLength) {
        var itemPusher = new ItemPusher(vm.minLength - length, vm, scopeCreatedAt);
        vm.scopeCreatedAt = itemPusher.scopeCreatedAt.bind(itemPusher);
        itemPusher.pushItem(scope);
      } else if (length > vm.maxLength) {
        vm.list.splice(vm.maxLength, length - vm.maxLength);
      }
    }

    function scopeCreatedAt(index, scope) {
      var item = vm.list[index];
      Object.defineProperty(item, SCOPE_PROP_NAME, {
        configurable: true,
        enumerable: false,
        value: scope
      });

      scope.$$ilListModels = [];
      scope.$$ilListChildCtrls = [];

      scope.$on('$destroy', function() {
        delete item[SCOPE_PROP_NAME];
      });
    }

    function listInputsHelper(onFull, useModel) {
      var valueProp = useModel ? '$modelValue' : '$viewValue';

      return listInputsHelperFn;

      function listInputsHelperFn(paramScope) {
        var scope = paramScope || $ilList.currentScope;
        var isEmpty = scope.$$ilListModels.every(function(ngModelCtrl) {
          return onFull ^ !valueExists(ngModelCtrl[valueProp]);
        });
        if (isEmpty) {
          return scope.$$ilListChildCtrls.every(function(ctrl) {
            return ctrl.list.every(function(item) {
              return listInputsHelperFn(item[SCOPE_PROP_NAME]);
            });
          });
        } else {
          return false;
        }
      }
    }

    function modelExists() {
      var value = $ilList.changed.$modelValue;
      return valueExists(value);
    }

    function valueExists(value) {
      return value || value === 0;
    }

    function viewExists() {
      var value = $ilList.changed.$viewValue;
      return valueExists(value);
    }
  }

  // ItemPusher class

  function ItemPusher(times, vm, scopeCreatedAt) {
    this._countdown = times;
    this._vm = vm;
    this._scopeCreatedAt = scopeCreatedAt;
  }

  ItemPusher.prototype.pushItem = function pushItem(scope) {
    this._vm.localScope.$ilList.currentScope = scope;
    this._vm.list.push(this._vm.createItem());
    if (--this._countdown <= 0) {
      this._vm.scopeCreatedAt = this._scopeCreatedAt;
    }
    delete this._vm.localScope.$ilList.currentScope;
  };

  ItemPusher.prototype.scopeCreatedAt = function scopeCreatedAt(index, scope) {
    this._scopeCreatedAt(index, scope);
    this.pushItem(scope);
  };

  var MAIN_PRIORITY = 2000;
  var IL_LIST_PRIORITY = 3000;

  function ilListDirective() {
    return {
      restrict: 'A',
      priority: IL_LIST_PRIORITY,
      controller: ilListController,
      link: function postLink(scope, element, attrs, ctrl) {
        ctrl.postInitialize();
      }
    };
  }

  function ilListScopeDirective() {
    return {
      restrict: 'A',
      require: 'ilList',
      link: {
        pre: function preLink(scope, element, attrs, ctrl) {
          var index = scope.$index;
          if (typeof index !== 'number') {
            throw new Error('scope.$index is not a number. Got: ' + index);
          }

          ctrl.scopeCreatedAt(index, scope);
        }
      }
    };
  }

  function ilItemModelDirective() {
    return {
      restrict: 'A',
      require: ['^ilList', 'ngModel'],
      link: function postLink(scope, element, attrs, ctrl) {
        var ilListCtrl = ctrl[0];
        var ngModelCtrl = ctrl[1];

        var selectedScope = attrs.ilItemModel ?
            scope.$eval(attrs.ilItemModel) :
            scope;

        var listener = function viewChangeListener() {
          ilListCtrl.listItemChanged(selectedScope.$index, ngModelCtrl);
        };

        ngModelCtrl.$viewChangeListeners.push(listener);

        pushToScopeArray(selectedScope.$$ilListModels, ngModelCtrl, scope);

        ilListCtrl.listenToEvents(selectedScope, element, listener);
      }
    };
  }

  function ilNewItemDirective() {
    return {
      restrict: 'A',
      require: 'ilList',
      priority: MAIN_PRIORITY,
      link: function postLink(scope, element, attrs, ctrl) {
        ctrl.createItem = function ilNewItemEval() {
          return ctrl.evalWithCurrentScope(attrs.ilNewItem);
        };
      }
    };
  }

  function ilIncreaseOnDirective() {
    return {
      restrict: 'A',
      require: 'ilList',
      priority: MAIN_PRIORITY,
      link: function postLink(scope, element, attrs, ctrl) {
        ctrl.mustIncrement = function ilIncreaseOnEval() {
          return ctrl.evalWithCurrentScope(attrs.ilIncreaseOn);
        };
      }
    };
  }

  function ilDecreaseOnDirective() {
    return {
      restrict: 'A',
      require: 'ilList',
      priority: MAIN_PRIORITY,
      link: function postLink(scope, element, attrs, ctrl) {
        ctrl.mustDecrement = function ilDecreaseOnEval() {
          return ctrl.evalWithCurrentScope(attrs.ilDecreaseOn);
        };
      }
    };
  }

  function ilListModelDirective() {
    return {
      restrict: 'A',
      require: ['^^ilList', 'ilList'],
      priority: MAIN_PRIORITY,
      link: function postLink(scope, element, attrs, ctrl) {
        var parentCtrl = ctrl[0];
        var elementCtrl = ctrl[1];

        elementCtrl.notifyParentList = function notifyParentList(scope, changed) {
          var parentScope = attrs.ilListModel ?
              scope.$eval(attrs.ilListModel) :
              scope.$parent;
          parentCtrl.listItemChanged(parentScope.$index, changed);
        };

        pushToScopeArray(scope.$$ilListChildCtrls, elementCtrl, scope);
      }
    };
  }

  function ilMinLengthDirective() {
    return {
      restrict: 'A',
      require: 'ilList',
      priority: MAIN_PRIORITY,
      link: function postLink(scope, element, attrs, ctrl) {
        var num = parseInt(attrs.ilMinLength);
        ctrl.minLength = num > 0 ? num : 0;
      }
    };
  }

  function ilMaxLengthDirective() {
    return {
      restrict: 'A',
      require: 'ilList',
      priority: MAIN_PRIORITY,
      link: function postLink(scope, element, attrs, ctrl) {
        var num = parseInt(attrs.ilMaxLength);
        ctrl.maxLength = num > 0 ? num : 0;
      }
    };
  }

  ilEnableHasFocusDirective.$inject = ['$timeout'];

  function ilEnableHasFocusDirective($timeout) {
    return {
      restrict: 'A',
      require: 'ilList',
      priority: MAIN_PRIORITY,
      link: postLink
    };

    function postLink(scope, element, attrs, ctrl) {
      ctrl.listenToEvents = function listenForHasFocus(inputScope, inputElement, listener) {
        inputElement.on('focus', function inputFocus() {
          ctrl.cancelBlurTimeout();
          ctrl.focusIndex = inputScope.$index;
          if (ctrl.blurListener) {
            inputScope.$apply(ctrl.blurListener);
            ctrl.blurListener = null;
            ctrl.focusIndex = inputScope.$index;
          }
          inputScope.$apply(listener);
          ctrl.focusIndex = inputScope.$index;
        });

        inputElement.on('blur', function inputBlur() {
          ctrl.blurListener = listener;
          ctrl.blurTimeout = $timeout(function blurTimeout() {
            ctrl.blurTimeout = null;
            ctrl.focusIndex = -1;
            ctrl.blurListener = null;
            listener();
          });
        });
      };
    }
  }

  function ilDecreaseMiddleDirective() {
    return {
      restrict: 'A',
      require: 'ilList',
      priority: MAIN_PRIORITY,
      link: function postLink(scope, element, attrs, ctrl) {
        ctrl.enableMiddleDecrease();
      }
    };
  }

  // Helper functions

  function removeElementFromArray(array, element) {
    var index = array.indexOf(element);
    if (index >= 0) {
      array.splice(index, 1);
    }
  }

  function pushToScopeArray(scopeArray, element, scope) {
    scopeArray.push(element);

    scope.$on('$destroy', function() {
      removeElementFromArray(scopeArray, scope);
    });
  }

  angular.module('incrementalList', [])
      .directive('ilList', ilListDirective)
      .directive('ilList', ilListScopeDirective)
      .directive('ilItemModel', ilItemModelDirective)
      .directive('ilNewItem', ilNewItemDirective)
      .directive('ilIncreaseOn', ilIncreaseOnDirective)
      .directive('ilDecreaseOn', ilDecreaseOnDirective)
      .directive('ilListModel', ilListModelDirective)
      .directive('ilMinLength', ilMinLengthDirective)
      .directive('ilMaxLength', ilMaxLengthDirective)
      .directive('ilEnableHasFocus', ilEnableHasFocusDirective)
      .directive('ilDecreaseMiddle', ilDecreaseMiddleDirective);

}());


text:
package unversioned

type ReplicaSetExpansion interface{}

type IngressExpansion interface{}


text:
CREATE TABLE `timesheets`.`a12_task` (
`task_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`project_idref` INT NOT NULL DEFAULT '0',
`name` VARCHAR( 64 ) NOT NULL DEFAULT 'new task',
`description` VARCHAR( 256 ) NOT NULL DEFAULT 'new task',
`budget` DOUBLE NOT NULL DEFAULT 0.00,
`inactive_asof` DATE NULL ,
`timestamp` DATETIME NOT NULL COMMENT 'Time is UTC, alias GMT, alias Greenwich Mean Time (created by timestamp trigger)'
) ENGINE = MYISAM ;

-- DROP TRIGGER a12_timestamp;
delimiter //
CREATE TRIGGER a12_timestamp BEFORE INSERT ON a12_task
FOR EACH ROW
  SET NEW.timestamp = UTC_TIMESTAMP()
//
delimiter ;


text:
create database project_comeet;

use project_comeet;

create table Personnel(
	p_id int primary key auto_increment,
	p_name varchar(20) not null,
	p_type varchar(15)
);

create table Meeting(
	m_id int primary key auto_increment,
	m_name varchar(30) not null,
	m_desc longtext not null,
	venue varchar(30) not null,
	start_period date not null,
	end_period date not null,
	n_accomodate varchar(20)
);
alter table Meeting add column (duration int not null);

create table Meeting_Role(
	mr_id int primary key auto_increment,
	mr_name varchar(20) not null,
	pro_quo int not null
);
alter table Meeting_Role add column (m_id int not null);
alter table Meeting_Role add column (foreign key (m_id) references Meeting(m_id));

create table Personnel_Role(
	pr_id int primary key auto_increment,
	mr_id int not null,
	p_id int not null,
	foreign key (mr_id) references Meeting_Role(mr_id),
	foreign key (p_id)  references Personnel(p_id)
);
alter table Personnel_Role add column(pr_availability int null);
alter table Personnel_Role add column(pr_utility int null);
alter table Personnel_Role add column(pr_pivot int null);

create table Slot(
	slot_id int primary key auto_increment,
	row int not null,
	col int not null,
	desc_time varchar(20) not null
);

create table Timetable(
	t_id int primary key auto_increment,
	m_id int not null,
	slot_id int not null,
	foreign key (m_id) references Meeting(m_id),
	foreign key (slot_id) references Slot(slot_id)
);

create table calendar(
	c_id int primary key auto_increment,
	p_id int not null,
	m_id int not null,
	start_time varchar(5) not null,
	end_time varchar(5) not null,
	foreign key (p_id) references Personnel(p_id),
	foreign key (m_id) references Meeting(m_id)
);


text:
from .base import CatBaseCommand

class CatIndicesCommand(CatBaseCommand):
    command_name = "elasticsearch:cat-indices"

    def run_request(self, index=None):
        if index is None:
            self.show_index_list_panel(self.run)
            return

        options = dict(
            index=index,
            params=dict(v=1)
        )

        return self.client.cat.indices(**options)