text:
jQuery.noConflict();
(function($,PLUGIN_ID){
	"use strict";
	var vars={
		offset:0
	};
	var functions={
		fieldsort:function(layout){
			var codes=[];
			$.each(layout,function(index,values){
				switch (values.type)
				{
					case 'ROW':
						$.each(values.fields,function(index,values){
							/* exclude spacer */
							if (!values.elementId) codes.push(values.code);
						});
						break;
					case 'GROUP':
						$.merge(codes,functions.fieldsort(values.layout));
						break;
					case 'SUBTABLE':
						$.each(values.fields,function(index,values){
							/* exclude spacer */
							if (!values.elementId) codes.push(values.code);
						});
						break;
				}
			});
			return codes;
		},
		loadapps:function(callback){
			kintone.api(kintone.api.url('/k/v1/apps',true),'GET',{offset:vars.offset},function(resp){
				/* setup app lists */
				$.each(resp.apps,function(index,values){
					if (values.appId!=kintone.app.getId()) $('select#clientapp').append($('<option>').attr('value',values.appId).text(values.name));
				})
				vars.offset+=100;
				if (resp.apps.length==100) functions.loadapps(callback);
				else
				{
					if (callback!=null) callback();
				}
			},function(error){});
		},
		reloadclientapp:function(callback){
			var target=$('select#clientapp');
			$('select#clientid').empty().html('<option value=""></option>');
			$('select#clienttaxsegment').empty().html('<option value=""></option>');
			$('select#clientfee1price').empty().html('<option value=""></option>');
			$('select#clientfee1month').empty().html('<option value=""></option>');
			$('select#clientfee2price').empty().html('<option value=""></option>');
			$('select#clientfee2month').empty().html('<option value=""></option>');
			$('select#clientfee3price').empty().html('<option value=""></option>');
			$('select#clientfee3month').empty().html('<option value=""></option>');
			$('select#clientfee4price').empty().html('<option value=""></option>');
			$('select#clientfee4month').empty().html('<option value=""></option>');
			$('select#clientfee5price').empty().html('<option value=""></option>');
			$('select#clientfee5month').empty().html('<option value=""></option>');
			$('select#clientfee6price').empty().html('<option value=""></option>');
			$('select#clientfee6month').empty().html('<option value=""></option>');
			$('select#clientfee7price').empty().html('<option value=""></option>');
			$('select#clientfee7month').empty().html('<option value=""></option>');
			$('select#clientfee8price').empty().html('<option value=""></option>');
			$('select#clientfee8month').empty().html('<option value=""></option>');
			$('select#clientfee9price').empty().html('<option value=""></option>');
			$('select#clientfee9month').empty().html('<option value=""></option>');
			$('select#clientfee10price').empty().html('<option value=""></option>');
			$('select#clientfee10month').empty().html('<option value=""></option>');
			if (target.val())
			{
				kintone.api(kintone.api.url('/k/v1/app/form/layout',true),'GET',{app:target.val()},function(resp){
					var sorted=functions.fieldsort(resp.layout);
					/* get fieldinfo */
					kintone.api(kintone.api.url('/k/v1/app/form/fields',true),'GET',{app:target.val()},function(resp){
						$.each(sorted,function(index){
							if (sorted[index] in resp.properties)
							{
								var fieldinfo=resp.properties[sorted[index]];
								/* check field type */
								switch (fieldinfo.type)
								{
									case 'CHECK_BOX':
										$('select#clientfee1month').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee2month').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee3month').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee4month').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee5month').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee6month').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee7month').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee8month').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee9month').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee10month').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										break;
									case 'NUMBER':
										$('select#clientfee1price').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee2price').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee3price').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee4price').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee5price').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee6price').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee7price').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee8price').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee9price').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#clientfee10price').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										break;
									case 'RADIO_BUTTON':
										$('select#clienttaxsegment').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										break;
									case 'SINGLE_LINE_TEXT':
										$('select#clientid').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										break;
								}
							}
						});
						if (callback) callback();
					},function(error){swal('Error!',error.message,'error');});
				},function(error){swal('Error!',error.message,'error');});
			}
		}
	};
	/*---------------------------------------------------------------
	 initialize fields
	---------------------------------------------------------------*/
	kintone.api(kintone.api.url('/k/v1/app/form/layout',true),'GET',{app:kintone.app.getId()},function(resp){
		var sorted=functions.fieldsort(resp.layout);
		/* get fieldinfo */
		kintone.api(kintone.api.url('/k/v1/app/form/fields',true),'GET',{app:kintone.app.getId()},function(resp){
			var config=kintone.plugin.app.getConfig(PLUGIN_ID);
			vars.fieldinfos=$.fieldparallelize(resp.properties);
			$.each(sorted,function(index){
				if (sorted[index] in vars.fieldinfos)
				{
					var fieldinfo=vars.fieldinfos[sorted[index]];
					/* check field type */
					switch (fieldinfo.type)
					{
						case 'CALC':
							switch (fieldinfo.format.toUpperCase())
							{
								case 'NUMBER':
								case 'NUMBER_DIGIT':
									if (!fieldinfo.lookup)
									{
										$('select#bill').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
										$('select#collect').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
									}
									break;
							}
							break;
						case 'DATE':
							$('select#date').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
							break;
						case 'NUMBER':
							if (!fieldinfo.lookup)
							{
								$('select#price').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
								$('select#tax').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
								$('select#carryover').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
							}
							break;
						case 'RADIO_BUTTON':
							$('select#taxsegment').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
							break;
						case 'SINGLE_LINE_TEXT':
							if (fieldinfo.lookup) $('select#client').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
							else $('select#item').append($('<option>').attr('value',fieldinfo.code).text(fieldinfo.label));
					}
				}
			});
			/* initialize valiable */
			functions.loadapps(function(){
				if (Object.keys(config).length!==0)
				{
					$('select#date').val(config['date']);
					$('select#client').val(config['client']);
					$('select#item').val(config['item']);
					$('select#price').val(config['price']);
					$('select#taxsegment').val(config['taxsegment']);
					$('select#tax').val(config['tax']);
					$('select#bill').val(config['bill']);
					$('select#carryover').val(config['carryover']);
					$('select#price').val(config['price']);
					$('select#collect').val(config['collect']);
					if ('clientapp' in config)
					{
						$('select#clientapp').val(config['clientapp']);
						functions.reloadclientapp(function(){
							$('select#clientid').val(config['clientid']);
							$('select#clienttaxsegment').val(config['clienttaxsegment']);
							$('select#clientfee1price').val(config['clientfee1price']);
							$('select#clientfee1month').val(config['clientfee1month']);
							$('select#clientfee2price').val(config['clientfee2price']);
							$('select#clientfee2month').val(config['clientfee2month']);
							$('select#clientfee3price').val(config['clientfee3price']);
							$('select#clientfee3month').val(config['clientfee3month']);
							$('select#clientfee4price').val(config['clientfee4price']);
							$('select#clientfee4month').val(config['clientfee4month']);
							$('select#clientfee5price').val(config['clientfee5price']);
							$('select#clientfee5month').val(config['clientfee5month']);
							$('select#clientfee6price').val(config['clientfee6price']);
							$('select#clientfee6month').val(config['clientfee6month']);
							$('select#clientfee7price').val(config['clientfee7price']);
							$('select#clientfee7month').val(config['clientfee7month']);
							$('select#clientfee8price').val(config['clientfee8price']);
							$('select#clientfee8month').val(config['clientfee8month']);
							$('select#clientfee9price').val(config['clientfee9price']);
							$('select#clientfee9month').val(config['clientfee9month']);
							$('select#clientfee10price').val(config['clientfee10price']);
							$('select#clientfee10month').val(config['clientfee10month']);
						});
					}
				}
				$('select#clientapp').on('change',function(){functions.reloadclientapp()});
			});
		},function(error){});
	},function(error){});
	/*---------------------------------------------------------------
	 button events
	---------------------------------------------------------------*/
	$('button#submit').on('click',function(e){
		var config=[];
		/* check values */
		/* setup config */
		config['clientapp']=$('select#clientapp').val();
		config['clientid']=$('select#clientid').val();
		config['clienttaxsegment']=$('select#clienttaxsegment').val();
		config['clientfee1price']=$('select#clientfee1price').val();
		config['clientfee1month']=$('select#clientfee1month').val();
		config['clientfee2price']=$('select#clientfee2price').val();
		config['clientfee2month']=$('select#clientfee2month').val();
		config['clientfee3price']=$('select#clientfee3price').val();
		config['clientfee3month']=$('select#clientfee3month').val();
		config['clientfee4price']=$('select#clientfee4price').val();
		config['clientfee4month']=$('select#clientfee4month').val();
		config['clientfee5price']=$('select#clientfee5price').val();
		config['clientfee5month']=$('select#clientfee5month').val();
		config['clientfee6price']=$('select#clientfee6price').val();
		config['clientfee6month']=$('select#clientfee6month').val();
		config['clientfee7price']=$('select#clientfee7price').val();
		config['clientfee7month']=$('select#clientfee7month').val();
		config['clientfee8price']=$('select#clientfee8price').val();
		config['clientfee8month']=$('select#clientfee8month').val();
		config['clientfee9price']=$('select#clientfee9price').val();
		config['clientfee9month']=$('select#clientfee9month').val();
		config['clientfee10price']=$('select#clientfee10price').val();
		config['clientfee10month']=$('select#clientfee10month').val();
		config['date']=$('select#date').val();
		config['client']=$('select#client').val();
		config['item']=$('select#item').val();
		config['price']=$('select#price').val();
		config['taxsegment']=$('select#taxsegment').val();
		config['tax']=$('select#tax').val();
		config['bill']=$('select#bill').val();
		config['carryover']=$('select#carryover').val();
		config['collect']=$('select#collect').val();
		/* save config */
		kintone.plugin.app.setConfig(config);
	});
	$('button#cancel').on('click',function(e){
		history.back();
	});
})(jQuery,kintone.$PLUGIN_ID);


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

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

<title> Ultimate - Multi Purpose HTML Template </title>

<link href="favicon.ico" rel="shortcut icon" type="image/x-icon" />

<link id="default-css" href="style.css" rel="stylesheet" type="text/css" media="all" />
<link id="skin-css" href="skins/blue.css" rel="stylesheet" type="text/css" media="all" />
<link id="responsive-css" href="responsive.css" rel="stylesheet" type="text/css" media="all" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css' />

