text:
\section{Conversaci\'on cnp4.txt}
\begin{verbatim}
pues ya con eso XD

sera?
sí
cualquier cosa yo me responsabilizo
con reyna que es mi amor

e calmate calmate
XD

faltaria el documento vision

 y el diagrama

pero ya los estoy asignando

peroooo

los casos de uso
estoy haciendo la visión

si son diagramas de casos de us no?
sip

no deja a cardoza

jeje no a hecho much
entonces qué lo haga él?

pues si no?

o com ves?
pues va
sí está bienn

y a carlos lo pngo a hacer los diagramas no?
sí

sguro que todo lo demas no?
pues con eso esta bien

mm Vista Lógica
Diagrama de clases
Modelo E-R (Si el sistema así lo requiere)
Vista de Implementación
Diagrama de Secuencia
Diagrama de estados
Diagrama de Colaboración

no?
yo digo que tambíen pero es mucho ._.

mm si eso si

el diagrama de clases no?

o el de e -r
es más importante el de clases.

ok

va

entonces mañana leemos muero de sueño

descansa
vale
27 May 2013 10:29

en cuanto estes avisame porfa ^^

emaaaaa

!!!
que paso

de los diagramas cual serian los mas mportantes a haer

hacer

?

porque carlos esta haciendo el diagrama de requisitos

y anahi modificando el de actividades
sólo lo importante.

por eso

con esos estara bien?

o hara falta algo de vista logica o vista implementacion?
yo digo que con eso está bien.

mmm ok

buno

y como viste la vision??

jejeje
pues está bien

enserio?
sí

ok

entonces lo pondre nada mas asi

mmm

ahroita lo subo y le das una checada
sí
ahorita me conecto
me ire a la escuela.

ok
27 May 2013 23:51
oye va a ser Yoshian quien firme ?

hii

aaa chinga no no
así esta el formato

ssi ya vi ahorita le digo
oky
28 May 2013 12:20

tas??
29 May 2013 03:58

hiii
hola Itzel

oyep

no tiens el a * y nb de ia?
tengo el a*
pero no tiene interfaz
y el nb yo no tengo el código.

mm ok

amm me lo podrias pasar?
pues sí podría

jaja me lo pasas?
sí
quería jugar tantito para desestresarme XD

jajaja ok ok
aStar.zip

y aprovechando tu noblesa

el activacion inivision??
tampoco fue autor de ese
además mi equipo lo hizo en un microcontrolador

o ya

no pues no

bueno

muchisimas gracias ^^
you're welcome
31 May 2013 05:00
ya duerme un poco Itzel
31 May 2013 08:40

jejeje ya estaba dormida
1 June 2013 22:09

emanueeel
2 June 2013 00:42
hola Itzel

q ondas q haciendo?
mi proyecto de extra de web

aaa ok

oyep ya tienes con quien hacer tt ??
sí Itezel
Itzel*
ya tengo equipo

o ya

oki ^^
le vas a decir a Pacheco?

mm no creo

jejeje

pensaba pero no
a quien le vas a decir?

pues a los dorante

jejeje creo
no lo conozco XD

jeje ni yo

XD
ya se quienes son
Martha Rosa y su esposo

ajap
3 June 2013 03:40
que onda Itzel
no tendrás por ahí algun contacto para conseguir trabajo en vacaiones.
6 June 2013 11:16

hii emanuel

pues si se de 2

uno es como programador web

y el otro es como promotor de cirugias para ojos en cualquier bodega o walmart cerca de tu casa
hola Itzel
el de programador cómo está el asunto?

pues tendrias q hablar directamente con el encargado

deja le digo
pero espera
si es temporal¡
?

sip
bueno

listo ya te agregue en una conversacion
ok gracias.

sip denada
gracias Itzel
creo que si conosco al compañero.

genial

eso es todo

^^

me alegra y pues es muy flexible en realidad
7 September 2013 23:44

hiii
hola Itzel!

q haciendo?
XD diiía que tarea pero sería mentir
diría *

jajajajaajaja muy buena esa
XD
y tú que haciendo Itzel?

pues lo de reconocimiento segun

jajajajaja

entre eso y el face ya sabes
que llevas de patrones?

q se vea

q se vea en colores

dividirlos en bandera
qué tanto es?

pues segun lo que veo

Ver imagen
ver por colores
banderas
Histogramas/contraccion-expansion
Distancia
Y el otro clasificador
también quiere clasificadores?

pues dicen q si

no se
según yo son las puras imágenes

hasta las banderas?
creo que sí
no estoy seguro D:

jajaja pues no se por eso e estado preguntando asi a varios
10 September 2013 14:30
pasa las respuestas XD

jajaja si me las supiera con gusto

pero stoy un poco perdida en esta materia

bueno las primera creo q es asi

z(:,:,1);
z(:,:,2)=0;
z(:,:,3)=0;

imshow(z);
impixel(z,134,167)

pasa las demas
nunca había hecho un examen tan ambiguo

jajaja ni yo

y en face

 no ma

no tienes el arreglo?
no :c

pff no mams moriremos

el clasificador ya te quedo?
no
pero lo importante es que tenemos salud

jajajaj ano mams

no

*
2 October 2013 09:36

hiii
2 October 2013 12:24
hola Itzel.
2 October 2013 22:51

q haciendo?
un reporte de aplicaciones XD
y tú

o que padre

jeje lo mismo

pero no tengo la practica

u.u

no la pasas?
la saqué de aquí
http://pcc.uasnet.mx/~ifvega/docencia/licenciatura/tpa/mxm_pthreads.c
XD
la otra no me quedó

jejej ok
pero de algo a nada

cual el inciso a?
es mejor algo XD

si eso si
sí
es el A

a perfectisimo

grax ^^
6 October 2013 23:53

hiii
Hola Itzel

q haciendo?
para que te digo que tarea Itzel
si estoy perdiendo mi tiempo en face
xD

jajajajajaaj

eso es ser sincero carajo

por cierto como se ejecuta el ejemplo q me mandaste?
ahí viene cómo
en la descripción está entre comentarios
se le pone la bandera
-lpthread
o algo así

a si pero para ejecutarlo me marca un error q no se q onda

jajajaja
qué te dice?

espera deja lo vuelvo a abrir

segmentation fault
ese tipo de errores como los odio

jaja si yo tambieen

aparte q creo q no tenia para impimir los datos
eso se lo pones con un for
algo así

sip

ok veamos si solo es eso

mira riet  un rato

https://www.facebook.com/photo.php?v=668044416545164&set=vb.132942833433364&type=2&theater
jajaja

mm no me sigue dando el mismo error
ya viste todo el código?

sip ya
es que a mi si me dio sin ese errr
error
y es el mismo

mmm rayos

asi tal cual copiaste y pegaste?
e hice la de imprimir

mmm ok
16 October 2013 23:47
que le echaron pleito al de redes Itzel XD
?

un wey medio mamon

le dijo q no enseña nada

y q esta mal q se procupe por que todos aprendamos q s pase los temas y solo de un ejemplo

entonces pues le pare su carrito
y qué dijo el profe D:

pues q estaba bien las opiniones q si todos los demas estabamos deacuerdo

y pues todos asi de

NO
en acuerdo con el chavo ?

osea todo estabamos en desacuerdo con el
 pues según el profe habla maravillas de sus otros dos grupos

??

jajaja a nosotros nos dice q somos unos huevones q tenemos mucho potencial pero nos gana la hueva
y quién fue el amigo que le echo pleito ?
XD

el novio de esta chica

https://www.facebook.com/blankazucenalg?fref=ts
pues quien sabe quien sea
y si se puso la situación tensa como dice fernando?

si la neta si

porque ese wey diciendole

y el prof aguantando

defendiendose

y pues ni terminabamos el codigo

y todos con ganas de decirle ya callate cabron
pues que mal plan
a mi me cae bien el profe
aunque sí le hace falta algo a sus clases
le echa ganas
para ser su primer semestre

si a mi tambien me cae bien

y pues es logico q de repente se le vaya la onda

yo creo q trata de hacer su mejor ezfuerso y pues tambien luego nosotros no cooperamos
 mi moral me dice ahora
que haga sus prácticas.

si

yo desde el principio

pro esq de verdad no le entendia nada

nunk habia visto sockets
es que sí estan medio talachudas sus practicas
pero al menos volvio a nacer en mi
el amor haacia C
XD

si la neta si

pero pues si rifa

jejeje
pues es administración UNIX
ya ni pacheco XD

si no ma

pacheco me descepciono la verdad u.u
sí
un poco
22 October 2013 00:42

hiiii
Hola Itzel!

q haciendo?
pues ya me iba a ir a dormir XD

a perdon una pregunta rapidisima

q hicieron hoy en reconocimiento

??
vimos algo de características
y dijo algo sobre el proyecto
mañana le preguntamos bien.

mmm ok

si mañana si ya vo
XD
pero no te preocupes
así importante
importante
no vimos algo XD

wiiii genial

muchisimas gracias ^^
de nada
nos vemos Itzel
hasta mañana

sipi descansa buenas noches
gracias igual tú descansa.
29 October 2013 09:58

hiii
hola Itzel!

q onda ya listo para el examen
naa XD

jajaj no ma

ya se dieron por vencidos?
pues tendremos que salvarla de alguna manera
pero...
pues aun trabajamos en eso XD

jajajajajaj no bueno

y q si entregaran las pracitas?
pues ahorita no tenemos alguna

no ma  canijos

pues ocn q las entreguen
pero no tenemos alguna Itzel XD

jajajajaj pues si caray
29 October 2013 14:37
cómo vas=
?

pues mal

jejeje

tu?
\end{verbatim}


text:
from datetime import datetime
import logging
import os.path
import yaml

from osc_lib.i18n import _

from tripleoclient import command
from tripleoclient import export
from tripleoclient import utils

class ExportOvercloud(command.Command):
    """Export stack information used as import of another stack"""

    log = logging.getLogger(__name__ + ".ExportOvercloud")
    now = datetime.now().strftime('%Y%m%d%H%M%S')

    def get_parser(self, prog_name):
        parser = super(ExportOvercloud, self).get_parser(prog_name)
        parser.add_argument('--stack',
                            dest='stack',
                            metavar='<stack>',
                            help=_('Name of the environment main Heat stack '
                                   'to export information from. '
                                   '(default=overcloud)'),
                            default='overcloud')
        parser.add_argument('--output-file', '-o', metavar='<output file>',
                            help=_('Name of the output file for the stack '
                                   'data export. It will default to '
                                   '"<name>.yaml"'))
        parser.add_argument('--force-overwrite', '-f', action='store_true',
                            default=False,
                            help=_('Overwrite output file if it exists.'))
        parser.add_argument(
            '--working-dir',
            action='store',
            help=_('The working directory for the deployment where all '
                   'input, output, and generated files are stored.\n'
                   'Defaults to "$HOME/overcloud-deploy/<stack>"'))
        parser.add_argument('--config-download-dir',
                            action='store',
                            help=_('Directory to search for config-download '
                                   'export data. Defaults to $HOME/'
                                   'overcloud-deploy/<stack>/config-download'))
        parser.add_argument('--no-password-excludes',
                            action='store_true',
                            dest='no_password_excludes',
                            help=_('Don''t exclude certain passwords from '
                                   'the password export. Defaults to False '
                                   'in that some passwords will be excluded '
                                   'that are not typically necessary.'))

        return parser

    def take_action(self, parsed_args):
        self.log.debug("take_action(%s)" % parsed_args)

        stack = parsed_args.stack
        self.log.info('Running at %s with parameters %s',
                      self.now,
                      parsed_args)

        if not parsed_args.working_dir:
            working_dir = utils.get_default_working_dir(stack)
        else:
            working_dir = parsed_args.working_dir

        if not parsed_args.config_download_dir:
            config_download_dir = os.path.join(os.environ.get('HOME'),
                                               "overcloud-deploy",
                                               parsed_args.stack,
                                               'config-download')
        else:
            config_download_dir = parsed_args.config_download_dir

        output_file = parsed_args.output_file or os.path.join(
            working_dir,
            '{}-export.yaml'.format(
                parsed_args.stack
            )
        )
        export_file_path = os.path.abspath(
            os.path.expanduser(
                output_file
            )
        )
        if (os.path.exists(export_file_path) and
                not parsed_args.force_overwrite):
            raise Exception(
                "File '%s' already exists, not exporting." % export_file_path)

        data = export.export_overcloud(
            working_dir, stack, excludes=not parsed_args.no_password_excludes,
            should_filter=False, config_download_dir=config_download_dir)
        # write the exported data
        with open(export_file_path, 'w') as f:
            yaml.safe_dump(data, f, default_flow_style=False)

        print("Stack information exported to %s." % export_file_path)

redpajama_set_name: RedPajamaGithub


text:
function match_media_mount(){
window.matchMedia = window.matchMedia || (function(doc, undefined){

  var docElem  = doc.documentElement,
      refNode  = docElem.firstElementChild || docElem.firstChild,
      // fakeBody required for <FF4 when executed in
      fakeBody = doc.createElement('body'),
      div      = doc.createElement('div');

  div.id = 'mq-test-1';
  div.style.cssText = "position:absolute;top:-100em";
  fakeBody.style.background = "none";
  fakeBody.appendChild(div);

  var mqRun = function ( mq ) {
    div.innerHTML = '';
    docElem.insertBefore( fakeBody, refNode );
    bool = div.offsetWidth === 42;
    docElem.removeChild( fakeBody );

    return { matches: bool, media: mq };
  },

  getEmValue = function () {
    var ret,
        body = docElem.body,
        fakeUsed = false;

    div.style.cssText = "position:absolute;font-size:1em;width:1em";

    if( !body ) {
      body = fakeUsed = doc.createElement( "body" );
      body.style.background = "none";
    }

    body.appendChild( div );

    docElem.insertBefore( body, docElem.firstChild );

    if( fakeUsed ) {
      docElem.removeChild( body );
    } else {
      body.removeChild( div );
    }

    //also update eminpx before returning
    ret = eminpx = parseFloat( div.offsetWidth );

    return ret;
  },

  //cached container for 1em value, populated the first time it's needed
  eminpx,

  // verify that we have support for a simple media query
  mqSupport = mqRun( '(min-width: 0px)' ).matches;

  return function ( mq ) {
    if( mqSupport ) {
      return mqRun( mq );
    } else {
      var min = mq.match( /\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ),
          max = mq.match( /\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ),
          minnull = min === null,
          maxnull = max === null,
          currWidth = doc.body.offsetWidth,
          em = 'em';

      if( !!min ) { min = parseFloat( min ) * ( min.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 ); }
      if( !!max ) { max = parseFloat( max ) * ( max.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 ); }

      bool = ( !minnull || !maxnull ) && ( minnull || currWidth >= min ) && ( maxnull || currWidth <= max );

      return { matches: bool, media: mq };
    }
  };

}( document ));

//https://raw.github.com/paulirish/matchMedia.js/master/matchMedia.addListener.js
(function(){if(window.matchMedia&&window.matchMedia("all").addListener){return false}var e=window.matchMedia,t=e("only all").matches,n=false,r=0,i=[],s=function(t){clearTimeout(r);r=setTimeout(function(){for(var t=0,n=i.length;t<n;t++){var r=i[t].mql,s=i[t].listeners||[],o=e(r.media).matches;if(o!==r.matches){r.matches=o;for(var u=0,a=s.length;u<a;u++){s[u].call(window,r)}}}},30)};window.matchMedia=function(r){var o=e(r),u=[],a=0;o.addListener=function(e){if(!t){return}if(!n){n=true;window.addEventListener("resize",s,true)}if(a===0){a=i.push({mql:o,listeners:u})}u.push(e)};o.removeListener=function(e){for(var t=0,n=u.length;t<n;t++){if(u[t]===e){u.splice(t,1)}}};return o}})()
}
var xxx_modalPopupWindow = null;
var popupshowed = false;
var $checkoutbtn = null;
function CreateModalPopUpObject() {
    if (xxx_modalPopupWindow == null) {
        xxx_modalPopupWindow = new ModalPopupWindow();
    }
    return xxx_modalPopupWindow;
}

function ModalPopupWindow() {
    var strOverLayHTML = '

'
    var orginalHeight;
    var orginalWidth;
    var btnStyle="";
    var maximize = false;
	div = document.createElement("div");
	div.innerHTML = strOverLayHTML;
    //document.body.appendChild(div);
	document.body.insertBefore(div, document.body.firstChild);

    this.ResizePopUp = function(height, width) {
        var divFrameParent = document.getElementById("divFrameParent");
        var divOverlay = document.getElementById("divOverlay");
        var left = (window.screen.availWidth - width) / 2;
        var top = (window.screen.availHeight - height) / 2;
        var xy = GetScroll();
        if (maximize) {
            left = xy[0] + 10;
            top = xy[1] + 10;
        } else {
            left += xy[0];
            top += xy[1];
        }
        divFrameParent.style.top = top + "px";
        divFrameParent.style.left = left + "px";
        divFrameParent.style.height = height + "px";
        divFrameParent.style.width = width + "px";
		ShowDivInCenter("divFrameParent");
    }
    var onPopUpCloseCallBack = null;
    var callbackArray = null;
    this.SetLoadingImagePath = function (imagePath) {
        document.getElementById("imgOverLayLoading").src = imagePath;
    }
    this.SetCloseButtonImagePath = function (imagePath) {
        //document.getElementById("imgOverLayClose").src = imagePath;
    }

    this.SetButtonStyle = function (_btnStyle) {
      btnStyle =_btnStyle;
    }

    function ApplyBtnStyle(){
    }

    function __InitModalPopUp(height, width, title) {
        orginalWidth = width;
        orginalHeight = height;
        maximize = false;
        var divFrameParent = document.getElementById("divFrameParent");
        var divOverlay = document.getElementById("divOverlay");
        var left = (window.screen.availWidth - width) / 2;
        var top = (window.screen.availHeight - height) / 2;
        var xy = GetScroll();
        left += xy[0];
        top += xy[1];
        document.getElementById("spanOverLayTitle").innerHTML = title;
        divOverlay.style.top = "0px";
        divOverlay.style.left = "0px";
        var e = document;
        var c = "Height";
        var maxHeight = Math.max(e.documentElement["client" + c], e.body["scroll" + c], e.documentElement["scroll" + c], e.body["offset" + c], e.documentElement["offset" + c]);
        c = "Width";
        var maxWidth = Math.max(e.documentElement["client" + c], e.body["scroll" + c], e.documentElement["scroll" + c], e.body["offset" + c], e.documentElement["offset" + c]);
        divOverlay.style.height = maxHeight + "px";
        divOverlay.style.width = maxWidth - 2 + "px";
        divOverlay.style.display = "";
        divFrameParent.style.display = "";
        //$('#divFrameParent').animate({ opacity: 1 }, 2000);
        divFrameParent.style.top = (top-100) + "px";
        divFrameParent.style.left = left + "px";
        divFrameParent.style.height = height + "px";
        divFrameParent.style.width = width + "px";
        onPopUpCloseCallBack = null;
        callbackArray = null;
    }
    this.ShowURL = function (url, height, width, title, onCloseCallBack, callbackFunctionArray, maxmizeBtn) {
    }
    this.ShowMessage = function (message, height, width, title) {
		popupshowed = true;
        __InitModalPopUp(height, width, title);
        document.getElementById("spanMessage").innerHTML = message;
        document.getElementById("divMessage").style.display = "";
        document.getElementById("spanLoading").style.display = "none";
        ApplyBtnStyle();
		ShowDivInCenter("divFrameParent");
    }
    this.ShowConfirmationMessage = function (message, height, width, title, onCloseCallBack, firstButtonText, onFirstButtonClick, secondButtonText, onSecondButtonClick) {
        this.ShowMessage(message, height, width, title);
        var maxWidth = 100;
        document.getElementById("spanMessage").innerHTML = message;
        document.getElementById("divMessage").style.display = "";
        document.getElementById("spanLoading").style.display = "none";
        if (onCloseCallBack != null && onCloseCallBack != '') {
            onPopUpCloseCallBack = onCloseCallBack;
        }
        ApplyBtnStyle();
    }

    function ShowLoading() {
        document.getElementById("spanLoading").style.display = "";
    }
    this.HideModalPopUp = function () {
        var divFrameParent = document.getElementById("divFrameParent");
		popupshowed = false;
        var divOverlay = document.getElementById("divOverlay");
        divOverlay.style.display = "none";
        divFrameParent.style.display = "none";
        if (onPopUpCloseCallBack != null && onPopUpCloseCallBack != '') {
            onPopUpCloseCallBack();
        }
    }
    this.CallCallingWindowFunction = function (index, para) {
        callbackArray[index](para);
    }
    this.ChangeModalPopUpTitle = function (title) {
        document.getElementById("spanOverLayTitle").innerHTML = title;
    }

    function setParentVariable(variableName, variableValue) {
        window[String(variableName)] = variableValue;
    }

    function GetScroll() {
        if (window.pageYOffset != undefined) {
            return [pageXOffset, pageYOffset];
        } else {
            var sx, sy, d = document,
                r = d.documentElement,
                b = d.body;
            sx = r.scrollLeft || b.scrollLeft || 0;
            sy = r.scrollTop || b.scrollTop || 0;
            return [sx, sy];
        }
    }
}

function AddEvent(html_element, event_name, event_function)
{
   if(html_element.attachEvent) //Internet Explorer
      html_element.attachEvent("on" + event_name, function() {event_function.call(html_element);});
   else if(html_element.addEventListener) //Firefox & company
      html_element.addEventListener(event_name, event_function, false); //don't need the 'call' trick because in FF everything already works in the right way
}
var modalWin = null;
function changeBillEvent(){

	if( oldurl == null && typeof payment != 'undefined' && typeof billmateindexurl != 'undefined'){

		oldurl = payment.saveUrl;
		payment.saveUrl = billmateindexurl;
		payment.onComplete = function(res){
			checkout.setLoadWaiting(false);
			eval(res.responseText);
		}
	}
//	if( typeof FireCheckout != 'undefined' && fireoldurl == null ){
//		fireoldurl = checkout.urls.save;
//	}
}
function updateAddress(){
	if( typeof FireCheckout != 'undefined' || typeof Lightcheckout != 'undefined' || typeof checkout.form != 'undefined'){
		if( typeof checkout.form == 'undefined'){
			params = Form.serialize(checkoutForm.form.id);
		} else if(typeof checkout.form != 'undefined'){
			params = Form.serialize(checkout.form);
		}
		checkout.setLoadWaiting(true);
		new Ajax.Request(billmatesaveurl, {
			method: 'post',
			parameters: params,
			onSuccess: function(res) {
				checkout.setLoadWaiting(false);
				eval(res.responseText);
			}
		});
	}else {
		payment.saveUrl = billmatesaveurl;
		payment.onComplete = function(res){
			eval(res.responseText);
			modalWin.HideModalPopUp();
		}
		payment.save();
	}
}
function afterSave(){
	if(typeof $checkoutbtn == 'function' ){
		$checkoutbtn.call();
	}
}
function closefunc(obj){
	checkout.setLoadWaiting(false);
	modalWin.HideModalPopUp();
}
function reviewstep(){
}
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g, '');};

