text:
namespace WebsitePanel.Portal.VPS2012 {

    public partial class VdcExternalNetwork {

        /// <summary>
        /// packageAddresses control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::WebsitePanel.Portal.UserControls.PackageIPAddresses packageAddresses;

        /// <summary>
        /// secQuotas control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::WebsitePanel.Portal.CollapsiblePanel secQuotas;

        /// <summary>
        /// QuotasPanel control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Panel QuotasPanel;

        /// <summary>
        /// locIPQuota control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Localize locIPQuota;

        /// <summary>
        /// addressesQuota control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::WebsitePanel.Portal.Quota addressesQuota;

        /// <summary>
        /// locBandwidthQuota control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Localize locBandwidthQuota;

        /// <summary>
        /// bandwidthQuota control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::WebsitePanel.Portal.Quota bandwidthQuota;
    }
}


text:
package org.reclipse.structure.specification.ui.handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
import org.eclipse.gef.ui.actions.SelectionAction;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
import org.fujaba.commons.edit.commands.SetConstraintCommand;
import org.fujaba.commons.edit.parts.AbstractNodeEditPart;
import org.reclipse.structure.specification.ui.edit.parts.PSCombinedFragmentEditPart;
import org.reclipse.structure.specification.ui.edit.parts.PSPatternSpecificationEditPart;
import org.reclipse.structure.specification.ui.edit.parts.PSSpecificationConstraintEditPart;

/**
 * This handler is used to execute resizing of parts.
 *
 * @author harka
 * @author Last editor: $Author$
 * @version $Revision$ $Date$
 */
public class ResizeHandler extends AbstractHandler
{
   protected String TO_MINIMUM = "org.reclipse.structure.specification.ui.commands.ResizeToMinimumSize";

   protected String TO_PREFERRED = "org.reclipse.structure.specification.ui.commands.ResizeToPreferredSize";

   @Override
   public Object execute(ExecutionEvent event) throws ExecutionException
   {
      // prepare action
      ResizeFigureAction action = new ResizeFigureAction(event, event
            .getCommand().getId());

      action.run();

      return null;
   }

   /**
    * This creation factory is used by the creation request.
    *
    * @author harka
    * @author Last editor: $Author$
    * @version $Revision$ $Date$
    */
   private class ResizeFigureAction extends SelectionAction
   {

      private boolean minimum;

      private ExecutionEvent event;

      /**
       * Default constructor.
       *
       * @param part The workbench part.
       */
      public ResizeFigureAction(ExecutionEvent event, String commandId)
      {
         super(HandlerUtil.getActivePart(event));
         this.event = event;
         if (commandId.equals(TO_MINIMUM))
         {
            minimum = true;
         }
      }

      @Override
      public void run()
      {
         // create a compound command
         CompoundCommand cc = new CompoundCommand();

         // get selection
         if (HandlerUtil.getCurrentSelection(event) instanceof IStructuredSelection)
         {
            IStructuredSelection selection = (IStructuredSelection) HandlerUtil
                  .getCurrentSelection(event);

            // collect resize commands
            for (final Object o : selection.toList())
            {
               if (o instanceof PSPatternSpecificationEditPart)
               {
                  PSPatternSpecificationEditPart root = (PSPatternSpecificationEditPart) o;
                  for (Object child : root.getChildren())
                  {
                     addCommands(cc, (AbstractNodeEditPart) child);
                  }
               }
            }

            execute(cc.unwrap());
         }
      }

      private CompoundCommand addCommands(CompoundCommand cc,
            AbstractNodeEditPart ep)
      {
         if (ep instanceof PSCombinedFragmentEditPart)
         {
            for (Object child : ep.getChildren())
            {
               addCommands(cc, (AbstractNodeEditPart) child);
            }
         }
         else
         {
            if (!(ep instanceof PSSpecificationConstraintEditPart))
               cc.add(createResizeCommand(ep, minimum));
         }
         return cc;
      }

      @Override
      protected boolean calculateEnabled()
      {
         return true;
      }
   }

   public Command createResizeCommand(AbstractNodeEditPart part, boolean minimum)
   {
      Dimension dim;
      if (!minimum)
      {
         dim = part.getPreferredSize();
      }
      else
      {
         dim = part.getMinimumSize();
      }

      int x = part.getModel().getX();
      int y = part.getModel().getY();

      return new SetConstraintCommand(part, new Rectangle(x, y, dim.width,
            dim.height));
   }
}

redpajama_set_name: RedPajamaGithub


text:
if (typeof resizeIframe == 'undefined') {
  /* redimensiona o frame quando o documento é carregado. */
  function resizeIframe(obj) {
    var s1 = screen.height;
    var s2 = obj.contentWindow.document.body.scrollHeight + 40;
    var bestSize=Math.max(s1, s2);
    obj.style.height = bestSize + 'px';
  }
}

if (typeof $ =='undefined')
  (
    $ = function (aElementId) {
      var ret=document.getElementById(aElementId);
      if (!ret)
        ret=document.getElementsByName(aElementId)[0];
      return ret;
    }
  )();

/*
 * abra a aba desejada (aTabId)
 * fechando todas as abas que pertencam à mesma classe especificada (aClassName)
 */
function openTabById(aClassName, aTabId) {
  var myList = document.getElementsByClassName(aClassName);
  for(var ndx=0; ndx<myList.length; ndx++)
    myList[ndx].style.display='none';

  var aTab = $(aTabId);
  if (typeof aTab != 'undefined')
   aTab.style.display='block';

}

/*
 * abre a aba que contêm os sub-itens do select tocado
 * ou seja, se escolheu Banco de dados, mostra a aba correspondente
 */
function yDevelopMenu(e) {
  if (e)
    openTabById('yDevelopSubMenu', 'yds_'+e[e.selectedIndex].value);
}

var yDevelop=function() {
  var that = {};

  that.fillList=function(aUL, data) {
    if (aUL) {
      while (aUL.firstChild) {
        aUL.removeChild(aUL.firstChild);
      }
      for(var n in data) {
        if (data.hasOwnProperty(n)) {
          var myDesc='';
          if (typeof data[n]['description'] != 'undefined') {
            var auxDesc=data[n]['description'].split(';');
            for(var j=0; j<auxDesc.length; j++) {
              if (myDesc>'')
                myDesc+='
';
              myDesc+=yAnalise(auxDesc[j]);
            }
          }

          var a = document.createElement('a');
          a.setAttribute('href', yAnalise(data[n]['href']));
          a.innerHTML=""+yAnalise(data[n]['label'])+"
"+myDesc+"
";
          if (data[n]['isDefault']==1)
            a.style.color='#F8F876';

          var newLi = document.createElement("li");
          newLi.id=data[n]['appRegistry'];

          newLi.appendChild(a);
          aUL.appendChild(newLi);
       }
     }
    } else
      console.log("UL Não definido");
  };

  that.joinHTML=function(data) {
    var auxHTML='';
    for(var n in data) {
      if (data.hasOwnProperty(n)) {
        var t=typeof data[n]['html'];
        if (t=='string')
          auxHTML+=data[n]['html'];
        else if (t=='object')
          auxHTML+=that.joinHTML(data[n]['html']);
        else if (t=='undefined') {
          for(var k in data[n]) {
            if (data[n].hasOwnProperty(k))
              auxHTML+=data[n][k];
          }
        }
      }
    }
    return auxHTML;
  }

  that.createFormAndFill = function(aDiv, data) {
    var auxHTML=that.joinHTML(data);

    aDiv.innerHTML=yAnalise(auxHTML);
  };

  that.fillForm = function(aForm, data) {
    var formElements = that.getFormFields(aForm);
    for(var i in formElements) {
      if (formElements.hasOwnProperty(i)) {
        if (typeof data[0][i] != 'undefined')
          formElements[i].value = data[0][i];
      }
    }
  };

  /*
   * pega todos os elementos de um form e os acomoda em um objeto
   * porem, so os que tiverem ID
   */
  that.getFormFields = function (aForm) {
    var ret={};
    for(var i=0; i<aForm.elements.length; i++) {
      if (aForm.elements[i].id>'')
        ret[aForm.elements[i].id]=aForm.elements[i]
    }
    return ret;
  }

  that.getFormElements = function(aFormName) {
    var inputs=document.forms[aFormName].getElementsByTagName("input");
    var selects=document.forms[aFormName].getElementsByTagName("select");
    var textarea=document.forms[aFormName].getElementsByTagName("textarea");
  };

  that.deleteItem = function(aFormName, a0) {
    var fieldValues = {};
    fieldValues['XID'] = $('XID').value;
    fieldValues['deleteChildrens']=($('_deleteChildrens_').checked?'Y':'N');
    that.invoke(this, a0+':deleteItem', fieldValues);
  };

  that.saveForm = function(aFormName, a0) {
    var fieldValues={}; var aux=[]; var n=0;
    var iName;
    var iValue;
    /*
    var inputs=document.forms[aFormName].getElementsByTagName("input");
    var selects=document.forms[aFormName].getElementsByTagName("select");
    var textarea=document.forms[aFormName].getElementsByTagName("textarea");
    */
    var formElements=document.forms[aFormName].elements;
    for(var k in formElements) {
      if (formElements.hasOwnProperty(k)) {
        iValue='';
        iName=(formElements[k].name) || (formElements[k].id);
        if (aux.indexOf(iName)<0) {
          if (formElements[k].type=='checkbox') {
            if (formElements[k].checked)
              iValue=formElements[k].value;
          } else if (formElements[k].type=='select-one') {
            iValue=formElements[k].selectedIndex;
            if (formElements[k].options[iValue])
              iValue = formElements[k].options[iValue].value;
          } else
            iValue=formElements[k].value;
          fieldValues[iName]=iValue;
          aux[n++]=iName;
        }
      }
    }
    that.invoke(this, a0+':saveForm', fieldValues);
  }

  that.toggleLeftMenu = function () {
    var leftMenu = $('leftMenu');
    if (leftMenu.style.display=='block') {
      leftMenu.style.display = 'none';
      $('adminContainer').style.marginLeft='0px';
      yDevelopReturn(null);
    } else {
      leftMenu.style.display = 'block';
      $('adminContainer').style.marginLeft='200px';
    }
  }

  that.home = function () {
    var applicatioMainFrame_ = $('applicatioMainFrame_');
    applicatioMainFrame_.src = 'index.php';
    yDevelopReturn(null);
  }

  that.reload = function () {
    var applicatioMainFrame_ = $('applicatioMainFrame_');
    applicatioMainFrame_.src = applicatioMainFrame_.src;
    yDevelopReturn(null);
  }

  that.invoke=function(e, a, oFieldValues) {
    var aAux=a.split(':');
    var eventName=aAux[0];
    var eventVerb=aAux[1];
    ycomm.invoke( 'yeapf:develop',
                  a,
                  oFieldValues,
                  function(status, error, data) {
                    if (eventVerb=='getList') {

                      listID=eventName+'List';
                      /* identificar a lista a ser preenchida */
                      ul=$(listID);
                      if (ul) {
                        /* preencher a lista com os dados que vieram do servidor */
                        that.fillList(ul, data);
                      } else
                        console.log(listID+' not found!');

                    } else if ((eventVerb=='getForm') || (eventVerb=='newItem')) {

                        formID=eventName+'_Body';
                        that.createFormAndFill($(formID), data);

                        if (eventVerb=='newItem')
                          $('Xancestor').value = myDevelop.menuPath[myDevelop.menuPath.length-1];

                    } else if (eventVerb=='getFormValues') {

                        formID=eventName+'_Form';
                        that.fillForm($(formID), data);

                    } else if (eventVerb == 'open') {

                      $('yah_returnToApp').style.display='block';
                      openTabById('bodyTab', eventName+'_Body');

                      that.invoke(e, eventName+':getList');

                    } else if ((eventVerb=='deleteItem') || (eventVerb=='saveForm')) {

                      /* Após salvar o formulário, recarregamos a lista */
                      that.invoke(e, eventName+':getList');

                    } else if (eventVerb=='getMenuRoot') {
                      if ((data) && (data[0]))
                        myDevelop.setMenuRoot(data[0]['menuRoot']);

                    }
                 });
    return that;
    }

    return that;
}