<link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />

                <form action="#" id="searchform" method="get">
                    <fieldset>
                        <input name="Search" type="text" onblur="this.value=(this.value=='') ? 'Enter Keyword' : this.value;" onfocus="this.value=(this.value=='Enter Keyword') ? '' : this.value;" value="Enter Keyword" alt="Search our site" class="text_input" />
                        <input name="submit" type="submit" value="" />
                    </fieldset>
                </form>

       Home

  Home - Multi Purpose

  Home - Portfolio

  Home - Blog

  Home - Business

      Sliders

  Nivo Slider

  Anything Slider

  Touch Slider

  Layer Slider

  Cycle Slider

      Features

  Useful HTML Elements

  4 Home Page Layouts

  5 Sliders

  Multiple Portfolio Style

  Multiple Blog Style

  2 Contact Page Layouts

  2 Different Menu Style

  Pricing Tables

  Google Fonts

  Easy Color Customization

  Responsive Design

  29 PSD files

      Styled Elements

  Typography

  Buttons

  Tabs

  Lists and Tables

  Toggles and Accordions

      Portfolio

  One Column

  1 Col With Right Sidebar

  1 Col With Left Sidebar

  1 Col Without Sidebar

  Two Column

  2 Col With Right Sidebar

  2 Col With Left Sidebar

  2 Col Without Sidebar

  Three Column

  3 Col With Right Sidebar

  3 Col With Left Sidebar

  3 Col Without Sidebar

  Portfolio Detail

      Blog

  Blog Full width

  Blog With Right Sidebar

  Blog With Left Sidebar

  Blog Two Column

  Blog Detail

      Pages

  Team

  404

  Testimonials

  Pricing Tables

  Side Navigation

  Sitemap

      Contact Us

  Contact - Layout 1

  Contact - Layout 2

                 Home

                 Portfolio

                 Portfolio Three Column With Sidebar

 Portfolio Page

  Page subtitle goes here

                         All
                         Design
                         Wordpress
                         Responsive
                         Portfolio

  Lorem ipsum dolor sit amet

                                  View Project
                                  Go to site

  Lorem ipsum dolor sit amet

                                  View Project
                                  Go to site

  Lorem ipsum dolor sit amet

                                  View Project
                                  Go to site

  Lorem ipsum dolor sit amet

                                  View Project
                                  Go to site

  Lorem ipsum dolor sit amet

                                  View Project
                                  Go to site

  Lorem ipsum dolor sit amet

                                  View Project
                                  Go to site

  Lorem ipsum dolor sit amet

                                  View Project
                                  Go to site

  Lorem ipsum dolor sit amet

                                  View Project
                                  Go to site

  Lorem ipsum dolor sit amet

                                  View Project
                                  Go to site

 1

  2

  3

  4

 Latest Posts

  Lorem ipsum dolor

 Lorem ipsum dolor sit amet, consectetur adipiscing elit...

  Lorem ipsum dolor

 Lorem ipsum dolor sit amet, consectetur adipiscing elit...

  Lorem ipsum dolor

 Lorem ipsum dolor sit amet, consectetur adipiscing elit...

 Popular Posts

  Lorem ipsum dolor

 Lorem ipsum dolor sit amet, consectetur adipiscing elit...

  Lorem ipsum dolor

 Lorem ipsum dolor sit amet, consectetur adipiscing elit...

 Categories

  Lorem ipsum dolor sit amet

  Lorem ipsum dolor sit amet

  Donec tincidunt risus quis nisi

  Donec tincidunt risus quis nisi

  Aenean lacinia porta leo, sit

  Donec placerat porttitor erat,

 Sample Text Widget

 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id massa vitae libero ultricies consequat. Sed pharetra tincidunt lorem, at laoreet arcu congue vitae.

 Address

 No 45, Season Street,
 Livingstone LA,
 Inc - 4502

  designthemes@somemail.com

 2145 - 007 - 1566

 designthemes

 Recent Tweets

 Client Testimonials

                                        Lorem ipsum dolor sit amet, consecte adipiscing elit. Suspendisse congue convallis eros vitae tincidunt. Aliquam volutpat. Lorem ipsum dolor sit amet, consectetur
                                        adipiscing elit. Proin vulputate dolor sit amet nibh
                                          Mary Jane
 - Ellen Jane

                                        Pellentesque eget est ligula. Nullam rutrum consequat purus sollicitudin vulputate. Nam rhoncus, erat non mollis pulvinar, tortor lacus convallis nunc.
                                          Mary Jane
 - Ellen Jane

                                        Quisque in augue felis. Duis non orci nibh. Nullam vitae sem felis, non dictum augue. Mauris sed dolor sed magna egestas hendrerit. Nulla pulvinar tellus sed
                                        sapien consequat imperdiet.
                                          Mary Jane
 - Ellen Jane

                                        Proin et massa odio, nec ullamcorper ante. Donec placerat sollicitudin luctus. Nam in volutpat lorem. Vivamus varius urna erat, eu placerat nunc.
                                          Mary Jane
 - Ellen Jane

 Email us

                        <form class="sendmail" action="http://iamdesigning.com/client_files/wp-themes/ultimate/html/php/sendmail.php" method="get">

                            	 Name *
                                <input name="name" type="text" />

                            	 Email *
                                <input name="email" type="text" />

                            	 Subject
                                <input name="subject" type="text" />

                                <textarea name="message" cols="" rows=""></textarea>

                                <input name="submit" type="submit" value="Send Message" />

                        </form>

 Please fill the above required fields!

  Home

  Sliders

  Features

  Styled Elements

  Portfolio

  Blog

  Pages

  Contact Us

 © iamdesigning | All Rights Reserved

redpajama_set_name: RedPajamaGithub


text:
package model.scenario;

import financial.market.Market;
import financial.market.OrderBookMarket;
import financial.utilities.Quote;
import goods.Good;
import goods.UndifferentiatedGoodType;
import model.MacroII;
import model.utilities.ActionOrder;
import sim.engine.SimState;
import sim.engine.Steppable;
import model.utilities.dummies.DummyBuyer;
import model.utilities.dummies.DummySeller;

/**
 *
Description

 *
 This is the scenario I used to test that the GUI and the scenario wouldn't blow up in my face
 *

 *

 *
Notes

 * Created with IntelliJ
 *

 *

 *
References

 *
 * @author Ernesto
 * @version 2012-09-10
 * @see
 */
public class TestScenario extends Scenario {

    public TestScenario(MacroII model) {
        super(model);
    }

    /**
     * Called by MacroII, it creates agents and then schedules them.
     */
    @Override
    public void start() {

        //create a useless market
        final Market testMarket = new OrderBookMarket(UndifferentiatedGoodType.GENERIC);
        //add it to the collections!
        getMarkets().put(UndifferentiatedGoodType.GENERIC,testMarket);

        //create fake buyer
        final DummyBuyer buyer = new DummyBuyer(getModel(),100,testMarket);
        buyer.receiveMany(UndifferentiatedGoodType.MONEY,10000000);

        //create fake seller
        final DummySeller seller = new DummySeller(getModel(),100);
        //add them to the list
        getAgents().add(buyer); getAgents().add(seller);

        //schedule them at t=1
        getModel().scheduleSoon(ActionOrder.DAWN,new Steppable() {
            @Override
            public void step(SimState simState) {
                testMarket.registerBuyer(buyer);
                testMarket.registerSeller(seller);

            }
        });

        //schedule them to trade to check that it gets recorded
        getModel().scheduleSoon(ActionOrder.TRADE,new Steppable() {
            @Override
            public void step(SimState simState) {
                Good good = Good.getInstanceOfUndifferentiatedGood(UndifferentiatedGoodType.GENERIC);
                seller.receive(good,null);

                testMarket.trade(buyer, seller,good ,
                        10, Quote.emptyBidQuote(UndifferentiatedGoodType.GENERIC), Quote.emptySellQuote(good));

            }
        });

        //schedule them to trade one more time
        getModel().scheduleAnotherDay(ActionOrder.TRADE,new Steppable() {
            @Override
            public void step(SimState simState) {
                Good good =  Good.getInstanceOfUndifferentiatedGood(UndifferentiatedGoodType.GENERIC);
                seller.receive(good,null);
                testMarket.trade(buyer, seller, good,
                        30, Quote.emptyBidQuote(UndifferentiatedGoodType.GENERIC),Quote.emptySellQuote(good));

            }
        },2);

        //force them to submit random quotes so that
        getModel().scheduleAnotherDay(ActionOrder.TRADE,new Steppable() {
            @Override
            public void step(SimState simState) {
                testMarket.submitBuyQuote(buyer,10);
                testMarket.submitBuyQuote(buyer,30);
            }
        },3);

        //force them to submit more random quotes
        getModel().scheduleAnotherDay(ActionOrder.TRADE,new Steppable() {
            @Override
            public void step(SimState simState) {
                testMarket.submitBuyQuote(buyer,40);
                testMarket.submitSellQuote(seller, 100,
                        Good.getInstanceOfUndifferentiatedGood(UndifferentiatedGoodType.GENERIC));
            }
        },4);

    }
}


text:
var fs = require('fs');
var http = require('http');
var getTestSocketPath = require('./testsocketpath').getTestSocketPath;
var util = require('util');

module.exports.run = function (broker) {
  console.log('   >> Broker PID:', process.pid);

  var resultSocketPath = getTestSocketPath();

  // Send test data to index.js every second
  var testDataInterval = setInterval(function () {
    var socketChannelData = broker.subscriptions;
    var channels = [];
    for (var i in socketChannelData) {
      channels = channels.concat(Object.keys(socketChannelData[i]));
    }

    var req = http.request({
      socketPath: resultSocketPath,
      method: 'POST'
    }, function (res) {
      res.on('data', function (data) {
        if (data.toString() == 'finish') {
          clearInterval(testDataInterval);
        }
      });
    });
    req.write(JSON.stringify([
      {
        origin: 'broker',
        pid: process.pid,
        type: 'channels',
        data: channels
      },
      {
        origin: 'broker',
        pid: process.pid,
        type: 'all',
        data: broker.dataMap.getAll()
      }
    ]));
    req.end();
  }, 1000);
};


text:
package ar.edu.ungs.business.services.impl;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import org.springframework.transaction.annotation.Transactional;

import ar.edu.ungs.business.dto.ArchivoDTO;
import ar.edu.ungs.business.services.ArchivoService;
import ar.edu.ungs.commons.exception.BusinessException;
import ar.edu.ungs.commons.exception.DaoException;
import ar.edu.ungs.persistence.dao.impl.autorizaciones.ArchivoDao;
import ar.edu.ungs.persistence.dao.impl.internacion.InternacionDao;
import ar.edu.ungs.persistence.entities.autorizaciones.Archivo;