function checkAddress(){
	var paymentInputObjects = $$('[name="payment[method]"]:checked');
	var selectedGateway = paymentInputObjects.length > 0 ? paymentInputObjects[0].value : '';

	if( selectedGateway != 'billmateinvoice' && selectedGateway!='partpayment' && !onchange_person_number){
		afterSave();
		return;
	}

	if(
		( typeof checkout == 'undefined' || typeof checkout.form == 'undefined' )
		&& ( typeof checkoutForm == 'undefined' || typeof checkoutForm.form.id == 'undefined' )
	   ){
		 return false;
		}
	if( typeof checkout.form == 'undefined'){
		params = Form.serialize(checkoutForm.form.id);
	} else if(typeof checkout.form != 'undefined'){
		params = Form.serialize(checkout.form);
	}

	checkout.setLoadWaiting(true);

	url = billmateindexurl;
	if( onchange_person_number ) {
		params += '&pophide=true';
	}
	new Ajax.Request(url, {
		method: 'post',
		parameters: params,
		onSuccess: function(res) {
			checkout.setLoadWaiting(false);
			eval(res.responseText);
		}
	});
}
var onchange_person_number = false;
function paymentSave(){
	if( onchange_person_number ) return false;

	if(typeof checkout.form == 'undefined'){
		checkout.setLoadWaiting(false);
		payment.saveUrl = oldurl;
		payment.onComplete = function(){
			checkout.setLoadWaiting(false);
			payment.saveUrl = billmateindexurl;
			payment.onComplete = function(res){
				checkout.setLoadWaiting(false);
				eval(res.responseText);
			}
		};
		payment.save();
	}else{
		if( typeof FireCheckout != 'undefined' ){
			checkout.save();
		}
	}
}
function selectDropDown(mySelect, value){
	var optCount      = mySelect.options.length;
	var reverseLookup = {};
	for (var i = 0; i < optCount; i++)
	{
	  var option = mySelect.options[i];
	  if( option.value == value ){
		mySelect.selectedIndex = i;
	  }
	}
}
function ShowMessage(content,wtitle){
	if(matchMedia('(max-width: 800px)').matches){
		modalWin.ShowMessage(content,370,250,wtitle);
	}else if(matchMedia('(min-width: 800px)').matches){
		modalWin.ShowMessage(content,240,500,wtitle);
	}else{
	}
}
AddEvent(window,'resize',function(){
	if( popupshowed ){
		if(matchMedia('(max-width: 800px)').matches){
			modalWin.ResizePopUp(370,250);
		}else if(matchMedia('(min-width: 800px)').matches){
			modalWin.ResizePopUp(240,500);
		}
	}
});