/* criamos um objeto do yDevelop */
var myDevelop=yDevelop();

/* pilha de menus escolhidos */
myDevelop.menuPath=[];
/* menu principal do aplicativo (definido no db.csv) */
myDevelop.menuRoot=null;

myDevelop.flipSpan = function(aActiveID, aInactiveID) {
  var a=$(aActiveID);
  var i=$(aInactiveID);
  i.style.display='none';
  a.style.display='block';
}

/* evento de chegada do menu escolhido
 * se for a primeira vez, guardar o menu principal do aplicativo */
myDevelop.setMenuRoot = function(aMenuRoot) {

  if (myDevelop.menuPath.length==0) {
    myDevelop.menuRoot=aMenuRoot;
    myDevelop.flipSpan('yds_dbMenuRefresh', 'yds_dbMenuBack');
  } else
    myDevelop.flipSpan('yds_dbMenuBack','yds_dbMenuRefresh');
  myDevelop.menuPath[myDevelop.menuPath.length]=aMenuRoot;
  myDevelop.invoke($('yds_dbMenu'), 'dbMenu:getList', {ancestor: aMenuRoot});
}

/* voltar na trilha de menu um nível */
myDevelop.backMenuHistory = function() {
  /* caso haja info na trilha, pegar o último elemento */
  if (myDevelop.menuPath.length>0) {
    var aux=myDevelop.menuPath.slice(0,myDevelop.menuPath.length-1);
    myDevelop.menuPath=aux;
    var aMenuRoot = myDevelop.menuPath[myDevelop.menuPath.length-1] || myDevelop.menuRoot;
    myDevelop.invoke($('yds_dbMenu'), 'dbMenu:getList', {ancestor: aMenuRoot});
  } else {
    myDevelop.invoke($('yds_dbMenu'), 'dbMenu:getMenuRoot');
  }

  /* ligar os icones apropriados */
  if (myDevelop.menuPath.length>1)
    myDevelop.flipSpan('yds_dbMenuBack','yds_dbMenuRefresh');
  else
    myDevelop.flipSpan('yds_dbMenuRefresh', 'yds_dbMenuBack');
}

/* voltar a mostrar a tela do aplicativo escondendo a de desenvolvimento */
function yDevelopReturn(e) {
  $('yah_returnToApp').style.display='none';
  $('yds_returnToApp').style.display='none';
  openTabById('bodyTab', 'guestBody');
}

/*
 * Funções para a edição da lista 'to-do'
 */
function ytodoSaveForm(e) {
  var formValues = myDevelop.getFormFields($('todo_Form'));
  var id = formValues['id'].value;
  var todoItem = formValues['todoItem'].value;
  myDevelop.invoke(e,
                   'todo:saveForm',
                   {
                     'id': id,
                     'todoItem': todoItem
                   }
                  );
}

function ydbTodoViewEntry(todoObj) {
  myDevelop.invoke($('todo_Body'), 'todo:getFormValues', todoObj );
}

/*
 * Funções que respondem aos clicks dos items carregados via REST
 */

/* dbConn */
function ydbConnViewEntry(dbConnID) {
  $('yds_returnToApp').style.display='block';
  openTabById('bodyTab', 'dbConn_Body');
  myDevelop.invoke($('dbConn_Body'), 'dbConn:getForm', dbConnID);
}

/* dbTables */
function ydbTablesViewEntry(dbTableName) {
  $('yds_returnToApp').style.display='block';
  openTabById('bodyTab', 'dbTables_Body');
}

/* dbMenu - click no item */
function ydbMenuViewEntry(dbMenuS) {
  $('yds_returnToApp').style.display='block';
  openTabById('bodyTab', 'dbMenu_Body');
  myDevelop.setMenuRoot(dbMenuS.ancestor);
  myDevelop.invoke($('dbMenu_Body'), 'dbMenu:getForm', dbMenuS);
}

/* dbMenu - click no escudo */
function ydbMenuEditMenuEntry(dbMenuS) {
  $('yds_returnToApp').style.display='block';
  openTabById('bodyTab', 'dbMenu_Body');
  myDevelop.invoke($('dbMenu_Body'), 'dbMenu:getForm', dbMenuS);
}

function ydbMenuLaunch(dbMenuS, dbMenuA) {
  yDevelopReturn();
  $('applicatioMainFrame_').src="body.php?s={0}&a={1}&u={2}".format(dbMenuS, dbMenuA, null);
}

function ydbMenuCreateEvent(dbMenuS, dbMenuA) {
  yDevelopReturn();
  $('applicatioMainFrame_').src="body.php?_Ys_=createSkeletonImplementation&s={0}&a={1}&u={2}".format(dbMenuS, dbMenuA, null);
  setTimeout(myDevelop.backMenuHistory, 1250);

}

/*=================================== ONLOAD!
  ativar o menu principal */
yDevelopMenu($('yds_options'));

/* carregar a lista de conexões */
myDevelop.invoke($('yds_dbConnection'), 'dbConn:getList');

/* carregar a lista de tabelas (da conexão ativa) */
myDevelop.invoke($('yds_dbTables'), 'dbTables:getList');

/* carregar a lista de eventos (da conexão ativa) */
myDevelop.invoke($('yds_dbMenu'), 'dbMenu:getMenuRoot');


text:
import { Injectable } from '@angular/core';
import { Http, Headers } from '@angular/http';

import 'rxjs/add/operator/toPromise';

import { User } from './user';

const LOCAL_USER_ACCESS_KEY = 'localUser';

@Injectable()
export class AuthenticationService {

    private user: User;

    private headers = new Headers({ 'Content-Type': 'application/json' });
    private loginApiUrl = 'api/v1/auth/login/';
    private logoutApiUrl = 'api/v1/auth/logout/';
    private registerApiUrl = 'api/v1/auth/register/';

    // TODO: user new HttpClient api instead of Http
    constructor(private http: Http) {
        this.loadUserFromCookies().then(user => {
            this.user = user;
        });
    }

    private loadUserFromCookies(): Promise<User> {
        // load user info from local storage
        let user: User = null;
        let userStr = localStorage.getItem(LOCAL_USER_ACCESS_KEY);
        if (!!userStr) {
            user = JSON.parse(userStr) as User;
        }
        return Promise.resolve(user);
    }

    getAuthenticatedUser(): User {
        return this.user;
    }

    isAuthenticated(): boolean {
        return !!this.user;
    }

    setAuthenticatedUser(user: User) {
        this.user = user;
        let userStr = JSON.stringify(user);
        // store user info to local storage
        localStorage.setItem(LOCAL_USER_ACCESS_KEY, userStr);
    }

    unauthenticate() {
        this.user = null;
        // clear user info from local storage
        localStorage.removeItem(LOCAL_USER_ACCESS_KEY);
    }

    login(username: string, password: string): Promise<User> {
        const data = JSON.stringify({
            'username': username,
            'password': password
        });
        return this.http.post(this.loginApiUrl, data, { headers: this.headers })
            .toPromise()
            .then(resp => {
                this.setAuthenticatedUser(resp.json() as User);
                return this.getAuthenticatedUser();
            })
            .catch(resp => {
                return Promise.reject(resp);
            });
    }

    logout(): Promise<boolean> {
        return this.http.post(this.logoutApiUrl, {})
            .toPromise()
            .then(resp => {
                this.unauthenticate();
                return true;
            })
            .catch(error => {
                console.log('logout failed:', error);
                this.unauthenticate();
                return Promise.reject(false);
            });
    }

    register(email: string, username: string, password: string): Promise<boolean> {
        console.log('register called, email:', email, 'username:', username, 'pwd:', password);
        const data = JSON.stringify({
            'email': email,
            'username': username,
            'password': password,
        });
        return this.http.post(this.registerApiUrl, data, { headers: this.headers })
            .toPromise()
            .then(resp => {
                return true;
            })
            .catch(error => {
                return false;
            });
    }
}


text:
class AddSizeToItem < ActiveRecord::Migration
  def change
    add_column :items, :size, :string
  end
end


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
using UnityEngine;
using UnityEngine.UI;

public class ButtonSettings : MonoBehaviour {

    //public static int releasedLevelStatic = GlobalVariables.levelUnlockHira;

