text:
using namespace std;

class INET_API Source : public UDPAppBase {

public:

    static int nodesNbr;
    static vector<IPvXAddress> nodesAddr; // store the IP addresses of all clients*
    static long bytesLeft;

    static int packetLen;
    static int fanout;
    static int witnessNbr;

    static int writeUploadNbr; // count the number of clients that registered their upload figures
    static long *uploadBandwidthArray;
    static long *uploadWitnessBandwidthArray;
    static FILE *uploadFile;

    static long nbAvgMeasures;
    static double *avgUploadBandwidthArray;
    static FILE *uploadSnapshotFile;

    static int writeReceivedUpdatesNbr; // count the number of clients that registered the percentage of updates they received
    static FILE *receivedUpdatesFile;

    static double encryptionsSum;
    static double primeSum;
    static double primeSum512;
    static int writeEncryptionsNbr;
    static FILE  *encryptionsFile;

    static int nbSessions;

    static int updNbPerRound;

    Source();
    virtual ~Source();

protected:

    bool membershipNeverComputed; // used to compute only once nodesAddr and nodesNbr, when the source receives the first message

    // module parameters
    const static int serverPort = 1000;
    const static int clientsPort = 500;

    cPar *videoSize; // Size of the video to transmit in bytes
    cPar *packetLenPar; // Size of video chunks in bytes
    cPar *fanoutPar;    // Number of clients the source directly sends updates to
    cPar *witnessNbrPar;
    cPar *nbSessionsPar;
    cPar *updNbPerRoundPar;

    // Round events and counter
    cPar *startTime;
    cPar *roundDuration;
    int roundId;
    cMessage *roundEvent;

    void injectUpdates(int destNodeId);

    virtual void initialize();
    virtual void finish();
    virtual void handleMessage(cMessage* msg);

};

#endif


text:
package divconq.web;

import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.DefaultHttpContent;
import io.netty.handler.codec.http.HttpContent;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http.HttpHeaders.Names;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
import io.netty.handler.stream.ChunkedInput;
import divconq.bus.Message;
import divconq.hub.DomainInfo;
import divconq.log.Logger;
import divconq.session.Session;
import divconq.util.MimeUtil;
import divconq.xml.XElement;

// TODO combine with WebContext??
public class HttpContext implements IInnerContext {
	protected Channel chan = null;
    protected XElement config = null;

    // used with HTTP only, not WS
	protected IContentDecoder decoder = null;
    protected Request request = null;
    protected Response response = null;
    protected Session session = null;
    protected WebSiteManager siteman = null;

    protected boolean isWebsocket = false;

    public Request getRequest() {
		return this.request;
	}

    public Response getResponse() {
		return this.response;
	}

    public void setSession(Session v) {
		this.session = v;
	}

    public Session getSession() {
		return this.session;
	}

    public WebSiteManager getSiteman() {
		return this.siteman;
	}

    public void isWebSocket(boolean v) {
    	this.isWebsocket = v;
    }

    public boolean isWebSocket() {
    	return this.isWebsocket;
    }

	public void load(ChannelHandlerContext ctx, HttpRequest req) {
		IContentDecoder d = this.decoder;

		if (d != null) {
			d.release();
			this.decoder = null;
		}

        this.request = new Request();
        this.request.load(ctx, req);

        this.response = new Response();
        this.response.load(ctx, req);
	}

	public XElement getConfig() {
		return this.config;
	}

	public Channel getChannel() {
		return this.chan;
	}

	public void setChannel(Channel chan) {
		this.chan = chan;
	}

    public void setDecoder(IContentDecoder v) {
		this.decoder = v;
	}

	public HttpContext(XElement config, WebSiteManager siteman) {
		this.config = config;
		this.siteman = siteman;
	}

	public void offerContent(HttpContent v) {
		this.session.touch();		// TODO make sure we are in proper context when this is called - as well as any calls to getSession above - then remove this extra reference to current session

		IContentDecoder d = this.decoder;

		if (d != null)
			d.offer(v);

		// TODO in netty 5 alpha 1 this is getting called after each normal http get and is forcing us to close everytime
		// we may want to review later

		//else
		//	this.sendBadRequest();
	}

	public void close() {
		try {
			if (this.chan != null)
				this.chan.close().await(2000);
		}
		catch (InterruptedException x) {
			// ignore
		}
	}

	public void sendNotFound() {
    	if (Logger.isDebug())
    		Logger.debug("Web server respond with Not Found");

		if (this.response != null) {
			this.response.setStatus(HttpResponseStatus.NOT_FOUND);
			this.send();
		}
	}

	public void sendForbidden() {
    	if (Logger.isDebug())
    		Logger.debug("Web server respond with Forbidden");

		if (this.response != null) {
			this.response.setStatus(HttpResponseStatus.FORBIDDEN);
			this.response.setKeepAlive(false);
			this.send();
		}
	}

	public void sendInternalError() {
    	if (Logger.isDebug())
    		Logger.debug("Web server respond with Internal Server Error");

		if (this.response != null) {
			this.response.setStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
			this.response.setKeepAlive(false);
			this.send();
		}
	}

	public void sendRequestBad() {
    	if (Logger.isDebug())
    		Logger.debug("Web server respond with Request Bad");

		if (this.response != null) {
			this.response.setStatus(HttpResponseStatus.BAD_REQUEST);
			this.response.setKeepAlive(false);
			this.send();
		}
	}

	public void sendRequestOkClose() {
		if (this.response != null) {
			this.response.setStatus(HttpResponseStatus.OK);
			this.response.setKeepAlive(false);
			this.send();
		}
	}

	public void sendRequestOk() {
		if (this.response != null) {
			this.response.setStatus(HttpResponseStatus.OK);
			//this.response.setKeepAlive(true);
			this.send();
		}
	}

	public void send() {
		//if ((this.chan != null) && this.chan.isWritable() && (this.response != null))
		if ((this.chan != null) && (this.response != null))
			this.response.write(this.chan);
	}

	public void sendStart(int contentLength) {
		if ((this.chan != null) && (this.response != null))
			this.response.writeStart(this.chan, contentLength);
	}

	public void send(ByteBuf content) {
		if (this.chan != null)
			this.chan.write(new DefaultHttpContent(content));
	}

	public void send(ChunkedInput<HttpContent> content) {
		if (this.chan != null)
			this.chan.write(content);

		/* TODO we don't need this?
		.addListener(new GenericFutureListener<Future<? super Void>>() {
				@Override
				public void operationComplete(Future<? super Void> future)
						throws Exception {
					//System.out.println("Sending an end");
					//HttpContext.this.response.writeEnd(HttpContext.this.chan);
				}
			});
			*/
	}

	public void sendEnd() {
		if ((this.chan != null) && (this.response != null))
			this.response.writeEnd(this.chan);
	}

	public void sendChunked() {
		//if ((this.chan != null) && this.chan.isWritable() && (this.response != null))
		if ((this.chan != null) && (this.response != null))
			this.response.writeChunked(this.chan);
	}

	public void sendDownloadHeaders(String name, String mime) {
		//if ((this.chan != null) && this.chan.isWritable() && (this.response != null))
		if ((this.chan != null) && (this.response != null))
			this.response.writeDownloadHeaders(this.chan, name, mime);
	}

	// should already have TaskContext if needed (SERVICES and HELLO do not need task context)
	public void send(Message m) {
		try {
			//if ((this.chan != null) && this.chan.isWritable()) {
			if (this.chan != null) {
				if (this.isWebsocket)
					this.chan.writeAndFlush(new TextWebSocketFrame(m.toString()));  //.sync();   we do not need to sync - HTTP is one request, one response.  we would not pile messages on this channel
				else {
					// include the version hash for the current deployed files
					m.setField("DeployVersion", this.siteman.getVersion());

					// we are always using UTF 8, charset is required with any "text/*" mime type that is not ANSI text
					this.response.setHeader(Names.CONTENT_TYPE, MimeUtil.getMimeType("json") + "; charset=utf-8");

					// TODO enable CORS - http://www.html5rocks.com/en/tutorials/file/xhr2/
					// TODO possibly config to be more secure for some users - see CORS handler in Netty
					this.response.setHeader(Names.ACCESS_CONTROL_ALLOW_ORIGIN, "*");

					this.response.setBody(m);
					this.response.write(this.chan);
				}
			}
		}
		catch (Exception x) {
		}
	}

	public void send(HttpContent chunk) {
		try {
			if ((this.chan != null)) {
				this.chan.writeAndFlush(chunk);   // we do not need to sync - HTTP is one request, one response.  we would not pile messages on this channel
			}
		}
		catch (Exception x) {
		}
	}

	public void sendDownload(HttpContent chunk) {
		try {
			if ((this.chan != null))
				this.chan.writeAndFlush(chunk).sync();    // for downloads we do need sync so we don't overwhelm client

			// TODO see if we can use something other than sync - http://normanmaurer.me/presentations/2014-facebook-eng-netty/slides.html#10.0
		}
		catch (Exception x) {
		}
	}

	public void closed() {

		IContentDecoder d = this.decoder;

		if (d != null)
			d.release();
	}

	@Override
	public WebDomain getDomain() {
		DomainInfo domaininfo = this.siteman.resolveDomainInfo(this.request);

		if (domaininfo != null)
			return this.siteman.getDomain(domaininfo.getId());

		return null;
	}

	@Override
	public IWebMacro getMacro(String name) {
		return this.siteman.getMacro(name);
	}
}

redpajama_set_name: RedPajamaGithub


text:
void UartInit(unsigned char Baud);
int UartRecvBytes(unsigned char * data, int length);
int UartSendBytes(const unsigned char * data, int length);

#define UART_DEFAULT_TIMEOUT  0x1000
void SetReadTimeout(unsigned int timeout);

#endif