@Named
@Transactional(rollbackFor = Exception.class)
public class ArchivoServiceImpl implements ArchivoService{

	@Inject
	private InternacionDao internacionDao;

	@Inject
	private ArchivoDao archivoDao;

	@Override
	public void adjuntarArchivo(ArchivoDTO archivoDto) throws BusinessException {
		try {
			Archivo archivo = new Archivo();
			archivo.setFile(archivoDto.getFile());
			archivo.setInternacion(internacionDao.findById(archivo.getId()));
			archivoDao.persist(archivo);
		} catch (DaoException e) {
			throw new BusinessException(e);
		}
	}

	@Override
	public void adjuntarArchivos(List<ArchivoDTO> archivos) throws BusinessException {
		for (ArchivoDTO archivo : archivos) {
			adjuntarArchivo(archivo);
		}
	}

}


text:
///\file

#ifndef __ETL_ILIST__
#define __ETL_ILIST__
#define __ETL_IN_ILIST_H__

#if WIN32
#undef min
#endif

#include <iterator>
#include <algorithm>
#include <functional>
#include <stddef.h>

#include "nullptr.h"
#include "list_base.h"
#include "type_traits.h"
#include "parameter_type.h"

namespace etl
{
  //***************************************************************************
  /// A templated base for all etl::list types.
  ///\ingroup list
  //***************************************************************************
  template <typename T>
  class ilist : public list_base
  {
  public:

    typedef T        value_type;
    typedef T*       pointer;
    typedef const T* const_pointer;
    typedef T&       reference;
    typedef const T& const_reference;
    typedef size_t   size_type;

  protected:

    typedef typename parameter_type<T, is_fundamental<T>::value || is_pointer<T>::value>::type parameter_t;

    //*************************************************************************
    /// The node element in the list.
    //*************************************************************************
    struct Node
    {
      //***********************************************************************
      /// Constructor
      //***********************************************************************
      Node()
        : previous(nullptr),
          next(nullptr)
      {
      }

      //***********************************************************************
      /// Marks the node as free.
      //***********************************************************************
      void mark_as_free()
      {
        previous = nullptr;
        next     = nullptr;
      }

      //***********************************************************************
      /// Checks if the node is free.
      //***********************************************************************
      bool is_free() const
      {
        return next == nullptr;
      }

      //***********************************************************************
      /// Reverses the previous & next pointers.
      //***********************************************************************
      void reverse()
      {
        std::swap(previous, next);
      }

      Node* previous;
      Node* next;
    };

    //*************************************************************************
    /// The data node element in the list.
    //*************************************************************************
    struct Data_Node : public Node
    {
      T value;
    };

    /// The node that acts as the list start and end.
    Node terminal_node;

  private:

    /// The pool of data nodes used in the list.
    Data_Node* node_pool;

    //*************************************************************************
    /// Downcast a Node* to a Data_Node*
    //*************************************************************************
    static Data_Node* data_cast(Node* p_node)
    {
      return static_cast<Data_Node*>(p_node);
    }

    //*************************************************************************
    /// Downcast a Node& to a Data_Node&
    //*************************************************************************
    static Data_Node& data_cast(Node& node)
    {
      return static_cast<Data_Node&>(node);
    }

    //*************************************************************************
    /// Downcast a const Node* to a const Data_Node*
    //*************************************************************************
    static const Data_Node* data_cast(const Node* p_node)
    {
      return static_cast<const Data_Node*>(p_node);
    }

    //*************************************************************************
    /// Downcast a const Node& to a const Data_Node&
    //*************************************************************************
    static const Data_Node& data_cast(const Node& node)
    {
      return static_cast<const Data_Node&>(node);
    }

  public:

    //*************************************************************************
    /// iterator.
    //*************************************************************************
    class iterator : public std::iterator<std::bidirectional_iterator_tag, T>
    {
    public:

      friend class ilist;

      iterator()
        : p_node(nullptr)
      {
      }

      iterator(Node& node)
        : p_node(&node)
      {
      }

      iterator(const iterator& other)
        : p_node(other.p_node)
      {
      }

      iterator& operator ++()
      {
        p_node = p_node->next;
        return *this;
      }

      iterator operator ++(int)
      {
        iterator temp(*this);
        p_node = p_node->next;
        return temp;
      }

      iterator& operator --()
      {
        p_node = p_node->previous;
        return *this;
      }

      iterator operator --(int)
      {
        iterator temp(*this);
        p_node = p_node->previous;
        return temp;
      }

      iterator operator =(const iterator& other)
      {
        p_node = other.p_node;
        return *this;
      }

      reference operator *()
      {
        return ilist::data_cast(p_node)->value;
      }

      const_reference operator *() const
      {
        return p_node->value;
      }

      pointer operator &()
      {
        return &(ilist::data_cast(p_node)->value);
      }

      const_pointer operator &() const
      {
        return &(ilist::data_cast(p_node)->value);
      }

      pointer operator ->()
      {
        return &(ilist::data_cast(p_node)->value);
      }

      const_pointer operator ->() const
      {
        return &(ilist::data_cast(p_node)->value);
      }

      friend bool operator == (const iterator& lhs, const iterator& rhs)
      {
        return lhs.p_node == rhs.p_node;
      }

      friend bool operator != (const iterator& lhs, const iterator& rhs)
      {
        return !(lhs == rhs);
      }

    private:

      Node* p_node;
    };

    //*************************************************************************
    /// const_iterator
    //*************************************************************************
    class const_iterator : public std::iterator<std::bidirectional_iterator_tag, const T>
    {
    public:

      friend class ilist;

      const_iterator()
        : p_node(nullptr)
      {
      }

      const_iterator(Node& node)
        : p_node(&node)
      {
      }

      const_iterator(const Node& node)
        : p_node(&node)
      {
      }

      const_iterator(const typename ilist::iterator& other)
        : p_node(other.p_node)
      {
      }

      const_iterator(const const_iterator& other)
        : p_node(other.p_node)
      {
      }

      const_iterator& operator ++()
      {
        p_node = p_node->next;
        return *this;
      }

      const_iterator operator ++(int)
      {
        const_iterator temp(*this);
        p_node = p_node->next;
        return temp;
      }

      const_iterator& operator --()
      {
        p_node = p_node->previous;
        return *this;
      }

      const_iterator operator --(int)
      {
        const_iterator temp(*this);
        p_node = p_node->previous;
        return temp;
      }

      const_iterator operator =(const const_iterator& other)
      {
        p_node = other.p_node;
        return *this;
      }

      const_reference operator *() const
      {
        return ilist::data_cast(p_node)->value;
      }

      const_pointer operator &() const
      {
        return ilist::data_cast(p_node)->value;
      }

      const Data_Node* operator ->() const
      {
        return p_node;
      }

      friend bool operator == (const const_iterator& lhs, const const_iterator& rhs)
      {
        return lhs.p_node == rhs.p_node;
      }

      friend bool operator != (const const_iterator& lhs, const const_iterator& rhs)
      {
        return !(lhs == rhs);
      }

    private:

      const Node* p_node;
    };

		typedef typename std::iterator_traits<iterator>::difference_type difference_type;

    typedef std::reverse_iterator<iterator>       reverse_iterator;
    typedef std::reverse_iterator<const_iterator> const_reverse_iterator;

    //*************************************************************************
    /// Assignment operator.
    //*************************************************************************
    ilist& operator = (const ilist& rhs)
    {
      assign(rhs.cbegin(), rhs.cend());

      return *this;
    }

    //*************************************************************************
    /// Gets the beginning of the list.
    //*************************************************************************
    iterator begin()
    {
      return iterator(get_head());
    }

    //*************************************************************************
    /// Gets the beginning of the list.
    //*************************************************************************
    const_iterator begin() const
    {
      return const_iterator(get_head());
    }

    //*************************************************************************
    /// Gets the end of the list.
    //*************************************************************************
    iterator end()
    {
      return iterator(terminal_node);
    }

    //*************************************************************************
    /// Gets the end of the list.
    //*************************************************************************
    const_iterator end() const
    {
      return const_iterator(static_cast<const Data_Node&>(terminal_node));
    }

    //*************************************************************************
    /// Gets the beginning of the list.
    //*************************************************************************
    const_iterator cbegin() const
    {
      return const_iterator(get_head());
    }

    //*************************************************************************
    /// Gets the end of the list.
    //*************************************************************************
    const_iterator cend() const
    {
      return const_iterator(static_cast<const Data_Node&>(terminal_node));
    }

    //*************************************************************************
    /// Gets the reverse beginning of the list.
    //*************************************************************************
    reverse_iterator rbegin()
    {
      return reverse_iterator(terminal_node);
    }

    //*************************************************************************
    /// Gets the reverse beginning of the list.
    //*************************************************************************
    const_reverse_iterator rbegin() const
    {
      return const_reverse_iterator(static_cast<const Data_Node&>(terminal_node));
    }

    //*************************************************************************
    /// Gets the reverse end of the list.
    //*************************************************************************
    reverse_iterator rend()
    {
      return reverse_iterator(get_head());
    }

    //*************************************************************************
    /// Gets the reverse beginning of the list.
    //*************************************************************************
    const_reverse_iterator crbegin() const
    {
      return const_reverse_iterator(static_cast<const Data_Node&>(terminal_node));
    }

    //*************************************************************************
    /// Gets the reverse end of the list.
    //*************************************************************************
    const_reverse_iterator crend() const
    {
      return const_reverse_iterator(get_head());
    }

    //*************************************************************************
    /// Gets a reference to the first element.
    //*************************************************************************
    reference front()
    {
      return data_cast(get_head()).value;
    }

    //*************************************************************************
    /// Gets a const reference to the first element.
    //*************************************************************************
    const_reference front() const
    {
      return data_cast(get_head()).value;
    }

    //*************************************************************************
    /// Gets a reference to the last element.
    //*************************************************************************
    reference back()
    {
      return data_cast(get_tail()).value;
    }

    //*************************************************************************
    /// Gets a reference to the last element.
    //*************************************************************************
    const_reference back() const
    {
      return data_cast(get_tail()).value;
    }