Element.prototype.triggerEvent = function(eventName)
{
    if (document.createEvent)
    {
        var evt = document.createEvent('HTMLEvents');
        evt.initEvent(eventName, true, true);
        return this.dispatchEvent(evt);
    }
    if (this.fireEvent)
        return this.fireEvent('on' + eventName);
}
function SaveAddress(){
	var a = jQuery.each(jQuery("#billing-address input, #shipping-address input"),function(){
		if(this.id != 'billing:postcode' && this.id != 'shipping:postcode' && this.id!= 'billing:person_number'){
			jQuery(this).change(function(){
			  $('billing:postcode').triggerEvent('change');
			  //$('payment-method-reset').triggerEvent('click')
			});
		}
	});
}
AddEvent(window, 'load', function(){
	match_media_mount();
	if( document.getElementById("billing:person_number") != null ){
		AddEvent(document.getElementById("billing:person_number"),'change', function(){
			$person = document.getElementById("billing:person_number").value.trim();
			if( $person  == '' ) return false;
			onchange_person_number = true;
			checkAddress();
		})
	}else {
		jQuery('.payment_person_number').show();
	}
	if ($('billing_person_number')) {
		$('billing_person_number').observe('click', billmateGetAddress);
	}

	if(typeof checkout!= 'undefined' && typeof checkout.form == 'undefined'){
		changeBillEvent();
	}
	modalWin = new CreateModalPopUpObject();
	if( $$('#checkout-review-submit .btn-checkout').length > 0 ){
		SaveAddress();
		$checkoutbtn = $$('#checkout-review-submit .btn-checkout')[0].onclick;
		$$('#checkout-review-submit .btn-checkout')[0].onclick = function(){ onchange_person_number = false; checkAddress(); };
	}
});
function billmateGetAddress(e){
	Event.stop(e);
	onchange_person_number = true;
	checkAddress();
}
function ShowDivInCenter(divId)
{
    try
    {
		var div = document.getElementById(divId);
		divWidth = document.getElementById("divFrameParent").offsetWidth;
        divHeight = document.getElementById("divFrameParent").offsetHeight;

        // Get the x and y coordinates of the center in output browser's window
        var centerX, centerY;
        if (self.innerHeight)
        {
            centerX = self.innerWidth;
            centerY = self.innerHeight;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        {
            centerX = document.documentElement.clientWidth;
            centerY = document.documentElement.clientHeight;
        }
        else if (document.body)
        {
            centerX = document.body.clientWidth;
            centerY = document.body.clientHeight;
        }

        var offsetLeft = (centerX - divWidth) / 2;
        var offsetTop = (centerY - divHeight) / 2;

        // The initial width and height of the div can be set in the
        // style sheet with display:none; divid is passed as an argument to // the function
        var ojbDiv = document.getElementById(divId);

        left = (offsetLeft) / 2 + window.scrollX;
        top = (offsetTop) / 2 + window.scrollY;

        ojbDiv.style.position = 'absolute';
        ojbDiv.style.top = top + 'px';
        ojbDiv.style.left = offsetLeft + 'px';
        ojbDiv.style.display = "block";

    }
    catch (e) {}
}

function Action1(){
alert('Action1 is excuted');
modalWin.HideModalPopUp();
}

function Action2(){
alert('Action2 is excuted');
modalWin.HideModalPopUp();
}

function EnrollNow(msg){
modalWin.HideModalPopUp();
modalWin.ShowMessage(msg,200,400,'User Information',null,null);
}

function EnrollLater(){
modalWin.HideModalPopUp();
modalWin.ShowMessage(msg,200,400,'User Information',null,null);
}


text:
package org.informagen.oswf.simulator.server;

// DTO
import org.informagen.oswf.simulator.dto.ProcessDescriptorSummary;
import org.informagen.oswf.simulator.dto.ProcessInstance;
import org.informagen.oswf.simulator.dto.ProcessInstanceState;
import org.informagen.oswf.simulator.dto.Action;
import org.informagen.oswf.simulator.dto.Step;
import org.informagen.oswf.simulator.dto.ProcessVariable;
import org.informagen.oswf.simulator.dto.StepActions;
import org.informagen.oswf.simulator.dto.Overview;

// OSWf - Interfaces
import org.informagen.oswf.OSWfEngine;
import org.informagen.oswf.OSWfConfiguration;

// OSWf - SPI, Util
import org.informagen.oswf.impl.DefaultOSWfEngine;
import org.informagen.oswf.impl.DefaultOSWfConfiguration;

// OSWf - Descriptors
import org.informagen.oswf.descriptors.WorkflowDescriptor;
import org.informagen.oswf.descriptors.ActionDescriptor;
import org.informagen.oswf.descriptors.StepDescriptor;

// OSWf - Query
import org.informagen.oswf.query.FieldExpression;
import org.informagen.oswf.query.Context;
import org.informagen.oswf.query.Field;
import org.informagen.oswf.query.Operator;
import org.informagen.oswf.query.WorkflowExpressionQuery;

// OSWf - Exceptions
import org.informagen.oswf.exceptions.WorkflowException;
import org.informagen.oswf.exceptions.WorkflowLoaderException;
import org.informagen.oswf.exceptions.InvalidInputException;
import org.informagen.oswf.exceptions.InvalidActionException;

// OSWf - PropertSet
import org.informagen.oswf.PersistentVars;
import org.informagen.oswf.Type;
import org.informagen.oswf.exceptions.InvalidValueTypeException;

// Application - RPC
import org.informagen.oswf.simulator.rpc.OSWfService;
import org.informagen.oswf.simulator.rpc.ServiceException;

// Simple Logging Facade
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

// Java - Text
import java.text.SimpleDateFormat;

// Java - Collections
import java.util.Collections;
import java.util.Set;
import java.util.Map;
import java.util.List;
import java.util.ArrayList;

// Java - util
import java.util.Date;

import static java.util.Collections.EMPTY_MAP;

// Google DI Annotation
import com.google.inject.Inject;

public class OSWfServiceImpl implements OSWfService {

    private static Logger logger = LoggerFactory.getLogger(OSWfServiceImpl.class);
    private static Logger startupLogger = LoggerFactory.getLogger("StartupLogger");

    protected static SimpleDateFormat dateFormatter = new SimpleDateFormat("dd-MMM-yy HH:mm");

    private OSWfConfiguration configuration;
    private final OSWfEngine wfEngine;

    @Inject
    public OSWfServiceImpl(OSWfConfiguration configuration) {
        this.configuration = configuration;
        startupLogger.info("Configuring OSWfService");

        wfEngine = new DefaultOSWfEngine("reporter");
        wfEngine.setConfiguration(configuration);
    }

    public List<ProcessDescriptorSummary> fetchWorkflowListing() throws ServiceException {

        List<ProcessDescriptorSummary> list = new ArrayList<ProcessDescriptorSummary>();

        try {

            Set<String> names = configuration.getWorkflowNames();

            for(String name : names) {

                WorkflowDescriptor wd;

                try {
                    wd = configuration.getWorkflow(name);
                } catch (WorkflowLoaderException workflowLoaderException) {

                    // Just log an error but keep reading workflow descriptions
                    logger.error(workflowLoaderException.getMessage());
                    continue;
                }

                list.add(new ProcessDescriptorSummary()
                    .name(wd.getWorkflowName())
                    .initialActionCount(wd.getInitialActions().size())
                    .stepCount(wd.getSteps().size())
                    .splitCount(wd.getSplits().size())
                    .joinCount(wd.getJoins().size())
                    .piCount(fetchProcessInstancesList(name).size())
                );
            }

        } catch (WorkflowLoaderException workflowLoaderException) {
            throw new ServiceException(workflowLoaderException.getMessage());
        }

        Collections.sort(list);
        return list;

    }

    public List<ProcessInstance> fetchProcessInstances(String workflowName) throws ServiceException {

        List<ProcessInstance> list = new ArrayList<ProcessInstance>();

        for(Long piid : fetchProcessInstancesList(workflowName))
            list.add(new ProcessInstance()
                .piid(piid)
                .state(wfEngine.getProcessInstanceState(piid).getName())
                .currentStepCount(wfEngine.getCurrentSteps(piid).size())
                .historyStepCount(wfEngine.getHistorySteps(piid).size())
            );

        return list;
    }

    private List<Long> fetchProcessInstancesList(String workflowName) throws ServiceException {

        FieldExpression activeProcessInstances = new FieldExpression(
            Context.ENTRY,
            Field.NAME,  Operator.EQUALS, workflowName
        );

        try {

            WorkflowExpressionQuery query = new WorkflowExpressionQuery(activeProcessInstances);
            return wfEngine.query(query);

        } catch (WorkflowException workflowException) {
            throw new ServiceException(workflowException.getMessage());
        }

    }

    public List<Action> fetchInitialActions(String workflowName)  throws ServiceException {

        List<Action> list = new ArrayList<Action>();

        try {
            WorkflowDescriptor wd = configuration.getWorkflow(workflowName);

            for(ActionDescriptor action : wd.getInitialActions())
               list.add( new Action(action.getId(), action.getName()) );

        } catch (WorkflowLoaderException workflowLoaderException) {
            throw new ServiceException(workflowLoaderException.getMessage());
        }

        Collections.sort(list);

        return list;

    }

    public ProcessInstanceState fetchProcessInstanceState(long piid)  throws ServiceException {

       ProcessInstanceState dto = new ProcessInstanceState();

       WorkflowDescriptor wfDescriptor = wfEngine.getWorkflowDescriptor(wfEngine.getWorkflowName(piid));

       // Current Steps
       for(org.informagen.oswf.Step step : wfEngine.getCurrentSteps(piid))
            dto.addCurrentStep(new Step()
                .id(step.getId())
                .name(wfDescriptor.getStep(step.getStepId()).getName())
                .status(step.getStatus())
                .owner(step.getOwner())
                .startDate(step.getStartDate() == null ? "" : dateFormatter.format(step.getStartDate()))
                .dueDate(step.getDueDate() == null ? "" : dateFormatter.format(step.getDueDate()))
           );

       // History Steps
       for(org.informagen.oswf.Step step : wfEngine.getHistorySteps(piid))
            dto.addHistoryStep(new Step()
                .id(step.getId())
                .name(wfDescriptor.getStep(step.getStepId()).getName())
                .status(step.getStatus())
                .actor(step.getActor())
                .action( wfDescriptor.getAction(step.getActionId()) == null ? "" :
                         wfDescriptor.getAction(step.getActionId()).getName() )
                .startDate(step.getStartDate() == null ? "" : dateFormatter.format(step.getStartDate()))
                .finishDate(step.getFinishDate() == null ? "" : dateFormatter.format(step.getFinishDate()))
           );

       // Process Variables; interate over all types but access as 'String' for display
       try {

           PersistentVars persistentVars = wfEngine.getPersistentVars(piid);

           for(Type type : Type.getTypes())
               for(String key : persistentVars.getKeys(type) )
                   dto.addProcessVariable(new ProcessVariable()
                      .name(key)
                      .type(type.getName())
                      .value(persistentVars.getString(key))
                   );

       } catch (InvalidValueTypeException invalidPropertyTypeException) {
           logger.error(invalidPropertyTypeException.getMessage());
       }

       Collections.reverse(dto.historySteps);

       return dto;

    }

    public List<Overview> fetchWorkflowOverview(String workflowName) throws ServiceException {

        List<Overview> list = new ArrayList<Overview>();

        try {

            WorkflowDescriptor wd = configuration.getWorkflow(workflowName);

            for(StepDescriptor step : wd.getSteps()) {
                Overview overview = new Overview()
                    .id(step.getId())
                    .stepName(step.getName())
                ;

                list.add(overview);
            }

            // Get all of the Current and History Steps for this workflow
            List<org.informagen.oswf.Step> currentSteps = new ArrayList<org.informagen.oswf.Step>();
            List<org.informagen.oswf.Step> historySteps = new ArrayList<org.informagen.oswf.Step>();
            for(Long piid : fetchProcessInstancesList(workflowName)) {
                currentSteps.addAll(wfEngine.getCurrentSteps(piid));
                historySteps.addAll(wfEngine.getHistorySteps(piid));
            }

            // Count all of the Current Steps
            for (org.informagen.oswf.Step step : currentSteps) {
                for(Overview overview : list) {
                    if(overview.id == step.getStepId()) {
                        overview.current++;
                        long pending = new Date().getTime() - step.getStartDate().getTime();
                        overview.maxPending = Math.max(overview.maxPending, pending);
                        break;
                    }
                }
            }

            // Count all of the History Steps
            for (org.informagen.oswf.Step step : historySteps) {
                for(Overview overview : list) {
                    if(overview.id == step.getStepId()) {
                        overview.history++;
                        if(step.getFinishDate() != null) {
                            long pending = step.getFinishDate().getTime() - step.getStartDate().getTime();
                            overview.avgPending = (overview.avgPending*(overview.history-1) + pending)/overview.history;
                        }
                        break;
                    }
                }
            }

        } catch (WorkflowLoaderException workflowLoaderException) {
            throw new ServiceException(workflowLoaderException.getMessage());
        }

        Collections.sort(list);

        return list;
    }

    public List<StepActions> fetchStepActions(long piid) throws ServiceException {

        List<StepActions> list = new ArrayList<StepActions>();

        WorkflowDescriptor wfDescriptor = wfEngine.getWorkflowDescriptor(wfEngine.getWorkflowName(piid));

        try {

            List<org.informagen.oswf.Step> steps = wfEngine.getCurrentSteps(piid);

            for(org.informagen.oswf.Step step : steps) {

                int stepId = step.getStepId();
                String stepName = wfDescriptor.getStep(stepId).getName();
                StepActions stepActions = new StepActions(stepId, stepName);

                List<ActionDescriptor>actions = wfDescriptor.getStep(stepId).getActions();

                for (ActionDescriptor action : actions)
                    stepActions.addAction(new Action(action.getId(), action.getName()));

                list.add(stepActions);
            }
        } catch (Exception exception) {
            throw new ServiceException(exception.getMessage());
        }

        Collections.sort(list);

        return list;
    }

    // Actor based Workflow Engine instances ==================================================

    public Long startProcess(String workflowName, String actor, int initialAction, Map<String,Object> inputs) throws ServiceException {

        OSWfEngine actorEngine = new DefaultOSWfEngine(actor);

        if(configuration != null)
            actorEngine.setConfiguration(configuration);

        long piid = 0;

        try {

            piid = actorEngine.initialize(workflowName, initialAction,(inputs != null) ? inputs : Collections.EMPTY_MAP);

        } catch (InvalidInputException invalidInputException) {
            throw new ServiceException(invalidInputException);
        } catch (WorkflowException workflowException) {
            logger.error(workflowException.getMessage());
            throw new ServiceException("This workflow could not be used to create process instances. It may reference class which are not available to the Simulator", "warning");
        }

        return new Long(piid);
    }

    public void doAction(String workflowName, long piid, String actor, int actionId, Map<String,Object> inputs) throws ServiceException {

        OSWfEngine actorEngine = new DefaultOSWfEngine(actor);

        if(configuration != null)
            actorEngine.setConfiguration(configuration);

        try {

            actorEngine.doAction(piid, actionId, (inputs != null) ? inputs : Collections.EMPTY_MAP);

        } catch (InvalidActionException invalidActionException) {
            WorkflowDescriptor wfDescriptor = actorEngine.getWorkflowDescriptor(wfEngine.getWorkflowName(piid));
            String actionName = wfDescriptor.getAction(actionId).getName();
            logger.warn(invalidActionException.getMessage());
            throw new ServiceException("Could not execute action '" + actionName + "' (actionId=" + actionId + "), it may have action restrictions.", "warning");
        } catch (InvalidInputException invalidInputException) {
            throw new ServiceException(invalidInputException);
        } catch (WorkflowException workflowException) {
            throw new ServiceException(workflowException);
        }
    }

}


text:
namespace chromecast {
namespace external_mojo {

namespace {
// Default path for Unix domain socket used by external Mojo services to connect
// to Mojo services within cast_shell.
constexpr base::StringPiece kDefaultBrokerPath("/tmp/cast_mojo_broker");

// Command-line arg to change the Unix domain socket path to connect to the
// Cast Mojo broker.
constexpr base::StringPiece kCastMojoBrokerPathSwitch("cast-mojo-broker-path");
}  // namespace

std::string GetBrokerPath() {
  std::string broker_path;
  base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
  if (command_line->HasSwitch(kCastMojoBrokerPathSwitch)) {
    broker_path = command_line->GetSwitchValueASCII(kCastMojoBrokerPathSwitch);
  } else {
    broker_path = std::string(kDefaultBrokerPath);
  }
  return broker_path;
}

}  // namespace external_mojo
}  // namespace chromecast


text:
package org.apereo.cas.pac4j.clients;

import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.pac4j.client.DefaultDelegatedClientIdentityProviderRedirectionStrategy;
import org.apereo.cas.pac4j.client.DelegatedClientIdentityProviderRedirectionStrategy;
import org.apereo.cas.services.DefaultRegisteredServiceAccessStrategy;
import org.apereo.cas.services.DefaultRegisteredServiceDelegatedAuthenticationPolicy;
import org.apereo.cas.services.DefaultServicesManager;
import org.apereo.cas.services.DefaultServicesManagerRegisteredServiceLocator;
import org.apereo.cas.services.InMemoryServiceRegistry;
import org.apereo.cas.services.RegisteredServiceDelegatedAuthenticationPolicy;
import org.apereo.cas.services.RegisteredServiceTestUtils;
import org.apereo.cas.services.ServicesManager;
import org.apereo.cas.services.ServicesManagerConfigurationContext;
import org.apereo.cas.util.CollectionUtils;
import org.apereo.cas.web.DelegatedClientIdentityProviderConfiguration;
import org.apereo.cas.web.cookie.CasCookieBuilder;
import org.apereo.cas.web.support.WebUtils;

import com.github.benmanes.caffeine.cache.Caffeine;
import lombok.val;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.core.Ordered;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletContext;
import org.springframework.webflow.context.ExternalContextHolder;
import org.springframework.webflow.context.servlet.ServletExternalContext;
import org.springframework.webflow.execution.RequestContextHolder;
import org.springframework.webflow.test.MockRequestContext;

import java.util.HashSet;
import java.util.List;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

/**
 * This is {@link DefaultDelegatedClientIdentityProviderRedirectionStrategyTests}.
 *
 * @author Misagh Moayyed
 * @since 6.4.0
 */
@Tag("Delegation")
public class DefaultDelegatedClientIdentityProviderRedirectionStrategyTests {

    private ServicesManager servicesManager;

    private CasCookieBuilder casCookieBuilder;

    private static MockRequestContext getMockRequestContext() {
        val context = new MockRequestContext();
        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));
        RequestContextHolder.setRequestContext(context);
        ExternalContextHolder.setExternalContext(context.getExternalContext());
        return context;
    }

    private static DelegatedClientIdentityProviderConfiguration getProviderConfiguration(final String client) {
        return DelegatedClientIdentityProviderConfiguration.builder()
            .name(client)
            .type("CasClient")
            .redirectUrl("https://localhost:8443/redirect")
            .build();
    }

    @BeforeEach
    public void setup() {
        val appCtx = new StaticApplicationContext();
        appCtx.refresh();
        val context = ServicesManagerConfigurationContext.builder()
            .serviceRegistry(new InMemoryServiceRegistry(appCtx))
            .applicationContext(appCtx)
            .environments(new HashSet<>(0))
            .servicesCache(Caffeine.newBuilder().build())
            .registeredServiceLocators(List.of(new DefaultServicesManagerRegisteredServiceLocator()))
            .build();
        this.servicesManager = new DefaultServicesManager(context);
        this.casCookieBuilder = mock(CasCookieBuilder.class);
    }

    @Test
    public void verifyExclusiveRedirect() {
        val strategy = getStrategy();
        val context = getMockRequestContext();
        val provider = getProviderConfiguration("SomeClient");

        val policy = new DefaultRegisteredServiceDelegatedAuthenticationPolicy();
        policy.setAllowedProviders(CollectionUtils.wrapList("SomeClient"));
        policy.setExclusive(true);
        configureService(policy);

        val service = RegisteredServiceTestUtils.getService();
        val results = strategy.getPrimaryDelegatedAuthenticationProvider(context, service, provider);
        assertFalse(results.isEmpty());
        assertTrue(results.get().isAutoRedirect());
        assertEquals(Ordered.LOWEST_PRECEDENCE, strategy.getOrder());
    }

    @Test
    public void verifyExistingPrimaryProvider() {
        val strategy = getStrategy();
        val context = getMockRequestContext();
        val provider = getProviderConfiguration("SomeClient");
        provider.setAutoRedirect(true);

        val policy = new DefaultRegisteredServiceDelegatedAuthenticationPolicy();
        configureService(policy);

        WebUtils.putDelegatedAuthenticationProviderPrimary(context, null);
        val results = strategy.getPrimaryDelegatedAuthenticationProvider(context, null, provider);
        assertFalse(results.isEmpty());
        assertTrue(results.get().isAutoRedirect());
    }

    @Test
    public void verifyPrimaryViaCookie() {
        val strategy = getStrategy();
        val context = getMockRequestContext();
        val provider = getProviderConfiguration("SomeClient");

        val policy = new DefaultRegisteredServiceDelegatedAuthenticationPolicy();
        configureService(policy);

        when(this.casCookieBuilder.retrieveCookieValue(any())).thenReturn("SomeClient");
        val results = strategy.getPrimaryDelegatedAuthenticationProvider(context, null, provider);
        assertFalse(results.isEmpty());
        assertTrue(results.get().isAutoRedirect());
    }

    private void configureService(final RegisteredServiceDelegatedAuthenticationPolicy policy) {
        val registeredService = RegisteredServiceTestUtils.getRegisteredService();
        val accessStrategy = new DefaultRegisteredServiceAccessStrategy();
        accessStrategy.setDelegatedAuthenticationPolicy(policy);
        registeredService.setAccessStrategy(accessStrategy);
        this.servicesManager.save(registeredService);
    }

    private DelegatedClientIdentityProviderRedirectionStrategy getStrategy() {
        var props = new CasConfigurationProperties();
        props.getAuthn().getPac4j().getCookie().setEnabled(true);
        return new DefaultDelegatedClientIdentityProviderRedirectionStrategy(servicesManager, casCookieBuilder, props);
    }
}