    void Awake() {
        string lvlunlockh = GlobalVariables.levelUnlockHira.ToString();
        string lvlunlockk = GlobalVariables.levelUnlockKata.ToString();

        GlobalVariables.array3Characters = new string[3] { "_", "", "" };
        GlobalVariables.inputArrayChanged = false;
        GlobalVariables.spawnedSushi.Clear();
        GlobalVariables.launchPermission = false;
        GlobalVariables.destroyedSushi = 0;

        if (GlobalVariables.actGameLvl.Split(new[] { " " }, System.StringSplitOptions.None)[0] == "h"
            && GlobalVariables.actGameLvl.Split(new[] { " " }, System.StringSplitOptions.None)[1].Equals(lvlunlockh)
            && GlobalVariables.levelUnlockHira<22)
        {
            GlobalVariables.levelUnlockHira++;
            PlayerPrefs.SetInt("levelhira", GlobalVariables.levelUnlockHira);

        }else if(GlobalVariables.actGameLvl.Split(new[] { " " }, System.StringSplitOptions.None)[0] == "k"
            && GlobalVariables.actGameLvl.Split(new[] { " " }, System.StringSplitOptions.None)[1].Equals(lvlunlockk)
            && GlobalVariables.levelUnlockKata<22)
            {

            GlobalVariables.levelUnlockKata++;
            PlayerPrefs.SetInt("levelkata", GlobalVariables.levelUnlockKata);
        }

    }

    public void ButtonMenu()
    {
		SceneManager.LoadSceneAsync("GameLevelChooser");
        //SceneManager.LoadScene("GameLevelChooser");
		gameObject.AddComponent <AudioSource>();
		GetComponent<AudioSource> ().clip = Resources.Load ("button_click") as AudioClip;
		GetComponent<AudioSource>().volume = 1;
		GetComponent<AudioSource>().Play();
    }

    public void ButtonNext()
    {
         string lvltipe;
         int  lvlnum;

       if(GlobalVariables.actGameLvl.Split(new[] { " " }, System.StringSplitOptions.None)[0] == "h")
        {
            lvltipe = "h ";
        }else{
            lvltipe = "k ";
        }
        lvlnum = int.Parse(GlobalVariables.actGameLvl.Split(new[] { " " }, System.StringSplitOptions.None)[1]);
        lvlnum = lvlnum + 1;
        GlobalVariables.actGameLvl = lvltipe + lvlnum;
		SceneManager.LoadSceneAsync("LevelStaging");
        //SceneManager.LoadScene("LevelStaging", LoadSceneMode.Single);
		gameObject.AddComponent <AudioSource>();
		GetComponent<AudioSource> ().clip = Resources.Load ("button_click") as AudioClip;
		GetComponent<AudioSource>().volume = 1;
		GetComponent<AudioSource>().Play();
    }

    public void ButtonRepeat(){
		SceneManager.LoadSceneAsync("LevelStaging");
        //SceneManager.LoadScene("LevelStaging", LoadSceneMode.Single);
		gameObject.AddComponent <AudioSource>();
		GetComponent<AudioSource> ().clip = Resources.Load ("button_click") as AudioClip;
		GetComponent<AudioSource>().volume = 1;
		GetComponent<AudioSource>().Play();
    }

    public void ButtonLesson(){

        string lvltipe;
        int lvlnum;

        if (GlobalVariables.actGameLvl.Split(new[] { " " }, System.StringSplitOptions.None)[0] == "h")
        {
            lvltipe = "h ";
        }
        else
        {
            lvltipe = "k ";
        }
        lvlnum = int.Parse(GlobalVariables.actGameLvl.Split(new[] { " " }, System.StringSplitOptions.None)[1]);
        lvlnum = lvlnum + 1;
        GlobalVariables.actLearnLvl = lvltipe + lvlnum;

        if (lvlnum < 16) {
			SceneManager.LoadSceneAsync("LevelInfo1");
            //SceneManager.LoadScene("LevelInfo1", LoadSceneMode.Single);
        }else{
			SceneManager.LoadSceneAsync("LevelInfo");
            //SceneManager.LoadScene("LevelInfo", LoadSceneMode.Single);
        }
		gameObject.AddComponent <AudioSource>();
		GetComponent<AudioSource> ().clip = Resources.Load ("button_click") as AudioClip;
		GetComponent<AudioSource>().volume = 1;
		GetComponent<AudioSource>().Play();
    }

}