    //*************************************************************************
    /// Assigns a range of values to the list.
		/// If ETL_THROW_EXCEPTIONS is defined throws etl::list_full if the list does not have enough free space.
    /// If ETL_THROW_EXCEPTIONS & _DEBUG are defined throws list_iterator if the iterators are reversed.
    //*************************************************************************
    template <typename TIterator>
    void assign(TIterator first, TIterator last)
    {
      // Reset the links.
      join(terminal_node, terminal_node);
      current_size = 0;

      // Add all of the elements.
      while (first != last)
      {
        if (!full())
        {
          Data_Node& data_node = node_pool[current_size];
          data_node.value = *first;
          join(get_tail(), data_node);
          join(data_node, terminal_node);
        }
        else
        {
#ifdef ETL_THROW_EXCEPTIONS
          throw list_full();
#else
          error_handler::error(list_full());
#endif
        }

        ++first;
        ++current_size;
      }

      next_free = current_size;

      // Clear the remaining elements in the node pool.
      for (size_t i = current_size; i < MAX_SIZE; ++i)
      {
        node_pool[i].mark_as_free();
      }
    }

    //*************************************************************************
    /// Assigns 'n' copies of a value to the list.
    //*************************************************************************
    void assign(size_t n, parameter_t value)
    {
      // Reset the links.
      join(terminal_node, terminal_node);
      current_size = 0;

      // Add all of the elements.
      while (current_size < n)
      {
        if (!full())
        {
          Data_Node& data_node = node_pool[current_size];
          data_node.value = value;
          join(*terminal_node.previous, data_node);
          join(data_node, terminal_node);
        }
        else
        {
#ifdef ETL_THROW_EXCEPTIONS
          throw list_full();
#else
          error_handler::error(list_full());
#endif
        }

        ++current_size;
      }

      next_free = current_size;

      // Clear the remaining elements in the node pool.
      for (size_t i = current_size; i < MAX_SIZE; ++i)
      {
        node_pool[i].mark_as_free();
      }
    }

    //*************************************************************************
    /// Adds a node to the front of the list so a new value can be assigned to front().
    //*************************************************************************
    void push_front()
    {
      if (!full())
      {
        Data_Node& data_node = node_pool[next_free];
        insert_node(get_head(), data_node);
      }
      else
      {
#ifdef ETL_THROW_EXCEPTIONS
        throw list_full();
#else
        error_handler::error(list_full());
#endif
      }
    }

    //*************************************************************************
    /// Pushes a value to the front of the list.
    //*************************************************************************
    void push_front(parameter_t value)
    {
      if (!full())
      {
        Data_Node& data_node = node_pool[next_free];
        data_node.value = value;
        insert_node(get_head(), data_node);
      }
      else
      {
#ifdef ETL_THROW_EXCEPTIONS
        throw list_full();
#else
        error_handler::error(list_full());
#endif
      }
    }

    //*************************************************************************
    /// Removes a value from the front of the list.
    //*************************************************************************
    void pop_front()
    {
      if (!empty())
      {
        remove_node(get_head());
      }
    }

    //*************************************************************************
    /// Adds a node to the back of the list so a new value can be assigned to back().
    //*************************************************************************
    void push_back()
    {
      if (!full())
      {
        Data_Node& data_node = node_pool[next_free];
        insert_node(terminal_node, data_node);
      }
      else
      {
#ifdef ETL_THROW_EXCEPTIONS
        throw list_full();
#else
        error_handler::error(list_full());
#endif
      }
    }

    //*************************************************************************
    /// Pushes a value to the back of the list..
    //*************************************************************************
    void push_back(parameter_t value)
    {
      if (!full())
      {
        Data_Node& data_node = node_pool[next_free];
        data_node.value = value;
        insert_node(terminal_node, data_node);
      }
      else
      {
#ifdef ETL_THROW_EXCEPTIONS
        throw list_full();
#else
        error_handler::error(list_full());
#endif
      }
    }

    //*************************************************************************
    /// Removes a value from the back of the list.
    //*************************************************************************
    void pop_back()
    {
      if (!empty())
      {
        remove_node(get_tail());
      }
    }

    //*************************************************************************
    /// Inserts a value to the list at the specified position.
    //*************************************************************************
    iterator insert(iterator position, const value_type& value)
    {
      if (!full())
      {
        Data_Node& data_node = node_pool[next_free];
        data_node.value = value;

        insert_node(*position.p_node, data_node);

        return iterator(data_node);
      }
      else
      {
#ifdef ETL_THROW_EXCEPTIONS
        throw list_full();
#else
        error_handler::error(list_full());
        return end();
#endif
      }
    }

    //*************************************************************************
    /// Inserts 'n' copies of a value to the list at the specified position.
    //*************************************************************************
    void insert(iterator position, size_t n, const value_type& value)
    {
      for (size_t i = 0; i < n; ++i)
      {
        if (!full())
        {
          // Set up the next free node and insert.
          Data_Node& data_node = node_pool[next_free];
          data_node.value = value;
          insert_node(*position.p_node, data_node);
        }
        else
        {
#ifdef ETL_THROW_EXCEPTIONS
          throw list_full();
#else
          error_handler::error(list_full());
#endif
        }
      }
    }

    //*************************************************************************
    /// Inserts a range of values to the list at the specified position.
    //*************************************************************************
    template <typename TIterator>
    void insert(iterator position, TIterator first, TIterator last)
    {
      while (first != last)
      {
        if (!full())
        {
          // Set up the next free node and insert.
          Data_Node& data_node = node_pool[next_free];
          data_node.value = *first++;
          insert_node(*position.p_node, data_node);
        }
        else
        {
#ifdef ETL_THROW_EXCEPTIONS
          throw list_full();
#else
          error_handler::error(list_full());
#endif
        }
      }
    }

    //*************************************************************************
    /// Erases the value at the specified position.
    //*************************************************************************
    iterator erase(iterator position)
    {
      iterator next(position);
      ++next;

      remove_node(*position.p_node);

      return next;
    }

    //*************************************************************************
    /// Erases a range of elements.
    //*************************************************************************
    iterator erase(iterator first, iterator last)
    {
      Node* p_first = first.p_node;
      Node* p_last  = last.p_node;
      Node* p_next;

      // Join the ends.
      join(*(p_first->previous), *p_last);

      // Erase the ones in between.
      while (p_first != p_last)
      {
        // Update the position of the earliest free node in the pool.
        size_t new_free = std::distance(&node_pool[0], data_cast(p_first));
        next_free       = std::min(next_free, new_free);

        // One less.
        --current_size;

        p_next = p_first->next;  // Remember the next node.
        p_first->mark_as_free(); // Free the current node.
        p_first = p_next;        // Move to the next node.
      }

      return last;
    }

    //*************************************************************************
    /// Resizes the list.
    //*************************************************************************
    void resize(size_t n)
    {
      resize(n, T());
    }

    //*************************************************************************
    /// Resizes the list.
    //*************************************************************************
    void resize(size_t n, parameter_t value)
    {
      if (n > MAX_SIZE)
      {
#ifdef ETL_THROW_EXCEPTIONS
        throw list_full();
#else
        error_handler::error(list_full());
        n = MAX_SIZE;
#endif
      }

      // Smaller?
      if (n < size())
      {
        iterator i_start = end();
        std::advance(i_start, -difference_type(size() - n));
        erase(i_start, end());
      }
      // Larger?
      else if (n > size())
      {
        insert(end(), n - size(), value);
      }
    }

    //*************************************************************************
    /// Clears the list.
    //*************************************************************************
    void clear()
    {
      initialise();
    }

    //*************************************************************************
    // Removes the values specified.
    //*************************************************************************
    void remove(const value_type& value)
    {
      iterator iValue = begin();

      while (iValue != end())
      {
        if (value == *iValue)
        {
          iValue = erase(iValue);
        }
        else
        {
          ++iValue;
        }
      }
    }

    //*************************************************************************
    /// Removes according to a predicate.
    //*************************************************************************
    template <typename TPredicate>
    void remove_if(TPredicate predicate)
    {
      iterator iValue = begin();

      while (iValue != end())
      {
        if (predicate(*iValue))
        {
          iValue = erase(iValue);
        }
        else
        {
          ++iValue;
        }
      }
    }

    //*************************************************************************
    /// Removes all but the first element from every consecutive group of equal
    /// elements in the container.
    //*************************************************************************
    void unique()
    {
        unique(std::equal_to<T>());
    }

    //*************************************************************************
    /// Removes all but the first element from every consecutive group of equal
    /// elements in the container.
    //*************************************************************************
    template <typename TIsEqual>
    void unique(TIsEqual isEqual)
    {
      if (empty())
      {
        return;
      }

      iterator i_item = begin();
      ++i_item;
      iterator i_previous = begin();

      while (i_item != end())
      {
        if (isEqual(*i_previous, *i_item))
        {
          i_item = erase(i_item);
        }
        else
        {
          i_previous = i_item;
          ++i_item;
        }
      }
    }

    //*************************************************************************
    /// Sort using in-place merge sort algorithm.
    /// Uses 'less-than operator as the predicate.
    //*************************************************************************
    void sort()
    {
      sort(std::less<T>());
    }

    //*************************************************************************
    /// Sort using in-place merge sort algorithm.
    /// Uses a supplied predicate function or functor.
    /// This is not my algorithm. I got it off the web somewhere.
    //*************************************************************************
    template <typename TCompare>
    void sort(TCompare compare)
    {
      iterator i_left;
      iterator i_right;
      iterator i_node;
      iterator i_head;
      iterator i_tail;
      int   list_size = 1;
      int   number_of_merges;
      int   left_size;
      int   right_size;

      if (is_trivial_list())
      {
        return;
      }

      while (true)
      {
        i_left = begin();
        i_head = end();
        i_tail = end();

        number_of_merges = 0;  // Count the number of merges we do in this pass.

        while (i_left != end())
        {
          ++number_of_merges;  // There exists a merge to be done.
          i_right = i_left;
          left_size = 0;

          // Step 'list_size' places along from left
          for (int i = 0; i < list_size; ++i)
          {
            ++left_size;
            ++i_right;

            if (i_right == end())
            {
              break;
            }
          }

          // If right hasn't fallen off end, we have two lists to merge.
          right_size = list_size;

          // Now we have two lists. Merge them.
          while (left_size > 0 || (right_size > 0 && i_right != end()))
          {
            // Decide whether the next node of merge comes from left or right.
            if (left_size == 0)
            {
              // Left is empty. The node must come from right.
              i_node = i_right++;
              --right_size;
            }
            else if (right_size == 0 || i_right == end())
            {
              // Right is empty. The node must come from left.
              i_node = i_left++;
              --left_size;
            }
            else if (compare(*i_left, *i_right))
            {
              // First node of left is lower or same. The node must come from left.
              i_node = i_left++;
              --left_size;
            }
            else
            {
              // First node of right is lower. The node must come from right.
              i_node = i_right;
              ++i_right;
              --right_size;
            }

            // Add the next node to the merged head.
            if (i_head == end())
            {
              join(*i_head.p_node, *i_node.p_node);
              i_head = i_node;
              i_tail = i_node;
            }
            else
            {
              join(*i_tail.p_node, *i_node.p_node);
              i_tail = i_node;
            }

            join(*i_tail.p_node, terminal_node);
          }

          // Now left has stepped `list_size' places along, and right has too.
          i_left = i_right;
        }

        // If we have done only one merge, we're finished.
        if (number_of_merges <= 1)   // Allow for number_of_merges == 0, the empty head case
        {
          return;
        }

        // Otherwise repeat, merging lists twice the size
        list_size *= 2;
      }
    }