text:
package java.lang.invoke;

import static java.lang.invoke.MethodHandleStatics.*;
import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;

/**
 * Unary function composition, useful for many small plumbing jobs.
 * The invoke method takes a single reference argument, and returns a reference
 * Internally, it first calls the {@code filter} method on the argument,
 * Making up the difference between the raw method type and the
 * final method type is the responsibility of a JVM-level adapter.
 * @author jrose
 */
class FilterOneArgument extends BoundMethodHandle {
    protected final MethodHandle filter;  // Object -> Object
    protected final MethodHandle target;  // Object -> Object

    @Override
    String debugString() {
        return target.toString();
    }

    protected Object invoke(Object argument) throws Throwable {
        Object filteredArgument = filter.invokeExact(argument);
        return target.invokeExact(filteredArgument);
    }

    private static final MethodHandle INVOKE;
    static {
        try {
            INVOKE =
                IMPL_LOOKUP.findVirtual(FilterOneArgument.class, "invoke",
                                        MethodType.genericMethodType(1));
        } catch (ReflectiveOperationException ex) {
            throw uncaughtException(ex);
        }
    }

    protected FilterOneArgument(MethodHandle filter, MethodHandle target) {
        super(INVOKE);
        this.filter = filter;
        this.target = target;
    }

    static {
        assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this class is deprecated
    }