text:
/**
 * EchoEndpointService.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package org.springframework.ws.axis1.case2.contractfirst.document_literal_12_arrayswrapped;

public interface EchoEndpointService extends javax.xml.rpc.Service {
    public java.lang.String getEchoEndpointDocumentLiteral12Address();

    public org.springframework.ws.axis1.case2.contractfirst.document_literal_12_arrayswrapped.EchoEndpoint getEchoEndpointDocumentLiteral12() throws javax.xml.rpc.ServiceException;

    public org.springframework.ws.axis1.case2.contractfirst.document_literal_12_arrayswrapped.EchoEndpoint getEchoEndpointDocumentLiteral12(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
}


text:
"""
Brocade Zone Connector Factory is responsible to dynamically create the
connection object based on the configuration
"""

from oslo_log import log as logging
from oslo_utils import importutils

from cinder.zonemanager.drivers.brocade import fc_zone_constants

LOG = logging.getLogger(__name__)

class BrcdFCZoneFactory(object):

    def __init__(self):
        self.sb_conn_map = {}

    def get_connector(self, fabric, sb_connector):
        """Returns Device Connector.

        Factory method to create and return
        correct SB connector object based on the protocol
        """

        fabric_ip = fabric.safe_get('fc_fabric_address')
        client = self.sb_conn_map.get(fabric_ip)

        if not client:

            fabric_user = fabric.safe_get('fc_fabric_user')
            fabric_pwd = fabric.safe_get('fc_fabric_password')
            fabric_port = fabric.safe_get('fc_fabric_port')
            fc_vfid = fabric.safe_get('fc_virtual_fabric_id')
            fabric_ssh_cert_path = fabric.safe_get('fc_fabric_ssh_cert_path')

            LOG.debug("Client not found. Creating connection client for"
                      " %(ip)s with %(connector)s protocol "
                      "for the user %(user)s at port %(port)s.",
                      {'ip': fabric_ip,
                       'connector': sb_connector,
                       'user': fabric_user,
                       'port': fabric_port,
                       'vf_id': fc_vfid})

            if sb_connector.lower() in (fc_zone_constants.REST_HTTP,
                                        fc_zone_constants.REST_HTTPS):
                client = importutils.import_object(
                    "cinder.zonemanager.drivers.brocade."
                    "brcd_rest_fc_zone_client.BrcdRestFCZoneClient",
                    ipaddress=fabric_ip,
                    username=fabric_user,
                    password=fabric_pwd,
                    port=fabric_port,
                    vfid=fc_vfid,
                    protocol=sb_connector
                )
            elif sb_connector.lower() in (fc_zone_constants.HTTP,
                                          fc_zone_constants.HTTPS):
                client = importutils.import_object(
                    "cinder.zonemanager.drivers.brocade."
                    "brcd_http_fc_zone_client.BrcdHTTPFCZoneClient",
                    ipaddress=fabric_ip,
                    username=fabric_user,
                    password=fabric_pwd,
                    port=fabric_port,
                    vfid=fc_vfid,
                    protocol=sb_connector
                )
            else:
                client = importutils.import_object(
                    "cinder.zonemanager.drivers.brocade."
                    "brcd_fc_zone_client_cli.BrcdFCZoneClientCLI",
                    ipaddress=fabric_ip,
                    username=fabric_user,
                    password=fabric_pwd,
                    key=fabric_ssh_cert_path,
                    port=fabric_port
                )
            self.sb_conn_map.update({fabric_ip: client})
        return client


text:
#ifndef DFGRegisterBank_h
#define DFGRegisterBank_h

#if ENABLE(DFG_JIT)

#include "DFGCommon.h"
#include "FPRInfo.h"
#include "GPRInfo.h"

namespace JSC { namespace DFG {

// === RegisterBank ===
//
// This class is used to implement the GPR and FPR register banks.
// All registers have two pieces of state associated with them:
// a lock count (used to indicate this register is already in use
// in code generation of the current node, and cannot be spilled or
// allocated as a temporary), and VirtualRegister 'name', recording
// which value (if any) a machine register currently holds.
// Either or both of these pieces of information may be valid for a
// given register. A register may be:
//
//  - unlocked, and unnamed: Available for allocation.
//  - locked, but unnamed:   Already allocated as a temporary or
//                           result for the current node.
//  - unlocked, but named:   Contains the result of a prior operation,
//                           not yet in use for this node,
//  - locked, but named:     Contains the result of a prior operation,
//                           already allocated as a operand to the
//                           current operation.
//
// For every named register we also record a hint value indicating
// the order in which registers should be selected to be spilled;
// registers that can be more cheaply spilled and/or filled should
// be selected first.
//
// Locking register is a strong retention mechanism; a locked register
// will never be reallocated (this is used to ensure the operands to
// the current node are in registers). Naming, conversely, in a weak
// retention mechanism - allocating a register may force a named value
// to be spilled.
//
// All named values must be given a hint that is greater than Min and
// less than Max.
template<class BankInfo>
class RegisterBank {
    typedef typename BankInfo::RegisterType RegID;
    static const size_t NUM_REGS = BankInfo::numberOfRegisters;

    typedef uint32_t SpillHint;
    static const SpillHint SpillHintInvalid = 0xffffffff;

public:
    RegisterBank()
    {
    }

    // Attempt to allocate a register - this function finds an unlocked
    // register, locks it, and returns it. If none can be found, this
    // returns -1 (InvalidGPRReg or InvalidFPRReg).
    RegID tryAllocate()
    {
        VirtualRegister ignored;

        for (uint32_t i = 0; i < NUM_REGS; ++i) {
            if (!m_data[i].lockCount && m_data[i].name == InvalidVirtualRegister)
                return allocateInternal(i, ignored);
        }

        return (RegID)-1;
    }

    // Allocate a register - this function finds an unlocked register,
    // locks it, and returns it. If any named registers exist, one
    // of these should be selected to be allocated. If all unlocked
    // registers are named, then one of the named registers will need
    // to be spilled. In this case the register selected to be spilled
    // will be one of the registers that has the lowest 'spillOrder'
    // cost associated with it.
    //
    // This method select the register to be allocated, and calls the
    // private 'allocateInternal' method to update internal data
    // structures accordingly.
    RegID allocate(VirtualRegister &spillMe)
    {
        uint32_t currentLowest = NUM_REGS;
        SpillHint currentSpillOrder = SpillHintInvalid;

        // This loop is broken into two halves, looping from the last allocated
        // register (the register returned last time this method was called) to
        // the maximum register value, then from 0 to the last allocated.
        // This implements a simple round-robin like approach to try to reduce
        // thrash, and minimize time spent scanning locked registers in allocation.
        // If a unlocked and unnamed register is found return it immediately.
        // Otherwise, find the first unlocked register with the lowest spillOrder.
        for (uint32_t i = 0 ; i < NUM_REGS; ++i) {
            // (1) If the current register is locked, it is not a candidate.
            if (m_data[i].lockCount)
                continue;
            // (2) If the current register's spill order is 0, pick this! – unassigned registers have spill order 0.
            SpillHint spillOrder = m_data[i].spillOrder;
            if (spillOrder == SpillHintInvalid)
                return allocateInternal(i, spillMe);
            // If this register is better (has a lower spill order value) than any prior
            // candidate, then record it.
            if (spillOrder < currentSpillOrder) {
                currentSpillOrder = spillOrder;
                currentLowest = i;
            }
        }

        // Deadlock check - this could only occur is all registers are locked!
        ASSERT(currentLowest != NUM_REGS && currentSpillOrder != SpillHintInvalid);
        // There were no available registers; currentLowest will need to be spilled.
        return allocateInternal(currentLowest, spillMe);
    }

    // Allocates the given register, even if this will force a spill.
    VirtualRegister allocateSpecific(RegID reg)
    {
        unsigned index = BankInfo::toIndex(reg);

        ++m_data[index].lockCount;
        VirtualRegister name = nameAtIndex(index);
        if (name != InvalidVirtualRegister)
            releaseAtIndex(index);

        return name;
    }

    // retain/release - these methods are used to associate/disassociate names
    // with values in registers. retain should only be called on locked registers.
    void retain(RegID reg, VirtualRegister name, SpillHint spillOrder)
    {
        unsigned index = BankInfo::toIndex(reg);

        // SpillHint must be valid.
        ASSERT(spillOrder != SpillHintInvalid);
        // 'index' must be a valid, locked register.
        ASSERT(index < NUM_REGS);
        ASSERT(m_data[index].lockCount);
        // 'index' should not currently be named, the new name must be valid.
        ASSERT(m_data[index].name == InvalidVirtualRegister);
        ASSERT(name != InvalidVirtualRegister);
        // 'index' should not currently have a spillOrder.
        ASSERT(m_data[index].spillOrder == SpillHintInvalid);

        m_data[index].name = name;
        m_data[index].spillOrder = spillOrder;
    }
    void release(RegID reg)
    {
        releaseAtIndex(BankInfo::toIndex(reg));
    }

    // lock/unlock register, ensures that they are not spilled.
    void lock(RegID reg)
    {
        unsigned index = BankInfo::toIndex(reg);

        ASSERT(index < NUM_REGS);
        ++m_data[index].lockCount;
        ASSERT(m_data[index].lockCount);
    }
    void unlock(RegID reg)
    {
        unsigned index = BankInfo::toIndex(reg);

        ASSERT(index < NUM_REGS);
        ASSERT(m_data[index].lockCount);
        --m_data[index].lockCount;
    }
    bool isLocked(RegID reg) const
    {
        return isLockedAtIndex(BankInfo::toIndex(reg));
    }

    // Get the name (VirtualRegister) associated with the
    // given register (or InvalidVirtualRegister for none).
    VirtualRegister name(RegID reg) const
    {
        return nameAtIndex(BankInfo::toIndex(reg));
    }

    bool isInUse(RegID reg) const
    {
        return isLocked(reg) || name(reg) != InvalidVirtualRegister;
    }

#ifndef NDEBUG
    void dump()
    {
        // For each register, print the VirtualRegister 'name'.
        for (uint32_t i =0; i < NUM_REGS; ++i) {
            if (m_data[i].name != InvalidVirtualRegister)
                dataLogF("[%02d]", m_data[i].name);
            else
                dataLogF("[--]");
        }
        dataLogF("\n");
    }
#endif

    class iterator {
    friend class RegisterBank<BankInfo>;
    public:
        VirtualRegister name() const
        {
            return m_bank->nameAtIndex(m_index);
        }

        bool isLocked() const
        {
            return m_bank->isLockedAtIndex(m_index);
        }

        void release() const
        {
            m_bank->releaseAtIndex(m_index);
        }

        RegID regID() const
        {
            return BankInfo::toRegister(m_index);
        }

#ifndef NDEBUG
        const char* debugName() const
        {
            return BankInfo::debugName(regID());
        }
#endif

        iterator& operator++()
        {
            ++m_index;
            return *this;
        }

        bool operator!=(const iterator& other) const
        {
            ASSERT(m_bank == other.m_bank);
            return m_index != other.m_index;
        }

        unsigned index() const
        {
            return m_index;
        }

    private:
        iterator(RegisterBank<BankInfo>* bank, unsigned index)
            : m_bank(bank)
            , m_index(index)
        {
        }

        RegisterBank<BankInfo>* m_bank;
        unsigned m_index;
    };

    iterator begin()
    {
        return iterator(this, 0);
    }

    iterator end()
    {
        return iterator(this, NUM_REGS);
    }

private:
    bool isLockedAtIndex(unsigned index) const
    {
        ASSERT(index < NUM_REGS);
        return m_data[index].lockCount;
    }

    VirtualRegister nameAtIndex(unsigned index) const
    {
        ASSERT(index < NUM_REGS);
        return m_data[index].name;
    }

    void releaseAtIndex(unsigned index)
    {
        // 'index' must be a valid register.
        ASSERT(index < NUM_REGS);
        // 'index' should currently be named.
        ASSERT(m_data[index].name != InvalidVirtualRegister);
        // 'index' should currently have a valid spill order.
        ASSERT(m_data[index].spillOrder != SpillHintInvalid);

        m_data[index].name = InvalidVirtualRegister;
        m_data[index].spillOrder = SpillHintInvalid;
    }

    // Used by 'allocate', above, to update inforamtion in the map.
    RegID allocateInternal(uint32_t i, VirtualRegister &spillMe)
    {
        // 'i' must be a valid, unlocked register.
        ASSERT(i < NUM_REGS && !m_data[i].lockCount);

        // Return the VirtualRegister of the named value currently stored in
        // the register being returned - or InvalidVirtualRegister if none.
        spillMe = m_data[i].name;

        // Clear any name/spillOrder currently associated with the register,
        m_data[i] = MapEntry();
        // Mark the register as locked (with a lock count of 1).
        m_data[i].lockCount = 1;

        return BankInfo::toRegister(i);
    }

    // === MapEntry ===
    //
    // This structure provides information for an individual machine register
    // being managed by the RegisterBank. For each register we track a lock
    // count, name and spillOrder hint.
    struct MapEntry {
        MapEntry()
            : name(InvalidVirtualRegister)
            , spillOrder(SpillHintInvalid)
            , lockCount(0)
        {
        }

        VirtualRegister name;
        SpillHint spillOrder;
        uint32_t lockCount;
    };

    // Holds the current status of all registers.
    MapEntry m_data[NUM_REGS];
};

typedef RegisterBank<GPRInfo>::iterator gpr_iterator;
typedef RegisterBank<FPRInfo>::iterator fpr_iterator;

} } // namespace JSC::DFG

#endif
#endif


text:
package cbrapp;

import com.google.gson.Gson;
import jcolibri.cbrcore.Attribute;
import jcolibri.cbrcore.CaseComponent;
import jcolibri.datatypes.Instance;

/**
 * Class which store result of CBR.
 * @author M. Navrotskiy
 * @version 1.0
 */
public class CbrSolution implements CaseComponent {

    /* Class fields. */
    /** Main concept. */
    private Instance mainConcept;
    /** Value of result. */
    private Instance result;

    /**
     * Convert class object to JSON string..
     * @return JSON string.
     */
    @Override
    public String toString() {
        Gson gson = new Gson();
        return gson.toJson(this);
    }

    /**
     * Set new value of result.
     * @param result_has_value New value.
     */
    public void setResult (Instance result_has_value) {
        this.result = result_has_value;
    }

    /**
     *Get value of result.
     * @return Value of result.
     */
    public Instance getResult() {
        return result;
    }

    /**
     * Get value of main concept.
     * @return Main concept.
     */
    public Instance getMainConcept() {
        return mainConcept;
    }

    /**
     * Set value of main concept.
     * @param mainConcept main concept.
     */
    public void setMainConcept(Instance mainConcept) {
        this.mainConcept = mainConcept;
    }

    /**
     * Get attributes id.
     * @return Attributes id.
     */
    @Override
    public Attribute getIdAttribute() {
        return new Attribute("mainConcept", this.getClass());
    }

}


text:
"""Unit tests for dm_root.py."""

__author__ = 'dgentry@google.com (Denton Gentry)'

import unittest
import google3
import dm_root
import tr.tr098_v1_4
import tr.tr181_v2_2

BASE181 = tr.tr181_v2_2.Device_v2_2.Device
BASE98 = tr.tr098_v1_4.InternetGatewayDevice_v1_10.InternetGatewayDevice

class MockTr181(BASE181):
  pass

class MockTr98(BASE98):
  pass

class MockManagement(object):
  def __init__(self):
    self.EnableCWMP = False

class DeviceModelRootTest(unittest.TestCase):
  def testAddManagementServer(self):
    root = dm_root.DeviceModelRoot(loop=None, platform=None)
    mgmt = MockManagement()
    root.add_management_server(mgmt)  # should do nothing.

    root.Device = MockTr181()
    root.InternetGatewayDevice = MockTr98()
    root.Export(objects=['Device', 'InternetGatewayDevice'])
    self.assertFalse(isinstance(root.InternetGatewayDevice.ManagementServer,
                                BASE98.ManagementServer))
    self.assertFalse(isinstance(root.Device.ManagementServer,
                                BASE181.ManagementServer))
    root.add_management_server(mgmt)  # should do nothing.
    self.assertTrue(isinstance(root.InternetGatewayDevice.ManagementServer,
                               BASE98.ManagementServer))
    self.assertTrue(isinstance(root.Device.ManagementServer,
                               BASE181.ManagementServer))

if __name__ == '__main__':
  unittest.main()


text:
package org.apache.asterix.om.typecomputer.impl;

import org.apache.asterix.dataflow.data.common.ILogicalBinaryComparator;
import org.apache.asterix.om.typecomputer.base.AbstractResultTypeComputer;
import org.apache.asterix.om.types.ATypeTag;
import org.apache.asterix.om.types.AUnionType;
import org.apache.asterix.om.types.BuiltinType;
import org.apache.asterix.om.types.IAType;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression;