    //*************************************************************************
    /// Reverses the list.
    //*************************************************************************
    void reverse()
    {
      if (is_trivial_list())
      {
        return;
      }

      iterator i_item = begin();

      while (i_item != end())
      {
        i_item.p_node->reverse();
        --i_item; // Now we've reversed it, we must decrement it.
      }

      // Terminal node.
      i_item.p_node->reverse();
    }

  protected:

    //*************************************************************************
    /// Constructor.
    //*************************************************************************
    ilist(Data_Node* node_pool, size_t max_size_)
      : list_base(max_size_),
        node_pool(node_pool)
    {
      initialise();
    }

  private:

    //*************************************************************************
    /// Join two nodes.
    //*************************************************************************
    void join(Node& left, Node& right)
    {
      left.next      = &right;
      right.previous = &left;
    }

    //*************************************************************************
    /// Join two nodes.
    //*************************************************************************
    void join(Data_Node& left, Data_Node& right)
    {
      left.next      = &right;
      right.previous = &left;
    }

    //*************************************************************************
    /// Is the list a trivial length?
    //*************************************************************************
    bool is_trivial_list() const
    {
      return (size() < 2);
    }

    //*************************************************************************
    /// Finds the next free node.
    //*************************************************************************
    void find_next_free()
    {
      while (next_free != MAX_SIZE)
      {
        if (node_pool[next_free].is_free())
        {
          return;
        }
        else
        {
          ++next_free;
        }
      }
    }

    //*************************************************************************
    /// Insert a node.
    //*************************************************************************
    void insert_node(Node& position, Node& node)
    {
      // Connect to the list.
      join(*position.previous, node);
      join(node,               position);

      // One more.
      ++current_size;

      // Update the position of the next free node in the pool.
      find_next_free();
    }

    //*************************************************************************
    /// Remove a node.
    //*************************************************************************
    void remove_node(Node& node)
    {
      // Update the position of the next free node in the pool.
      size_t new_free = std::distance(&node_pool[0], data_cast(&node));
      next_free       = std::min(next_free, new_free);

      // One less.
      --current_size;

      // Disconnect the node from the list.
      join(*node.previous, *node.next);
      node.mark_as_free();
    }

    //*************************************************************************
    /// Get the head node.
    //*************************************************************************
    Node& get_head()
    {
      return *terminal_node.next;
    }

    //*************************************************************************
    /// Get the head node.
    //*************************************************************************
    const Node& get_head() const
    {
      return *terminal_node.next;
    }

    //*************************************************************************
    /// Get the tail node.
    //*************************************************************************
    Node& get_tail()
    {
      return *terminal_node.previous;
    }

    //*************************************************************************
    /// Get the tail node.
    //*************************************************************************
    const Node& get_tail() const
    {
      return *terminal_node.previous;
    }

    //*************************************************************************
    /// Initialise the list.
    //*************************************************************************
    void initialise()
    {
      // Reset the node pool.
      for (size_t i = 0; i < max_size(); ++i)
      {
        node_pool[i].mark_as_free();
      }

      next_free    = 0;
      current_size = 0;
      join(terminal_node, terminal_node);
    }
  };
}

//*************************************************************************
/// Equal operator.
///\param lhs Reference to the first list.
///\param rhs Reference to the second list.
///\return <b>true</b> if the arrays are equal, otherwise <b>false</b>.
//*************************************************************************
template <typename T>
bool operator ==(const etl::ilist<T>& lhs, const etl::ilist<T>& rhs)
{
  return (lhs.size() == rhs.size()) && std::equal(lhs.begin(), lhs.end(), rhs.begin());
}

//*************************************************************************
/// Not equal operator.
///\param lhs Reference to the first list.
///\param rhs Reference to the second list.
///\return <b>true</b> if the arrays are not equal, otherwise <b>false</b>.
//*************************************************************************
template <typename T>
bool operator !=(const etl::ilist<T>& lhs, const etl::ilist<T>& rhs)
{
  return !(lhs == rhs);
}

//*************************************************************************
/// Less than operator.
///\param lhs Reference to the first list.
///\param rhs Reference to the second list.
///\return <b>true</b> if the first list is lexigraphically less than the
/// second, otherwise <b>false</b>.
//*************************************************************************
template <typename T>
bool operator <(const etl::ilist<T>& lhs, const etl::ilist<T>& rhs)
{
  return std::lexicographical_compare(lhs.begin(),
                                      lhs.end(),
                                      rhs.begin(),
                                      rhs.end());
}

//*************************************************************************
/// Greater than operator.
///\param lhs Reference to the first list.
///\param rhs Reference to the second list.
///\return <b>true</b> if the first list is lexigraphically greater than the
/// second, otherwise <b>false</b>.
//*************************************************************************
template <typename T>
bool operator >(const etl::ilist<T>& lhs, const etl::ilist<T>& rhs)
{
  return std::lexicographical_compare(lhs.begin(),
                                      lhs.end(),
                                      rhs.begin(),
                                      rhs.end(),
                                      std::greater<T>());
}

//*************************************************************************
/// Less than or equal operator.
///\param lhs Reference to the first list.
///\param rhs Reference to the second list.
///\return <b>true</b> if the first list is lexigraphically less than or equal
/// to the second, otherwise <b>false</b>.
//*************************************************************************
template <typename T>
bool operator <=(const etl::ilist<T>& lhs, const etl::ilist<T>& rhs)
{
  return !operator >(lhs, rhs);
}

//*************************************************************************
/// Greater than or equal operator.
///\param lhs Reference to the first list.
///\param rhs Reference to the second list.
///\return <b>true</b> if the first list is lexigraphically greater than or
/// equal to the second, otherwise <b>false</b>.
//*************************************************************************
template <typename T>
bool operator >=(const etl::ilist<T>& lhs, const etl::ilist<T>& rhs)
{
  return !operator <(lhs, rhs);
}

#if WIN32
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif

#undef __ETL_IN_ILIST_H__

#endif


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>com.cyc.base.exception (Core Client Implementation 1.1.1 API)</title>
<meta name="date" content="2018-01-24">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

com.cyc.base.exception

Interfaces

SessionCompatibleBaseClientException

Exceptions

BaseClientException

BaseClientRuntimeException

CycApiException

CycConnectionException

CycTimeOutException


text:
package com.ja.markdown.modeller.sc.java.jpa;

import com.ja.markdown.modeller.sc.java.model.JavaClass;

public enum JpaClass {

	Entity, EntityManager, Column, GeneratedValue, GenerationType, Id, JoinColumn, ManyToMany, ManyToOne, NamedQuery, NamedQueries, OneToMany, OrderBy, PersistenceContext, Temporal, TemporalType;

	public JavaClass instance() {
		return new JavaClass("javax.persistence." + toString());
	}
}


text:
using System.Configuration;
using Microsoft.Azure.Mobile.Server.Tables;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Linq;
using BeerDrinkin.DataObjects;

namespace BeerDrinkin.Models
{
    public class BeerDrinkinContext : DbContext
    {
        private const string CONNECTION_STRING_NAME = "Name=MS_TableConnectionString";

        static BeerDrinkinContext()
        {
            // Automatic migration
            //Database.SetInitializer(new MigrateDatabaseToLatestVersion<BeerDrinkinContext, Migrations.Configuration>());

            Database.SetInitializer<BeerDrinkinContext>(new CreateDatabaseIfNotExists<BeerDrinkinContext>());

            // No migration
            //Database.SetInitializer<BeerDrinkinContext>(null);
        }

        public BeerDrinkinContext()
            : base(CONNECTION_STRING_NAME)
        { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Add(
                new AttributeToColumnAnnotationConvention<TableColumnAttribute, string>(
                    "ServiceTableColumn", (property, attributes) => attributes.Single().ColumnType.ToString()));
        }

        public DbSet<User> Users { get; set; }
        public DbSet<CheckIn> CheckIns { get; set; }
        public DbSet<Beer> Beers { get; set; }
        public DbSet<Rating> Ratings { get; set; }
        public DbSet<Favourite> Favourites { get; set; }
        public DbSet<Brewery> Breweries { get; set; }
        public DbSet<Image> Images { get; set; }
        public DbSet<Wish> Wishes { get; set; }
        public DbSet<AppEvent> AppEvents { get; set; }
        public DbSet<WeatherCondition> WeatherConditions { get; set; }

    }
}


text:
<?php
namespace Squanch\Plugins\PhpCache\Command;

use Squanch\Commands\AbstractDelete;
use Cache\Namespaced\NamespacedCachePool;
use Squanch\Plugins\PhpCache\Connector\IPhpCacheConnector;

class Delete extends AbstractDelete implements IPhpCacheConnector
{
	use \Squanch\Plugins\PhpCache\Connector\TPhpCacheConnector;

	protected function onDeleteBucket(string $bucket): bool
	{
		$bucket = new NamespacedCachePool($this->getConnector(), $bucket);
		var_dump($bucket);
		return $bucket->clear();
	}

	protected function onDeleteItem(string $bucket, string $key): bool
	{
		$bucket = new NamespacedCachePool($this->getConnector(), $bucket);
		return $bucket->deleteItem($key);
	}
}


text:
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: JanGolle
 * Date: 19.11.14
 * Time: 18:07
 * To change this template use File | Settings | File Templates.
 */

namespace app\modules\frontend\controllers;

use app\forms\HotMessageForm;
use app\forms\SearchForm;
use app\models\Membership;
use Yii;
use app\forms\MessageForm;
use app\forms\ProplanForm;
use app\abstracts\FrontController;
use app\models\Feedback;
use yii\helpers\Url;

class AjaxController extends FrontController
{
    public function actionFeedback($id)
    {
        $this->validateAjax();

        $feedback = new Feedback();

        $feedback->setAttributes([
            'user_id' => \Yii::$app->user->id,
            'escort_id' => $id,
            'text' => \Yii::$app->request->post('FeedbackForm')['text'],
            'time' => 'now'
        ]);

        $feedback->save(true);
    }