    public static MethodHandle make(MethodHandle filter, MethodHandle target) {
        if (filter == null)  return target;
        if (target == null)  return filter;
        return new FilterOneArgument(filter, target);
    }

//    MethodHandle make(MethodHandle filter1, MethodHandle filter2, MethodHandle target) {
//        MethodHandle filter = make(filter1, filter2);
//        return make(filter, target);
//    }
}


text:
class Hypothesis < ActiveRecord::Base

  has_many :attachments, :as => :item, :dependent => :destroy
  has_one :canvas_item
  has_many :comments, :dependent => :destroy
  has_many :experiments, :dependent => :destroy
  belongs_to :hypothesis, :touch => true
  has_many :hypotheses
  belongs_to :item_status
  belongs_to :project, :touch => true
  has_many :questions, :dependent => :destroy
  has_many :tasks, :class_name => "ProjectTask", :dependent => :destroy

  validates_presence_of :title
  validates_presence_of :project

  accepts_nested_attributes_for :questions, :allow_destroy => true
  accepts_nested_attributes_for :experiments, :allow_destroy => true
  accepts_nested_attributes_for :tasks, :allow_destroy => true

  attr_accessor :notify_flag

  include Sanitized

  include ImportExport

  def export
    hash = super
    hash["relationships"] = {
      "hypothesis_id" => self.hypothesis_id,
      "item_status_id" => self.item_status_id,
      "project_id" => self.project_id
    }
    return hash
  end

  # def Hypothesis.import(hash, member, project)
  #   bp = super(hash)
  #   bp.member = member
  #   bp.project = project
  #   return bp
  # end

  acts_as_audited :associated_with => :project

  validate do |hypothesis|
    if hypothesis.id && hypothesis.id == hypothesis.hypothesis_id
      hypothesis.errors.add(:hypothesis_id, "can't refer to self")
    end
  end

  before_create do |hypothesis|
    if (hypothesis.notify_flag.nil?)
      if (hypothesis.title_changed? || hypothesis.description_changed? || (hypothesis.item_status_id_changed? && hypothesis.item_status && hypothesis.item_status.status != "started"))
        hypothesis.notify_flag = (hypothesis.new_record? ? :new : :updated) if hypothesis.notify_flag.nil?
      end
    end

    hypothesis.insert_at(1) unless hypothesis.position

    true
  end

  after_create do |hypothesis|
    unless hypothesis.canvas_item || hypothesis.project.goal_create_hypothesis_completed
      hypothesis.project.goal_create_hypothesis_completed = true
      hypothesis.project.save!
    end
    true
  end

  before_update do |hypothesis|
    if (hypothesis.notify_flag.nil?)
      if (hypothesis.item_status_id_changed? && hypothesis.item_status && hypothesis.item_status.status == "valid")
        hypothesis.notify_flag = :validated
      end
    end
    true
  end

  after_update do |hypothesis|
    if (!hypothesis.project.goal_test_hypothesis_completed && hypothesis.item_status)
      hypothesis.project.goal_test_hypothesis_completed = true
    end
    if (!hypothesis.project.goal_validate_hypothesis_completed && hypothesis.complete?)
      hypothesis.project.goal_validate_hypothesis_completed = true
    end
    hypothesis.project.save! if hypothesis.project.changed?
    true
  end

  before_save do |hypothesis|
    if (hypothesis.title_changed? || hypothesis.description_changed? || (hypothesis.item_status_id_changed? && hypothesis.item_status && hypothesis.item_status.status != "started"))
      if (hypothesis.canvas_item)
        hypothesis.canvas_item = hypothesis.canvas_item.create_updated(
          :text => hypothesis.title,
          :description => hypothesis.description,
          :item_status => ((hypothesis.item_status.nil? || hypothesis.item_status.status == "started") ? ItemStatus.find_by_status("unknown") : hypothesis.item_status),
          :updated => true
        )
      end
    end

    if (hypothesis.item_status_id_changed?)
      if (hypothesis.item_status_id)
        hypothesis.completed_at = Time.now
      else
        hypothesis.completed_at = nil
      end

      hypothesis.remove_from_list(false)
      hypothesis.insert_at(-1)
    end

    true
  end

  before_destroy do |model|
    model.remove_from_list(false)
    true
  end

  after_commit do |hypothesis|
    if (hypothesis.notify_flag == :validated)
      Resque.enqueue(Jobs::Notify::HypothesisValidated, hypothesis.id)
    elsif (hypothesis.notify_flag)
      Resque.enqueue(Jobs::Notify::HypothesisUpdated, hypothesis.id, hypothesis.notify_flag == :new)
    end
    true
  end

  scope(:top_level, where(:hypothesis_id => nil))
  scope(:non_canvas, joins("LEFT JOIN canvas_items ON hypotheses.id = canvas_items.hypothesis_id").where("canvas_items.id IS NULL"))

  def complete?
    return [ItemStatus.cached_find_by_status("valid"), ItemStatus.cached_find_by_status("invalid"), ItemStatus.cached_find_by_status("unknown")].include?(self.item_status)
  end

  def to_hash
    Rails.cache.fetch(self.cache_key + "/hash") do
      m = self.created_by_member
      {
        :type => self.class.name.underscore,
        :id => self.id,
        :project_id => self.project_id,
        :created_at => self.created_at,
        :updated_at => self.updated_at,
        :created_by_member_id => m ? m.id : nil,
        :completed_at => self.completed_at,
        :completed_reason => self.completed_reason,
        :description => self.description,
        :hypothesis_id => self.hypothesis_id,
        :position => self.position,
        :title => self.title,
        :status => self.status,
        :canvas_box => (self.canvas_item && self.canvas_item.box) ? self.canvas_item.box.label : nil
      }
    end
  end

  def created_by_member
    a = self.audits.where("user_id IS NOT NULL").order("created_at").select{|x| x.user.members.where(:project_id => self.project_id).first}.first
    a = a ? a.user.members.where(:project_id => self.project_id).first : nil
  end

  def to_s
    return self.title
  end

  def status_summary(start_at, end_at)
    changes = self.audits.where(["audits.created_at BETWEEN ? AND ?", start_at, end_at]).descending
    if (changes.select{|x| x.action == "create"}.first)
      return "New"
    elsif (changes.select{|x| x.new_attributes.has_key?("item_status_id")}.first)
      return case self.item_status
      when ItemStatus.cached_find_by_status("invalid")
        "Invalidated"
      when ItemStatus.cached_find_by_status("started")
        "Started"
      when ItemStatus.cached_find_by_status("valid")
        "Validated"
      when ItemStatus.cached_find_by_status("unknown")
        "Unknown"
      else
        "Updated"
      end
    else
      return "Updated"
    end
  end

  def url
    "#{Rails.application.routes.url_helpers.project_url(self.project, Rails.application.config.action_mailer.default_url_options)}#hypothesis/#{self.id}"
  end

  def status
    return "#{self.item_status}"
  end

  def status=(value)
    if value == ''
      self.item_status = nil
    else
      self.item_status = ItemStatus.find_by_status(value)
    end
  end

  def remove_from_list(save_self = true)
    return unless self.position

    if (self.hypothesis)
      self.hypothesis.hypotheses.where("position > ?", self.position).each{|x| x.update_attributes!(:position => x.position-1)}
    else
      self.project.hypotheses.top_level.where("position > ?", self.position).each{|x| x.update_attributes!(:position => x.position-1)}
    end

    # move children into position occupied by self
    if (!save_self)
      self.hypotheses.sort_by{|x| -x.position}.each do |child|
        child.hypothesis = nil
        child.insert_at(self.position)
      end
    end

    # remove self from list
    self.update_attributes!(:position => nil) if (save_self)
  end

  def insert_at(pos)
    if (pos == -1)
      if (self.hypothesis)
        pos = [0, self.hypothesis.hypotheses.maximum(:position)].select{|x| x}.max+1
      else
        pos = [0, self.project.hypotheses.top_level.maximum(:position)].select{|x| x}.max+1
      end
    end

    if (self.hypothesis)
      self.hypothesis.hypotheses.where("position >= ?", pos).each{|x| x.update_attributes!(:position => x.position+1)}
    else
      self.project.hypotheses.top_level.where("position >= ?", pos).each{|x| x.update_attributes!(:position => x.position+1)}
    end
    self.position = pos
  end
end


text:
<?php

namespace Genemu\Bundle\FormBundle\Controller;

use Symfony\Component\DependencyInjection\ContainerAware;
use Symfony\Component\HttpFoundation\Response;

/**
 * Class Base64Controller
 *
 * @author Olivier Chauvel <olivier@generation-multiple.com>
 */
class Base64Controller extends ContainerAware
{
    public function refreshCaptchaAction()
    {
        $captcha = $this->container->get('genemu.gd.captcha');
        $options = $this->container->get('session')->get('genemu_form.captcha.options', array());
        $captcha->setOptions($options);
        $datas = preg_split('([;,]{1})', substr($captcha->getBase64(), 5));

        return new Response(base64_decode($datas[2]), 200, array('Content-Type' => $datas[0]));
    }

    public function base64Action()
    {
        $query = $this->container->get('request')->server->get('QUERY_STRING');
        $datas = preg_split('([;,]{1})', $query);

        return new Response(base64_decode($datas[2]), 200, array('Content-Type' => $datas[0]));
    }
}


text:
require 'rails/railtie'

module LogStasher
  class Railtie < Rails::Railtie
    config.jquery_image_zoom = ActiveSupport::OrderedOptions.new

    initializer :jquery_image_zoom do |app|
      puts 'initializer in module'
    end
  end
end


text:
using UnityEngine;
using System.Collections;
using AssemblyCSharp;

namespace PortableRealm
{

public class MRDruid : MRCharacter
{
	#region Properties

	public override MRGame.eCharacters Character
	{
		get{
			return MRGame.eCharacters.Druid;
		}
	}
	public override string Name
	{
		get{
			return "Druid";
		}
	}

	public override string IconName
	{
		get{
			return "Textures/druid";
		}
	}

	public override int StartingGoldValue
	{
		get {
			return 10;
		}
	}

	#endregion

	#region Methods

	public MRDruid()
	{
	}

	public MRDruid(JSONObject jsonData, int index) :
		base(jsonData, index)
	{
	}

	// Does initialization associated with birdsong.
	public override void StartBirdsong()
	{
		base.StartBirdsong();
	}

	// Tests if this controllable activates a map chit to summon monsters
	public override bool ActivatesChit(MRMapChit chit)
	{
		// Peace with Nature: does not activate sound and warning chits
		if (chit.ChitType == MRMapChit.eMapChitType.Warning || chit.ChitType == MRMapChit.eMapChitType.Sound)
			return false;
		return base.ActivatesChit(chit);
	}

	// Returns the die pool for a given roll type
	public override MRDiePool DiePool(MRGame.eRollTypes roll)
	{
		// Concealment: roll 1 die on hide rolls
		if (roll == MRGame.eRollTypes.Hide)
		{
			MRDiePool pool = MRDiePool.NewDicePool;
			pool.NumDice = 1;
			return pool;
		}
		return base.DiePool(roll);
	}