text:
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/abc4ec8f-3827-42e6-8eea-81a995aa0b1b/mini.png)](https://insight.sensiolabs.com/projects/abc4ec8f-3827-42e6-8eea-81a995aa0b1b)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Babacooll/CommandPlanner/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Babacooll/CommandPlanner/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/Babacooll/CommandPlanner/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Babacooll/CommandPlanner/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/Babacooll/CommandPlanner/badges/build.png?b=master)](https://scrutinizer-ci.com/g/Babacooll/CommandPlanner/build-status/master)

CommandPlanner is a cron management for Symfony Console component commands.

## Installation

CommandPlanner is available through composer :

```Shell
$ php composer.phar require babacooll/command-planner ~0.0.1
```

## Usage

You can load method in CommandPlanner by two ways :

## Example inline

PHP File :

```php
<?php

require('vendor/autoload.php');

use CommandPlanner\CommandPlanner;

$commandPlanner = new CommandPlanner();

$commandPlanner->add(
    new \CommandPlanner\Wrapper\CommandWrapper(
        'CommandPlanner\Tests\Data\TestCommand',
        'Symfony\Component\Console\Application',
        \Cron\CronExpression::factory('* * * * *'),
        [
            'parameters' => ['test'],
            'log_file'   => 'test.log',
            'options'    => []
        ]
    )
);

$commandPlanner->run();
```

## Example from config

PHP File :

```php
<?php

require('vendor/autoload.php');

use CommandPlanner\CommandPlanner;

$commandPlanner = new CommandPlanner();

$commandPlanner->addCommandsFromConfig('config/config.yml');

$commandPlanner->run();
```

Config File :

```yml
command_planner:
    commands:
        my_first_command:
            namespace : CommandPlanner\Tests\Data\TestCommand
            timing: '* * * * * *'
            parameters: ['test']
            options: ['--yell']
            log_file: test.log

    application: Symfony\Component\Console\Application

```

These examples use CommandPlanner\Tests\Data\TestCommand test command from this package.

## TODO

* Unit testing
* Exception handler


text:
function [ total_size ] = gaming_on(  )
%GAMING_ON Calculates the bytes to consume given by an ONLINE GAMING model
%   *** Calculates the bytes to be consume during the activity time (Ton)
%   of an ONLINE GAMING model.
%
% USAGE:
%       [ total_size ] = gaming_on( )
%
% INPUT:
%       - sampleSize:   the size of the sample to be
%
% OUTPUT:
%       - total_size:   the packet size (in bytes) during activity period
%
% Author: Mario Cao Cueto
% DIT-UPM, Universidad Politécnica de Madrid
% eMail: mcao@dit.upm.es
% Copyright 2014 Mario Cao Cueto.

% ONLINE MODEL:
% Srinivasan, R., Zhuang, J., Jalloul, L., Novak, R., & Park, J. (2008).
% IEEE 802.16 m evaluation methodology document (EMD).
% http://ieee802.org/16/tgm/docs/80216m-08_004r2.pdf

%% ONLINE GAMING: BYTES during Ton

server_packet = 0;
while(server_packet<=0)
    server_packet = evrnd(330,82);
end

total_size=server_packet;

end


text:
import React,{ PropTypes } from 'react'
import { Link } from 'react-router'
import CSSModules from 'react-css-modules'

import Swipe from "components/swipe/swipe";
import GoodsTickerItem from './components/GoodsTickerItem'

import { fetchPosts } from "components/common/fetch";
import { getRequest } from 'libs/util'
import classNames from 'classnames'
import styles from './index.less'

class GoodsTicker extends React.Component {
    constructor(props) {
        super(props)

        this.state = {
            tabList: [],
            tabIndex: 0,
            sortList: [
                {
                    id: 1,
                    name:"人气",
                    canSort: false,
                    sort: "",
                    type: "",
                    active: true,
                },
                {
                    id: 2,
                    name:"销量",
                    sort: "",
                    canSort: true,
                    type: "order_num",
                    active: false,
                },
                {
                    id: 3,
                    name:"价格",
                    canSort: true,
                    sort: "",
                    type: "final_price",
                    active: false,
                },
                {
                    id: 4,
                    name:"优惠券",
                    canSort: true,
                    sort: "",
                    type: "value",
                    active: false,
                }
            ],
            list: [],

            isLoading: false,
            page: 1,
            size: 10,
            isEnd: false
        }
    }

    componentDidMount() {
        this.getTabData()
    }

    getSortType(){
        let { sortList } = this.state, result = {};
        let obj = sortList.find(obj=>obj.active==true && obj.canSort);
        if(obj){
            result.sort = "sort:" + obj.type + ":" + obj.sort;
        }

        return result
    }

    getTabData(){
        let { tabUrl } = this.props;
        fetchPosts(tabUrl ,{ },"GET").then((data)=>{
            if(data.responseCode===1000){
                this.initTab(data.data);
            }else{
                this.initTab();
            }
        }).catch(() => {
        });
    }

    initTab(data){
        if(!data) data = [];
        let state = {}, api = "";
        state.tabList = data;
        state.isEnd = false;
        if(data.length > 0){
            state.tabIndex = data[0].id;
        }
        this.setState(state, ()=>{
            this.getListData({page: 1});
        })
    }

    getListData(opt){
        let { tabIndex, tabList, size, isLoading, isEnd } = this.state;
        if(isLoading || isEnd) return;

        let tab = tabList.find(obj=>obj.id == tabIndex);
        if(!tab) return;
        this.setState({isLoading: true});

        let api = "/stuff" + tab.url.split("?")[0];
        opt = Object.assign(opt, getRequest(api), {size}, this.getSortType());

        fetchPosts(api, opt, "GET").then((data)=>{
            if(data.returnCode===1000){
                this.initList(data.data, opt.page);
            }else{
                this.initList();
            }
        }).catch(() => {
            this.setState({isLoading:false});
        });
    }

    initList(data, page){
        data = data || [];
        let { size, list } = this.state;
        let state = {
            isLoading: false,
            page: page,
            list: page == 1 ? data : list.concat(data),
            isEnd: data.length < size ? true : false
        };

        this.setState(state);
    }

    getTabComponents(){
        let { tabIndex, tabList } = this.state;
        return tabList.map((obj, index) => {
            return this.onTabClickHandler(obj.id, obj.url)}>{obj.dirName}
        })
    }

    getSortComponents(){
        let { sortList } = this.state;
        return sortList.map((obj, index) => {
            let style = classNames({
                "goods-ticker-sort-item": obj.canSort,
                "goods-ticker-sort-item-normal": !obj.canSort,
                "active": obj.active,
                "up": obj.sort == "asc",
                "down": obj.sort == "desc"
            })
            return
this.onSortClickHandler(obj.id)}>{obj.name}

        })
    }

    getListItems(){
        let { list } = this.state;
        return list.map((obj, index) => {
            return <GoodsTickerItem key={index} data={obj} />
        })
    }

    onTabClickHandler(index){
        let state = {
            tabIndex: index,
            isEnd: false
        };

        this.setState(state, ()=>{
            this.getListData({page: 1});
        });
    }

    onSortClickHandler(sortId){
        let sortList = this.state.sortList.map((obj, index)=>{
            if(obj.id == sortId){
                obj.active = true;
                if(obj.sort == "desc"){
                    obj.sort = "asc"
                }else {
                    obj.sort = "desc"
                }
            }else{
                obj.active = false;
                obj.sort = "";
            }
            return obj;
        })

        this.setState({sortList, isEnd: false}, ()=>{
            this.getListData({page: 1});
        });
    }

    touchMove(that, args){
        if(that.min - args[0] > 30){
            let { page } = this.state;
            this.getListData({page: page+1});
        }
    }

    render() {
        let props = {
            property:"translateY",
            className:"scroll-warpper",
            tag:"ul",
            min:"auto",
            stopPro:false,
            vertical:true,
            touchMove: (that,args)=>this.touchMove(that,args),
        }

        let { list, isLoading, page, isEnd } = this.state;
        let noTip = ""
        let noDataTip = "--已经到底了--";
        if(list.length === 0){
            noDataTip = "--敬请期待--"
        }
        if(isLoading){
            noTip =
--加载中--
;
        }else if(page >=1 && isEnd === true){
            noTip =
{noDataTip}
;
        }

        return (

                <Swipe {...props}>

{ this.getTabComponents()}

{ this.getSortComponents() }

                        { this.getListItems() }

                    {noTip}
                </Swipe>

        )
    }
}

GoodsTicker.defaultProps = {
    tabUrl: "/stuff/coupon/goodsClass.do?specialId=3"
}

export default CSSModules(GoodsTicker, styles, {allowMultiple:true});


text:
package br.exemplo.hibernate.view;

import br.exemplo.hibernate.controller.ProdutoController;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;

/**
 *
 * @author Rafael 01/11/2013
 *
 * Classe que representa o formulário de cadastro de produtos.
 */
public class ConsultaProduto extends javax.swing.JInternalFrame {

    private ProdutoController controller;