    public function actionFeedbacklist()
    {
        $this->validateAjax();

        $feedbacks = $this->model('Feedback')->getFeedbackList();

        if(!$feedbacks)
            $this->ajaxError('Отзывы не найдены');

        $this->ajax('_feedbacks', [
            'feedbacks' => $this->mergeFeedbacks($feedbacks),
        ]);
    }

    public function actionLastfeedback()
    {
        $this->validateAjax();

        $feedback = $this->model('Feedback')->getLastFeedback($this->get('lastId'));

        if(!$feedback)
            $this->ajaxError('Отзыв не найден');

        $feedback = $this->mergeFeedbacks([$feedback]);
        $feedback = $feedback[0];

        $this->ajax('_feedback', [
            'feedback' => $feedback,
        ]);
    }

    public function actionCounties()
    {
        $this->validateAjax();

        $id = (int)$this->get('region');

        if($id !== 0)
            $region = $this->model('Region')->findRegion($this->get('region'));
        else
            $region = ['countries' => []];

        if(!$region)
            $this->ajaxNotFound('Не найден регион');

        $searchForm = new SearchForm();
        $searchForm->setCountries($region['countries']);

        $this->ajax('_countriesSelector', [
            'searchForm' => $searchForm,
        ]);
    }

    public function actionCountrycities()
    {
        $this->validateAjax();

        $id = (int)$this->get('country');

        if($id !== 0)
            $country = $this->model('Region')->findCountryWithStates($this->get('country'));
        else
            $country = ['states' => []];

        if(!$country)
            $this->ajaxNotFound('Страна не найдена');

        $searchForm = new SearchForm();

        if($country['states']){
            $searchForm->setStates($country['states']);
            $this->ajax('_statesSelector', ['searchForm' => $searchForm]);
        }else{
            if($id !== 0)
                $country = $this->model('Region')->findCountryWithCities($id);
            else
                $country = ['cities' => []];

            if(!$country)
                $this->ajaxNotFound('Страна не найдена');

            $searchForm->setCities($country['cities']);
            $this->ajax('_citiesSelector', ['searchForm' => $searchForm]);
        }
    }

    public function actionStatecities()
    {
        $this->validateAjax();

        $id = (int)$this->get('state');

        if($id !== 0)
            $state = $this->model('Region')->findState($id);
        else
            $state = ['cities' => []];

        if(!$state)
            $this->ajaxNotFound('Штат не найден');

        $searchForm = new SearchForm();
        $searchForm->setCities($state['cities']);

        $this->ajax('_citiesSelector', ['searchForm' => $searchForm]);
    }

    public function actionProfiles()
    {
        $this->validateAjax();

        Yii::$app->session->setSearchSettings($this->getPost());

        /*$profiles = $this->model('Escort')->getProfiles(['topLimit' => Yii::$app->params['topProfilesLimit'], 'sortByDate' => true]);

        if(!$profiles)
            $this->ajaxNotFound('Не удалось найти профили');*/

        $this->ajax([
            //'html' => $this->renderPartial('_topProfiles', ['vips' => $profiles]),
            'redirect' => Url::toRoute(['escort/list']),
        ]);
    }

    public function actionVips()
    {
        $this->validateAjax();

        $vips = $this->model('Escort')->getVips();

        if(!$vips)
            $this->ajaxNotFound('Не удалось найти профили');

        $this->ajax([
            'vips' => $vips,
        ]);
    }

    public function actionPremiums()
    {
        $this->validateAjax();

        $vips = $this->model('Escort')->getPremiums();

        if(!$vips)
            $this->ajaxNotFound('Не удалось найти профили');

        $this->ajax('_vipPersons', [
            'vips' => $vips,
        ]);
    }

    public function actionTopprofiles()
    {
        $this->validateAjax();
        $vips = $this->model('Escort')->getProfiles(['topLimit' => Yii::$app->params['topProfilesLimit'], 'sortByDate' => true]);

        if(!$vips)
            $this->ajaxNotFound('Не удалось найти профили');

        $this->ajax('_topProfiles', [
            'vips' => $vips,
        ]);
    }

    public function actionHotmessages()
    {
        $this->validateAjax();

        $messages = $this->model('Message')->getHotMessages();

        if(!$messages)
            $this->ajaxNotFound('Не удалось найти сообщения');

        $this->ajax('_hotMessages', [
            'messages' => $messages,
        ]);
    }

    public function actionLasthotmessage()
    {
        $this->validateAjax();

        $message = $this->model('Message')->getLastHotMessage($this->get('lastId'));

        if(!$message)
            $this->ajaxError('Не удалось найти сообщение');

        $this->ajax('_hotMessage', [
            'message' => $message,
        ]);
    }

    public function actionLastverified()
    {
        $this->validateAjax();

        $escorts = $this->model('Escort')->getLastVerified();

        if(!$escorts)
            $this->ajaxNotFound('Не удалось найти профили');

        $this->ajax('_lastVerified', [
            'vips' => $this->mergeProfiles($escorts),
        ]);
    }

    public function actionGetmessagepopup($id)
    {
        $this->validateAjax();

        $account = $this->model('Account')->findEntityById($id);

        $messageForm = new MessageForm();

        if(!$account)
            $this->ajaxNotFound('Не удалось найти профиль');

        $this->ajax('_sendMessagePopup',[
            'account' => $account,
            'messageForm' => $messageForm
        ]);
    }

    public function actionProplancost($id)
    {
        $this->validateAjax();

        $proplan = $this->model('Membership')->findById($id);
        if(!$proplan)
            $this->ajaxNotFound('Не удалось найти account ID {id}', ['id' => $id]);

        $proplanForm = new ProplanForm();
        $proplanForm->setProplan($proplan);

        $this->ajax('partials/_proplanCost', [
            'proplan' => $proplan,
            'proplanForm' => $proplanForm,
        ]);
    }

    public function actionProplansubmit($id)
    {
        $this->validateAjax();

        $proplan = $this->model('Membership')->findById($id);
        if(!$proplan)
            $this->ajaxNotFound('Не удалось найти account ID {id}', ['id' => $id]);

        $proplanForm = new ProplanForm();

        $proplanForm->id = $id;
        $proplanForm->userId = Yii::$app->user->id;
        $proplanForm->setProplan($proplan);

        if(!$proplanForm->load($this->getPost()))
            $this->ajaxError('Неверные данные');

        $price = $proplanForm->price*($proplanForm->duration/$proplan->duration);

        $money = Yii::$app->user->getBalance() - $price;

        if($money < 0){
            $this->ajax([
                'money' => $this->renderPartial('partials/_proplanFailed', [
                    'amount' => abs($money),
                ]),
                'url' => Url::toRoute(['account/index', 'page' => 'credits']),
            ]);
        }

        if($endDate = $proplanForm->save()){
            $this->ajax('partials/_proplanExtended', [
                'date' => Yii::$app->local->formatDate($endDate),
            ]);
        }else
            $this->ajaxError('Не удалось подключить аккаунт');
    }

    /**
     * @param \app\models\Escort[] $escorts
     * @return \stdClass[]
     */
    private function mergeProfiles(array $escorts)
    {
        foreach($escorts as $i => $escort){
            $escortData = $escort->getAttributes();

            $escortData['fullName'] = $escort->getFullName();
            $escortData['ava'] = $escort->getRandomImg();
            $escortData['city'] = $escort->getCityName();
            $escortData['isOnline'] = $escort->getIsOnline();

            $escorts[$i] = (object)$escortData;
        }

        return (array)$escorts;
    }

    /**
     * @param \app\models\Feedback[] $feedbacks
     * @return array
     */
    private function mergeFeedbacks(array $feedbacks)
    {
        foreach($feedbacks as $i => $feedback){
            $feedbackInfo = $feedback->getAttributes();
            $escortInfo = $feedback->escort->getAttributes();

            unset($escortInfo['id']);
            $escortInfo['ava'] = $feedback->escort->getAva();
            $escortInfo['userId'] = $feedbackInfo['user_id'];
            $escortInfo['userName'] = $feedback->escort->getFullName();
            $escortInfo['escortId'] = $feedbackInfo['escort_id'];

            $feedbacks[$i] = (object)array_merge($feedbackInfo, $escortInfo);
        }

        return (array)$feedbacks;
    }
}


text:
module BlankSpec where

import Test.Hspec
import Main

spec :: Spec
spec = do
  describe "blank test" $ do
    it "test" $ 3 `shouldBe` (3 :: Int)


text:
package com.intellij.codeInsight.intention;

import com.intellij.codeInsight.daemon.LightIntentionActionTestCase;

/**
 * @author Dmitry Batkovich
 */
public class AddJavadocIntentionTest extends LightIntentionActionTestCase {

  public void test() throws Exception { doAllTests(); }

  @Override
  protected String getBasePath() {
    return "/codeInsight/addJavadoc";
  }
}


text:
class Firm < ActiveRecord::Base
	has_many :patients
	has_many :sections
	has_many :functions

	usar_como_cnpj :cnpj

	attr_accessible :atividade, :bairro, :cep, :cidade, :cnae, :cnpj, :endereco, :frente_trabalho, :nome_fantasia, :razao_social, :risco, :telefone, :uf

	validates_presence_of :atividade, :bairro, :cep, :cidade, :cnae, :cnpj, :endereco, :nome_fantasia, :razao_social, :risco, :telefone, :uf

	accepts_nested_attributes_for :patients, :sections, :functions, allow_destroy: true

end


text:
package org.jasig.cas.support.saml.services.idp.metadata.cache;

import com.google.common.cache.CacheBuilder;
import com.google.common.cache.LoadingCache;
import org.jasig.cas.support.saml.services.SamlRegisteredService;
import org.opensaml.saml.metadata.resolver.ChainingMetadataResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.concurrent.TimeUnit;

/**
 * An adaptation of metadata resolver which handles the resolution of metadata resources
 * inside a Guava cache. It basically is a fancy wrapper around Guava, and constructs the cache
 * semantics before processing the resolution of metadata for a SAML service.
 *
 * @author Misagh Moayyed
 * @since 5.0.0
 */