	// Update is called once per frame
	public override void Update ()
	{
		base.Update();
	}

	#endregion
}

}


text:
void Enemy::_init()
{
    //you could hit enemy 3 times
    _hp = 3;

    spSprite sprite = new Sprite;
    sprite->setResAnim(res::ui.getResAnim("asteroid"));
    sprite->attachTo(_view);
    sprite->setAnchor(Vector2(0.5f, 0.5f));

    //it random scale and rotation
    sprite->setRotation(scalar::randFloat(0, MATH_PI * 2));
    sprite->setScale(scalar::randFloat(0.5f, 1.0f));

    //it is rotating by tween with random speed
    float dest = MATH_PI * 2;
    if (rand() % 2 == 0)
        dest *= -1;
    dest += sprite->getRotation();
    sprite->addTween(Sprite::TweenRotation(dest), rand() % 12000 + 10000, -1);
}

void Enemy::_update(const UpdateState& us)
{
    //nothing to do
}

void Enemy::explode()
{
    //hit by rocket
    _hp--;
    if (_hp == 0)
    {
        //dead, hide it with alpha tween
        _dead = true;
        _view->addTween(Actor::TweenAlpha(0), 300)->detachWhenDone();
    }
}


text:
import React from 'react';
import { Txt } from '../../Txt';
import { JsonTypes } from '../types';
import { widgetFactory } from './widget-util';

export const CodeWidget = widgetFactory('Code', {}, [JsonTypes.string])(
	({ value }) => {
		return (
			<Txt
				code
				truncate
				copy={value}
				style={{ maxWidth: '200px' }}
				tooltip={value}
			>
				{value}
			</Txt>
		);
	},
);


text:
Abilene's Best Boot Camp

## Prerequisites