public class MinMaxAggTypeComputer extends AbstractResultTypeComputer {

    public static final MinMaxAggTypeComputer INSTANCE = new MinMaxAggTypeComputer();

    private MinMaxAggTypeComputer() {
    }

    @Override
    protected IAType getResultType(ILogicalExpression expr, IAType... strippedInputTypes) throws AlgebricksException {
        ATypeTag typeTag = strippedInputTypes[0].getTypeTag();
        if (ILogicalBinaryComparator.inequalityUndefined(typeTag)) {
            return BuiltinType.ANULL;
        }
        return typeTag == ATypeTag.ANY ? BuiltinType.ANY : AUnionType.createUnknownableType(strippedInputTypes[0]);
    }
}


text:
require "spec_helper"

describe TransactionsController do
  describe "routing" do

    it "routes to #index" do
      get("/transactions").should route_to("transactions#index")
    end

    it "routes to #new" do
      get("/transactions/new").should route_to("transactions#new")
    end

    it "routes to #show" do
      get("/transactions/1").should route_to("transactions#show", :id => "1")
    end

    it "routes to #edit" do
      get("/transactions/1/edit").should route_to("transactions#edit", :id => "1")
    end

    it "routes to #create" do
      post("/transactions").should route_to("transactions#create")
    end

    it "routes to #update" do
      put("/transactions/1").should route_to("transactions#update", :id => "1")
    end

    it "routes to #destroy" do
      delete("/transactions/1").should route_to("transactions#destroy", :id => "1")
    end

  end
end


text:
 1
Official Repository for Hacktoberfest 2k17 NITK Edition meetup conducted at NITK Surathkal in collaboration with Team Engineer.

## CONTRIBUTING

* This repository is for the NITK Hacktoberfest Meetup for the year 2k17. It's basic aim is to get people started with Open Source Contribution.
* To get started take a look at our [CONTRIBUTING doc](CONTRIBUTING.md) for more information.

## License

* This repository is under [MIT LICENSE](LICENSE). For more information refer the License terms.

## Code of Conduct

* The [Web Club Code of Conduct](CODE_OF_CONDUCT.md) can be seen primarily to get the dos/donts for the repository.


text:
package org.dyn4j.collision;

import java.util.List;

import junit.framework.TestCase;

import org.dyn4j.collision.broadphase.BroadphasePair;
import org.dyn4j.collision.broadphase.SapIncremental;
import org.dyn4j.collision.manifold.ClippingManifoldSolver;
import org.dyn4j.collision.manifold.Manifold;
import org.dyn4j.collision.manifold.ManifoldPoint;
import org.dyn4j.collision.narrowphase.Gjk;
import org.dyn4j.collision.narrowphase.Penetration;
import org.dyn4j.collision.narrowphase.Separation;
import org.dyn4j.geometry.Circle;
import org.dyn4j.geometry.HalfEllipse;
import org.dyn4j.geometry.Shape;
import org.dyn4j.geometry.Transform;
import org.dyn4j.geometry.Vector2;
import org.junit.Before;
import org.junit.Test;

/**
 * Test case for {@link Circle} - {@link HalfEllipse} collision detection.
 * @author William Bittle
 * @version 3.1.5
 * @since 3.1.5
 */
public class CircleHalfEllipseTest extends AbstractTest {
	/** The test {@link Circle} */
	private Circle c;

	/** The test {@link HalfEllipse} */
	private HalfEllipse e;

	/**
	 * Sets up the test.
	 */
	@Before
	public void setup() {
		this.c = new Circle(0.5);
		this.e = new HalfEllipse(2.0, 0.5);
		this.sapI.clear();
		this.sapBF.clear();
		this.sapT.clear();
		this.dynT.clear();
	}

	/**
	 * Tests {@link Shape} AABB.
	 */
	@Test
	public void detectShapeAABB() {
		Transform t1 = new Transform();
		Transform t2 = new Transform();

		// test containment
		TestCase.assertTrue(this.aabb.detect(c, t1, e, t2));
		TestCase.assertTrue(this.aabb.detect(e, t2, c, t1));

		// test overlap
		t1.translate(-0.75, 0.0);
		TestCase.assertTrue(this.aabb.detect(c, t1, e, t2));
		TestCase.assertTrue(this.aabb.detect(e, t2, c, t1));

		// test only AABB overlap
		t2.translate(0.0, -0.9);
		TestCase.assertTrue(this.aabb.detect(c, t1, e, t2));
		TestCase.assertTrue(this.aabb.detect(e, t2, c, t1));

		// test no overlap
		t2.translate(1.0, 0.0);
		TestCase.assertFalse(this.aabb.detect(c, t1, e, t2));
		TestCase.assertFalse(this.aabb.detect(e, t2, c, t1));
	}

	/**
	 * Tests {@link Collidable} AABB.
	 */
	@Test
	public void detectCollidableAABB() {
		// create some collidables
		CollidableTest ct1 = new CollidableTest(c);
		CollidableTest ct2 = new CollidableTest(e);

		// test containment
		TestCase.assertTrue(this.aabb.detect(ct1, ct2));
		TestCase.assertTrue(this.aabb.detect(ct2, ct1));

		// test overlap
		ct1.translate(-0.75, 0.0);
		TestCase.assertTrue(this.aabb.detect(ct1, ct2));
		TestCase.assertTrue(this.aabb.detect(ct2, ct1));

		// test only AABB overlap
		ct2.translate(0.0, -0.9);
		TestCase.assertTrue(this.aabb.detect(ct1, ct2));
		TestCase.assertTrue(this.aabb.detect(ct2, ct1));

		// test no overlap
		ct2.translate(1.0, 0.0);
		TestCase.assertFalse(this.aabb.detect(ct1, ct2));
		TestCase.assertFalse(this.aabb.detect(ct2, ct1));
	}

	/**
	 * Tests {@link SapIncremental}.
	 */
	@Test
	public void detectBroadphase() {
		List<BroadphasePair<CollidableTest>> pairs;

		// create some collidables
		CollidableTest ct1 = new CollidableTest(c);
		CollidableTest ct2 = new CollidableTest(e);

		this.sapI.add(ct1);
		this.sapI.add(ct2);
		this.sapBF.add(ct1);
		this.sapBF.add(ct2);
		this.sapT.add(ct1);
		this.sapT.add(ct2);
		this.dynT.add(ct1);
		this.dynT.add(ct2);

		// test containment
		pairs = this.sapI.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.sapBF.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.sapT.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.dynT.detect();
		TestCase.assertEquals(1, pairs.size());

		// test overlap
		ct1.translate(-0.75, 0.0);
		this.sapI.update(ct1);
		this.sapBF.update(ct1);
		this.sapT.update(ct1);
		this.dynT.update(ct1);
		pairs = this.sapI.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.sapBF.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.sapT.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.dynT.detect();
		TestCase.assertEquals(1, pairs.size());

		// test only AABB overlap
		ct2.translate(0.0, -0.9);
		this.sapI.update(ct2);
		this.sapBF.update(ct2);
		this.sapT.update(ct2);
		this.dynT.update(ct2);
		pairs = this.sapI.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.sapBF.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.sapT.detect();
		TestCase.assertEquals(1, pairs.size());
		pairs = this.dynT.detect();
		TestCase.assertEquals(1, pairs.size());

		// test no overlap
		ct2.translate(1.0, 0.0);
		this.sapI.update(ct2);
		this.sapBF.update(ct2);
		this.sapT.update(ct2);
		this.dynT.update(ct2);
		pairs = this.sapI.detect();
		TestCase.assertEquals(0, pairs.size());
		pairs = this.sapBF.detect();
		TestCase.assertEquals(0, pairs.size());
		pairs = this.sapT.detect();
		TestCase.assertEquals(0, pairs.size());
		pairs = this.dynT.detect();
		TestCase.assertEquals(0, pairs.size());
	}

	/**
	 * Tests that sat is unsupported.
	 */
	@Test(expected = UnsupportedOperationException.class)
	public void detectSat() {
		Penetration p = new Penetration();
		Transform t1 = new Transform();
		Transform t2 = new Transform();

		this.sat.detect(c, t1, e, t2, p);
	}

	/**
	 * Tests {@link Gjk}.
	 */
	@Test
	public void detectGjk() {
		Penetration p = new Penetration();
		Transform t1 = new Transform();
		Transform t2 = new Transform();
		Vector2 n = null;

		// test containment
		TestCase.assertTrue(this.gjk.detect(c, t1, e, t2, p));
		TestCase.assertTrue(this.gjk.detect(c, t1, e, t2));
		n = p.getNormal();
		TestCase.assertEquals( 0.000, n.x, 1.0e-3);
		TestCase.assertEquals( 1.000, n.y, 1.0e-3);
		TestCase.assertEquals( 0.500, p.getDepth(), 1.0e-3);
		// try reversing the shapes
		TestCase.assertTrue(this.gjk.detect(e, t2, c, t1, p));
		TestCase.assertTrue(this.gjk.detect(e, t2, c, t1));
		n = p.getNormal();
		TestCase.assertEquals( 0.000, n.x, 1.0e-3);
		TestCase.assertEquals(-1.000, n.y, 1.0e-3);
		TestCase.assertEquals( 0.500, p.getDepth(), 1.0e-3);

		// test overlap
		t1.translate(-0.75, 0.0);
		TestCase.assertTrue(this.gjk.detect(c, t1, e, t2, p));
		TestCase.assertTrue(this.gjk.detect(c, t1, e, t2));
		n = p.getNormal();
		TestCase.assertEquals( 0.000, n.x, 1.0e-3);
		TestCase.assertEquals( 1.000, n.y, 1.0e-3);
		TestCase.assertEquals( 0.500, p.getDepth(), 1.0e-3);
		// try reversing the shapes
		TestCase.assertTrue(this.gjk.detect(e, t2, c, t1, p));
		TestCase.assertTrue(this.gjk.detect(e, t2, c, t1));
		n = p.getNormal();
		TestCase.assertEquals( 0.000, n.x, 1.0e-3);
		TestCase.assertEquals(-1.000, n.y, 1.0e-3);
		TestCase.assertEquals( 0.500, p.getDepth(), 1.0e-3);

		// test AABB overlap
		t2.translate(0.0, -0.9);
		TestCase.assertFalse(this.gjk.detect(c, t1, e, t2, p));
		TestCase.assertFalse(this.gjk.detect(c, t1, e, t2));
		// try reversing the shapes
		TestCase.assertFalse(this.gjk.detect(e, t2, c, t1, p));
		TestCase.assertFalse(this.gjk.detect(e, t2, c, t1));

		// test no overlap
		t2.translate(1.0, 0.0);
		TestCase.assertFalse(this.gjk.detect(c, t1, e, t2, p));
		TestCase.assertFalse(this.gjk.detect(c, t1, e, t2));
		// try reversing the shapes
		TestCase.assertFalse(this.gjk.detect(e, t2, c, t1, p));
		TestCase.assertFalse(this.gjk.detect(e, t2, c, t1));
	}