@Component("defaultSamlRegisteredServiceCachingMetadataResolver")
public final class DefaultSamlRegisteredServiceCachingMetadataResolver implements SamlRegisteredServiceCachingMetadataResolver {
    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultSamlRegisteredServiceCachingMetadataResolver.class);

    @Value("${cas.samlidp.metadata.cache.exp.minutes:30}")
    private long metadataCacheExpirationMinutes;

    @Autowired
    @Qualifier("chainingMetadataResolverCacheLoader")
    private ChainingMetadataResolverCacheLoader chainingMetadataResolverCacheLoader;

    private LoadingCache<SamlRegisteredService, ChainingMetadataResolver> cache;

    /**
     * Instantiates a new Saml registered service caching metadata resolver.
     */
    public DefaultSamlRegisteredServiceCachingMetadataResolver() {}

    @PostConstruct
    private void init() {
        this.cache = CacheBuilder.newBuilder().maximumSize(1)
                .expireAfterWrite(this.metadataCacheExpirationMinutes, TimeUnit.MINUTES).build(this.chainingMetadataResolverCacheLoader);
    }

    @Override
    public ChainingMetadataResolver resolve(final SamlRegisteredService service) {
        ChainingMetadataResolver resolver = null;
        try {
            LOGGER.debug("Resolving metadata for [{}] at [{}].", service.getName(), service.getMetadataLocation());
            resolver = this.cache.get(service);
            return resolver;
        } catch (final Exception e) {
            throw new IllegalArgumentException("Metadata resolver could not be located from metadata " + service.getMetadataLocation(), e);
        } finally {
            if (resolver != null) {
                LOGGER.debug("Loaded and cached SAML metadata [{}] from [{}] for [{}] minute(s)",
                        resolver.getId(),
                        service.getMetadataLocation(),
                        this.metadataCacheExpirationMinutes);
            }
        }
    }
}


text:
package main

import (
	"fmt"
	"log"
	"math/rand"
	"net/http"
	"os"
	"os/signal"
	"strconv"
	"time"

	"s.mcquay.me/dm/chipmunk"

	"github.com/gorilla/context"
	"github.com/kelseyhightower/envconfig"
	"github.com/spf13/cobra"
)

type Config struct {
	Host         string
	Port         int
	DBHost       string
	DBName       string
	ClientID     string
	ClientSecret string
	CookieSecret string
}

func init() {
	rand.Seed(time.Now().UnixNano())
}

func main() {
	var host, clientId, clientSecret, cookieSecret string
	var port int

	var run = &cobra.Command{
		Use:   "run",
		Short: "run command",
		Long:  `run chipd with given options`,
		Run: func(cmd *cobra.Command, args []string) {
			config := &Config{
				DBHost: "localhost",
				DBName: "dmcquay",
			}
			err := envconfig.Process("chipd", config)
			if err != nil {
				log.Fatal(err)
			}
			if host != "" {
				config.Host = host
			}
			if port != -1 {
				config.Port = port
			} else {
				if config.Port == 0 {
					config.Port = 8080
				}
			}
			if clientId != "" {
				config.ClientID = clientId
			}
			if clientSecret != "" {
				config.ClientSecret = clientSecret
			}
			if cookieSecret != "" {
				config.CookieSecret = cookieSecret
			} else {
				if config.CookieSecret == "" {
					config.CookieSecret = strconv.Itoa(rand.Int())
				}
			}
			if config.ClientID == "" || config.ClientSecret == "" {
				log.Println("Please provide both a clientId and a clientSecret")
				os.Exit(1)
			}
			log.Printf("%+v", config)

			sigs := make(chan os.Signal, 1)
			signal.Notify(sigs, os.Interrupt, os.Kill)
			go func() {
				s := <-sigs
				log.Printf("signal: %+v", s)
				os.Exit(1)
			}()

			sm := http.NewServeMux()
			_, err = chipmunk.NewServer(
				sm,
				config.ClientID,
				config.ClientSecret,
				config.CookieSecret,
				config.DBHost,
				config.DBName,
				"",
			)
			if err != nil {
				log.Fatalf("problem initializing Chipd server: %+v", err)
			}

			hostname := "localhost"
			if config.Host == "" {
				hostname, err = os.Hostname()
				if err != nil {
					log.Printf("problem getting hostname:", err)
				}
			}
			log.Printf("serving at: http://%s:%d/", hostname, config.Port)

			addr := fmt.Sprintf("%s:%d", config.Host, config.Port)
			err = http.ListenAndServe(addr, context.ClearHandler(sm))
			if err != nil {
				log.Printf("%+v", err)
				os.Exit(1)
			}
		},
	}

	run.Flags().StringVarP(
		&host,
		"host",
		"n",
		"",
		"hostname",
	)
	run.Flags().IntVarP(
		&port,
		"port",
		"p",
		-1,
		"port",
	)
	run.Flags().StringVarP(
		&clientId,
		"clientId",
		"i",
		"",
		"github oauth clientId",
	)
	run.Flags().StringVarP(
		&clientSecret,
		"clientSecret",
		"s",
		"",
		"github oauth clientSecret",
	)
	run.Flags().StringVarP(
		&cookieSecret,
		"cookieSecret",
		"c",
		"",
		"cookieSecret",
	)

	var rootCmd = &cobra.Command{Use: "app"}
	rootCmd.AddCommand(run)
	rootCmd.Execute()
}


text:
{include resources/ug-header.md}
{set-property title "CL-Markdown User's Guide"}

# CL-Markdown - Quick Start

{table-of-contents :start 2 :depth 3}

CL-Markdown is an enhanced version of John Gruber's [Markdown][] text
markup langauge. Markdown's goal is to keep text readable as *text* and
as HTML. CL-Markdown keeps this principle and adds a flexible extension
mechanism so that you can build complex documents easily.

 [Markdown]: http://daringfireball.net/projects/markdown/

### Getting Started