    public ConsultaProduto() {
        initComponents();
        this.controller = new ProdutoController(this);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblNome = new javax.swing.JLabel();
        txtNome = new javax.swing.JTextField();
        lblPreco = new javax.swing.JLabel();
        txtPreco = new javax.swing.JTextField();
        lblDescricao = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        txtDescricao = new javax.swing.JTextArea();
        jSeparator1 = new javax.swing.JSeparator();
        btAlterar = new javax.swing.JButton();
        btLimpar = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        jScrollPane3 = new javax.swing.JScrollPane();
        tbProduto = new javax.swing.JTable();
        lblPesquisar = new javax.swing.JLabel();
        txtPesquisar = new javax.swing.JTextField();
        lblId = new javax.swing.JLabel();
        btBuscar = new javax.swing.JButton();
        btExcluir = new javax.swing.JButton();

        setClosable(true);
        setTitle("Consultar Produtos");

        lblNome.setText("Nome:");

        lblPreco.setText("Preco:");

        lblDescricao.setText("Descricao:");

        txtDescricao.setColumns(20);
        txtDescricao.setRows(5);
        jScrollPane1.setViewportView(txtDescricao);

        btAlterar.setText("Alterar");
        btAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btAlterarActionPerformed(evt);
            }
        });

        btLimpar.setText("Limpar");
        btLimpar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btLimparActionPerformed(evt);
            }
        });

        tbProduto.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tbProduto.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tbProdutoMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(tbProduto);

        lblPesquisar.setText("Pesquisar:");

        lblId.setVisible(false);

        btBuscar.setText("Buscar");
        btBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btBuscarActionPerformed(evt);
            }
        });

        btExcluir.setText("Excluir");
        btExcluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btExcluirActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator1)
            .addComponent(jSeparator2)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(btAlterar)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(btLimpar)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(btExcluir))
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 452, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblDescricao)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(lblPesquisar)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtPesquisar, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(btBuscar))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(lblNome)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(lblPreco)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtPreco, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(lblId, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblId, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblNome)
                        .addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lblPreco)
                        .addComponent(txtPreco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblDescricao)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btLimpar)
                    .addComponent(btAlterar)
                    .addComponent(btExcluir))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblPesquisar)
                    .addComponent(txtPesquisar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btBuscar))
                .addGap(24, 24, 24)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btAlterarActionPerformed
        this.controller.alterar();
    }//GEN-LAST:event_btAlterarActionPerformed

    private void btLimparActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btLimparActionPerformed
        this.controller.limparCamposConsulta();
    }//GEN-LAST:event_btLimparActionPerformed

    private void tbProdutoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbProdutoMouseClicked
        this.controller.preencherCampos();
    }//GEN-LAST:event_tbProdutoMouseClicked

    private void btBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btBuscarActionPerformed
        this.controller.pesquisar();
    }//GEN-LAST:event_btBuscarActionPerformed

    private void btExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btExcluirActionPerformed
        this.controller.excluir();
    }//GEN-LAST:event_btExcluirActionPerformed

    public JButton getBtAlterar() {
        return btAlterar;
    }

    public void setBtAlterar(JButton btAlterar) {
        this.btAlterar = btAlterar;
    }

    public JButton getBtLimpar() {
        return btLimpar;
    }

    public void setBtLimpar(JButton btLimpar) {
        this.btLimpar = btLimpar;
    }

    public JLabel getLblDescricao() {
        return lblDescricao;
    }

    public void setLblDescricao(JLabel lblDescricao) {
        this.lblDescricao = lblDescricao;
    }

    public JLabel getLblNome() {
        return lblNome;
    }

    public void setLblNome(JLabel lblNome) {
        this.lblNome = lblNome;
    }

    public JLabel getLblPesquisar() {
        return lblPesquisar;
    }

    public void setLblPesquisar(JLabel lblPesquisar) {
        this.lblPesquisar = lblPesquisar;
    }

    public JLabel getLblPreco() {
        return lblPreco;
    }

    public void setLblPreco(JLabel lblPreco) {
        this.lblPreco = lblPreco;
    }

    public JTable getTbProduto() {
        return tbProduto;
    }

    public void setTbProduto(JTable tbProduto) {
        this.tbProduto = tbProduto;
    }

    public JTextArea getTxtDescricao() {
        return txtDescricao;
    }

    public void setTxtDescricao(JTextArea txtDescricao) {
        this.txtDescricao = txtDescricao;
    }

    public JTextField getTxtNome() {
        return txtNome;
    }

    public void setTxtNome(JTextField txtNome) {
        this.txtNome = txtNome;
    }

    public JTextField getTxtPesquisar() {
        return txtPesquisar;
    }

    public void setTxtPesquisar(JTextField txtPesquisar) {
        this.txtPesquisar = txtPesquisar;
    }

    public JTextField getTxtPreco() {
        return txtPreco;
    }

    public void setTxtPreco(JTextField txtPreco) {
        this.txtPreco = txtPreco;
    }

    public JLabel getLblId() {
        return lblId;
    }

    public void setLblId(JLabel lblId) {
        this.lblId = lblId;
    }

    public JButton getBtBuscar() {
        return btBuscar;
    }

    public void setBtBuscar(JButton btBuscar) {
        this.btBuscar = btBuscar;
    }

    public JButton getBtExcluir() {
        return btExcluir;
    }

    public void setBtExcluir(JButton btExcluir) {
        this.btExcluir = btExcluir;
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btAlterar;
    private javax.swing.JButton btBuscar;
    private javax.swing.JButton btExcluir;
    private javax.swing.JButton btLimpar;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JLabel lblDescricao;
    private javax.swing.JLabel lblId;
    private javax.swing.JLabel lblNome;
    private javax.swing.JLabel lblPesquisar;
    private javax.swing.JLabel lblPreco;
    private javax.swing.JTable tbProduto;
    private javax.swing.JTextArea txtDescricao;
    private javax.swing.JTextField txtNome;
    private javax.swing.JTextField txtPesquisar;
    private javax.swing.JTextField txtPreco;
    // End of variables declaration//GEN-END:variables
}


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

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.support.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * AttachmentMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class AttachmentMarshaller {

    private static final MarshallingInfo<String> FILENAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("fileName").build();
    private static final MarshallingInfo<java.nio.ByteBuffer> DATA_BINDING = MarshallingInfo.builder(MarshallingType.BYTE_BUFFER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("data").build();

    private static final AttachmentMarshaller instance = new AttachmentMarshaller();

    public static AttachmentMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(Attachment attachment, ProtocolMarshaller protocolMarshaller) {

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

        try {
            protocolMarshaller.marshall(attachment.getFileName(), FILENAME_BINDING);
            protocolMarshaller.marshall(attachment.getData(), DATA_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
package net.powermatcher.fpai.fullwidget;

import net.powermatcher.core.agent.framework.data.BidInfo;

public class AgentInfo {

    public String id;
    public double[][] coordinates;

    public AgentInfo(String id, BidInfo bid) {
        this.id = id;
        double[] demand = bid.getDemand();
        coordinates = new double[demand.length][];
        for (int i = 0; i < demand.length; i++) {
            coordinates[i] = new double[] { bid.getMarketBasis().toPrice(i), demand[i] };
        }
    }
}


text:
//Built using buildjs.py script - do not hand edit

// app.js
/**
 * Created by cmakler on 10/31/14.
 */
var kgAngular = angular.module('kineticGraphs', []);

kgAngular.controller('kgController', function ($scope) {

    Reveal.addEventListener('slidechanged', function (event) {
        $scope.$broadcast('resize');
    });

});

// d3-helpers.js
kgAngular.service('D3Helpers', function () {

    this.drawCircles = function (data, circles) {

        circles = circles.data(data);
        circles.exit().remove();
        circles.enter().append('circle');
        circles
            .attr('cx', function (d) {
                return d.cx
            })
            .attr('cy', function (d) {
                return d.cy
            })
            .attr('stroke', function(d) {
                return d.color
            })
            .attr('fill', function (d) {
                return d.color
            })
            .attr('r', function (d) {
                return d.r || 10;
            });
        return circles;

    };

    this.drawLines = function (data, lines) {

        lines = lines.data(data);
        lines.exit().remove();
        lines.enter().append('line')
            .attr('class', function(d) {
                return d.class
            });
        lines
            .attr('x1', function (d) {
                return d.x1
            })
            .attr('y1', function (d) {
                return d.y1
            })
            .attr('x2', function (d) {
                return d.x2
            })
            .attr('y2', function (d) {
                return d.y2
            })
            .attr('stroke-width', 2)
            .attr('stroke', function (d) {
                return d.color || '#666666'
            });

        return lines;

    };

    this.drawRects = function (data, rects) {

        rects = rects.data(data);
        rects.exit().remove();
        rects.enter().append('rect')
            .attr('class', function (d) {
                return d.class
            })
            .attr('fill-opacity', 0.3);;
        rects
            .attr('x', function (d) {
                return d.x
            })
            .attr('y', function (d) {
                return d.y
            })
            .attr('width', function (d) {
                return d.width
            })
            .attr('height', function (d) {
                return d.height
            })
            .attr('style', function(d) {
                return 'fill:' + d.color
            });

        return rects;

    };

    this.drawCurves = function (data,curves) {

        curves = curves.data(data);
        curves.exit().remove();
        curves.enter().append('svg:path').attr('fill','none');
        curves
            .attr('stroke-width', 2)
            .attr('stroke', function (d) {
                return d.color || '#666666'
            })
            .attr('d', function (d) {
                return d.points
            });
        return curves;

    };

    this.drawAreas = function(data,areas) {

        areas = areas.data(data);
        areas.exit().remove();
        areas.enter().append('svg:path')
            .attr('fill-opacity', 0.3);
        areas
            .attr('d', function (d) {
                return d.points
            })
            .attr('fill', function (d) {
                return d.color
            });
        return areas;

    };

    this.drawTexts = function (data,texts) {

        texts = texts.data(data);
        texts.exit().remove();
        texts.enter().append("svg:text");
        texts
            .attr("x", function (d) {
                return d.x
            })
            .attr("y", function (d) {
                return d.y
            })
            .attr("text-anchor", function (d) {
                return d.anchor
            })
            .attr("fill", function (d) {
                return d.color
            })
            .attr("font-size", 14)
            .attr("font-style", "oblique")
            .text(function (d) {
                return d.text
            });

        return texts;

    };

    this.configLabel = function(labelParams) {

        var width = labelParams['width'] || 100,
            xOffset = labelParams['xOffset'] || 0,
            yOffset = labelParams['yOffset'] || 0,
            xCoord = 0,
            yCoord = 0;

        if(labelParams.hasOwnProperty('point') && labelParams.point != undefined) {
            xCoord = labelParams.point['x'] || labelParams.point[0] || xCoord;
            yCoord = labelParams.point['y'] || labelParams.point[1] || yCoord;
        }

        var x = labelParams['graph'].x(xCoord) + xOffset,
            y = labelParams['graph'].y(yCoord) + yOffset - 20,
            align = labelParams['align'] || 'left';

        if(align == 'right') {
            x -= width;
        }
        if(align == 'center') {
            x -= 0.5*width;
        }
        return {
            html: labelParams['html'],
            x: x,
            y: y,
            align: align,
            width: width,
            math: true,
            size: '16pt'
        }
    };

    this.drawDivs = function(data,divs) {

        divs = divs.data(data);
        divs.exit().remove();
        divs.enter().append("div");
        divs
            .attr("class", function(d) {
                return d.math ? 'katex' : "";
            })
            .attr("style", function (d) {
                return "position: absolute; font-size: " + d.size + "; text-align: "+ d.align + "; left: " + d.x + "px; top: " + d.y + "px; color: " + d.color + "; width: " + d.width + "px";
            })
            .text(function(d) { return d.html});

        for (var i = 0; i < data.length; i++) {
            if (false != data[i].math) {
                var element = divs[0][i],
                    text = element.innerText;
                katex.render(text, element)
            }
        }

        return divs;
    };

    this.addAxes = function(graph,x_axis,y_axis) {

        graph.xDomain = [x_axis.min || 0, x_axis.max || 10];
        graph.yDomain = [y_axis.min || 0, y_axis.max || 10];

        // Create the D3 scales for the x and y dimensions
        graph.x = d3.scale.linear()
            .range([0, graph.width])
            .domain(graph.xDomain);
        graph.y = d3.scale.linear()
            .range([graph.height, 0])
            .domain(graph.yDomain);

        graph.curveFunction = d3.svg.line()
            .x(function (d) {
                return graph.x(d.x);
            }).y(function (d) {
                return graph.y(d.y);
            }).interpolate("linear");

        graph.verticalArea = d3.svg.area()
            .x(function (d) {
                return graph.x(d.x);
            })
            .y0(function (d) {
                return graph.y(d.y0);
            })
            .y1(function (d) {
                return graph.y(d.y1);
            });

        graph.horizontalArea = d3.svg.area()
            .x0(function (d) {
                return graph.x(d.x0);
            })
            .x1(function (d) {
                return graph.x(d.x1);
            })
            .y(function (d) {
                return graph.y(d.y);
            });

        return graph;

    }

});

// clicker.js
/**
 * Created by cmakler on 12/17/14.
 */

// Set the CSV to be used throughout the session.
// This doesn't change, though the data in it will.
kgAngular.directive('clickerFile', function () {
    return {
        restrict: 'E',
        scope: false,
        template: "<input ng-if='!currentFile' type='file'/>",
        link: function (scope, element) {
            element.on('change', function (onChangeEvent) {
                scope.currentFile = (onChangeEvent.srcElement || onChangeEvent.target).files[0];
                scope.$apply();
            });
        }
    };
});

kgAngular.directive('clickerQuestion', function () {
    return {
        restrict: 'E',
        scope: true,
        transclude: true,
        replace: true,
        template: "

<button ng-click='update()'>Reveal</button><button ng-click='reset()'>Reset</button>

",
        controller: function ($scope) {

            $scope.options = {}

            this.addOption = function(scope) {
                $scope.options[scope.letter] = scope;
            };

            function updateChildren() {
                for (var letter in $scope.options) {
                    var count = $scope.count[letter],
                        frequency = 100 * count / $scope.total,
                        option = $scope.options[letter];
                    option.frequency = frequency;
                    option.count = count;
                    option.$apply();
                }
            }

            function parseCSV(csvdata) {

                var data = csvdata['data'];

                $scope.reset();

                // i starts at 5 because student data begins on the sixth line of the CSV
                for (var i = 5; i < data.length; i++) {
                    var studentResponse = data[i];
                    if (studentResponse.length == 1) {
                        studentResponse = studentResponse[0].split(',');
                    }
                    if (studentResponse.length > 2) {

                        // Each student's most response to the last question is in the seventh-to-last column of the CSV
                        var responseLetter = studentResponse[studentResponse.length - 7];
                        if ($scope.count.hasOwnProperty(responseLetter)) {
                            $scope.count[responseLetter] += 1;
                        } else {
                            $scope.count[responseLetter] = 1;
                        }
                        $scope.total++;
                    }
                    updateChildren();
                }

            }

            // Get latest data from CSV.
            $scope.update = function () {

                if ($scope.currentFile) {
                    Papa.parse($scope.currentFile, {
                        complete: parseCSV //when data is loaded, call parseCSV
                    });
                }

            };

            $scope.reset = function () {
                // Reset count and frequency objects for this scope.
                $scope.count = {'A': 0, 'B': 0, 'C': 0, 'D': 0, 'E': 0};
                $scope.frequency = {'A': 0, 'B': 0, 'C': 0, 'D': 0, 'E': 0};
                $scope.total = 0;
                updateChildren();
            }

        }
    }
});

kgAngular.directive('clickerOption', function () {
    return {
        restrict: 'E',
        scope: true,
        replace: true,
        transclude: true,
        require: '^clickerQuestion',
        template: "

{{letter}}

	{{ count }} ({{ frequency | number: 0 }}%)

",
        link: function (scope, element, attrs, ClickerCtrl) {
            scope.letter = attrs['letter'];
            scope.count = '-';
            scope.frequency = '-';
            ClickerCtrl.addOption(scope)

        }
    }
});

// model.js
/**
 * Created by cmakler on 10/31/14.
 */

'use strict';

kgAngular.directive('model', function () {

    function controller($scope, $window) {

        $scope.params = $scope.params || {};
        $scope.functions = $scope.functions || {};

        // Redraw graph objects when a child calls this update function
        this.update = function() {
            $scope.$broadcast('redraw');
        };

        Reveal.addEventListener('ready',function(event) {
            console.log('content loaded');
            $scope.$broadcast('resize');
        });

        // Redraw graph objects when parameters change
        $scope.$watchCollection('params',function(){$scope.$broadcast('redraw');});

        // Setters for parameters and functions
        this.setValue = function(category,name,value) {
            $scope[category][name] = value;
        };

    }

    return {
        restrict: 'E',
        scope: true,
        controller: controller
    }

})

// math.js
/**
 * Created by cmakler on 11/10/14.
 */

kgAngular.directive('renderedMath',function() {

    function link(scope,el) {

        if(scope.expression) {

            function render() {
                katex.render(scope.expression, el[0]);
            }

            scope.$on('redraw', render);

            render();

        } else {

            katex.render(el[0].innerText, el[0])

        }

    }

    return {
        link: link,
        restrict: 'A',
        scope: {expression: '@'}
    }

});

// param.js
/**
 * Created by cmakler on 11/6/14.
 */

/**
 * Created by cmakler on 10/31/14.
 */

'use strict';

kgAngular.directive('param', function () {

    function link(scope,el,attrs,ModelCtrl) {
        ModelCtrl.setValue('params',attrs.name,(attrs.type && attrs.type != 'number') ? attrs.value : parseFloat(attrs.value));
    }

    return {
        require: '^model',
        link: link,
        restrict: 'E',
        scope: false
    }

});

// function.js
/**
 * Created by cmakler on 11/6/14.
 */

'use strict';

kgAngular.directive('function', function () {

    function link(scope,el,attrs,ModelCtrl) {

        var fn = new econgraphs.functions[scope.category][scope.form];

        if (scope.fnParams) {
            fn = fn.updateParams(scope.fnParams);
        }
        ModelCtrl.setValue('functions', scope.name, fn);

    }

    return {
        require: '^model',
        link: link,
        restrict: 'E',
        scope: { name: '@', category: '@', form: '@', fnParams: '&' }
    }

});

// slider.js
/**
 * Created by cmakler on 10/31/14.
 */

'use strict';

kgAngular.directive('slider', function () {

        function link(scope, el, attrs, ModelCtrl) {
            el = el[0];

            var raw_value = scope.value; // needed to help smoothe slider motion

            var height = 40,
                radius = height / 2,
                margin = 20;

            var svg,circle, line;

            scope.width = el.parentElement.clientWidth - 2*margin;

            scope.innerWidth = scope.width - 2 * radius;

            function positionDelta(dx) {
                return dx * (scope.max - scope.min) / scope.innerWidth
            }

            svg = d3.select(el).append('svg')
                .attr({width: el.parentElement.clientWidth, height: 2 * radius});

            var drag = d3.behavior.drag()
                .on("dragstart", function () {
                    this.parentNode.appendChild(this);
                    d3.select(this).transition()
                        .ease("elastic")
                        .duration(500)
                        .attr("r", radius * 0.8);
                })
                .on("drag", function () {
                    var dragPosition = parseFloat(raw_value) + positionDelta(d3.event.dx);
                    raw_value = Math.max(scope.min, Math.min(scope.max, dragPosition));
                    scope.$apply(function() {
                        scope.value = Math.round(raw_value / parseFloat(scope.precision)) * scope.precision;
                    });
                    ModelCtrl.update();
                })
                .on("dragend", function () {
                    d3.select(this).transition()
                        .ease("elastic")
                        .duration(500)
                        .attr("r", radius * 0.7);
                });

            // Draw slider line
            line = svg.append('line').attr({x1: radius, x2: radius + scope.innerWidth, y1: radius, y2: radius, stroke: 'blue', strokeWidth: 1});

            // Establish y-coordinate and radius for control circle
            circle = svg.append('circle')
                .attr({cy: radius, r: radius * 0.7 })
                .call(drag);

            // Set and update x-coordinate for control circle
            scope.$watch('value', function (value) {
                circle.attr({cx: function() {
                    return radius + scope.innerWidth * (value - scope.min) / (scope.max - scope.min);
                }});
            });

            scope.$on('resize', function() {
                scope.width = el.parentElement.clientWidth - 2*margin;
                scope.innerWidth = scope.width - 2*radius;
                svg.attr('width',el.parentElement.clientWidth);
                line.attr('x2', radius + scope.innerWidth);
                circle.attr({cx: function () {
                    return radius + scope.innerWidth * (scope.value - scope.min) / (scope.max - scope.min);
                }});
            })

        }

        return {
            link: link,
            require: '^model',
            restrict: 'E',
            scope: { value: '=', min: '=', max: '=', precision: '=' }
        };
    });

// toggle.js
/**
 * Created by cmakler on 01/09/15.
 */

'use strict';

kgAngular.directive('toggle', function () {

    function link(scope, el, attrs, ModelCtrl) {

        if(scope.init == 'true') {
            scope.param = true;
        }

        scope.toggle = function() {
            scope.param = !scope.param;
            ModelCtrl.update();
        };

    }

    return {
        link: link,
        require: '^model',
        restrict: 'E',
        replace: true,
        transclude: true,
        template: "<button ng-click='toggle()')></button>",
        scope: { param: '=', init:'@' }
    };
});

// graph.js
/**
 * Created by cmakler on 10/31/14.
 */

'use strict';

kgAngular.directive('graph', function (D3Helpers) {

    function link(scope, el, attrs, ModelCtrl) {

        el = el[0];

        scope.graph_definition = scope.graph_definition || {};

        scope.x_axis = scope.x_axis || {min: 0, max: 10, title: 'X axis', ticks: 1};
        scope.y_axis = scope.y_axis || {min: 0, max: 10, title: 'Y axis', ticks: 1};
        scope.dimensions = {height: attrs.height || 700, width: attrs.width || 700};
        scope.margin = {top: 10, right: 10, bottom: 80, left: 90};

        scope.$on('redraw', drawObjects);
        scope.$on('resize', resize);

        // These are D3 selectors for each type of shape on the graph
        var circles, lines, curves, rects, areas, texts, divs, x_axis, y_axis, x_axis_label, y_axis_label;

        // Regenerate current definitions of plotted shapes from graph objects.
        function plotted_shapes () {

            // reset plotted shapes
            var shapes = {lines: [], circles: [], curves: [], texts: [], rects: [], areas: [], divs: []};

            // get current coordinates for shapes
            scope.graph_definition.objects.forEach(function (graph_object) {
                shapes = graph_object.update(shapes,scope.graph_definition);
            });

            return shapes;

        }

        function drawObjects() {

            // get updated data based on current parameters
            var data = plotted_shapes();

            // update the data for each of the D3 shape selectors
            areas = D3Helpers.drawAreas(data.areas, areas);
            rects = D3Helpers.drawRects(data.rects, rects);
            lines = D3Helpers.drawLines(data.lines,lines);
            curves = D3Helpers.drawCurves(data.curves,curves);
            circles = D3Helpers.drawCircles(data.circles,circles);
            texts = D3Helpers.drawTexts(data.texts,texts);
            divs = D3Helpers.drawDivs(data.divs,divs);

            // Add x axis
            x_axis.call(d3.svg.axis().scale(scope.graph_definition.x).orient("bottom").ticks(scope.x_axis.ticks));
            x_axis_label.text(scope.x_axis.title);

            // Add y axis
            y_axis.call(d3.svg.axis().scale(scope.graph_definition.y).orient("left").ticks(scope.y_axis.ticks));
            y_axis_label.text(scope.y_axis.title);

        }

        function resize() {
            if (scope.graph_definition.vis) {
                d3.select(el).select('svg').remove();
                d3.select(el).selectAll('div').remove();
                drawGraph();
            }
        }

        function drawGraph() {

            // The width and height of the drawn graph are the width and height of the alloted space, minus the margins.
            scope.graph_definition.width = Math.min(el.parentElement.clientWidth,scope.dimensions.width) - scope.margin.left - scope.margin.right;
            scope.graph_definition.height = scope.dimensions.height - scope.margin.top - scope.margin.bottom;

            // Create the D3 visualization object
            scope.graph_definition.vis = d3.select(el)
                .append("svg")
                .attr("width", el.parentElement.clientWidth)
                .attr("height", scope.dimensions.height)
                .append("g")
                .attr("transform", "translate(" + scope.margin.left + "," + scope.margin.top + ")");

            d3.select(el.parentNode).select('div').remove();
            scope.graph_definition.divs = d3.select(el.parentNode)
                .append("div")
                .attr("style", "position:absolute; left: " + scope.margin.left + "px; top: " + scope.margin.top + "px; width: " + scope.graph_definition.width + "px; height: " + scope.graph_definition.height + "px");

            areas = scope.graph_definition.vis.append('g').attr('class', 'graph-objects').selectAll('g.area');
            rects = scope.graph_definition.vis.append('g').attr('class', 'graph-objects').selectAll('g.rect');
            curves = scope.graph_definition.vis.append('g').attr('class', 'graph-objects').selectAll('g.curve');
            lines = scope.graph_definition.vis.append('g').attr('class', 'graph-objects').selectAll('g.line');
            circles = scope.graph_definition.vis.append('g').attr('class', 'graph-objects').selectAll('g.circle');
            texts = scope.graph_definition.vis.append('g').attr('class', 'graph-objects').selectAll('g.text');
            divs = scope.graph_definition.divs.append('div').attr('class', 'graph-divs').selectAll('div');
            x_axis = scope.graph_definition.vis.append('g').attr('class', 'x axis').attr("transform", "translate(0," + scope.graph_definition.height + ")");
            y_axis = scope.graph_definition.vis.append('g').attr('class', 'y axis');
            x_axis_label = x_axis.append("text")
                .attr("x", scope.graph_definition.width / 2)
                .attr("y", "4em")
                .style("text-anchor", "middle");
            y_axis_label = y_axis.append("text")
                .attr("transform", "rotate(-90)")
                .attr("x", -scope.graph_definition.height / 2)
                .attr("y", "-4em")
                .style("text-anchor", "middle");

            // Establish axes and scales
            scope.graph_definition = D3Helpers.addAxes(scope.graph_definition, scope.x_axis, scope.y_axis);

            drawObjects();
        }

        drawGraph();

    }

    function controller($scope) {

        $scope.graph_definition = $scope.graph_definition || {};

        var graph_objects = $scope.graph_definition.objects = [];
        var graph_divs = $scope.graph_definition.divs = [];

        this.addObject = function(newObject) {
            graph_objects.push(newObject);
        };

        this.addAxis = function(dim,axis_definition) {
            $scope[dim+'_axis'] = axis_definition;
        };

        this.addDiv = function(newDiv) {
            graph_divs.push(newDiv)
        };

    }

    return {
        link: link,
        controller: controller,
        require: '^model',
        restrict: 'E',
        scope: true
    }

});

// axis.js
/**
 * Created by cmakler on 10/31/14.
 */

'use strict';

kgAngular.directive('axis', function () {

    function link(scope, el, attrs, GraphCtrl) {

        function addAxis() {
            GraphCtrl.addAxis(scope.dim, {
                min: scope.min(),
                max: scope.max(),
                title: scope.title,
                ticks: scope.ticks()
            });
        }

        scope.$watch('title', addAxis);

        addAxis();

    }

    return {
        link: link,
        restrict: 'E',
        require: '^graph',
        scope: {dim: '@', min: '&', max: '&', title: '@', ticks: '&'}
    }

});

// point.js
/**
 * Created by cmakler on 11/3/14.
 */

kgAngular.directive('point', function () {

        function link(scope, element, attrs, graphCtrl) {

            // Show unless there is an attribute determining show/hide behavior
            if (!attrs['show']) {
                scope.show = function () {
                    return true
                }
            }

            graphCtrl.addObject({

                update: function (shapes,graph) {

                    if (scope.show()) {

                        var p = (typeof scope.point == 'function') ? scope.point() : scope.point;

                        var droplines = scope.droplines || 'none'; // set droplines to "none" by default

                        var label = scope.label || 'none';

                        var x = p[0] || p.x,
                            y = p[1] || p.y;

                        var xInDomain = (x <= graph.xDomain[1] && x >= graph.xDomain[0]),
                            yInDomain = (y <= graph.yDomain[1] && y >= graph.yDomain[0]);

                        var cx = graph.x(x),
                            cy = graph.y(y);

                        // Add point to shapes if it's in the graph domain
                        if (xInDomain && yInDomain) {

                            shapes.circles.push({
                                color: scope.color,
                                cx: cx,
                                cy: cy,
                                r: scope.r
                            });

                        }

                        if (label != 'none') {
                            shapes.texts.push({
                                text: scope.label,
                                x: cx,
                                y: cy + 5,
                                anchor: 'middle',
                                color: 'white'
                            })
                        }

                        // Add associated labels only if each is in its dimension fo the graph domain
                        if (scope.xlabel != '' && xInDomain) {
                            shapes.divs.push({
                                html: scope.xlabel,
                                x: cx - 50,
                                y: graph.height + 20,
                                width: 100,
                                color: scope.color,
                                align: 'center',
                                size: '16pt'
                            })
                        }

                        if (scope.ylabel != '' && yInDomain) {
                            shapes.divs.push({
                                html: scope.ylabel,
                                x: -120,
                                y: cy - 20,
                                width: 100,
                                color: scope.color,
                                align: 'right',
                                size: '16pt'
                            })
                        }

                        // Add associated droplines only if the each is in its dimension of the graph domain

                        if (droplines != 'none') {

                            // Add a vertical dropline unless droplines == horizontal
                            if (droplines != 'horizontal' && xInDomain) {
                                shapes.lines.push({class: scope.style + ' dropline', color: scope.color,
                                    x1: cx, y1: Math.max(cy, 0), x2: cx, y2: graph.height + 25});
                            }

                            // Add a horizontal dropline unless droplines == vertical
                            if (droplines != 'vertical' && yInDomain) {
                                shapes.lines.push({class: scope.style + ' dropline', color: scope.color,
                                    x1: Math.min(cx, graph.width), y1: cy, x2: -25, y2: cy});
                            }

                        }

                    }

                    return shapes;

                }
            });

        }

        return {
            link: link,
            require: '^graph',
            restrict: 'E',
            scope: { point: '&', droplines: '@', label: '@', xlabel: '@', ylabel: '@', color: '@', show:'&', r: '@'}
        }
    }
);

// curve.js
/**
 * Created by cmakler on 11/3/14.
 */

kgAngular.directive('curve', function (D3Helpers) {

        function link(scope, element, attrs, graphCtrl) {

            // Show unless there is an attribute determining show/hide behavior
            if (!attrs['show']) {
                scope.show = function () {
                    return true
                }
            }

            graphCtrl.addObject({

                update: function (shapes,graph) {

                    if(scope.show()) {

                        var p = (typeof scope.fn == 'function') ? scope.fn() : scope.fn;

                        var yofx = [];
                        var xofy = [];

                        if ('y' != scope.ind) {
                            yofx = p.points(graph.xDomain, graph.yDomain)
                        }

                        if ('x' != scope.ind) {
                            xofy = p.points(graph.xDomain, graph.yDomain, true)
                        }

                        function sortObjects(key, descending) {
                            return function (a, b) {
                                var lower = descending ? a[key] : b[key],
                                    higher = descending ? b[key] : a[key];
                                return lower > higher ? -1 : lower < higher ? 1 : lower <= higher ? 0 : NaN;
                            }
                        }

                        var allPoints = d3.merge([yofx, xofy]);

                        if ('y' == scope.ind) {
                            allPoints = allPoints.sort(sortObjects('y'));
                        } else {
                            allPoints = allPoints.sort(sortObjects('x'));
                        }

                        shapes.curves.push({points: graph.curveFunction(allPoints), color: scope.color});

                        // Add label to last point

                        var label = scope.label || 'none';

                        // Add associated labels only if each is in its dimension fo the graph domain
                        if (label != 'none') {
                            var labelObject = D3Helpers.configLabel({
                                graph: graph,
                                html:label,
                                point: allPoints[allPoints.length - 1],
                                xOffset: parseInt(scope.labelOffsetX()),
                                yOffset: parseInt(scope.labelOffsetY())
                            });
                            labelObject.color = scope.color;

                            shapes.divs.push(labelObject);
                        }

                    }

                    return shapes;

                }
            });

        }

        return {
            link: link,
            require: '^graph',
            restrict: 'E',
            scope: { fn: '&', label:'@', ind: '@', color: '@', show: '&', labelOffsetX: '&', labelOffsetY: '&' }
        }
    }
);

// line.js
/**
 * Created by cmakler on 11/3/14.
 */

kgAngular.directive('line', function (D3Helpers) {

        function link(scope, element, attrs, graphCtrl) {

            // Show unless there is an attribute determining show/hide behavior
            if (!attrs['show']) {
                scope.show = function () {
                    return true
                }
            }

            graphCtrl.addObject({

                update: function (shapes, graph) {

                    if (scope.show()) {

                        if(scope.params() != undefined && scope.params().hasOwnProperty('definitionType')) {
                            scope.fn = new kg.functions.Linear(scope.params());
                        }

                        var l = (typeof scope.fn == 'function') ? scope.fn() : scope.fn;

                        if(l != undefined) {var points = l.points(graph.xDomain, graph.yDomain),
                            x1 = graph.x(points[0].x),
                            y1 = graph.y(points[0].y),
                            x2 = graph.x(points[1].x),
                            y2 = graph.y(points[1].y);

                        shapes.lines.push({x1: x1, y1: y1, x2: x2, y2: y2, color: scope.color});}

                        // Add label to last point

                        var label = scope.label || 'none';

                        if (label != 'none') {
                            var labelObject = D3Helpers.configLabel({
                                graph: graph,
                                html: label,
                                point: points[1],
                                xOffset: parseInt(scope.labelOffsetX()),
                                yOffset: parseInt(scope.labelOffsetY())
                            });
                            labelObject.color = scope.color;

                            shapes.divs.push(labelObject);
                        }
                    }

                    return shapes;

                }
            });

        }

        return {
            link: link,
            require: '^graph',
            restrict: 'E',
            scope: { fn: '&', color: '@', show:'&', params: '&', label:'@', labelOffsetX:'&', labelOffsetY:'&'}
        }
    }
);

kgAngular.directive('rule', function (D3Helpers) {

        function link(scope, element, attrs, graphCtrl) {

            // Show unless there is an attribute determining show/hide behavior
            if (!attrs['show']) {
                scope.show = function () {
                    return true
                }
            }

            graphCtrl.addObject({

                update: function (shapes, graph) {

                    if (scope.show()) {

                        var direction = scope.direction || 'vertical',
                            xDomain = domainAsObject(graph.xDomain),
                            yDomain = domainAsObject(graph.yDomain);

                        var value = (typeof scope.fn == 'function') ? scope.fn() : scope.fn;

                        if (value != undefined) {

                            var labelPoint = {},
                                axisLabelPoint= {};

                            if(direction == 'vertical' && value >= xDomain.min && value <= xDomain.max) {
                                shapes.lines.push(
                                    {
                                        x1: graph.x(value),
                                        y1: graph.y(yDomain.min),
                                        x2: graph.x(value),
                                        y2: graph.y(yDomain.max),
                                        color: scope.color
                                    }
                                );

                                labelPoint = {x: value, y: yDomain.max};
                            }

                            if (direction == 'horizontal' && value >= yDomain.min && value <= yDomain.max) {
                                shapes.lines.push(
                                    {
                                        x1: graph.x(xDomain.min),
                                        y1: graph.y(value),
                                        x2: graph.x(xDomain.max),
                                        y2: graph.y(value),
                                        color: scope.color
                                    }
                                );

                                labelPoint = {x: xDomain.max, y: value};
                                axisLabelPoint = {x: xDomain.max, y: value};
                            }

                            // Add label to last point

                            var label = scope.label || 'none';

                            if (label != 'none') {
                                var labelObject = D3Helpers.configLabel({
                                    graph: graph,
                                    html: label,
                                    point: labelPoint,
                                    xOffset: parseInt(scope.labelOffsetX()),
                                    yOffset: parseInt(scope.labelOffsetY())
                                });
                                labelObject.color = scope.color;

                                shapes.divs.push(labelObject);
                            }

                            // Add axis label

                            var axisLabel = scope.axisLabel || 'none';

                            if (axisLabel != 'none') {
                                var axisLabelObject = D3Helpers.configLabel({
                                    graph: graph,
                                    html: axisLabel,
                                    point: axisLabelPoint,
                                    xOffset: parseInt(scope.labelOffsetX()),
                                    yOffset: parseInt(scope.labelOffsetY())
                                });
                                axisLabelObject.color = scope.color;

                                shapes.divs.push(axisLabelObject);
                            }

                        }

                    }

                    return shapes;

                }
            });

        }

        return {
            link: link,
            require: '^graph',
            restrict: 'E',
            scope: { fn: '&', direction: '@', color: '@', show: '&', axisLabel: '@', label: '@', labelOffsetX: '&', labelOffsetY: '&'}
        }
    }
);

kgAngular.directive('segment', function (D3Helpers) {

        function link(scope, element, attrs, graphCtrl) {

            // Show unless there is an attribute determining show/hide behavior
            if (!attrs['show']) {
                scope.show = function () {
                    return true
                }
            }

            graphCtrl.addObject({

                update: function (shapes, graph) {

                    if (scope.show()) {

                        var points = (typeof scope.points == 'function') ? scope.points() : scope.points;

                        var x1 = graph.x(points[0].x),
                            y1 = graph.y(points[0].y),
                            x2 = graph.x(points[1].x),
                            y2 = graph.y(points[1].y);

                        shapes.lines.push({x1: x1, y1: y1, x2: x2, y2: y2, color: scope.color});

                        // Add label to last point

                        var label = scope.label || 'none';

                        if (label != 'none') {

                            var labelPoint = ('center' == scope.labelPosition) ? {x : 0.5*(points[0].x + points[1].x), y: 0.5 * (points[0].y + points[1].y)} : points[1];

                            var labelObject = D3Helpers.configLabel({
                                graph: graph,
                                html: label,
                                point: labelPoint,
                                xOffset: parseInt(scope.labelOffsetX()),
                                yOffset: parseInt(scope.labelOffsetY())
                            });
                            labelObject.color = scope.color;

                            shapes.divs.push(labelObject);
                        }

                    }

                    return shapes;

                }
            });

        }

        return {
            link: link,
            require: '^graph',
            restrict: 'E',
            scope: { points: '&', color: '@', show:'&', label: '@', labelOffsetX: '&', labelOffsetY: '&', labelPosition: '@'}
        }
    }
);

// area.js
/**
 * Created by cmakler on 11/3/14.
 */

kgAngular.directive('area', function (D3Helpers) {

        function link(scope, element, attrs, graphCtrl) {

            // Show unless there is an attribute determining show/hide behavior
            if (!attrs['show']) {
                scope.show = function () {
                    return true
                }
            }

            graphCtrl.addObject({

                update: function (shapes,graph) {

                    if (scope.show()) {

                        var p = (typeof scope.fn == 'function') ? scope.fn() : scope.fn;

                        shapes.areas.push({points: graph.curveFunction(p.area(graph.xDomain, graph.yDomain)), color: scope.color});

                    }

                    return shapes;

                }
            });

        }

        return {
            link: link,
            require: '^graph',
            restrict: 'E',
            scope: { fn: '&', ind: '@', color: '@', show: '&' }
        }
    }
);

// rect.js
/**
 * Created by cmakler on 1/9/15.
 */

kgAngular.directive('rect', function (D3Helpers) {

        function link(scope, element, attrs, graphCtrl) {

            // Show unless there is an attribute determining show/hide behavior
            if (!attrs['show']) {
                scope.show = function () {
                    return true
                }
            }

            graphCtrl.addObject({

                update: function (shapes, graph) {

                    if(scope.show()) {

                        var p = (typeof scope.points == 'function') ? scope.points() : scope.points;

                        var x1 = graph.x(p[0][0]),
                            y1 = graph.y(p[0][1]),
                            x2 = graph.x(p[1][0]),
                            y2 = graph.y(p[1][1]);

                        var x = Math.min(x1,x2),
                            y = Math.min(y1,y2),
                            width = Math.abs(x1 - x2),
                            height = Math.abs(y1 - y2);

                        shapes.rects.push({x: x, y: y, width: width, height:height , color: scope.color});

                    }

                    return shapes;

                }
            });

        }

        return {
            link: link,
            require: '^graph',
            restrict: 'E',
            scope: { points: '&', show: '&', color: '@' }
        }
    }
);

// label.js
/**
 * Created by cmakler on 1/9/15.
 */

kgAngular.directive('label', function () {

        function link(scope, element, attrs, graphCtrl) {

            // Show unless there is an attribute determining show/hide behavior
            if(!attrs['show']) { scope.show = function(){return true} }

            graphCtrl.addObject({

                update: function (shapes, graph) {

                    if (scope.show()) {

                        var p = (typeof scope.point == 'function') ? scope.point() : scope.point;
                        var l = (typeof scope.label == 'function') ? scope.label() : scope.label;

                        var x = p[0],
                            y = p[1];

                        var xInDomain = (x <= graph.xDomain[1] && x >= graph.xDomain[0]),
                            yInDomain = (y <= graph.yDomain[1] && y >= graph.yDomain[0]);

                        var cx = graph.x(x),
                            cy = graph.y(y);

                        // Add label to shapes if it's in the graph domain
                        if (xInDomain && yInDomain) {

                            shapes.divs.push({
                                html: l,
                                x: cx - 75,
                                y: cy + 5,
                                width: 150,
                                align: 'center',
                                color: scope.color,
                                math: false,
                                size: '14pt'
                            });

                        }

                    }

                    return shapes;

                }
            });

        }

        return {
            link: link,
            require: '^graph',
            restrict: 'E',
            scope: { point: '&', label: '@', color: '@', show:'&'}
        }
    }
);


text:
package org.aludratest.log4testing.engine;

import java.util.AbstractList;
import java.util.List;

import org.aludratest.log4testing.TestCaseLog;
import org.aludratest.log4testing.TestStepGroupLog;
import org.aludratest.log4testing.TestStepLog;
import org.aludratest.log4testing.TestSuiteLog;

class FilteringTestCaseLog extends FilteringNamedTestLogElement<TestCaseLog> implements TestCaseLog {

	public FilteringTestCaseLog(TestCaseLog delegate, LogContext logContext) {
		super(delegate, logContext);
	}

	@Override
	public TestSuiteLog getParent() {
		TestSuiteLog parent = getDelegate().getParent();
		return parent == null ? null : new FilteringTestSuiteLog(parent, getLogContext());
	}

	@Override
	public boolean isIgnored() {
		return getDelegate().isIgnored();
	}

	@Override
	public boolean isFailed() {
		return getDelegate().isFailed();
	}

	@Override
	public String getIgnoredReason() {
		return getDelegate().getIgnoredReason();
	}

	@Override
	public List<TestStepGroupLog> getTestStepGroups() {
		return new FilteringTestStepGroupLogList();
	}

	private class FilteringTestStepGroupLogList extends AbstractList<TestStepGroupLog> {

		@Override
		public TestStepGroupLog get(int index) {
			TestStepGroupLog log = getDelegate().getTestStepGroups().get(index);
			return log == null ? null : new FilteringTestStepGroupLog(log, getLogContext());
		}

		@Override
		public int size() {
			return getDelegate().getTestStepGroups().size();
		}

	}

	@Override
	public int getNumberOfTestSteps() {
		int counter = 0;
		for (TestStepGroupLog group : getTestStepGroups()) {
			counter += group.getTestSteps().size();
		}
		return counter;
	}

	@Override
	public TestStepLog getLastFailedStep() {
		TestStepLog lastFailed = null;
		for (TestStepGroupLog group : getTestStepGroups()) {
			for (TestStepLog step : group.getTestSteps()) {
				if (step.getStatus() != null && step.getStatus().isFailure()) {
					lastFailed = step;
				}
			}
		}

		return lastFailed;
	}

}


text:
<?xml version='1.0' encoding='UTF-8'?>
<biz.neustar.jenkins.plugins.packer.PackerPublisher_-DescriptorImpl plugin="packer@1.4">
  <installations>
    <biz.neustar.jenkins.plugins.packer.PackerInstallation>
      <name>Packer 1.1.0</name>
      <home></home>
      <properties>
        <hudson.tools.InstallSourceProperty>
          <installers>
            <biz.neustar.jenkins.plugins.packer.PackerInstaller>
              <id>1.1.0-linux-amd64</id>
            </biz.neustar.jenkins.plugins.packer.PackerInstaller>
          </installers>
        </hudson.tools.InstallSourceProperty>
      </properties>
      <packerHome></packerHome>
      <params></params>
      <jsonTemplate></jsonTemplate>
      <templateModeJsonObj>
        <nullObject>false</nullObject>
        <properties class="org.apache.commons.collections.map.ListOrderedMap" serialization="custom">
          <unserializable-parents/>
          <org.apache.commons.collections.map.ListOrderedMap>
            <default>
              <insertOrder>
                <string>value</string>
                <string>jsonTemplate</string>
              </insertOrder>
            </default>
            <map>
              <entry>
                <string>value</string>
                <string>file</string>
              </entry>
              <entry>
                <string>jsonTemplate</string>
                <string></string>
              </entry>
            </map>
          </org.apache.commons.collections.map.ListOrderedMap>
        </properties>
      </templateModeJsonObj>
      <templateMode>file</templateMode>
    </biz.neustar.jenkins.plugins.packer.PackerInstallation>
  </installations>
</biz.neustar.jenkins.plugins.packer.PackerPublisher_-DescriptorImpl>


text:
import { RouterConfig,provideRouter } from "@angular/router";
import { SearchListComponent } from "./search-list.component";
import { ViewSongComponent } from "./view-song.component";
import { EditSongComponent } from "./edit-song.component";

const routeConf:RouterConfig = [

    {
        path:"",
        redirectTo:"/list",
        pathMatch:"full"
    },
    {
        path:"list",
        component: SearchListComponent
    },
    {
        path:"song/:id",
        component: ViewSongComponent
    }
    ,
    {
        path:"edit/:id",
        component: EditSongComponent
    }
    ,
    {
        path:"edit",
        component: EditSongComponent
    }
];

export const appRouteProviders:any[] = [
    provideRouter(routeConf)
];


text:
//
//  SoundSourcePool.h
//  ObjectAL
//
//  Created by Karl Stenerud on 17/12/09.
//
//  Copyright (c) 2009 Karl Stenerud. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall remain in place
// in this source code.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// Attribution is not required, but appreciated :)
//

#import "ALSoundSource.h"

#pragma mark ALSoundSourcePool

/**
 * A pool of sound sources, which can be fetched based on availability.
 */
@interface ALSoundSourcePool : NSObject
{
	/** All sources managed by this pool (id<ALSoundSource>). */
	NSMutableArray* sources;
}

#pragma mark Properties

/** All sources managed by this pool (id<ALSoundSource>). */
@property(nonatomic,readonly) NSArray* sources;

#pragma mark Object Management

/** Make a new pool.
 * @return A new pool.
 */
+ (id) pool;

#pragma mark Source Management

/** Add a source to this pool.
 *
 * @param source The source to add.
 */
- (void) addSource:(id<ALSoundSource>) source;

/** Remove a source from this pool
 *
 * @param source The source to remove.
 */
- (void) removeSource:(id<ALSoundSource>) source;

/** Acquire a free or freeable source from this pool.
 * It first attempts to find a completely free source.
 * Failing this, it will attempt to interrupt a source and return that (if attemptToInterrupt
 * is TRUE).
 *
 * @param attemptToInterrupt If TRUE, attempt to interrupt sources to free them for use.
 * @return The freed sound source, or nil if no sources are freeable.
 */
- (id<ALSoundSource>) getFreeSource:(bool) attemptToInterrupt;

@end


text:
module RSpec::Authorization
  module Adapters
    # Create a new restful helper method using the available dictionaries. Method
    # that is not available raise a +NoMethodError+, consider the following
    # example:
    #
    #   RestfulHelperMethod.new(:to_read)
    #
    # This class can be inferred automatically as an array, for example on
    # multiple assignment, consider the following example:
    #
    #   behavior, actions = RestfulHelperMethod(:to_read)
    #   behavior # => :read
    #   actions  # => [:index, :show]
    #
    # === RESTful helper methods
    #
    # Currently available helper method are:
    #
    # - +to_read+
    # - +to_create+
    # - +to_update+
    # - +to_delete+
    # - +to_manage+
    #
    # The above method is not related to declarative_authorization privileges,
    # and serve simply as convinience method, below is a table of restful actions
    # returned from the restful helper method:
    #
    #   Method        RESTful actions
    #   ----------------------------------------------------------------------
    #   to_read       [:index, :show]
    #   to_create     [:new, :create]
    #   to_update     [:edit, :update]
    #   to_delete     [:destroy]
    #   to_manage     [:index, :show, :new, :create, :edit, :update, :destroy]
    #
    # === Focused RESTful helper methods
    #
    # Currently available focused helper methods are:
    #
    # - +only_to_read+
    # - +only_to_create+
    # - +only_to_update+
    # - +only_to_delete+
    #
    # And their negated counterparts are:
    #
    # - +except_to_read+
    # - +except_to_create+
    # - +except_to_update+
    # - +except_to_delete+
    #
    # The above helper methods have a different action table compared to the
    # regular helper methods, this is due to it's nature to focus only on certain
    # behavior, and it negates other actions:
    #
    #   Method         Focused actions   Negated actions
    #   -------------------------------------------------------------------------
    #   only_to_read   [:index, :show]   [:new, :create, :edit, :update, :delete]
    #   only_to_create [:new, :create]   [:index, :show, :edit, :update, :delete]
    #   only_to_update [:edit, :update]  [:index, :show, :new, :create, :delete]
    #   only_to_delete [:destroy]        [:index, :show, :new, :create, :edit, :update]
    #
    # The negated focused helper methods have exactly the opposite matching table,
    # following is actions table for negated focused helper methods:
    #
    #   Method           Focused actions                                Negated actions
    #   -------------------------------------------------------------------------------
    #   except_to_read   [:new, :create, :edit, :update, :delete]       [:index, :show]
    #   except_to_create [:index, :show, :edit, :update, :delete]       [:new, :create]
    #   except_to_update [:index, :show, :new, :create, :delete]        [:edit, :update]
    #   except_to_delete [:index, :show, :new, :create, :edit, :update] [:destroy]
    #
    class RestfulHelperMethod
      # @return [Symbol] Restful helper method prefix
      attr_reader :prefix
      # @return [Symbol] Restful helper method name
      attr_reader :name
      # @return [Symbol] The behavior of the restful helper method
      attr_reader :behavior
      # @return [Array<Symbol>] The list of actions for a given behavior
      attr_reader :actions
      # @return [Array<Symbol>] The list of negated actions for a given behavior
      attr_reader :negated_actions

      # Creates a restful helper method using the available dictionaries. Invalid
      # or a non-available helper method that passed in raise an error, consider
      # the following example:
      #
      #   RestfulHelperMethod.new(:to_explode) # this will explode
      #   => NoMethodError: undefined method `to_explode' for RestfulHelperMethod
      #
      # @param name [Symbol] restful method name to be retrieved
      def initialize(name)
        @name, @prefix, @behavior = find_method(name).to_a.map(&:to_sym)

        raise NoMethodError, error_message unless DICTIONARIES.key?(behavior)

        @actions         = DICTIONARIES[behavior]
        @negated_actions = prefix.eql?(:to) ? [] : (DICTIONARIES[:manage] - actions)

        swap_negated_actions if prefix.eql?(:except_to)
      end

      def humanize
        name.to_s.gsub("_", " ")
      end

      private

      def error_message
        "undefined method `#{name}' for #{self.class}"
      end

      def find_method(name)
        /^(to|only_to|except_to)_(.*)$/.match(name)
      end

      def swap_negated_actions
        @actions, @negated_actions = negated_actions, actions
      end

      def to_a
        [actions, negated_actions]
      end

      DICTIONARIES = {
        read:   %i(index show),
        create: %i(new create),
        update: %i(edit update),
        delete: %i(destroy),
        manage: %i(index show new create edit update destroy)
      }
    end
  end
end


text:
android-test-app
================


text:
<!-- BEGIN int -->
	<input type="number" min="{int.FIELD_MINLEN}" max="{int.FIELD_MAXLEN}" class="post" name="{int.FIELD_IDENT}" size="{int.FIELD_LENGTH}" value="{int.FIELD_VALUE}" />
<!-- END int -->


text:
const rfr = require('rfr')
const chai = require('chai')
const expect = chai.expect

const moduleRoutes = rfr('./modules/v1/routes')
const routesHelper = rfr('./tests/helpers/routes')(moduleRoutes)
const routes = routesHelper.getRoutes()

describe('Modules V1: Routes', () => {
  describe('HEAD', () => {
    it('should not have any HEAD routes', () => {
      expect(routes.head.length).to.equal(0)
    })
  })
  describe('GET', () => {
    it('should not have any GET routes', () => {
      expect(routes.get.length).to.equal(0)
    })
  })
  describe('POST', () => {
    it('should have a POST /test routes', () => {
      expect(routesHelper.checkRoute('post', '/test')).to.be.true
    })
  })
  describe('PUT', () => {
    it('should not have any PUT routes', () => {
      expect(routes.put.length).to.equal(0)
    })
  })
  describe('PATCH', () => {
    it('should not have any PATCH routes', () => {
      expect(routes.patch.length).to.equal(0)
    })
  })
  describe('DELETE', () => {
    it('should not have any DELETE routes', () => {
      expect(routes.delete.length).to.equal(0)
    })
  })
})


text:
Enumerate Physical Devices

<link href="../css/lg_stylesheet.css" rel="stylesheet"></link>

Code file for this section is 02-enumerate_devices.cpp

The next step in the samples progression is determining the
physical devices present on the system.

After you have created an instance, the loader knows how many Vulkan
physical devices are available, but your application doesn't know this yet.
The application learns how many devices are available by asking the
Vulkan API for a list of physical devices.

Physical devices are related to the instance as shown in the above diagram.

Getting Lists of Objects from Vulkan

Obtaining list of objects is a fairly common operation in Vulkan,
and the API has a consistent pattern for doing so.
API functions that return lists have count and pointer arguments.
The count argument is a pointer to an integer so that the API can
set its value.  The steps are:

Call the function with a valid pointer to an integer for the count argument
and a NULL for the pointer argument.

The API fills in the count argument with the number of objects in the list.

The application allocates enough space to store the list.

The application calls the function again with the pointer argument pointing
to the space just allocated.

You will see this pattern often in the Vulkan API.

vkEnumeratePhysicalDevices Function

The vkEnumeratePhysicalDevices function returns only a list of handles
for each physical device on the system.
A physical device might be a graphics card that one plugs into a desktop computer, some sort
of GPU core on an SoC, etc.
If there are multiple devices available, the application must decide somehow
which of them it will use.

Our sample code enumerates the physical devices as follows:

// Get the number of devices (GPUs) available.
VkResult res = vkEnumeratePhysicalDevices(info.inst, &gpu_count, NULL);
// Allocate space and get the list of devices.
info.gpus.resize(gpu_count);
res = vkEnumeratePhysicalDevices(info.inst, &gpu_count, info.gpus.data());

Note that the info.gpus variable is a vector of type VkPhysicalDevice,
which is a handle.

All enumerate does is get the list of physical device handles.
The device program, which is the next step in the progression,
looks at this list to decide which device to use.

The Samples info Structure

You'll notice the use of an info variable in the above code.
Each sample program uses the global info structure
variable to track Vulkan information and application state.
This facilitates using more compact function calls to perform
steps that have already been covered in this tutorial.
For example, see the line of code in the enumerate program:

`init_instance(info, "vulkansamples_enumerate");`

which performs the steps discussed on the instance page
of this tutorial.
init_instance() creates the instance and stores the handle in info.
And then vkEnumeratePhysicalDevices() uses info.inst in the call to
vkEnumeratePhysicalDevices().

Now that you have the list of devices (GPUs), it is now time to select a GPU
and create a Vulkan logical device object so that you can start working with
that GPU.

        Previous: Instance
        Back to: Index
        Next: Device

© Copyright 2016 LunarG, Inc


text:
layout: post
authors: ["Greg Wilson"]
title: "More on Instructor Training"
date: 2016-07-26
time: "00:08:00"
category: ["Instructor Training"]
---

Since we announced yesterday that we are
[re-opening applications for instructor training]({{site.baseurl}}/blog/2016/07/reopening-instructor-training.html),
several questions have come in by email and on Twitter.
We've answered the general ones below,
and will update this post as others arrive.

**Why are you running open-enrollment classes?**
:   Our primary goal is to increase our reach:
    many geographic regions and research disciplines are sparsely represented in our instructor pool,
    or not represented at all,
    and we are always conscious of the need to
    [maintain and improve diversity]({{site.baseurl}}/blog/2016/02/checking-the-balance.html).

**How does this relate to instructor training for partner organizations?**
:   Partner organizations are
    [guaranteed a certain number of instructor training slots]({{site.baseurl}}/scf/join/)
    as part of their agreement with us,
    and those trainings are given priority over open-enrollment offerings.

**How many classes are being offered, and how many spaces are available?**
:   We are currently planning to run two classes, each for about 30 participants.

**Where will the training take place?**
:   These two classes will take place online,
    and will run over two full days.
    We will choose dates and times to accommodate as many people as possible.

**How are participants going to be selected?**
:   We will select participants based on
    previous involvement with Software and Data Carpentry,
    location,
    research discipline,
    previous teaching experience,
    ability to commit time to teaching and mentorship,
    and all of the other factors in
    [the application form](https://amy.software-carpentry.org/workshops/request_training/).

**When will selections be made?**
:   We will start notifying people in a few weeks
    (i.e., the second half of August).

**In what time zones will classes take place?**
:   We haven't decided yet,
    but they will be aimed at different timezones
    so that we can accommodate the widest possible range of participants.

**Will you offer more open-enrollment classes in future?**
:   Yes.

**Wil people have to re-apply to take part?**
:   No:
    we will keep all applications,
    and contact people as spots become available
    to see if they're still interested.