This project depends upon [NodeJS](http://nodejs.org), [Bower](http://bower.io), and [SASS](http://sass-lang.com/install)
(which in turn requires [RubyGems](https://rubygems.org/pages/download)).

## Installation

Run the following:

    npm install
    bower install
    gulp

This will automatically open your default browser at http://localhost:3000 and show you the site.


text:
package controllers;

import com.google.inject.Inject;
import com.google.inject.TypeLiteral;

import controllers.generic.GenericApiController;
import dtos.SensorConfigurationsDto;
import dtos.conversion.ModelDtoConversionService;
import models.SensorConfigurations;
import models.Tenant;
import models.service.FrontendUserService;
import models.service.ModelService;

/**
 * Created by Frank on 17.03.2016.
 */
public class SensorConfigurationsController extends
        GenericApiController<SensorConfigurations, SensorConfigurationsDto, SensorConfigurationsDto, SensorConfigurationsDto> {

    @Inject
    public SensorConfigurationsController(FrontendUserService frontendUserService,
                                          ModelService<Tenant> tenantModelService, ModelService<SensorConfigurations> modelService,
                                          TypeLiteral<SensorConfigurations> typeLiteral, ModelDtoConversionService conversionService) {
        super(frontendUserService, tenantModelService, modelService, typeLiteral,
                conversionService);
    }

    @Override protected String getSelfRoute(Long id) {
        return controllers.routes.SensorConfigurationsController.get(id).absoluteURL(request());
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >

    <ImageView
        android:id="@+id/ivUserPhoto"
        android:layout_width="114dp"
        android:layout_height="114dp"
        android:paddingLeft="12dp"
        android:paddingTop="12dp"
        android:src="@drawable/user" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/tvNameUser"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingLeft="10dp"
            android:paddingTop="15dp"
            android:textColor="#000000"
            android:textSize="15sp"/>

        <TextView
            android:id="@+id/tvNumberOfSharedFiles"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingLeft="10dp"
            android:paddingTop="3dp"
            android:textColor="#000000"
            android:textSize="15sp"/>
    </LinearLayout>

</LinearLayout>


text:
#include <stdio.h>
#include <vector>
#include "TIS100Instruction.h"
#include "MicroInstruction.h"
#include "GenericParser.h"
#include "Program.h"

#define PARSER_NO_ERROR 0
#define PARSER_ERROR_UNKNOWN_INSTRUCTION 1
#define PARSER_ERROR_MISSING_SRC_OPERAND 2
#define PARSER_ERROR_MISSING_DST_OPERAND 3
#define PARSER_ERROR_MISSING_COMMA       4
#define PARSER_ERROR_INVALID_SRC_OPERAND 5
#define PARSER_ERROR_INVALID_DST_OPERAND 6
#define PARSER_ERROR_MISSING_JMP_TARGET  7

// #define USE_DEDICATED_PORT_INSTR

MIDestination TIStoMIDestination(TIS100Destination dst)
{
	switch (dst)
	{
	case TISD_NIL:
		return MID_NIL;
	case TISD_ACC:
		return MID_ACC;
	case TISD_PORT_UP:
		return MID_PORT_UP;
	case TISD_PORT_DOWN:
		return MID_PORT_DOWN;
	case TISD_PORT_LEFT:
		return MID_PORT_LEFT;
	case TISD_PORT_RIGHT:
		return MID_PORT_RIGHT;
	}

	return MID_Unknown;
}

MISource TIStoMISource(TIS100Source src)
{
	switch (src)
	{
	case TISS_NIL:
		return MIS_NIL;
	case TISS_ACC:
		return MIS_ACC;
	case TISS_PORT_UP:
		return MIS_PORT_UP;
	case TISS_PORT_DOWN:
		return MIS_PORT_DOWN;
	case TISS_PORT_LEFT:
		return MIS_PORT_LEFT;
	case TISS_PORT_RIGHT:
		return MIS_PORT_RIGHT;
	}

	return MIS_Unknown;
}

bool ParseTISFile(const char* filename, std::vector<TIS100Instruction*>& instructionList)
{
	FILE* f = fopen(filename, "rb");
	if (!f)
	{
		return false;
	}

	fseek(f, 0, SEEK_END);
	int fileSize = ftell(f);
	fseek(f, 0, SEEK_SET);

	char* buffer = new char[fileSize + 1];
	fread(buffer, sizeof(char), fileSize, f);
	buffer[fileSize] = '\0';

	fclose(f);

	GenericParser parser(buffer);

	// Parse the file...
	int parseError = PARSER_NO_ERROR;
	while (parser.GetNextChar() != '\0')
	{
		parseError = PARSER_NO_ERROR;

		TIS100Instruction* instr = new TIS100Instruction();

		char token[256];
		if (!parser.GetNextToken(token, 256))
		{
			break;
		}

		// Check if this is a label
		if (parser.GetNextChar() == ':')
		{
			instr->SetLabel(token);

			// Skip colon.
			parser.Expecting(':');
		}
		else
		{
			// This must be an instruction mnemonic.
			if (!_stricmp(token, "nop"))
			{
				instr->SetMnemonic(TISM_NOP);
			}
			else if (!_stricmp(token, "mov"))
			{
				char src[32], dst[32];
				if (!parser.GetNextToken(src, 32))
				{
					parseError = PARSER_ERROR_MISSING_SRC_OPERAND;
					break;
				}
				if (!parser.Expecting(','))
				{
					parseError = PARSER_ERROR_MISSING_COMMA;
					break;
				}
				if (!parser.GetNextToken(dst, 32))
				{
					parseError = PARSER_ERROR_MISSING_DST_OPERAND;
					break;
				}

				instr->SetMnemonic(TISM_MOV);
				if (!instr->SetDestination(dst))
				{
					parseError = PARSER_ERROR_INVALID_DST_OPERAND;
					break;
				}

				if (!instr->SetSource(src))
				{
					parseError = PARSER_ERROR_INVALID_SRC_OPERAND;
					break;
				}
			}
			else if (!_stricmp(token, "add"))
			{
				char src[32];
				if (!parser.GetNextToken(src, 32))
				{
					parseError = PARSER_ERROR_INVALID_SRC_OPERAND;
					break;
				}

				instr->SetMnemonic(TISM_ADD);
				if (!instr->SetSource(src))
				{
					parseError = PARSER_ERROR_INVALID_SRC_OPERAND;
				}
			}
			else if (!_stricmp(token, "sub"))
			{
				char src[32];
				if (!parser.GetNextToken(src, 32))
				{
					parseError = PARSER_ERROR_INVALID_SRC_OPERAND;
					break;
				}

				instr->SetMnemonic(TISM_SUB);
				if (!instr->SetSource(src))
				{
					parseError = PARSER_ERROR_INVALID_SRC_OPERAND;
				}
			}
			else if (!_stricmp(token, "neg"))
			{
				instr->SetMnemonic(TISM_NEG);
			}
			else if (!_stricmp(token, "sav"))
			{
				instr->SetMnemonic(TISM_SAV);
			}
			else if (!_stricmp(token, "swp"))
			{
				instr->SetMnemonic(TISM_SWP);
			}
			else if (!_stricmp(token, "jmp"))
			{
				char target[32];
				if (!parser.GetIdentifier(target, 32))
				{
					parseError = PARSER_ERROR_MISSING_JMP_TARGET;
					break;
				}

				instr->SetMnemonic(TISM_JMP);
				instr->SetJumpTarget(target);
			}
			else if (!_stricmp(token, "jro"))
			{
				char src[32];
				if (!parser.GetNextToken(src, 32))
				{
					parseError = PARSER_ERROR_MISSING_JMP_TARGET;
					break;
				}

				instr->SetMnemonic(TISM_JRO);
				instr->SetSource(src);
			}
			else if (!_stricmp(token, "jez"))
			{
				char target[32];
				if (!parser.GetIdentifier(target, 32))
				{
					parseError = PARSER_ERROR_MISSING_JMP_TARGET;
					break;
				}

				instr->SetMnemonic(TISM_JEZ);
				instr->SetJumpTarget(target);
			}
			else if (!_stricmp(token, "jnz"))
			{
				char target[32];
				if (!parser.GetIdentifier(target, 32))
				{
					parseError = PARSER_ERROR_MISSING_JMP_TARGET;
					break;
				}

				instr->SetMnemonic(TISM_JNZ);
				instr->SetJumpTarget(target);
			}
			else if (!_stricmp(token, "jgz"))
			{
				char target[32];
				if (!parser.GetIdentifier(target, 32))
				{
					parseError = PARSER_ERROR_MISSING_JMP_TARGET;
					break;
				}

				instr->SetMnemonic(TISM_JGZ);
				instr->SetJumpTarget(target);
			}
			else if (!_stricmp(token, "jlz"))
			{
				char target[32];
				if (!parser.GetIdentifier(target, 32))
				{
					parseError = PARSER_ERROR_MISSING_JMP_TARGET;
					break;
				}

				instr->SetMnemonic(TISM_JLZ);
				instr->SetJumpTarget(target);
			}
			else
			{
				parseError = PARSER_ERROR_UNKNOWN_INSTRUCTION;
				break;
			}
		}

		if (parseError == PARSER_NO_ERROR)
		{
			instructionList.push_back(instr);
		}
		else
		{
			// TODO: Print the error (preferably with a line number).
			break;
		}
	}

	delete[] buffer;

	return parseError == PARSER_NO_ERROR;
}

bool VerifyLabels(const std::vector<TIS100Instruction*>& instructionList)
{
	std::vector<TIS100Instruction*>::const_iterator curInstrIt, curInstrItLast = instructionList.end();
	for (curInstrIt = instructionList.begin(); curInstrIt != curInstrItLast; ++curInstrIt)
	{
		TIS100Instruction* curInstruction = *curInstrIt;
		if (!curInstruction->IsJump() || curInstruction->GetMnemonic() == TISM_JRO)
		{
			continue;
		}

		const char* jumpTarget = curInstruction->GetJumpTarget();

		// Search for the label.
		bool found = false;
		std::vector<TIS100Instruction*>::const_iterator labelInstrIt, labelInstrItLast = instructionList.end();
		for (labelInstrIt = instructionList.begin(); labelInstrIt != labelInstrItLast;++labelInstrIt)
		{
			const char* label = (*labelInstrIt)->GetLabel();
			if (!label)
			{
				continue;
			}

			if (!_stricmp(label, jumpTarget))
			{
				found = true;
				break;
			}
		}

		if (!found)
		{
			printf("Label \"%s\" not found.\n", jumpTarget);
			return false;
		}
	}

	return true;
}

Program* Assemble(std::vector<TIS100Instruction*>& instructionList)
{
	Program* prog = new Program();

	std::vector<TIS100Instruction*>::iterator curInstrIt, curInstrItLast = instructionList.end();
	for (curInstrIt = instructionList.begin(); curInstrIt != curInstrItLast; ++curInstrIt)
	{
		TIS100Instruction* instr = *curInstrIt;

		const char* label = instr->GetLabel();
		if (label)
		{
			prog->AddLabel(label);
		}

		switch (instr->GetMnemonic())
		{
		case TISM_NOP:
			prog->AddMicroInstruction(new MicroInstruction(MIM_ADD, MID_NIL, MIS_NIL, MIS_NIL));
			break;
		case TISM_MOV:
			switch (instr->GetSource())
			{
			case TISS_IMM:
#ifdef USE_DEDICATED_PORT_INSTR
				if (instr->IsDestinationPort())
				{
					// MOV imm, port => WRP port, imm
					prog->AddMicroInstruction(new MicroInstruction(MIM_WRP, TIStoMIDestination(instr->GetDestination()), MIS_NIL, instr->GetImmediate()));
				}
				else
				{
					// MOV imm, reg => ADD reg, NIL, imm
					prog->AddMicroInstruction(new MicroInstruction(MIM_ADD, TIStoMIDestination(instr->GetDestination()), MIS_NIL, instr->GetImmediate()));
				}
#else
				// MOV imm, port/reg => ADD port/reg, NIL, imm
				prog->AddMicroInstruction(new MicroInstruction(MIM_ADD, TIStoMIDestination(instr->GetDestination()), MIS_NIL, instr->GetImmediate()));
#endif
				break;
			case TISS_PORT_UP:
			case TISS_PORT_DOWN:
			case TISS_PORT_LEFT:
			case TISS_PORT_RIGHT:
			case TISS_PORT_ANY:
			case TISS_PORT_LAST:
#ifdef USE_DEDICATED_PORT_INSTR
				if (instr->IsDestinationPort())
				{
					// MOV portS, portD => RDP TMP, portS; WRP portD, TMP;
					prog->AddMicroInstruction(new MicroInstruction(MIM_RDP, MID_TMP, TIStoMISource(instr->GetSource()), MIS_NIL));
					prog->AddMicroInstruction(new MicroInstruction(MIM_WRP, TIStoMIDestination(instr->GetDestination()), MIS_TMP, MIS_NIL));
				}
				else
				{
					// MOV port, reg => RDP reg, port
					prog->AddMicroInstruction(new MicroInstruction(MIM_RDP, TIStoMIDestination(instr->GetDestination()), TIStoMISource(instr->GetSource()), MIS_NIL));
				}
#else
				// MOVE portS, portD/reg => ADD portD/reg, portS, NIL
				prog->AddMicroInstruction(new MicroInstruction(MIM_ADD, TIStoMIDestination(instr->GetDestination()), TIStoMISource(instr->GetSource()), MIS_NIL));
#endif
				break;
			case TISS_ACC:
			case TISS_NIL:
#ifdef USE_DEDICATED_PORT_INSTR
				if (instr->IsDestinationPort())
				{
					// MOV reg, port => WRP port, reg
					prog->AddMicroInstruction(new MicroInstruction(MIM_WRP, TIStoMIDestination(instr->GetDestination()), TIStoMISource(instr->GetSource()), MIS_NIL));
				}
				else
				{
					// MOV regS, regD => ADD regD, NIL, regS
					prog->AddMicroInstruction(new MicroInstruction(MIM_ADD, TIStoMIDestination(instr->GetDestination()), MIS_NIL, TIStoMISource(instr->GetSource())));
				}
#else
				// MOV regS, port/regD => ADD regD, port/regS, NIL
				prog->AddMicroInstruction(new MicroInstruction(MIM_ADD, TIStoMIDestination(instr->GetDestination()), TIStoMISource(instr->GetSource()), MIS_NIL));
#endif
				break;
			}
			break;
		case TISM_ADD:
			switch (instr->GetSource())
			{
			case TISS_IMM:
				// ADD imm => ADD ACC, ACC, imm
				prog->AddMicroInstruction(new MicroInstruction(MIM_ADD, MID_ACC, MIS_ACC, instr->GetImmediate()));
				break;
			case TISS_PORT_UP:
			case TISS_PORT_DOWN:
			case TISS_PORT_LEFT:
			case TISS_PORT_RIGHT:
			case TISS_PORT_ANY:
			case TISS_PORT_LAST:
#ifdef USE_DEDICATED_PORT_INSTR
				// ADD port => RDP TMP, port; ADD ACC, ACC, TMP
				prog->AddMicroInstruction(new MicroInstruction(MIM_RDP, MID_TMP, TIStoMISource(instr->GetSource()), MIS_NIL));
				prog->AddMicroInstruction(new MicroInstruction(MIM_ADD, MID_ACC, MIS_ACC, MIS_TMP));
#else
				// ADD port => ADD ACC, port, ACC
				prog->AddMicroInstruction(new MicroInstruction(MIM_ADD, MID_ACC, TIStoMISource(instr->GetSource()), MIS_ACC));
#endif
				break;
			case TISS_ACC:
			case TISS_NIL:
				// ADD reg => ADD ACC, ACC, reg
				prog->AddMicroInstruction(new MicroInstruction(MIM_ADD, MID_ACC, MIS_ACC, TIStoMISource(instr->GetSource())));
				break;
			}
			break;
		case TISM_SUB:
			switch (instr->GetSource())
			{
			case TISS_IMM:
				// SUB imm => ADD ACC, ACC, imm
				prog->AddMicroInstruction(new MicroInstruction(MIM_SUB, MID_ACC, MIS_ACC, instr->GetImmediate()));
				break;
			case TISS_PORT_UP:
			case TISS_PORT_DOWN:
			case TISS_PORT_LEFT:
			case TISS_PORT_RIGHT:
			case TISS_PORT_ANY:
			case TISS_PORT_LAST:
#ifdef USE_DEDICATED_PORT_INSTR
				// SUB port => RDP TMP, port; SUB ACC, ACC, TMP
				prog->AddMicroInstruction(new MicroInstruction(MIM_RDP, MID_TMP, TIStoMISource(instr->GetSource()), MIS_NIL));
				prog->AddMicroInstruction(new MicroInstruction(MIM_SUB, MID_ACC, MIS_ACC, MIS_TMP));
#else
				// SUB port => ISUB ACC, port, ACC
				prog->AddMicroInstruction(new MicroInstruction(MIM_ISUB, MID_ACC, TIStoMISource(instr->GetSource()), MIS_ACC));
#endif
				break;
			case TISS_ACC:
			case TISS_NIL:
				// SUB reg => SUB ACC, ACC, reg
				prog->AddMicroInstruction(new MicroInstruction(MIM_SUB, MID_ACC, MIS_ACC, TIStoMISource(instr->GetSource())));
				break;
			}
			break;
		case TISM_NEG:
			prog->AddMicroInstruction(new MicroInstruction(MIM_NEG, MID_ACC, MIS_ACC, 1));
			break;
		case TISM_SAV:
			prog->AddMicroInstruction(new MicroInstruction(MIM_ADD, MID_BAK, MIS_ACC, MIS_NIL));
			break;
		case TISM_SWP:
			prog->AddMicroInstruction(new MicroInstruction(MIM_SWP, MID_NIL, MIS_NIL, MIS_NIL));
			break;
		case TISM_JMP:
			prog->AddMicroInstruction(new MicroInstruction(MIM_JMP, MID_NIL, MIS_ACC, prog->FindLabelOffset(instr->GetJumpTarget())));
			break;
		case TISM_JEZ:
			prog->AddMicroInstruction(new MicroInstruction(MIM_JEZ, MID_NIL, MIS_ACC, prog->FindLabelOffset(instr->GetJumpTarget())));
			break;
		case TISM_JNZ:
			prog->AddMicroInstruction(new MicroInstruction(MIM_JNZ, MID_NIL, MIS_ACC, prog->FindLabelOffset(instr->GetJumpTarget())));
			break;
		case TISM_JGZ:
			prog->AddMicroInstruction(new MicroInstruction(MIM_JGZ, MID_NIL, MIS_ACC, prog->FindLabelOffset(instr->GetJumpTarget())));
			break;
		case TISM_JLZ:
			prog->AddMicroInstruction(new MicroInstruction(MIM_JLZ, MID_NIL, MIS_ACC, prog->FindLabelOffset(instr->GetJumpTarget())));
			break;
		case TISM_JRO:
			switch (instr->GetSource())
			{
			case TISS_IMM:
				// JRO imm
				prog->AddMicroInstruction(new MicroInstruction(MIM_JRO, MID_NIL, MIS_ACC, instr->GetImmediate()));
				break;
			case TISS_PORT_UP:
			case TISS_PORT_DOWN:
			case TISS_PORT_LEFT:
			case TISS_PORT_RIGHT:
			case TISS_PORT_ANY:
			case TISS_PORT_LAST:
				// TODO: Removing RDP from here requires new HW in Next PC logic entity to be able to calculate the jump target from a port value.
				// JRO port => RDP TMP, port; JRO TMP
				prog->AddMicroInstruction(new MicroInstruction(MIM_RDP, MID_TMP, TIStoMISource(instr->GetSource()), MIS_NIL));
				prog->AddMicroInstruction(new MicroInstruction(MIM_JRO, MID_NIL, MIS_ACC, MIS_TMP));
				break;
			case TISS_ACC:
			case TISS_NIL:
				// JRO reg
				prog->AddMicroInstruction(new MicroInstruction(MIM_JRO, MID_NIL, MIS_ACC, TIStoMISource(instr->GetSource())));
				break;
			}
			break;
		default:
			break;
		}
	}

	prog->FixForwardJumps();

	return prog;
}

bool WriteProg(const char* filename, Program* prog)
{
	unsigned int* imem = prog->GetCode();

	FILE* f = fopen(filename, "w");
	if (!f)
	{
		return false;
	}

	unsigned int numInstructions = prog->GetNumInstructions();
	for (unsigned int i = 0; i < numInstructions; ++i)
	{
		fprintf(f, "%08X\n", imem[i]);
	}

	fclose(f);

	return true;
}

int main(int argc, char** argv)
{
	// TODO: Parse input arguments

	const char* inputFile = "double.tis";
	const char* outputFile = "double.prg";

	// Parse input file and retrieve all the instructions
	std::vector<TIS100Instruction*> instructionList;
	if (!ParseTISFile(inputFile, instructionList))
	{
		printf("Failed to parse %s as TIS assembly file.\n", inputFile);
		return -1;
	}

	// Check if all labels are present in the program
	if (!VerifyLabels(instructionList))
	{
		printf("Failed to verify program labels.\n");
		return -1;
	}

	// Assemble the instruction list into a program
	Program* prog = Assemble(instructionList);
	if (!prog)
	{
		printf("Failed to assemble program.\n");
		return -1;
	}

	// Write the final instruction list to the outputFile.
	if (!WriteProg(outputFile, prog))
	{
		printf("Failed to write program to file.\n");
		return -1;
	}

	return 0;
}


text:
"""Magnum test utilities."""

from magnum.db import api as db_api

def get_test_baymodel(**kw):
    return {
        'id': kw.get('id', 32),
        'project_id': kw.get('project_id', 'fake_project'),
        'user_id': kw.get('user_id', 'fake_user'),
        'uuid': kw.get('uuid', 'e74c40e0-d825-11e2-a28f-0800200c9a66'),
        'name': kw.get('name', 'baymodel1'),
        'image_id': kw.get('image_id', 'ubuntu'),
        'flavor_id': kw.get('flavor_id', 'm1.small'),
        'master_flavor_id': kw.get('master_flavor_id', 'm1.small'),
        'keypair_id': kw.get('keypair_id', 'keypair1'),
        'external_network_id': kw.get('external_network_id',
                                      'd1f02cfb-d27f-4068-9332-84d907cb0e2e'),
        'fixed_network': kw.get('fixed_network', 'private'),
        'dns_nameserver': kw.get('dns_nameserver', '8.8.1.1'),
        'apiserver_port': kw.get('apiserver_port', 8080),
        'docker_volume_size': kw.get('docker_volume_size', 20),
        'cluster_distro': kw.get('cluster_distro', 'fedora-atomic'),
        'ssh_authorized_key': kw.get('ssh_authorized_key',
                                     'ssh-rsa AAAAB3NzaC1ycEAAAADA'
                                     'v0XRqg3tm+jlsOKGO81lPDH+KaSJ'
                                     'Q7wvmjUqszP/H6NC/m+qiGp/sTis'
                                     'DYucqbeuM7nmJi+8Hb55y1xWoOZI'
                                     'KMa71G5/4EOQxuQ/sgW965OOO2Hq'
                                     'X8vjlQUnTK0HijrbSTLxp/9kazWW'
                                     'FrfsdB8RtZBN digambar@magnum'),
        'coe': kw.get('coe', 'swarm'),
        'created_at': kw.get('created_at'),
        'updated_at': kw.get('updated_at'),
    }

def get_test_bay(**kw):
    return {
        'id': kw.get('id', 42),
        'uuid': kw.get('uuid', '5d12f6fd-a196-4bf0-ae4c-1f639a523a52'),
        'name': kw.get('name', 'bay1'),
        'discovery_url': kw.get('discovery_url', None),
        'project_id': kw.get('project_id', 'fake_project'),
        'user_id': kw.get('user_id', 'fake_user'),
        'baymodel_id': kw.get('baymodel_id',
                              'e74c40e0-d825-11e2-a28f-0800200c9a66'),
        'stack_id': kw.get('stack_id', '047c6319-7abd-4bd9-a033-8c6af0173cd0'),
        'status': kw.get('status', 'CREATE_IN_PROGRESS'),
        'status_reason': kw.get('status_reason', 'Completed successfully'),
        'api_address': kw.get('api_address', '172.17.2.3'),
        'node_addresses': kw.get('node_addresses', ['172.17.2.4']),
        'node_count': kw.get('node_count', 3),
        'created_at': kw.get('created_at'),
        'updated_at': kw.get('updated_at'),
    }

def create_test_bay(**kw):
    """Create test bay entry in DB and return Bay DB object.
    Function to be used to create test Bay objects in the database.
    :param kw: kwargs with overriding values for bay's attributes.
    :returns: Test Bay DB object.
    """
    bay = get_test_bay(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if 'id' not in kw:
        del bay['id']
    dbapi = db_api.get_instance()
    return dbapi.create_bay(bay)

def get_test_pod(**kw):
    return {
        'id': kw.get('id', 42),
        'uuid': kw.get('uuid', '10a47dd1-4874-4298-91cf-eff046dbdb8d'),
        'name': kw.get('name', 'pod1'),
        'project_id': kw.get('project_id', 'fake_project'),
        'user_id': kw.get('user_id', 'fake_user'),
        'desc': kw.get('desc', 'test pod'),
        'bay_uuid': kw.get('bay_uuid', '5d12f6fd-a196-4bf0-ae4c-1f639a523a52'),
        'images': kw.get('images', ['MyImage']),
        'labels': kw.get('labels', {'name': 'foo'}),
        'status': kw.get('status', 'Running'),
        'host': kw.get('host', '10.0.0.3'),
        'created_at': kw.get('created_at'),
        'updated_at': kw.get('updated_at'),
    }

def create_test_pod(**kw):
    """Create test pod entry in DB and return Pod DB object.
    Function to be used to create test Pod objects in the database.
    :param kw: kwargs with overriding values for pod's attributes.
    :returns: Test Pod DB object.
    """
    pod = get_test_pod(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if 'id' not in kw:
        del pod['id']
    dbapi = db_api.get_instance()
    return dbapi.create_pod(pod)

def get_test_service(**kw):
    return {
        'id': kw.get('id', 42),
        'uuid': kw.get('uuid', '10a47dd1-4874-4298-91cf-eff046dbdb8d'),
        'name': kw.get('name', 'service1'),
        'project_id': kw.get('project_id', 'fake_project'),
        'user_id': kw.get('user_id', 'fake_user'),
        'bay_uuid': kw.get('bay_uuid', '5d12f6fd-a196-4bf0-ae4c-1f639a523a52'),
        'labels': kw.get('labels', {'name': 'foo'}),
        'selector': kw.get('selector', {'name': 'foo'}),
        'ip': kw.get('ip', '172.17.2.2'),
        'ports': kw.get('ports', [{'port': 80}]),
        'created_at': kw.get('created_at'),
        'updated_at': kw.get('updated_at'),
    }

def create_test_service(**kw):
    """Create test service entry in DB and return Service DB object.
    Function to be used to create test Service objects in the database.
    :param kw: kwargs with overriding values for service's attributes.
    :returns: Test Service DB object.
    """
    service = get_test_service(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if 'id' not in kw:
        del service['id']
    dbapi = db_api.get_instance()
    return dbapi.create_service(service)

def get_test_node(**kw):
    return {
        'id': kw.get('id', 42),
        'uuid': kw.get('uuid', 'ea8e2a25-2901-438d-8157-de7ffd68d051'),
        'type': kw.get('type', 'virt'),
        'project_id': kw.get('project_id', 'fake_project'),
        'user_id': kw.get('user_id', 'fake_user'),
        'image_id': kw.get('image_id', 'ubuntu'),
        'ironic_node_id': kw.get('ironic_node_id'),
        'created_at': kw.get('created_at'),
        'updated_at': kw.get('updated_at'),
    }

def create_test_node(**kw):
    """Create test node entry in DB and return Node DB object.
    Function to be used to create test Node objects in the database.
    :param kw: kwargs with overriding values for node's attributes.
    :returns: Test Node DB object.
    """
    node = get_test_node(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if 'id' not in kw:
        del node['id']
    dbapi = db_api.get_instance()
    return dbapi.create_node(node)

def get_test_container(**kw):
    return {
        'id': kw.get('id', 42),
        'uuid': kw.get('uuid', 'ea8e2a25-2901-438d-8157-de7ffd68d051'),
        'name': kw.get('name', 'container1'),
        'project_id': kw.get('project_id', 'fake_project'),
        'user_id': kw.get('user_id', 'fake_user'),
        'image': kw.get('image', 'ubuntu'),
        'created_at': kw.get('created_at'),
        'updated_at': kw.get('updated_at'),
        'command': kw.get('command', 'fake_command'),
        'bay_uuid': kw.get('bay_uuid', 'fff114da-3bfa-4a0f-a123-c0dffad9718e'),
        'status': kw.get('state', 'Running'),
    }

def create_test_container(**kw):
    """Create test container entry in DB and return Container DB object.
    Function to be used to create test Container objects in the database.
    :param kw: kwargs with overriding values for container's attributes.
    :returns: Test Container DB object.
    """
    container = get_test_container(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if 'id' not in kw:
        del container['id']
    dbapi = db_api.get_instance()
    return dbapi.create_container(container)

def get_test_rc(**kw):
    return {
        'id': kw.get('id', 42),
        'uuid': kw.get('uuid', '10a47dd1-4874-4298-91cf-eff046dbdb8d'),
        'name': kw.get('name', 'service1'),
        'project_id': kw.get('project_id', 'fake_project'),
        'user_id': kw.get('user_id', 'fake_user'),
        'images': kw.get('images', ['steak/for-dinner']),
        'bay_uuid': kw.get('bay_uuid', '5d12f6fd-a196-4bf0-ae4c-1f639a523a52'),
        'labels': kw.get('labels', {'name': 'foo'}),
        'replicas': kw.get('replicas', 3),
        'manifest_url': kw.get('file:///tmp/rc.yaml'),
        'created_at': kw.get('created_at'),
        'updated_at': kw.get('updated_at'),
    }

def create_test_rc(**kw):
    """Create test rc entry in DB and return ReplicationController DB object.
    Function to be used to create test ReplicationController objects in the
    database.
    :param kw: kwargs with overriding values for service's attributes.
    :returns: Test Service DB object.
    """
    service = get_test_rc(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if 'id' not in kw:
        del service['id']
    dbapi = db_api.get_instance()
    return dbapi.create_rc(service)

def get_test_baylock(**kw):
    return {
        'id': kw.get('id', 42),
        'bay_uuid': kw.get('bay_uuid', '5d12f6fd-a196-4bf0-ae4c-1f639a523a52'),
        'conductor_id': kw.get('conductor_id',
                               '72625085-c507-4410-9b28-cd7cf1fbf1ad'),
    }


text: I assign the decorated object to a local variable.


text:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:background="#ffffff"
    >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="16dp"
        android:textSize="18sp"
        android:text="@string/ipsum" />

</ScrollView>


text:
(function() {
  'use strict';

  angular
    .module('app')
    .factory('msgFact', msgFact);

    msgFact.$inject = ['$http', 'chatSocket', 'authFact', '$q', '$rootScope', 'localStorageService', 'moment'];

    function msgFact($http, chatSocket, authFact, $q, $rootScope, localStorageService, moment) {

      var invite,
          myPhoto = '',
          otherPhoto = '',
          userId,
          otherId,
          newMessageCount = 0,
          token;

      return {

        requestForMessagesSent: false,
        isIncremented: false,

        requestThreads: function() {
          if (!token) {
            token = authFact.getTokenLocalStorage();
          }

          var deferred = $q.defer();
          this.requestForMessagesSent = false;

          $http.put('/threads', token).then(function(data) {
            deferred.resolve(data);
          }, function(data) {
            deferred.reject(data);
          });
            return deferred.promise;
        },

        requestMessages: function(threadId, userId) {
          // if browser is refreshed, app.js will make request for current thread.
          // if state === 'thread' app.js will also make request for current thread.
          // below, we prevent duplicate requests
          // if (this.requestForMessagesSent) {
          //   return;
          // }

          // if (threadId === null) return;

          var self = this;
          var deferred = $q.defer();
          this.requestForMessagesSent = true;

          $http.put('/getMessages', {threadId: threadId, userId: userId}).then(function(data) {
            deferred.resolve(data);
          }, function(data) {
            deferred.reject(data);
          });

          return deferred.promise;
        },

        getOtherId: function() {
          return otherId;
        },

        setRequestForMessagesSent: function() {
          this.requestForMessagesSent = true;
        },

        storeThreadItems: function(items) {
          return localStorageService.set('dating-token.threadItems', items);
        },

        getThreadItems: function(id) {
          return localStorageService.get('dating-token.threadItems');
        },

        getMessageCount: function() {
          // this function gets call a lot when clicked on thread... have to figure out why...
          if (newMessageCount < 1) {
            return;
          }

          return newMessageCount;
        },

        resetMessageCount: function() {
          newMessageCount = 0;
        },

        incrementMessageCount: function() {
          newMessageCount++;
          console.log('newMessageCount', newMessageCount);
          $rootScope.$broadcast('new-message-count');
        },

        // seperate photos
        // orderPhotos: function(photos, userId) {
        //   for (var i = 0; i < photos.length; i++) {
        //     if (photos[i].userId !== userId) {
        //       otherPhoto = photos[i].photo;
        //       return otherPhoto;
        //     } else if (photos[i].userId === userId) {
        //       myPhoto = photos[i].photo;
        //       return myPhoto;
        //     }
        //   }
        // }

      };

    }

})();


text:
CURRENT_DIR:=$(shell pwd)
COMMON_DIR:=$(CURRENT_DIR)/../../../common
include $(COMMON_DIR)/images.sh

IMAGE_NAME=$(SELDONIO_BUSYBOX_IMAGE_NAME)
IMAGE_VERSION=$(SELDONIO_BUSYBOX_IMAGE_VERSION)

build_image:
	docker build --force-rm=true -t $(IMAGE_NAME):$(IMAGE_VERSION) .

push_to_dockerhub:
	@docker login -u seldonio && \
		docker push $(IMAGE_NAME):$(IMAGE_VERSION)