The easiest way to install CL-Markdown is using the
[bundle][]. You can also use [ASDF-Install][], download
tarballs or grab the sources directly (usings [darcs][]). If
you do use the bundle, here is what you'd do:

    shell> cd <lisp-sources>
    shell> curl http://common-lisp.net/project/cl-markdown/cl-markdown-bundle.tar.gz > cl-markdown-bundle.tar.gz
    shell> tar -zxvf cl-markdown-bundle.tar.gz
    shell> lisp
    ;; Super Lisp 5.3 (just kidding)
    lisp: (require 'asdf)
    lisp: (load "cl-markdown-bundle/cl-markdown.asd")
    lisp: (asdf:oos 'asdf:load-op 'cl-markdown)
    lisp: (in-package cl-markdown)

The top-level CL-Markdown command is `markdown`. It creates a
`document` from a source (pathname, stream or string) and
then sends the document to a stream in a `format`. The
default format is `:html` and the default output is `t`
(which sends the output to `*standard-output*`.). You can use
an already open stream for output, provide a pathname to a
file (which will be overwritten!) or use the symbol `nil` to
direct output to a new stream. At this time, support for
formats other than HTML is not provided. For example:

    lisp: (markdown "# Hello *there*")
    "
Hello there
"

CL-Markdown implements most of John Gruber's
[specification][markdown-specification] (though it does not
yet handle e-mails and some edges cases). It also adds a new
syntax for extensions.

 [markdown-specification]: http://daringfireball.net/projects/markdown/syntax

### Function calls: \{ and \}

Calling extension functions requires three things:

1. writing (or finding) the extension that you want
2. telling CL-Markdown that you want to use the extension
3. writing your Markdown text with calls to the extension

The last part is the easiest; all you need to do is open a
curly brace, type the name of extension function, type in the
arguments (separated by spaces) and type a closing curly
brace. For example:

"\{now\}" will generate the text "{now}".

The second step is necessary because CL-Markdown won't
recognize functions as functions unless you tell it to up
front. After all, you wouldn't want to allow people to
execute arbitrary code; it **might** be a security risk
(smile). Because CL-Markdown operates in two stages, there
are two times when functions can be called: during parsing
and during rendering. Functions active during these stages
are keep in the special variables `*render-active-functions*`
and `*parse-active-functions*`.

An example might make this clearer. First, we'll call Markdown
without specifying any functions:

    ? (markdown "Today is {today}. It is {now}."
      :format :html :stream t)

Today is
    ; Warning: Inactive or undefined CL-Markdown function TODAY
    ; While executing: #<STANDARD-METHOD RENDER-SPAN-TO-HTML ((EQL EVAL) T)>
    . It is
    ; Warning: Inactive or undefined CL-Markdown function NOW
    ; While executing: #<STANDARD-METHOD RENDER-SPAN-TO-HTML ((EQL EVAL) T)>
    .

As you can see, the functions weren't ones that CL-Markdown was ready
to recognize, so we got warnings and no text was generated. If we
tell CL-Markdown that `today` and `now` should be treated as
functions, then we see a far prettier picture:

    ? (let ((*render-active-functions*
             (append '(today now) *render-active-functions*)))
        (markdown "Today is {today}. It is {now}."
            :format :html :stream t))

Today is 1 August 2006. It is 11:36.

By now, we've seen how to include function calls in CL-Markdown
documents and how to generate those documents with CL-Markdown. The
final piece of the puzzle is actually writing the extensions.

#### Writing Cl-Markdown extensions

There are several ways to write extensions. {footnote
Extensions beg for a little {abbrev DSL Domain Specific
Language} but those macros are still to be written.} The
easiest is one is to write functions active during rendering
that return the text that you wish to be included in the
document. For example:

    (defun today (phase arguments result)
      (declare (ignore phase arguments result))
      (format-date "%e %B %Y" (get-universal-time)))

The format-date command is part of [metatilities-base][]; it
returns a string of the date using the C library inspired
date format. This string is placed in the document whereever
the function call (\{today\}) is found.

 [metatilities]:

Alternately, one can use the `*output-stream*` variable to
insert more complicated text. This would look like:

    (defun now (phase arguments result)
      (declare (ignore phase arguments result))
      (format *output-stream* "~a"
        (format-date "%H:%M" (get-universal-time)))
      nil)

(Note that `now` returns `nil` so that the date isn't inserted
twice!).

The other alternative is to use your function calls to alter
the structure of the CL-Markdown document and then let
Markdown deal with some or all of the rest. The `anchor`
extension provides an example of this:

    (defun anchor (phase &rest args)
      (ecase phase
        (:parse
         (let ((name (caar args))
               (title (cadar args)))
           (setf (item-at (link-info *current-document*) name)
                 (make-instance 'link-info
                   :id name :url (format nil "#~a" name)
                   :title (or title "")))))
        (:render (let ((name (caar args)))
                   (format nil ""
                           name name)))))

`Anchor` makes it easier to insert anchors into your document
and to link to those anchors from elsewhere. It is active
during both parsing and rendering. During the parsing phase,
it uses it's arguments to determine the name and title of the
link and places this into the current document's link
information table. During rendering, it outputs the HTML
needed to mark the link. {footnote If you would like to see
more examples, look in the files `extensions.lisp` or
`footnotes.lisp`.}

{footnotes}

{include resources/ug-footer.md}


text:
<?php

/**
 *  \file       htdocs/lib/treeview.lib.php
 *  \ingroup    core
 *  \brief      Libraries for tree views
 *  \version    $Id: treeview.lib.php,v 1.10 2010/07/01 22:42:42 eldy Exp $
 */

/**
 * Return if a child id is in descendance of parentid
 *
 * @param $fulltree		Full tree. Tree must be an array of records that looks like:
 *							id = id record
 *							id_mere = id record mother
 *							id_children = array of direct child id
 *							label = record label
 * 							fullpath = Full path of id
 * 							level =	Level of record
 * @param $parentid		Parent id
 * @param $childid		Child id
 * @return	int			1=Yes, 0=No
 */
function is_in_subtree($fulltree,$parentid,$childid)
{
	if ($parentid == $childid) return 1;

	// Get fullpath of parent
	$fullpathparent='';
	foreach($fulltree as $key => $val)
	{
		//print $val['id']."-".$section."
";
		if ($val['id'] == $parentid)
		{
			$fullpathparent=$val['fullpath'];
			break;
		}
	}
	//print '> parent='.$parentid.' - child='.$childid.' - '.$fullpathparent.'
';

	foreach($fulltree as $record)
	{
		if ($record['id'] == $childid)
		{
			//print $record['fullpath'].'_'.' - '.$fullpathparent.'_';
			if (preg_match('/'.$fullpathparent.'_/i',$record['fullpath'].'_'))
			{
				//print 'DEL='.$childid;
				return 1;
			}
		}
	}

	return 0;
}

/**
 * Show picto of a tree view
 *
 * @param 	fulltree	Array of entries in correct order
 * @param 	key			Key of value to show picto
 * @return	array		(0 or 1 if at least one of this level after, 0 or 1 if at least one of higher level after)
 */
function tree_showpad(&$fulltree,$key,$selected=0)
{
	$pos=1;

	// Loop on each pos, because we will output an img for each pos
	while ($pos <= $fulltree[$key]['level'] && $fulltree[$key]['level'] > 0)
	{
		// Process picto for column $pos

		$atleastonofthislevelafter=0;
		$nbofhigherlevelafter=0;
		$nbofdirinsub=0;
		$nbofdocinsub=0;
		$found=0;
		//print 'x'.$key;
		foreach($fulltree as $key2 => $val2)
		{
			if ($found == 1) // We are after the entry to show
			{
				if ($fulltree[$key2]['level'] > $pos)
				{
					$nbofdirinsub++;
					$nbofdocinsub+=$fulltree[$key2]['cachenbofdoc'];
					$nbofhigherlevelafter++;
				}
				if ($fulltree[$key2]['level'] == $pos)
				{
					$atleastonofthislevelafter=1;
				}
				if ($fulltree[$key2]['level'] <= $pos)
				{
					break;
				}
			}
			if ($key2 == $key)
			{
				$found=1;
			}
		}
		//print $atleastonofthislevelafter;

		if ($atleastonofthislevelafter)
		{
			if ($fulltree[$key]['level'] == $pos) print img_picto_common('','treemenu/branch.gif');
			else print img_picto_common('','treemenu/line.gif');
		}
		else
		{
			if ($fulltree[$key]['level'] == $pos) print img_picto_common('','treemenu/branchbottom.gif');
			else print img_picto_common('','treemenu/linebottom.gif');
		}
		$pos++;
	}

	return array($atleastonofthislevelafter,$nbofhigherlevelafter,$nbofdirinsub,$nbofdocinsub);
}

// ------------------------------- Used by enu editor -----------------

/**
 * 	\brief		Ad javascript tree functions
 */
function tree_addjs()
{
	global $langs;
	print '';
}

/* cette fonction gere le decallage des elements
 suivant leur position dans l'arborescence
 */
function tree_showline($tab,$rang)
{
	global $conf, $rangLast, $idLast, $menu_handler;

	if ($conf->use_javascript_ajax)
	{
		if($rang == $rangLast)
		{
			print '';
			//print 'aa';
		}
		elseif($rang > $rangLast)
		{

			print '

';

		}
		elseif($rang < $rangLast)
		{
			print '';

			for($i=$rang; $i < $rangLast; $i++)
			{
				print '

';
				echo "\n";
			}

		}
	}
	else
	{
		if($rang > $rangLast)
		{

			print '

';

		}
		elseif($rang < $rangLast)
		{

			for($i=$rang; $i < $rangLast; $i++)
			{
				print '

';
				echo "\n";
			}

		}
	}

	print '
';

	// Content of line
	print '  '.$tab[2].'';
	print '
'.img_edit('default',0,'class="menuEdit" id="edit'.$tab[0].'"').'
';
	print '
'.img_edit_add('default',0,'class="menuNew" id="new'.$tab[0].'"').'
';
	print '
'.img_delete('default',0,'class="menuDel" id="del'.$tab[0].'"').'
';
	print '
'.img_picto("Monter","1uparrow").''.img_picto("Descendre","1downarrow").'
';

	print '
';
	echo "\n";

	$rangLast = $rang;
	$idLast = $tab[0];
}

/*fonction r�cursive d'affichage de l'arbre
 $tab  :tableau des �l�ments
 $pere :index de l'�l�ment courant
 $rang :d�callage de l'�l�ment
 */
function tree_recur($tab,$pere,$rang)
{
	if ($pere == 0) print '
';

	if ($rang > 10)	return;	// Protection contre boucle infinie

	//ballayage du tableau
	for ($x=0;$x<count($tab);$x++)
	{
		//si un �l�ment a pour p�re : $pere
		if ($tab[$x][1]==$pere)
		{
			//on l'affiche avec le d�callage courrant
			tree_showline($tab[$x],$rang);

			/*et on recherche ses fils
			 en rappelant la fonction recur()
			 (+ incr�mentation du d�callage)*/
			tree_recur($tab,$tab[$x][0],$rang+1);
		}
	}

	if ($pere == 0) print '
';
}

?>


text:
<?php

namespace Flarum\Api\Controller;

use Flarum\Api\UrlGenerator;
use Flarum\Core\Search\SearchCriteria;
use Flarum\Core\Search\User\UserSearcher;
use Psr\Http\Message\ServerRequestInterface;
use Tobscure\JsonApi\Document;

class ListUsersController extends AbstractCollectionController
{
    /**
     * {@inheritdoc}
     */
    public $serializer = 'Flarum\Api\Serializer\UserSerializer';

    /**
     * {@inheritdoc}
     */
    public $include = ['groups'];

    /**
     * {@inheritdoc}
     */
    public $sortFields = [
        'username',
        'commentsCount',
        'discussionsCount',
        'answerCount',
        'askCount',
        'praise_count',
        'agree_count',
        'same_question_count',
        'lastSeenTime',
        'joinTime'
    ];

    /**
     * @var UserSearcher
     */
    protected $searcher;

    /**
     * @var UrlGenerator
     */
    protected $url;

    /**
     * @param UserSearcher $searcher
     * @param UrlGenerator $url
     */
    public function __construct(UserSearcher $searcher, UrlGenerator $url)
    {
        $this->searcher = $searcher;
        $this->url = $url;
    }

    /**
     * {@inheritdoc}
     */
    protected function data(ServerRequestInterface $request, Document $document)
    {
        $actor = $request->getAttribute('actor');
        $query = array_get($this->extractFilter($request), 'q');
        $is_pingxx = array_get($this->extractFilter($request), 'is_pingxx');
        $sort = $this->extractSort($request);

        $criteria = new SearchCriteria($actor, $query, $sort);

        $limit = $this->extractUserLimit($request);
        $offset = $this->extractOffset($request);
        $load = $this->extractInclude($request);

        $results = $this->searcher->search($criteria, $limit, $offset, $load, $is_pingxx);

        $document->addPaginationLinks(
            $this->url->toRoute('users.index'),
            $request->getQueryParams(),
            $offset,
            $limit,
            $results->areMoreResults() ? null : 0
        );

        return $results->getResults();
    }
}


text:
package com.amazonaws.services.config.model.transform;

import java.util.Map;
import java.util.List;

import com.amazonaws.AmazonClientException;
import com.amazonaws.services.config.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.BinaryUtils;
import com.amazonaws.util.StringUtils;
import com.amazonaws.util.IdempotentUtils;
import com.amazonaws.util.StringInputStream;
import com.amazonaws.protocol.json.*;

/**
 * ConfigStreamDeliveryInfoMarshaller
 */
public class ConfigStreamDeliveryInfoJsonMarshaller {

    /**
     * Marshall the given parameter object, and output to a SdkJsonGenerator
     */
    public void marshall(ConfigStreamDeliveryInfo configStreamDeliveryInfo,
            StructuredJsonGenerator jsonGenerator) {

        if (configStreamDeliveryInfo == null) {
            throw new AmazonClientException(
                    "Invalid argument passed to marshall(...)");
        }

        try {
            jsonGenerator.writeStartObject();

            if (configStreamDeliveryInfo.getLastStatus() != null) {
                jsonGenerator.writeFieldName("lastStatus").writeValue(
                        configStreamDeliveryInfo.getLastStatus());
            }
            if (configStreamDeliveryInfo.getLastErrorCode() != null) {
                jsonGenerator.writeFieldName("lastErrorCode").writeValue(
                        configStreamDeliveryInfo.getLastErrorCode());
            }
            if (configStreamDeliveryInfo.getLastErrorMessage() != null) {
                jsonGenerator.writeFieldName("lastErrorMessage").writeValue(
                        configStreamDeliveryInfo.getLastErrorMessage());
            }
            if (configStreamDeliveryInfo.getLastStatusChangeTime() != null) {
                jsonGenerator.writeFieldName("lastStatusChangeTime")
                        .writeValue(
                                configStreamDeliveryInfo
                                        .getLastStatusChangeTime());
            }

            jsonGenerator.writeEndObject();
        } catch (Throwable t) {
            throw new AmazonClientException(
                    "Unable to marshall request to JSON: " + t.getMessage(), t);
        }
    }

    private static ConfigStreamDeliveryInfoJsonMarshaller instance;

    public static ConfigStreamDeliveryInfoJsonMarshaller getInstance() {
        if (instance == null)
            instance = new ConfigStreamDeliveryInfoJsonMarshaller();
        return instance;
    }

}