	/**
	 * Tests the {@link Gjk} distance method.
	 */
	@Test
	public void gjkDistance() {
		Separation s = new Separation();

		Transform t1 = new Transform();
		Transform t2 = new Transform();

		Vector2 n = null;
		Vector2 p1 = null;
		Vector2 p2 = null;

		// test containment
		TestCase.assertFalse(this.gjk.distance(c, t1, e, t2, s));
		// try reversing the shapes
		TestCase.assertFalse(this.gjk.distance(e, t2, c, t1, s));

		// test overlap
		t1.translate(-0.75, 0.0);
		TestCase.assertFalse(this.gjk.distance(c, t1, e, t2, s));
		// try reversing the shapes
		TestCase.assertFalse(this.gjk.distance(e, t2, c, t1, s));

		// test AABB overlap
		t2.translate(0.0, -0.9);
		TestCase.assertTrue(this.gjk.distance(c, t1, e, t2, s));
		n = s.getNormal();
		p1 = s.getPoint1();
		p2 = s.getPoint2();
		TestCase.assertEquals( 0.021, s.getDistance(), 1.0e-3);
		TestCase.assertEquals( 0.332, n.x, 1.0e-3);
		TestCase.assertEquals(-0.943, n.y, 1.0e-3);
		TestCase.assertEquals(-0.583, p1.x, 1.0e-3);
		TestCase.assertEquals(-0.471, p1.y, 1.0e-3);
		TestCase.assertEquals(-0.576, p2.x, 1.0e-3);
		TestCase.assertEquals(-0.491, p2.y, 1.0e-3);
		// try reversing the shapes
		TestCase.assertTrue(this.gjk.distance(e, t2, c, t1, s));
		n = s.getNormal();
		p1 = s.getPoint1();
		p2 = s.getPoint2();
		TestCase.assertEquals( 0.021, s.getDistance(), 1.0e-3);
		TestCase.assertEquals(-0.332, n.x, 1.0e-3);
		TestCase.assertEquals( 0.943, n.y, 1.0e-3);
		TestCase.assertEquals(-0.576, p1.x, 1.0e-3);
		TestCase.assertEquals(-0.491, p1.y, 1.0e-3);
		TestCase.assertEquals(-0.583, p2.x, 1.0e-3);
		TestCase.assertEquals(-0.471, p2.y, 1.0e-3);

		// test no overlap
		t2.translate(1.0, 0.0);
		TestCase.assertTrue(this.gjk.distance(c, t1, e, t2, s));
		n = s.getNormal();
		p1 = s.getPoint1();
		p2 = s.getPoint2();
		TestCase.assertEquals( 0.588, s.getDistance(), 1.0e-3);
		TestCase.assertEquals( 0.762, n.x, 1.0e-3);
		TestCase.assertEquals(-0.647, n.y, 1.0e-3);
		TestCase.assertEquals(-0.368, p1.x, 1.0e-3);
		TestCase.assertEquals(-0.323, p1.y, 1.0e-3);
		TestCase.assertEquals( 0.079, p2.x, 1.0e-3);
		TestCase.assertEquals(-0.704, p2.y, 1.0e-3);
		// try reversing the shapes
		TestCase.assertTrue(this.gjk.distance(e, t2, c, t1, s));
		n = s.getNormal();
		p1 = s.getPoint1();
		p2 = s.getPoint2();
		TestCase.assertEquals( 0.588, s.getDistance(), 1.0e-3);
		TestCase.assertEquals(-0.762, n.x, 1.0e-3);
		TestCase.assertEquals( 0.647, n.y, 1.0e-3);
		TestCase.assertEquals( 0.079, p1.x, 1.0e-3);
		TestCase.assertEquals(-0.704, p1.y, 1.0e-3);
		TestCase.assertEquals(-0.368, p2.x, 1.0e-3);
		TestCase.assertEquals(-0.323, p2.y, 1.0e-3);
	}

	/**
	 * Test the {@link ClippingManifoldSolver}.
	 */
	@Test
	public void getClipManifold() {
		Manifold m = new Manifold();
		Penetration p = new Penetration();

		Transform t1 = new Transform();
		Transform t2 = new Transform();

		ManifoldPoint mp = null;
		Vector2 p1 = null;

		// test containment gjk
		this.gjk.detect(c, t1, e, t2, p);
		TestCase.assertTrue(this.cmfs.getManifold(p, c, t1, e, t2, m));
		TestCase.assertEquals(1, m.getPoints().size());
		// try reversing the shapes
		this.gjk.detect(e, t2, c, t1, p);
		TestCase.assertTrue(this.cmfs.getManifold(p, e, t2, c, t1, m));
		TestCase.assertEquals(1, m.getPoints().size());

		t1.translate(-0.75, 0.0);

		// test overlap gjk
		this.gjk.detect(c, t1, e, t2, p);
		TestCase.assertTrue(this.cmfs.getManifold(p, c, t1, e, t2, m));
		TestCase.assertEquals(1, m.getPoints().size());
		mp = m.getPoints().get(0);
		p1 = mp.getPoint();
		TestCase.assertEquals(-0.750, p1.x, 1.0e-3);
		TestCase.assertEquals( 0.500, p1.y, 1.0e-3);
		TestCase.assertEquals( 0.500, mp.getDepth(), 1.0e-3);
		// try reversing the shapes
		this.gjk.detect(e, t2, c, t1, p);
		TestCase.assertTrue(this.cmfs.getManifold(p, e, t2, c, t1, m));
		TestCase.assertEquals(1, m.getPoints().size());
		mp = m.getPoints().get(0);
		p1 = mp.getPoint();
		TestCase.assertEquals(-0.750, p1.x, 1.0e-3);
		TestCase.assertEquals( 0.500, p1.y, 1.0e-3);
		TestCase.assertEquals( 0.500, mp.getDepth(), 1.0e-3);
	}
}


text:
"""
conftest.py
~~~~~~~~~~~

Py.test fixtures.
"""
import os.path

import pytest

from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.serialization import Encoding

CERT_DELIMITER = '-----END CERTIFICATE-----\n'
HERE = os.path.dirname(__file__)

def build_chain_from_pem(chain):
    """
    Splits a PEM cert chain and converts them to DER bytes.
    """
    certs = chain.split(CERT_DELIMITER)

    parsed_certs = (
        x509.load_pem_x509_certificate(
            (cert+CERT_DELIMITER).encode('ascii'),
            default_backend()
        )
        for cert in certs if cert
    )
    encoded_certs = [
        cert.public_bytes(Encoding.DER) for cert in parsed_certs
    ]
    return encoded_certs

@pytest.fixture
def certifi_chain():
    """
    Returns the trust chain associated with certifi.io. Note that this expires
    in 2018.
    """
    with open(os.path.join(HERE, 'fixtures', 'certifi_chain.pem'), 'r') as f:
        chain = f.read()

    encoded_certs = build_chain_from_pem(chain)
    assert len(encoded_certs) == 3
    return encoded_certs

@pytest.fixture
def expired():
    """
    Returns the cert chain from expired.badssl.com.
    """
    with open(os.path.join(HERE, 'fixtures', 'expired-badssl.pem'), 'r') as f:
        chain = f.read()

    encoded_certs = build_chain_from_pem(chain)
    assert len(encoded_certs) == 3
    return encoded_certs

@pytest.fixture
def wrong_host():
    """
    Returns the cert chain from wrong.host.badssl.com.
    """
    path = os.path.join(HERE, 'fixtures', 'wronghost-badssl.pem')
    with open(path, 'r') as f:
        chain = f.read()

    encoded_certs = build_chain_from_pem(chain)
    assert len(encoded_certs) == 3
    return encoded_certs

@pytest.fixture
def self_signed():
    """
    Returns the cert chain from selfsigned.badssl.com.
    """
    path = os.path.join(HERE, 'fixtures', 'selfsigned-badssl.pem')
    with open(path, 'r') as f:
        chain = f.read()

    encoded_certs = build_chain_from_pem(chain)
    assert len(encoded_certs) == 1
    return encoded_certs


text: $ echo 'error: no contents'  #=> --egrep


text:
@implementation AppRoot

static AppRoot* only = nil;

+ (instancetype) sharedInstance {
    @synchronized(self) {
        if (only == nil) {
            only = [[self alloc] init];

            NSLog(@"init AppRoot");
        }
        return only;
    }
}

@end


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

namespace Output
{
    /// <summary>
    /// saves the Calculated Values of the Track. Actually the class is not needed
    /// </summary>
    public class TrackOutput
    {
        /// <summary>
        /// the results of the last Calculation step
        /// </summary>
        public TrackOutput LastCalculation
        {
            get
            {
                if(_lastCalculation ==null)
                    _lastCalculation = new TrackOutput();
                return _lastCalculation;
            }
            set { _lastCalculation = value; }
        }
        private TrackOutput _lastCalculation;
    }
}


text:
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.vr.util;

import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;

import org.chromium.chrome.browser.vr.TestVrShellDelegate;
import org.chromium.content_public.browser.test.util.CriteriaHelper;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

/**
 * Utility class to simulate a Daydream View NFC tag being scanned.
 */
public class NfcSimUtils {
    private static final String DETECTION_ACTIVITY = ".nfc.ViewerDetectionActivity";
    // TODO(bsheedy): Use constants from VrCore if ever exposed
    private static final String APPLICATION_RECORD_STRING = "com.google.vr.vrcore";
    private static final String RESERVED_KEY = "google.vr/rsvd";
    private static final String VERSION_KEY = "google.vr/ver";
    private static final String DATA_KEY = "google.vr/data";
    private static final ByteOrder BYTE_ORDER = ByteOrder.BIG_ENDIAN;
    // Hard coded viewer ID (0x03) instead of using NfcParams and converting
    // to a byte array because NfcParams were removed from the GVR SDK
    private static final byte[] PROTO_BYTES = new byte[] {(byte) 0x08, (byte) 0x03};
    private static final int VERSION = 123;
    private static final int RESERVED = 456;

    // VrCore always seems to recover within ~10 seconds, so give it that plus some extra to be safe
    private static final int NFC_SCAN_TIMEOUT_MS = 15000;
    private static final int NFC_SCAN_INTERVAL_MS = 5000;

    /**
     * Makes an Intent that triggers VrCore as if the Daydream headset's NFC
     * tag was scanned.
     *
     * @return The intent to send to VrCore to simulate an NFC scan.
     */
    public static Intent makeNfcIntent() {
        Intent nfcIntent = new Intent(NfcAdapter.ACTION_NDEF_DISCOVERED);
        NdefMessage[] messages = new NdefMessage[] {new NdefMessage(
                new NdefRecord[] {NdefRecord.createMime(RESERVED_KEY, intToByteArray(RESERVED)),
                        NdefRecord.createMime(VERSION_KEY, intToByteArray(VERSION)),
                        NdefRecord.createMime(DATA_KEY, PROTO_BYTES),
                        NdefRecord.createApplicationRecord(APPLICATION_RECORD_STRING)})};
        nfcIntent.putExtra(NfcAdapter.EXTRA_NDEF_MESSAGES, messages);
        nfcIntent.setComponent(new ComponentName(
                APPLICATION_RECORD_STRING, APPLICATION_RECORD_STRING + DETECTION_ACTIVITY));
        return nfcIntent;
    }

    /**
     * Simulates the NFC tag of the Daydream headset being scanned.
     *
     * @param context The Context that the NFC scan activity will be started from.
     */
    public static void simNfcScan(Context context) {
        Intent nfcIntent = NfcSimUtils.makeNfcIntent();
        try {
            context.startActivity(nfcIntent);
        } catch (ActivityNotFoundException e) {
            // On unsupported devices, won't find VrCore -> Do nothing
        }
    }

    /**
     * Repeatedly simulates an NFC scan until VR is actually entered. This is a workaround for
     * https://crbug.com/736527.
     *
     * @param context The Context that the NFC scan activity will be started from.
     */
    public static void simNfcScanUntilVrEntry(final Context context) {
        final TestVrShellDelegate delegate = VrShellDelegateUtils.getDelegateInstance();
        delegate.setExpectingBroadcast();
        CriteriaHelper.pollInstrumentationThread(() -> {
            if (!delegate.isExpectingBroadcast()) return true;
            simNfcScan(context);
            return false;
        }, "NFC failed to cause VR entry", NFC_SCAN_TIMEOUT_MS, NFC_SCAN_INTERVAL_MS);
    }

    private static byte[] intToByteArray(int i) {
        final ByteBuffer bb = ByteBuffer.allocate(Integer.SIZE / Byte.SIZE);
        bb.order(BYTE_ORDER);
        bb.putInt(i);
        return bb.array();
    }
}


text:
package com.dys.chatwork4s.http.parameters

/**
  * ファイル情報を取得する際に指定するパラメータ
  *
  * @param createDownloadUrl ダウンロードする為のURLを生成するか<br>30秒間だけダウンロード可能なURLを生成します
  */
case class GetFile(
                    createDownloadUrl: Option[Boolean] = None
                  ) extends HttpParameter {
  override def toParameters: Seq[(String, String)] = singleParameter(
    ("create_download_url", createDownloadUrl.map(booleanToInt))
  )
}

object GetFile {
  val empty: GetFile = GetFile()
}


text:
package org.interfacedesign.auth.domain.model;

import org.apache.commons.lang3.StringUtils;
import org.interfacedesign.auth.domain.model.repository.RoleRepository;
import org.interfacedesign.auth.domain.model.repository.UsersRepository;
import org.interfacedesign.base.exception.DesignException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * Created by lishaohua on 16-6-7.
 */
@Service
public class UserServiceImpl implements UsersService {
    private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);
    @Autowired
    private UsersRepository usersRepository;
    @Autowired
    private RoleRepository roleRepository;

    public Page<Users> getUsers(String name, Pageable pageable) {
        return usersRepository.findByNameLike(name, pageable);
    }

    @Transactional
    public Page<Users> getAllUsers(Pageable pageable) {
        return usersRepository.findAll(pageable);
    }

    @Transactional
    public void addUsers(String name, String password, List<String> roles) {
        if(CollectionUtils.isEmpty(roles)) {
            throw new IllegalArgumentException("添加用户至少包含一个角色");
        }
        Users usersByName = usersRepository.findByName(name);
        if(usersByName != null) {
            throw new IllegalArgumentException("添加的用户已经存在");
        }
        Users users = new Users(name, password);
        addRoleToUser(users, roles);
    }

    @Transactional
    public void addRoleToUser(Long usersId,  List<String> roles) {
        Users users = usersRepository.findOne(usersId);
        if(users == null) {
            throw new IllegalArgumentException("需要添加角色的用户不存在");
        }
        addRoleToUser(users, roles);
    }

    @Transactional
    public void addRole(String name, String description) {
        if(StringUtils.isEmpty(name)) {
            throw new IllegalArgumentException("添加的角色名不能为空");
        }
        Role role = roleRepository.findByName(name);
        if(role != null) {
            logger.warn("role{}已经存在", name);
            return;
        }
        role = new Role(name, description);
        roleRepository.save(role);
    }

    @Transactional
    public void addUsersToRole(String roleName, List<Long> users) {
        if(StringUtils.isEmpty(roleName)) {
            throw new IllegalArgumentException("需要添加用户的角色不能为空");
        }
        Role roleByName = roleRepository.findByName(roleName);
        if(roleByName == null) {
            throw new IllegalArgumentException("需要添加用户的角色不存在");
        }
        List<Users> all = usersRepository.findAll(users);
//        roleByName.addUsers(all);
    }

    private void addRoleToUser(Users users, List<String> roles) {
        for(String roleName : roles) {
            Role role = roleRepository.findByName(roleName);
            if(role != null) {
                users.addRole(role);
            }
        }
        usersRepository.save(users);
    }

}


text:
package com.orientechnologies.common.serialization.types;

import java.math.BigDecimal;
import java.math.BigInteger;

import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
 * @author Andrey Lomakin
 * @since 04.04.12
 */
public class DecimalSerializerTest {
  private final static int        FIELD_SIZE = 9;
  private static final BigDecimal OBJECT     = new BigDecimal(new BigInteger("20"), 2);
  private ODecimalSerializer      decimalSerializer;
  private static final byte[]     stream     = new byte[FIELD_SIZE];

  @BeforeClass
  public void beforeClass() {
    decimalSerializer = new ODecimalSerializer();
  }

  @Test
  public void testFieldSize() {
    Assert.assertEquals(decimalSerializer.getObjectSize(OBJECT), FIELD_SIZE);
  }

  @Test
  public void testSerialize() {
    decimalSerializer.serialize(OBJECT, stream, 0);
    Assert.assertEquals(decimalSerializer.deserialize(stream, 0), OBJECT);
  }
}


text:
Simple cache helpers for Sinatra.

## Installation

Add this line to your application's Gemfile:

    gem 'sinatra-simplecache'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install sinatra-simplecache

## Usage

Modular Application:

``` ruby
require 'sinatra/base'
require 'sinatra/simplecache'
require 'erubis'

class TestApp < Sinatra::Base
  helpers Sinatra::SimpleCache
  set :erb, escape_html: true

  get '/' do
    cache(key: "index", expire: 10) { erb :index, locals: { _time: Time.now }}
  end

  run! if app_file == $0
end
```

`sinatra-simplecache` provide `cache` helper method.
This helper method take two args,

* options
  - key: cache key
  - expire: set expire time(Time or Numeric)
* block
  - evaluate Template, RDB/KVS Query etc.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
  width: 100%;
}
#commodityManage table td,
#commodityManage table th {
  border: 1px solid green;
  text-align: left;
}
#tem_Dialog table {
  width: 100%;
}
#tem_Dialog .add_categoryAction {
  background-color: white;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -30rem;
  margin-top: -25rem;
  width: 60rem;
  height: 50rem;
  border: 1px solid green;
}
#tem_Dialog .add_categoryAction td {
  border: 1px solid red;
}
.pro_cate table .cateName {
  color: white;
}
.icon-pencil {
  color: black;
}
.pro_cate table .cateName span {
  color: black;
}
.pro_cate .icon-contract2,
.pro_cate .icon-expand2 {
  height: 3rem;
  width: 3rem;
  border: 1px solid red;
  display: inline-block;
  cursor: pointer;
  color: red;
  text-align: center;
  line-height: 3rem;
}
.pro_cate img {
  width: 3rem;
  height: 3rem;
}
.add_categoryAction p {
  height: 4rem;
  border: 1px solid black;
  margin: 0;
  line-height: 4rem;
}
.add_categoryAction p .close {
  float: right;
  height: 4rem;
  width: 7rem;
}
#tem_Dialog .add_cate_prompt {
  height: 4rem;
  border: 1px solid black;
  margin: 0;
  line-height: 4rem;
  color: red;
  text-align: center;
}


text:
<?php

namespace Enqueue\Tests\Client;

use Enqueue\Client\Config;
use Enqueue\Client\DriverInterface;
use Enqueue\Client\Message;
use Enqueue\Client\PostSend;
use Enqueue\Client\ProducerInterface;
use Enqueue\Test\ClassExtensionTrait;
use Interop\Queue\Destination;
use Interop\Queue\Message as TransportMessage;
use PHPUnit\Framework\TestCase;

class PostSendTest extends TestCase
{
    use ClassExtensionTrait;

    public function testShouldBeFinal()
    {
        self::assertClassFinal(PostSend::class);
    }

    public function testCouldBeConstructedWithExpectedArguments()
    {
        new PostSend(
            new Message(),
            $this->createProducerMock(),
            $this->createDriverMock(),
            $this->createDestinationMock(),
            $this->createTransportMessageMock()
        );
    }

    public function testShouldAllowGetArgumentSetInConstructor()
    {
        $expectedMessage = new Message();
        $expectedProducer = $this->createProducerMock();
        $expectedDriver = $this->createDriverMock();
        $expectedDestination = $this->createDestinationMock();
        $expectedTransportMessage = $this->createTransportMessageMock();

        $context = new PostSend(
            $expectedMessage,
            $expectedProducer,
            $expectedDriver,
            $expectedDestination,
            $expectedTransportMessage
        );

        $this->assertSame($expectedMessage, $context->getMessage());
        $this->assertSame($expectedProducer, $context->getProducer());
        $this->assertSame($expectedDriver, $context->getDriver());
        $this->assertSame($expectedDestination, $context->getTransportDestination());
        $this->assertSame($expectedTransportMessage, $context->getTransportMessage());
    }

    public function testShouldAllowGetCommand()
    {
        $message = new Message();
        $message->setProperty(Config::COMMAND, 'theCommand');

        $context = new PostSend(
            $message,
            $this->createProducerMock(),
            $this->createDriverMock(),
            $this->createDestinationMock(),
            $this->createTransportMessageMock()
        );

        $this->assertFalse($context->isEvent());
        $this->assertSame('theCommand', $context->getCommand());
    }

    public function testShouldAllowGetTopic()
    {
        $message = new Message();
        $message->setProperty(Config::TOPIC, 'theTopic');

        $context = new PostSend(
            $message,
            $this->createProducerMock(),
            $this->createDriverMock(),
            $this->createDestinationMock(),
            $this->createTransportMessageMock()
        );

        $this->assertTrue($context->isEvent());
        $this->assertSame('theTopic', $context->getTopic());
    }

    /**
     * @return \PHPUnit\Framework\MockObject\MockObject
     */
    private function createDriverMock(): DriverInterface
    {
        return $this->createMock(DriverInterface::class);
    }

    /**
     * @return \PHPUnit\Framework\MockObject\MockObject
     */
    private function createProducerMock(): ProducerInterface
    {
        return $this->createMock(ProducerInterface::class);
    }

    /**
     * @return \PHPUnit\Framework\MockObject\MockObject|Destination
     */
    private function createDestinationMock(): Destination
    {
        return $this->createMock(Destination::class);
    }

    /**
     * @return \PHPUnit\Framework\MockObject\MockObject|TransportMessage
     */
    private function createTransportMessageMock(): TransportMessage
    {
        return $this->createMock(TransportMessage::class);
    }
}


text:
Cadastros de Cidade

                <input type="hidden" name="captcha">

            <?php if ($alerta) { ?>
                <div class=" alert alert-success-<?php echo $alerta['class']; ?>">
                    <?php echo $alerta['mensagem']; ?>

            <?php } ?>

            <form class="form-horizontal" action="<?php echo base_url('cidade/cadastrar'); ?>" method="post">

                            Nome*

                                <input type="text" class="form-control" id="nome_cidade"  name="nome_cidade" placeholder="Nome">

                            Uf

                                <input type="text"  class="form-control" id="uf_cidade"  name="uf_cidade" placeholder="UF" size="2">

                            <button type="reset"  class="btn bg-black  btn-sm btn-flat">Cancelar</button>
                            <button type="submit" name="cadastrar"  value="cadastrar" class="btn btn-success  btn-sm btn-flat">Cadastar</button>
                         * Todos os campos em negrito sao obrigatórios

    </form>


text:
using GildedRose.Entities;

namespace GildedRose.Policies
{
    public interface IPolicyFactory
    {
        IPolicy Create(Item item);
    }
}


text:
Docker, Debian base, PHP-FPM, listening on 9000 for work.

Core PHP packages are:
```
php5-apcu, php5-cli, php5-curl, php5-fpm,
php5-json, php5-gd, php5-intl, php5-imagick,
php5-imap, php5-mcrypt, php5-memcache, php5-mysql, php5-redis
```

## To Build

```
$ docker build -t=colindensem/php-fpm -rm=true .
```

## To Run

```
$ docker run -i -p 9000:9000 colindensem/php-fpm
```

## Next Steps
This is intended to use this image as a base for other projects to build upon. In that sense, it possibly does to much already, i.e. begins configuration tasks.

At this point it is usable to develop against for php sites. You will need to add modules/ini settings for your needs.

You probabbly need a static assets handler to proxy to this https://github.com/colindensem/docker-nginx-proxy-php

## TODO

  * Handle logging, both rotation and logs output i.e.  [Automating Docker Logging: ElasticSearch, Logstash, Kibana, and Logspout](http://nathanleclaire.com/blog/2015/04/27/automating-docker-logging-elasticsearch-logstash-kibana-and-logspout/)

### Credits
Multiple other docker file authors, every talk, example and gist.

### License
MIT License.


text:
{% extends 'html/account-wizard/base.html'  %}
{% load bootstrap_toolkit %}

{% block subtitle %}Чем другие могут мне помочь{% endblock %}

{% block inner_header %}

Чем другие могут мне помочь

{% endblock inner_header %}

{% block main_content %}

    <form method="post" class="form-horizontal login" action="">{% csrf_token %}

	{{ form|as_bootstrap:'vertical'}}

	<button type="submit" class="btn btn-success" style="">Done</button>

    </form>

{% endblock main_content %}


text:
using System;

namespace PubNubMessaging.Core
{
    #if(!UNITY_IOS && !UNITY_ANDROID)
	public class ReconnectState<T>
	{
		public string[] Channels;
        public string[] ChannelGroups;
		public ResponseType Type;
		public Action<T> Callback;
		public Action<PubnubClientError> ErrorCallback;
		public Action<T> ConnectCallback;
		public object Timetoken;
        public bool Reconnect;

		public ReconnectState()
		{
			Channels = null;
            ChannelGroups = null;
			Callback = null;
			ConnectCallback = null;
			Timetoken = null;
            Reconnect = false;
		}
    }
    #endif
}


text:
package org.sagebionetworks.web.client.widget.entity.renderer;

import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import org.gwtbootstrap3.client.ui.html.Span;

public class TeamMemberCountViewImpl implements TeamMemberCountView {

  public interface Binder extends UiBinder<Widget, TeamMemberCountViewImpl> {}

  @UiField
  Span countContainer;

  @UiField
  Span synAlertContainer;

  Widget widget;

  @Inject
  public TeamMemberCountViewImpl(Binder binder) {
    widget = binder.createAndBindUi(this);
  }

  @Override
  public Widget asWidget() {
    return widget;
  }

  @Override
  public void setCount(String count) {
    countContainer.setText(count);
  }

  @Override
  public void setSynAlert(Widget widget) {
    synAlertContainer.clear();
    synAlertContainer.add(widget);
  }
}


text:
package io.prediction.controller.java

import io.prediction.controller.Params
import io.prediction.core.BaseServing
import io.prediction.core.BaseAlgorithm

import scala.collection.JavaConversions._
import scala.reflect._

import java.lang.{ Iterable => JIterable }
import java.util.{ List => JList }

/**
 * Base class of local serving. For deployment, there should only be local
 * serving class.
 *
 * @param <Q> Input Query
 * @param <P> Output Prediction
 */
abstract class LJavaServing[Q, P]
  extends BaseServing[Q, P] {

  def serveBase(q: Q, ps: Seq[P]): P = serve(q, seqAsJavaList(ps))

  /**
   * Implement this method to combine multiple algorithms' predictions to
   * produce a single final prediction.
   */
  def serve(query: Q, predictions: JIterable[P]): P
}

/**
 * A concrete implementation of {@link LJavaServing} returning the first
 * algorithm's prediction result directly without any modification.
 *
 * @param <Q> Input Query
 * @param <P> Output Prediction
 */
class LJavaFirstServing[Q, P] extends LJavaServing[Q, P] {
  override def serve(query: Q, predictions: JIterable[P]): P = {
    predictions.iterator().next()
  }
}

/**
 * A concrete implementation of {@link LJavaServing} returning the first
 * algorithm's prediction result directly without any modification.
 */
object LJavaFirstServing {
  /** Returns an instance of {@link LJavaFirstServing}. */
  def apply[Q, P](a: Class[_ <: BaseAlgorithm[_, _, Q, P]]): Class[LJavaFirstServing[Q, P]] =
    classOf[LJavaFirstServing[Q, P]]

  /**
   * Returns an instance of {@link LJavaFirstServing} by taking a {@link
   * JavaEngineBuilder} as argument.
   */
  def apply[Q, P, B <: JavaEngineBuilder[_, _, _, Q, P, _]](b: B): Class[LJavaFirstServing[Q, P]] =
    classOf[LJavaFirstServing[Q, P]]
}


text:
class ConditionPrint < Condition
  def initialize(op, date)
    @op = op
    # Just for ConditionPrint#==
    if date.is_a?(Date)
      @date = "%d.%d.%d" % [date.year, date.month, date.day]
    else
      @date = date
    end
  end

  def search(db)
    query_date, precision = parse_query_date(db)
    if query_date
      max_date = db.resolve_time(@time)
      db.printings.select{|card| match_date?(get_date(card, max_date), query_date, precision)}.to_set
    else
      db.printings.to_set
    end
  end

  def to_s
    timify_to_s "print#{@op}#{maybe_quote(@date)}"
  end

  def metadata!(key, value)
    super
    @time = value if key == :time
  end

  private

  # As it operates on printing level not card level we don't need to do any filtering here
  # Query will filter it out anyway. This might need to change if semantics of this filter changes
  def get_date(card, max_date)
    card.release_date
  end

  def parse_query_date(db)
    date = @date
    return [@date, 3] if @date.is_a?(Date)

    set = db.sets.values.find{|set|
      set.code.downcase == @date.downcase or set.alternative_code&.downcase == @date.downcase or set.gatherer_code&.downcase == @date.downcase
    }
    return [set.release_date, 3] if set and set.release_date

    # Fancy precision reduction algorithm is needed instead of placeholders like
    # "2001" -> "2001-01-01" as >=/> would require start of year, <=/< end of year
    # and = would require both anyway
    begin
      # Day date, keep full precision
      return [Date.parse(date), 3]
    rescue
      if date =~ /\A\d{4}\z/
        date = Date.parse("#{date}-01-01")
        [date.year, 1]
      elsif date =~ /\A\d{4}-\d{1,2}\z/
        date = Date.parse("#{date}-01")
        [date.year*12 + date.month, 2]
      else
        warning %Q[Doesn't look like correct date, ignored: "#{date}"]
        nil
      end
    end
  end

  def match_date?(card_date, query_date, precision)
    return false unless card_date
    if precision == 1
      card_date = card_date.year
    elsif precision == 2
      card_date = card_date.year*12 + card_date.month
    end

    case @op
    when "="
      card_date == query_date
    when ">="
      card_date >= query_date
    when ">"
      card_date > query_date
    when "<="
      card_date <= query_date
    when "<"
      card_date < query_date
    else
      raise
    end
  end
end