text:
<?php

if ( ! defined('ABSPATH')) exit;  // if direct access

?>

<?php the_content(); ?>

        <?php
        $job_bm_responsibilities = get_post_meta(get_the_ID(), 'job_bm_responsibilities', true);

        if(!empty($job_bm_responsibilities)){

        ?>

<?php _e('Responsibilities:', job_bm_textdomain); ?>

        <?php

        $job_bm_responsibilities = get_post_meta(get_the_ID(), 'job_bm_responsibilities', true);

        echo $job_bm_responsibilities;

        ?>

        <?php
        }
        ?>

        <?php
        $job_bm_education_requirements = get_post_meta(get_the_ID(), 'job_bm_education_requirements', true);

        if(!empty($job_bm_education_requirements)){

        ?>

<?php _e('Educational requirements:', job_bm_textdomain); ?>

        <?php
        echo $job_bm_education_requirements;
        ?>

        <?php
        }
        ?>

        <?php
        $job_bm_experience_requirements = get_post_meta(get_the_ID(), 'job_bm_experience_requirements', true);

        if(!empty($job_bm_experience_requirements)){

        ?>

<?php _e('Experience requirements:', job_bm_textdomain); ?>

        <?php

        $job_bm_experience_requirements = get_post_meta(get_the_ID(), 'job_bm_experience_requirements', true);

        echo $job_bm_experience_requirements;

        ?>

        <?php
        }
        ?>

        <?php
        $job_bm_skills_requirements = get_post_meta(get_the_ID(), 'job_bm_skills_requirements', true);

        if(!empty($job_bm_skills_requirements)){

        ?>

<?php _e('Desired Skills:', job_bm_textdomain); ?>

        <?php

        $job_bm_skills_requirements = get_post_meta(get_the_ID(), 'job_bm_skills_requirements', true);

        echo $job_bm_skills_requirements;

        ?>

        <?php
        }
        ?>

        <?php
        $job_bm_qualifications = get_post_meta(get_the_ID(), 'job_bm_qualifications', true);

        if(!empty($job_bm_qualifications)){

        ?>

<?php _e('Qualifications:', job_bm_textdomain); ?>

        <?php

        $job_bm_qualifications = get_post_meta(get_the_ID(), 'job_bm_qualifications', true);

        echo $job_bm_qualifications;

        ?>

        <?php
        }
        ?>

redpajama_set_name: RedPajamaGithub


text:
function mean_peak_segments=peak_averaged_signal_batch_multifreq_beta(peak_freq,target_freq,sampling_freq)

freq_num=length(peak_freq);

if length(target_freq)~=freq_num
    display('peak_freq and target_freq must be vectors of the same length.')
end

freq_label='';
for j=1:freq_num
    freq_labels{j}=[num2str(target_freq(j)),'_spaced_',num2str(peak_freq(j))];
    freq_label=[freq_label,freq_labels{j}];
end

[listname,listpath]=uigetfile('*list','Choose a list of files to calculate peak-averaged signal.');

filenames=textread([listpath,listname],'%s');
filenum=length(filenames);

max_segment_length=2*floor(sampling_freq/min(target_freq))+1;

t_mat=nan(max_segment_length,freq_num);
mean_peak_segments=nan(max_segment_length,freq_num);
se_peak_segments=nan(max_segment_length,freq_num);

for j=1:freq_num

    segment_length=2*floor(sampling_freq/target_freq(j))+1;

    peak_freq_wavelet=dftfilt3(peak_freq(j), 8, sampling_freq, 'winsize', segment_length);

    t=[1:segment_length]-floor(segment_length/2)-1;
    t=t/sampling_freq;

    fid=fopen([listname(1:end-5),'_',char(freq_labels{j}),'_peak_avg.txt'],'w');

    format=[];
    for i=1:segment_length
        format=[format,'%f\t'];
    end
    format=[format(1:end-1),'n'];

%     Peak_segments=[];
    Peak_segment_sum=zeros(1,segment_length);
    num_peaks=0;

    parfor i=1:filenum

        filename=char(filenames(i));
        data=load(filename);
%         signal_length=length(data);

        peak_freq_filtered=conv(data,peak_freq_wavelet);
        %     peak_freq_filtered=peak_freq_filtered(sampling_freq/2+1:end-sampling_freq/2);
        peak_freq_mag=abs(peak_freq_filtered);
        signal_length=length(peak_freq_mag);

        Max_locs=zeros(1,signal_length);
        Win_centers=zeros(1,signal_length);

        for k=1:signal_length

            win_center=k;
            win_start=max(1,win_center-floor(segment_length/2));
            win_end=min(signal_length,win_center+floor(segment_length/2));

            [maximum,location]=max(peak_freq_mag(win_start:win_end));
            Maxima(k)=maximum;
            Max_locs(k)=location+win_start-1;
            Win_centers(k)=win_center;

        end

%         peak_freq_filtered=peak_freq_filtered(segment_length+1:end-segment_length);
        peak_freq_mag=peak_freq_mag(segment_length+1:end-segment_length);
        signal_length=length(peak_freq_mag);
        Maxima=Maxima(segment_length+1:end-segment_length);

%         figure(), plot(peak_freq_mag), hold on, plot(real(peak_freq_filtered),'k'), plot(Maxima,'c')

        Peak_locs=Max_locs(Max_locs==Win_centers);

        Peak_locs=Peak_locs-segment_length;
        Peak_locs=Peak_locs(Peak_locs>floor(segment_length/2) & Peak_locs<signal_length-floor(segment_length/2));

%         pfm_max=max(peak_freq_mag);
%         pfm_min=min(peak_freq_mag);

        for k=1:length(Peak_locs)

            num_peaks=num_peaks+1;

            peak_location=Peak_locs(k);

%             plot([peak_location peak_location],[pfm_max pfm_min],'r')

            segment_start=max(1,peak_location-floor(segment_length/2));
            segment_end=min(signal_length,peak_location+floor(segment_length/2));
            Peak_segment_sum=Peak_segment_sum+data(segment_start:segment_end)';

            fprintf(fid,format,data(segment_start:segment_end));

        end

%         saveas(gcf,[filename(1:end-4),'_',char(freq_labels{j}),'_peaks.fig'])
%         close(gcf)

    end

    Peak_segment_avg=Peak_segment_sum'/num_peaks;

    t_mat(1:segment_length,j)=t;
    mean_peak_segments(1:segment_length,j)=Peak_segment_avg;
%     se_peak_segments(1:segment_length,j)=std(Peak_segments)'/sqrt(length(Peak_segments));

    fprintf(fid,format,Peak_segment_avg);
    fclose(fid);

%     t=[1:segment_length]-floor(segment_length/2)-1;
%     t=t/sampling_freq;

    figure()
    plot(t,Peak_segment_avg)
    title([num2str(target_freq),' Hz-Spaced ',num2str(peak_freq),' Hz Peak-Triggered Average Signal for ',listname])
    xlabel('Time From Peak (s)')
    saveas(gcf,[listname(1:end-5),'_',num2str(target_freq),'_spaced_',num2str(peak_freq),'_peak_avg.fig'])

%     figure()
%     plot(t,std(Peak_segments))
%     title([num2str(target_freq),' Hz-Spaced ',num2str(peak_freq),' Hz Peak-Triggered Signal S.D. for ',listname])
%     xlabel('Time From Peak (s)')
%     saveas(gcf,[listname(1:end-5),'_',num2str(target_freq),'_spaced_',num2str(peak_freq),'_peak_sd.fig'])

%     figure()
%     boxplot(Peak_segments)
%     title([num2str(target_freq),' Hz-Spaced ',num2str(peak_freq),' Hz Peak-Triggered Signal Boxplot for ',listname])
%     set(gca,'XTickLabel',t)
%     xlabel('Time From Peak (s)')
%     saveas(gcf,[listname(1:end-5),'_',num2str(target_freq),'_spaced_',num2str(peak_freq),'_peak_boxplot.fig'])

end

figure()
plot(t_mat,mean_peak_segments)
% hold on
% plot(t_mat,mean_peak_segments+se_peak_segments,':')
% plot(t_mat,mean_peak_segments-se_peak_segments,':')
title([num2str(target_freq),' Hz-Spaced ',num2str(peak_freq),' Hz Peak-Triggered Average Signal for ',listname])
xlabel('Time From Peak (s)')
legend(freq_labels)
saveas(gcf,[listname(1:end-5),'_',freq_label,'_peak_avg.fig'])


text:
        <?php
        $messages = \GFramework\App::getInstance()->getConfig()->errors;
        foreach($this->___data['errors'] as $v) {
            ?>

<?php echo $messages[$v] ?>

        <?php } ?>


text:
module ActiveReport
  module Exceptions
    class ReportNotFound < StandardError
      def initialize(report)
        @report = report
      end

      def message
        "ActiveReport checked #{Rails.root.join("app/reports")} for a report named #{@report}, and didn't find one."
      end
    end
  end
end


text:
%Contourlet Toolbox (Version 2.0)
%
%Demos
% DECDEMO    Demonstrates contourlet decomposition and reconstruction
% NLADEMO    Demo for contourlet nonlinear approximation.
% NLADEMO2   Nonlinear approximation demo using only the finest scale
% DENOISEDEMO  Denoise demo
%
%Main functions: Contourlets pyramidal directional filter bank
% PDFBDEC    Pyramidal Directional Filter Bank (or Contourlet) Decomposition
% PDFBREC    Pyramid Directional Filterbank Reconstruction
%
%Retrieve filters by names
% PFILTERS   Generate filters for the Laplacian pyramid
% DFILTERS   Generate directional 2D filters
% LDFILTER   Generate filter for the ladder structure
%
%Utility functions of the contourlet transform
% SHOWPDFB   Show contourlet or PDFB coefficients.
% PDFB2VEC   Convert the output of the PDFB into a vector form
% VEC2PDFB   Convert the vector form to the output structure of the PDFB
% PDFB_TR    Retain the most significant coefficients at certain subbands
% PDFB_NEST  Estimate the noise standard deviation in the PDFB domain
%
%Laplacian pyramid
% LPDEC      Laplacian Pyramid Decomposition
% LPDEC      Laplacian Pyramid Reconstruction
%
%Wavelet filter bank
% WFB2DEC    2-D Wavelet Filter Bank Decomposition
% WFB2REC    2-D Wavelet Filter Bank Decomposition
%
%Directional filter bank
% DFBDEC     Directional Filterbank Decomposition
% DFBREC     Directional Filterbank Reconstruction
% DFBDEC_L   Directional Filterbank Decomposition using Ladder Structure
% DFBREC_L   Directional Filterbank Reconstruction using Ladder Structure
% DFBIMAGE   Produce an image from the result subbands of DFB
%
%Two-channel 2D filter banks (used in the DFB)
% FBDEC      Two-channel 2D Filterbank Decomposition
% FBDEC_L    Two-channel 2D Filterbank Decomposition using Ladder Structure
% FBREC      Two-channel 2D Filterbank Reconstruction
% FBREC_L    Two-channel 2D Filterbank Reconstruction using Ladder Structure
%
%Multidimensional filtering (used in building block filter banks)
% SEFILTER2  2D seperable filtering with extension handling
% EFILTER2   2D Filtering with edge handling (via extension)
% EXTEND2    2D extension

%Multidimensional sampling (used in building block filter banks)
% PDOWN      Parallelogram Downsampling
% PUP        Parallelogram Upsampling
% QDOWN      Quincunx Downsampling
% QUP        Quincunx Upsampling
% QUPZ       Quincunx Upsampling (with zero-pad and matrix extending)
% DUP        Diagonal Upsampling
% RESAMP     Resampling in 2D filterbank
% RESAMPZ    Resampling of matrix
% RESAMPC    Mex file used in RESAMP
%
%Polyphase decomposition (used in the ladder structure implementation)
% QPDEC      Quincunx Polyphase Decomposition
% QPREC      Quincunx Polyphase Reconstruction
% PPDEC      Parallelogram Polyphase Decomposition
% PPREC      Parallelogram Polyphase Reconstruction
%
%Support functions to avoid visual distortion (used in DFB)
% BACKSAMP   Backsampling the subband images of the directional filter bank
% REBACKSAMP Re-backsampling the subband images of the DFB
%
%Support functions for generating filters
% FFILTERS   Fan filters from diamond shape filters
% LD2QUIN    Quincunx filters from the ladder network structure
% MCTRANS    McClellan transformation
% MODULATE2  2D modulation
%
%Other support functions
% COMPUTESCALE   Comupute display scale for PDFB coefficients
% SMTHBORDER Smooth the borders of a signal or image
% SNR        Compute the signal-to-noise ratio


text:
> <%= appDescription %>

[![Build Status](https://secure.travis-ci.org/<%= userName %>/<%= appNameSlug %>.png?branch=master)](https://travis-ci.org/<%= userName %>/<%= appNameSlug %>)

## Getting Started

1º Clone <%= appName %> repo

```bash
$ git clone https://github.com/<%= userName %>/<%= appNameSlug %>.git
```

2º Enter in <%= appNameSlug %> directory

```bash
$ cd <%= appNameSlug %>
```

3º Test your go package

```bash
$ make test
```

After change this template to create your own package

Build your package

```bash
$ go build
```

OR

Install your new go package

```bash
$ go install
```

## Contributing

See the [CONTRIBUTING Guidelines](https://github.com/<%= userName %>/<%= appNameSlug %>/blob/master/CONTRIBUTING.md)

## Support
If you have any problem or suggestion please open an issue [here](https://github.com/<%= userName %>/<%= appNameSlug %>/issues).

## License <% if (license === 'MIT') { %>

The MIT License

Copyright (c) <%= year %>, <%= authorName %>

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 be
included in all copies or substantial portions of the Software.

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.<% } %>
<% if (license === 'BSD') { %>
The BSD License

Copyright (c) <%= year %>, <%= authorName %>

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this
  list of conditions and the following disclaimer in the documentation and/or
  other materials provided with the distribution.

* Neither the name of the <%= authorName %> nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<% } %>


text:
var exec = require('child_process').execSync;

module.exports = function df() {
    try {
        return 100 - parseFloat(exec("df | grep / | awk '{ print $8 }'").toString().trim().split('\n')[0]) + '%';
    } catch (e) {
        return false;
    }
};


text:
var expect = require('chai').expect;
var fs = require('fs');
var Express = require('../index')('express');
var mockBody = {dep_date: "20+01+2015", ori: 'pnk', dst: 'JOG'};
// var mockDataExpress = fs.readFileSync('./ex.html', 'utf8');
var mockDataExpress = '';
var debug       = require('debug')('raabbajam:priceCacheCalendar:expressspec');
describe('Price Generator for Express', function () {
	this.timeout(20000);
	/*it('should extend base', function (next) {
		var express = new Express(mockBody, mockDataExpress);
		expect(express.name).to.equal('express');
		next();
	});
	it('should return cache', function (next) {
		var express = new Express(mockBody, mockDataExpress);
		express.getCache()
			.then(function () {
				expect(express.cache[mockBody.ori.toLowerCase()+mockBody.dst.toLowerCase()]).to.exist;
				// debug(express.cache);
				next();
			})
			.catch(function (err) {
				next(err);
			});
	});
	it('should loop get all routes', function (next) {
		var express = new Express(mockBody, mockDataExpress);
		var routes = express.getAllRoutes();
		debug('routes',routes);
		expect(routes.length).gt(0);
		next();
	});
	it('should get all routes cache', function (next) {
		var express = new Express(mockBody, mockDataExpress);
		var routes = express.getAllRoutes();
		express.getAllCaches(routes)
			.then(function () {
				debug('express.cache',express.cache);
				expect(express.cache).not.eq({});
				next();
			})
			.catch(function (err) {
				next(err);
			});
	});*/
	/*it('should merge all cache', function (next) {
		var express = new Express(mockBody, mockDataExpress);
		var routes = express.getAllRoutes();
		express.getAllCaches(routes)
			.then(express.mergeCache.bind(express))
			.then(function (res) {
				// debug(JSON.stringify(express._scrape, null, 2));
				debug('lowestPrices', JSON.stringify(res, null, 2));
				debug(express.cache);
				next();
			})
			.catch(function (err) {
				next(err);
			});
	});*/
	/*it('should compare with db and insert to db if cheaper, for all lowest price', function (next) {
		var express = new Express(mockBody, mockDataExpress);
		var routes = express.getAllRoutes();
		express.getAllCaches(routes)
			.then(express.mergeCache.bind(express))
			.then(express.insertAllLowest.bind(express))
			.then(function (res) {
				console.log('HELLO BRO!!');
				fs.writeFileSync('./ci2.html', express._scrape);
				next();
			})
			.catch(function (err) {
				next(err);
			});
	});*/
});

describe('Cache prices for Express', function() {
	this.timeout(80000);
	/*describe('getCheapestInRow, getAllCheapest', function () {
		{//i
			var express = new Express(mockBody, mockDataExpress);
		}
		it('should return an array of object with ori, dst, class and flight property', function (next) {
			var cheapest = express.getCheapestInRow(row);
			debug('cheapest',cheapest)
			expect(cheapest[0].class).to.eq("Q0.1");
			next();
		});
		it('should return an array cheapest class', function (next) {
			var flightClasses = express.getAllCheapest(rows);
			debug('flightClasses',flightClasses);
			expect(Object.keys(flightClasses).length).to.gt(0);
			next();
		});
	});*/
	describe('merge', function() {
		it('should get all cheapest seat per row, get prices data from db or scrape if necessary and return it after merged', function (done) {
			var json = JSON.parse(fs.readFileSync('./excp.json', 'utf8'));
			var express = new Express(mockBody, 'mockDataExpress');
			// console.log(mockBody, express._dt)
			express.merge(json)
				.then(function (res) {
					// debug(res);
					fs.writeFileSync('./excp2.json', JSON.stringify(res,null, 4));
					done();
				}, done);
		});
	});
});


text:
package iso20022

type AccountUsageType2Code string


text:
Problem: Your app processes jobs that take a long time.  You want an
easy way to check the progress of your app to see if it is still alive
and running.

Solution: status!

With status, your app can send a heartbeat to a log4j logger.  Users
can interact with the logger via IMs and listen in to that heartbeat
just when they choose.

* Your app does not need to concern itself with throttling, per user
settings, or even the fact that IMs are being sent.
* Add the app to your contact list and know exactly when your app is
up and running or down, even from home.
* It's also great for non-tech-savvy users.  If a person can IM
through Gmail, they can check status.

# Observer Pattern

For those familiar with design patterns, this basically implements the
[observer pattern](http://en.wikipedia.org/wiki/Observer_pattern)
where the observer is you, the thing being observed is your app, and
you get notified of updates via IM whenever the app logs.  IM the app
to register yourself as an observer.  IM it again saying "stop" to
remove yourself from the list of observers.

# Install

Status can currently be built with either `ant` or `mvn`.  If you use
`ant`, the jar will be output in the current directory.  If you use
`mvn`, the jar will be output to the target/ directory.

If you are using an app server like JBoss, drop status.jar into its
lib/ directory (the sibling of the deploy/ directory).  You will also
need to drop in any dependent jars, like smack.jar, if they are not
already provided by your app server.  These are all included in the
lib/ directory of this repo.

Add something like the following to your app's log4j.xml
configuration, specifying the account your app should send IMs from.

    <appender name="GTALK" class="com.plpatterns.status.GtalkAppender">
      <param name="FromAddress" value="myAppUsername@gmail.com"/>
      <param name="Password"    value="myAppPassword"/>
    </appender>

    <!-- Send any log messages in the category "status" over IM -->
    <category name="status" additivity="true">
      <priority value="DEBUG"/>
      <appender-ref ref="GTALK"/>
    </category>

If you want to use an XMPP service other than Gtalk, use the
XmppAppender class which takes more options, all of which are
required.

# Usage

In your app, you need to actually output status.  This is done simply
by logging.  If you're already using log4j, your app doesn't need any
new dependencies and doesn't need to know anything specifically about
this project.

I'm showing here how to use a special "status" category/logger name so
that only messages intended for IMs will go to IMs.  Note, that the
category string used creating the logger must match what is in your
configuration file (above).  See the [log4j
manual](http://logging.apache.org/log4j/1.2/manual.html) for more
information.

    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;

    ...

    private static final Log STATUS = LogFactory.getLog("status." + ThisClass.class.getCanonicalName());

    ...

    while (makingProgress()) {
      doWork();
      STATUS.info("Done " + percentDone() + "%");
    }

To get status updates sent to you, IM "myAppUsername@gmail.com".  Just
say "hi", or any greeting you feel like, and status will start
forwarding logged status messages to you as IMs.

myAppUsername should not need to confirm you as a contact in Gmail,
but you may need to add myAppUsername@gmail.com as a contact.

See the [wiki](http://wiki.github.com/jtran/status) for IM commands.

# Throttling

Not all status messages will be sent as IMs.  Messages are
automatically dropped in order to not flood you with IMs.  At any
time, you can IM the app to adjust the number of IMs it sends you.
For example, sending the IM ...

    every 10 minutes

... or ...

    every 30 s

... will allow status messages to be sent as IMs at most every 10
minutes (or 30 seconds).  In other words, the first status message
will be sent as an IM.  And for the next 10 minutes, status messages
will be silently dropped.  The next status message after that will be
sent as an IM, and so on.  Status either forwards a logged message or
drops it; it does not store status messages until the time limit has
passed.

The time period is per IM address, so different people can monitor the
app at different intervals.

You can pause IMs at any time by IMing ...

    stop

... and resume them by IMing ...

    start

See the [wiki](http://wiki.github.com/jtran/status) for more commands.


text:
package com.evolveum.midpoint.model.impl.scripting.actions;

import com.evolveum.midpoint.model.api.ModelExecuteOptions;
import com.evolveum.midpoint.model.api.ScriptExecutionException;
import com.evolveum.midpoint.model.impl.scripting.PipelineData;
import com.evolveum.midpoint.model.impl.scripting.ExecutionContext;
import com.evolveum.midpoint.model.api.PipelineItem;
import com.evolveum.midpoint.model.impl.scripting.helpers.OperationsHelper;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.PrismObjectValue;
import com.evolveum.midpoint.prism.PrismValue;
import com.evolveum.midpoint.prism.delta.ObjectDelta;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import com.evolveum.midpoint.xml.ns._public.model.scripting_3.ActionExpressionType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author mederly
 */
@Component
public class AddExecutor extends BaseActionExecutor {

    private static final String NAME = "add";

    @Autowired private OperationsHelper operationsHelper;

    @PostConstruct
    public void init() {
        scriptingExpressionEvaluator.registerActionExecutor(NAME, this);
    }

    @Override
    public PipelineData execute(ActionExpressionType expression, PipelineData input, ExecutionContext context, OperationResult globalResult) throws ScriptExecutionException {

        ModelExecuteOptions executionOptions = getOptions(expression, input, context, globalResult);
        boolean dryRun = getParamDryRun(expression, input, context, globalResult);

        for (PipelineItem item : input.getData()) {
            OperationResult result = operationsHelper.createActionResult(item, this, context, globalResult);
            context.checkTaskStop();
            PrismValue value = item.getValue();
            if (value instanceof PrismObjectValue) {
                @SuppressWarnings({ "unchecked", "raw" })
                PrismObject<? extends ObjectType> prismObject = ((PrismObjectValue) value).asPrismObject();
                ObjectType objectType = prismObject.asObjectable();
                long started = operationsHelper.recordStart(context, objectType);
                Throwable exception = null;
                try {
                    operationsHelper.applyDelta(createAddDelta(objectType), executionOptions, dryRun, context, result);
                    operationsHelper.recordEnd(context, objectType, started, null);
                } catch (Throwable ex) {
                    operationsHelper.recordEnd(context, objectType, started, ex);
                    exception = processActionException(ex, NAME, value, context);
                }
				context.println((exception != null ? "Attempted to add " : "Added ") + prismObject.toString() + optionsSuffix(executionOptions, dryRun) + exceptionSuffix(exception));
            } else {
				//noinspection ThrowableNotThrown
				processActionException(new ScriptExecutionException("Item is not a PrismObject"), NAME, value, context);
            }
            operationsHelper.trimAndCloneResult(result, globalResult, context);
        }
        return input;
    }

	private ObjectDelta<? extends ObjectType> createAddDelta(ObjectType objectType) {
        return ObjectDelta.createAddDelta(objectType.asPrismObject());
    }
}


text:
// Copyright (c) 2013 - present UTN-LIS

module.exports = function (grunt) {

    'use strict';

    require('load-grunt-tasks')(grunt);

    // Project configuration.
    grunt.initConfig({
        buildConfig: {
            name: 'pumascript',
            output: 'dist/<%= buildConfig.name %>'
        },

        jshint: {
            all: [
                'gruntfile.js',
                'src/**/*.js',
                'tasks/*.js',
                'test/*.js'
            ],
            options: {
                jshintrc: '.jshintrc',
                reporter: require('jshint-stylish')
            }
        },

        exec: {
            webpack: {
                cmd: 'node ./node_modules/webpack/bin/webpack.js --config webpack.config.js'
            }
        },

        uglify: {
            dist: {
                options: {
                    sourceMap: true,
                    sourceMapName: 'dist/pumascript.min.map',
                    sourceMapIn: 'dist/pumascript.map',
                },
                files: {
                    'dist/pumascript.min.js': [ 'dist/pumascript.js' ]
                }
            }
        },

        clean: {
            tests: ['tmp'],
            dist: ['dist']
        },

        qunit: {
            all: ['test/**/*.html']
        }
    });

    grunt.registerTask('init', 'Prepare to start working with Puma', function () {
        // Use spawn to report progress of the task
        var spawn = require('child_process').spawn;
        var cmd = spawn('bower', ['install'], { cwd: './editor' });
        var done = this.async();

        cmd.stdout.on('data', function (data) {
            grunt.log.write(data.toString());
        });

        cmd.stderr.on('data', function (data) {
            grunt.log.error('Error: ' + data.toString());
        });

        cmd.on('exit', function (code) {
            if (code > 0) {
                grunt.fail.fatal('Process Finished Code: ' + code.toString());
            } else {
                grunt.log.ok('Process Finished Code: ' + code.toString());
            }

            done();
        });
    });

    grunt.registerTask('build-dev', ['clean:dist', 'exec:webpack']);

    grunt.registerTask('build', ['build-dev', 'uglify:dist']);

    // Whenever the "test" task is run, first clean the "tmp" dir, then run this
    // plugin's task(s), then test the result.
    grunt.registerTask('test', ['clean', 'exec:webpack', 'qunit']);

    grunt.registerTask('travis', ['jshint', 'test']);

    grunt.registerTask('default', ['init']);
};


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

namespace Merchello.Tests.Base.Umbraco.ApplicationContext
{
    public class FakeUmbracoApplication
    {
    }
}


text:
<!DOCTYPE html>

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

    <title>MusicCollection - App ejemplo de uso de FireBase</title>

    <link rel="stylesheet" href="app/js/libs/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="app/js/libs/bootstrap/dist/css/bootstrap-theme.min.css" />

Music Collection

Nuevo disco

                <form  class="panel-body" id="guardar-disco">

                        Nombre
                        <input type="text" class="form-control" nampe="nombre" id="nombre" placeholder="Nombre" />

                        Autor
                        <input type="text" class="form-control" name="autor" id="autor" placeholder="Autor" />

                        Año
                        <input type="number" class="form-control" name="año" id="año" placeholder="Año" />

                        Descripción
                        <textarea class="form-control" rows="3" name="descripcion" id="descripcion"></textarea>

                    <button type="submit" class="btn btn-default">Guardar disco</button>
                </form>


text:
/*jslint node: true*/

var fs = require('fs');

function Controller(req, res) {
    this.req = req;
    this.res = res;
}
Controller.prototype.sendResponse = function (resp) {
    if (resp.status) {
        this.res.statusCode = resp.status;
        switch (resp.status) {
        case 204:
            resp.noContent = true;
            break;
        }
    }
    if (resp.headers) {
        resp.headers.forEach(function (header) {
            this.res.setHeader(header.name, header.value);
        }.bind(this));
    }
    if (resp.noContent) {
        this.res.end();
    } else if (resp.data) {
        this.res.end(resp.data);
    }
};
Controller.prototype.serverError = function () {
    this.sendResponse({
        status: 500,
        headers: [
            {name: 'Content-Type', value: 'text/html'}
        ],
        data: 'Internal server error'
    });
};
Controller.prototype.notFound = function () {
    this.sendResponse({
        status: 404,
        headers: [
            {name: 'Content-Type', value: 'text/html'}
        ],
        data: 'Not found'
    });
};
Controller.prototype.readFile = function (file, cb) {
    fs.readFile(__dirname + '/../' + file, function (err, data) {
        if (err) {
            this.notFound();
            console.log(err);
        } else {
            cb(data);
        }
    }.bind(this));
};
Controller.prototype.setContentHeaders = function (data, type) {
    var headers = [
        {name: 'Content-Type', value: type || 'text/html'},
        {name: 'Content-Length', value: Buffer.byteLength(data)}
    ];
    this.sendResponse({
        headers: headers
    });
};
Controller.prototype.serveJSON = function (data, status) {
    this.setContentHeaders(data, 'application/json');
    this.sendResponse({
        status: status || 200,
        data: typeof data === 'object' ? JSON.stringify(data) : data
    });
};
Controller.prototype.serveHTML = function (data, status, noContent) {
    this.setContentHeaders(data, 'text/html');
    this.sendResponse({
        status: status || 200,
        data: data,
        noContent: noContent
    });
};
Controller.prototype.serveFile = function (file, type, status) {
    this.readFile(file, function (data) {
        var dataStr, headers;
        dataStr = data.toString('utf8');
        this.setContentHeaders(dataStr, type);
        this.sendResponse({
            status: status || 200,
            data: data.toString('utf8')
        });
    }.bind(this));
};

exports.Controller = Controller;


text:
"""Pretty-print tabular data."""

from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from collections import namedtuple
from platform import python_version_tuple
import re
from six.moves import map
import six
from six.moves import range
from six.moves import zip

if python_version_tuple()[0] < "3":
    from itertools import izip_longest
    _none_type = type(None)
    _int_type = int
    _float_type = float
    _text_type = six.text_type
    _binary_type = str
else:
    from itertools import zip_longest as izip_longest
    from functools import reduce
    _none_type = type(None)
    _int_type = int
    _float_type = float
    _text_type = str
    _binary_type = bytes

__all__ = ["tabulate"]
__version__ = "0.6"

Line = namedtuple("Line", ["begin", "hline", "sep", "end"])

DataRow = namedtuple("DataRow", ["begin", "sep", "end"])

TableFormat = namedtuple("TableFormat", ["lineabove", "linebelowheader",
                                         "linebetweenrows", "linebelow",
                                         "headerrow", "datarow",
                                         "padding", "usecolons", "usehtmlattrs",
                                         "with_header_hide",
                                         "without_header_hide"])

_format_defaults = {"padding": 0,
                    "usecolons": False,
                    "usehtmlattrs": False,
                    "with_header_hide": [],
                    "without_header_hide": []}

_table_formats = {"simple":
                  TableFormat(lineabove=None,
                              linebelowheader=Line("", "-", "  ", ""),
                              linebetweenrows=None,
                              linebelow=Line("", "-", "  ", ""),
                              headerrow=DataRow("", "  ", ""),
                              datarow=DataRow("", "  ", ""),
                              padding=0,
                              usecolons=False,
                              usehtmlattrs=False,
                              with_header_hide=["linebelow"],
                              without_header_hide=[]),
                  "plain":
                  TableFormat(None, None, None, None,
                              DataRow("", "  ", ""), DataRow("", "  ", ""),
                              **_format_defaults),
                  "grid":
                  TableFormat(lineabove=Line("+", "-", "+", "+"),
                              linebelowheader=Line("+", "=", "+", "+"),
                              linebetweenrows=Line("+", "-", "+", "+"),
                              linebelow=Line("+", "-", "+", "+"),
                              headerrow=DataRow("|", "|", "|"),
                              datarow=DataRow("|", "|", "|"),
                              padding=1,
                              usecolons=False,
                              usehtmlattrs=False,
                              with_header_hide=[],
                              without_header_hide=["linebelowheader"]),
                  "pipe":
                  TableFormat(lineabove=None,
                              linebelowheader=Line("|", "-", "|", "|"),
                              linebetweenrows=None,
                              linebelow=None,
                              headerrow=DataRow("|", "|", "|"),
                              datarow=DataRow("|", "|", "|"),
                              padding=1,
                              usecolons=True,
                              usehtmlattrs=False,
                              with_header_hide=[],
                              without_header_hide=[]),
                  "orgtbl":
                  TableFormat(lineabove=None,
                              linebelowheader=Line("|", "-", "+", "|"),
                              linebetweenrows=None,
                              linebelow=None,
                              headerrow=DataRow("|", "|", "|"),
                              datarow=DataRow("|", "|", "|"),
                              padding=1,
                              usecolons=False,
                              usehtmlattrs=False,
                              with_header_hide=[],
                              without_header_hide=["linebelowheader"]),
                  "rst":
                  TableFormat(lineabove=Line("", "=", "  ", ""),
                              linebelowheader=Line("", "=", "  ", ""),
                              linebetweenrows=None,
                              linebelow=Line("", "=", "  ", ""),
                              headerrow=DataRow("", "  ", ""),
                              datarow=DataRow("", "  ", ""),
                              padding=0,
                              usecolons=False,
                              usehtmlattrs=False,
                              with_header_hide=[],
                              without_header_hide=["linebelowheader"]),
                  "mediawiki":
                  TableFormat(lineabove=Line("{| class=\"wikitable\" style=\"text-align: left;\"",
                                             "", "", "\n|+ <!-- caption -->\n|-"),
                              linebelowheader=Line("|-", "", "", ""),
                              linebetweenrows=Line("|-", "", "", ""),
                              linebelow=Line("|}", "", "", ""),
                              headerrow=DataRow("!", "!!", ""),
                              datarow=DataRow("|", "||", ""),
                              padding=1,
                              usecolons=False,
                              usehtmlattrs=True,
                              with_header_hide=[],
                              without_header_hide=["linebelowheader"])}

_invisible_codes = re.compile("\x1b\[\d*m")  # ANSI color codes

def simple_separated_format(separator):
    """Construct a simple TableFormat with columns separated by a separator.

    >>> tsv = simple_separated_format("\t") ; \
        tabulate([["foo", 1], ["spam", 23]], tablefmt=tsv) == u'foo \\t 1\\nspam\\t23'
    True

    """
    return TableFormat(None, None, None, None,
                       headerrow=None, datarow=DataRow('', '\t', ''), **_format_defaults)

def _isconvertible(conv, string):
    try:
        n = conv(string)
        return True
    except ValueError:
        return False

def _isnumber(string):
    """
    >>> _isnumber("123.45")
    True
    >>> _isnumber("123")
    True
    >>> _isnumber("spam")
    False
    """
    return _isconvertible(float, string)

def _isint(string):
    """
    >>> _isint("123")
    True
    >>> _isint("123.45")
    False
    """
    return type(string) is int or \
           (isinstance(string, _binary_type) or isinstance(string, _text_type)) and \
           _isconvertible(int, string)

def _type(string, has_invisible=True):
    """The least generic type (type(None), int, float, str, unicode).

    >>> _type(None) is type(None)
    True
    >>> _type("foo") is type("")
    True
    >>> _type("1") is type(1)
    True
    >>> _type(u'\x1b[31m42\x1b[0m') is type(42)
    True
    >>> _type('\x1b[31m42\x1b[0m') is type(42)
    True

    """

    if has_invisible and \
       (isinstance(string, _text_type) or isinstance(string, _binary_type)):
        string = _strip_invisible(string)

    if string is None:
        return _none_type
    elif _isint(string):
        return int
    elif _isnumber(string):
        return float
    elif isinstance(string, _binary_type):
        return _binary_type
    else:
        return _text_type

def _afterpoint(string):
    """Symbols after a decimal point, -1 if the string lacks the decimal point.

    >>> _afterpoint("123.45")
    2
    >>> _afterpoint("1001")
    -1
    >>> _afterpoint("eggs")
    -1
    >>> _afterpoint("123e45")
    2

    """
    if _isnumber(string):
        if _isint(string):
            return -1
        else:
            pos = string.rfind(".")
            pos = string.lower().rfind("e") if pos < 0 else pos
            if pos >= 0:
                return len(string) - pos - 1
            else:
                return -1  # no point
    else:
        return -1  # not a number

def _padleft(width, s, has_invisible=True):
    """Flush right.

    >>> _padleft(6, u'\u044f\u0439\u0446\u0430') == u'  \u044f\u0439\u0446\u0430'
    True

    """
    iwidth = width + len(s) - len(_strip_invisible(s)) if has_invisible else width
    fmt = u"{0:>%ds}" % iwidth
    return fmt.format(s)

def _padright(width, s, has_invisible=True):
    """Flush left.

    >>> _padright(6, u'\u044f\u0439\u0446\u0430') == u'\u044f\u0439\u0446\u0430  '
    True

    """
    iwidth = width + len(s) - len(_strip_invisible(s)) if has_invisible else width
    fmt = u"{0:<%ds}" % iwidth
    return fmt.format(s)

def _padboth(width, s, has_invisible=True):
    """Center string.

    >>> _padboth(6, u'\u044f\u0439\u0446\u0430') == u' \u044f\u0439\u0446\u0430 '
    True

    """
    iwidth = width + len(s) - len(_strip_invisible(s)) if has_invisible else width
    fmt = u"{0:^%ds}" % iwidth
    return fmt.format(s)

def _strip_invisible(s):
    "Remove invisible ANSI color codes."
    return re.sub(_invisible_codes, "", s)

def _visible_width(s):
    """Visible width of a printed string. ANSI color codes are removed.

    >>> _visible_width('\x1b[31mhello\x1b[0m'), _visible_width("world")
    (5, 5)

    """
    if isinstance(s, _text_type) or isinstance(s, _binary_type):
        return len(_strip_invisible(s))
    else:
        return len(_text_type(s))

def _align_column(strings, alignment, minwidth=0, has_invisible=True):
    """[string] -> [padded_string]

    >>> list(map(str,_align_column(["12.345", "-1234.5", "1.23", "1234.5", "1e+234", "1.0e234"], "decimal")))
    ['   12.345  ', '-1234.5    ', '    1.23   ', ' 1234.5    ', '    1e+234 ', '    1.0e234']

    """
    if alignment == "right":
        strings = [s.strip() for s in strings]
        padfn = _padleft
    elif alignment in "center":
        strings = [s.strip() for s in strings]
        padfn = _padboth
    elif alignment in "decimal":
        decimals = [_afterpoint(s) for s in strings]
        maxdecimals = max(decimals)
        strings = [s + (maxdecimals - decs) * " "
                   for s, decs in zip(strings, decimals)]
        padfn = _padleft
    else:
        strings = [s.strip() for s in strings]
        padfn = _padright

    if has_invisible:
        width_fn = _visible_width
    else:
        width_fn = len

    maxwidth = max(max(list(map(width_fn, strings))), minwidth)
    padded_strings = [padfn(maxwidth, s, has_invisible) for s in strings]
    return padded_strings

def _more_generic(type1, type2):
    types = { _none_type: 0, int: 1, float: 2, _text_type: 4 }
    invtypes = { 4: _text_type, 2: float, 1: int, 0: _none_type }
    moregeneric = max(types.get(type1, 4), types.get(type2, 4))
    return invtypes[moregeneric]

def _column_type(strings, has_invisible=True):
    """The least generic type all column values are convertible to.

    >>> _column_type(["1", "2"]) is _int_type
    True
    >>> _column_type(["1", "2.3"]) is _float_type
    True
    >>> _column_type(["1", "2.3", "four"]) is _text_type
    True
    >>> _column_type(["four", u'\u043f\u044f\u0442\u044c']) is _text_type
    True
    >>> _column_type([None, "brux"]) is _text_type
    True
    >>> _column_type([1, 2, None]) is _int_type
    True

    """
    types = [_type(s, has_invisible) for s in strings ]
    return reduce(_more_generic, types, int)

def _format(val, valtype, floatfmt, missingval=u""):
    """Format a value accoding to its type.

    Unicode is supported:

    >>> hrow = [u'\u0431\u0443\u043a\u0432\u0430', u'\u0446\u0438\u0444\u0440\u0430'] ; \
        tbl = [[u'\u0430\u0437', 2], [u'\u0431\u0443\u043a\u0438', 4]] ; \
        good_result = u'\\u0431\\u0443\\u043a\\u0432\\u0430      \\u0446\\u0438\\u0444\\u0440\\u0430\\n-------  -------\\n\\u0430\\u0437             2\\n\\u0431\\u0443\\u043a\\u0438           4' ; \
        tabulate(tbl, headers=hrow) == good_result
    True

    """
    if val is None:
        return missingval

    if valtype in [int, _binary_type, _text_type]:
        return u"{0}".format(val)
    elif valtype is float:
        return format(float(val), floatfmt)
    else:
        return u"{0}".format(val)

def _align_header(header, alignment, width):
    if alignment == "left":
        return _padright(width, header)
    elif alignment == "center":
        return _padboth(width, header)
    else:
        return _padleft(width, header)

def _normalize_tabular_data(tabular_data, headers):
    """Transform a supported data type to a list of lists, and a list of headers.

    Supported tabular data types:

    * list-of-lists or another iterable of iterables

    * 2D NumPy arrays

    * dict of iterables (usually used with headers="keys")

    * pandas.DataFrame (usually used with headers="keys")

    The first row can be used as headers if headers="firstrow",
    column indices can be used as headers if headers="keys".

    """

    if hasattr(tabular_data, "keys") and hasattr(tabular_data, "values"):
        # dict-like and pandas.DataFrame?
        if hasattr(tabular_data.values, "__call__"):
            # likely a conventional dict
            keys = list(tabular_data.keys())
            rows = list(izip_longest(*list(tabular_data.values())))  # columns have to be transposed
        elif hasattr(tabular_data, "index"):
            # values is a property, has .index => it's likely a pandas.DataFrame (pandas 0.11.0)
            keys = list(tabular_data.keys())
            vals = tabular_data.values  # values matrix doesn't need to be transposed
            names = tabular_data.index
            rows = [[v]+list(row) for v,row in zip(names, vals)]
        else:
            raise ValueError("tabular data doesn't appear to be a dict or a DataFrame")

        if headers == "keys":
            headers = list(map(_text_type,keys))  # headers should be strings

    else:  # it's a usual an iterable of iterables, or a NumPy array
        rows = list(tabular_data)

        if headers == "keys" and len(rows) > 0:  # keys are column indices
            headers = list(map(_text_type, list(range(len(rows[0])))))

    # take headers from the first row if necessary
    if headers == "firstrow" and len(rows) > 0:
        headers = list(map(_text_type, rows[0])) # headers should be strings
        rows = rows[1:]

    headers = list(headers)
    rows = list(map(list,rows))

    # pad with empty headers for initial columns if necessary
    if headers and len(rows) > 0:
       nhs = len(headers)
       ncols = len(rows[0])
       if nhs < ncols:
           headers = [u""]*(ncols - nhs) + headers

    return rows, headers

def tabulate(tabular_data, headers=[], tablefmt="simple",
             floatfmt="g", numalign="decimal", stralign="left",
             missingval=u""):
    """Format a fixed width table for pretty printing.

    >>> print(tabulate([[1, 2.34], [-56, "8.999"], ["2", "10001"]]))
    ---  ---------
      1      2.34
    -56      8.999
      2  10001
    ---  ---------

    The first required argument (`tabular_data`) can be a
    list-of-lists (or another iterable or iterables), a dictionary of
    iterables, a two-dimensional NumPy array, or a Pandas' dataframe.

    Table headers
    -------------

    To print nice column headers, supply the second argument (`headers`):

      - `headers` can be an explicit list of column headers
      - if `headers="firstrow"`, then the first row of data is used
      - if `headers="keys"`, then dictionary keys or column indices are used

    Otherwise a headerless table is produced.

    If the number of headers is less than the number of columns, they
    are supposed to be names of the last columns. This is consistent
    with the plain-text format of R and Pandas' dataframes.

    >>> print(tabulate([["sex","age"],["Alice","F",24],["Bob","M",19]],
    ...       headers="firstrow"))
           sex      age
    -----  -----  -----
    Alice  F         24
    Bob    M         19

    Column alignment
    ----------------

    `tabulate` tries to detect column types automatically, and aligns
    the values properly. By default it aligns decimal points of the
    numbers (or flushes integer numbers to the right), and flushes
    everything else to the left. Possible column alignments
    (`numalign`, `stralign`) are: right, center, left, decimal (only
    for `numalign`).

    Table formats
    -------------

    `floatfmt` is a format specification used for columns which
    contain numeric data with a decimal point.

    `None` values are replaced with a `missingval` string:

    >>> print(tabulate([["spam", 1, None],
    ...                 ["eggs", 42, 3.14],
    ...                 ["other", None, 2.7]], missingval="?"))
    -----  --  ----
    spam    1  ?
    eggs   42  3.14
    other   ?  2.7
    -----  --  ----

    Various plain-text table formats (`tablefmt`) are supported:
    'plain', 'simple', 'grid', 'pipe', 'orgtbl', 'rst', and 'mediawiki'.

    "plain" format doesn't use any pseudographics to draw tables,
    it separates columns with a double space:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
    ...                 ["strings", "numbers"], "plain"))
    strings      numbers
    spam         41.9999
    eggs        451

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="plain"))
    spam   41.9999
    eggs  451

    "simple" format is like Pandoc simple_tables:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
    ...                 ["strings", "numbers"], "simple"))
    strings      numbers
    ---------  ---------
    spam         41.9999
    eggs        451

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="simple"))
    ----  --------
    spam   41.9999
    eggs  451
    ----  --------

    "grid" is similar to tables produced by Emacs table.el package or
    Pandoc grid_tables:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
    ...                ["strings", "numbers"], "grid"))
    +-----------+-----------+
    | strings   |   numbers |
    +===========+===========+
    | spam      |   41.9999 |
    +-----------+-----------+
    | eggs      |  451      |
    +-----------+-----------+

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="grid"))
    +------+----------+
    | spam |  41.9999 |
    +------+----------+
    | eggs | 451      |
    +------+----------+

    "pipe" is like tables in PHP Markdown Extra extension or Pandoc
    pipe_tables:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
    ...                ["strings", "numbers"], "pipe"))
    | strings   |   numbers |
    |:----------|----------:|
    | spam      |   41.9999 |
    | eggs      |  451      |

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="pipe"))
    |:-----|---------:|
    | spam |  41.9999 |
    | eggs | 451      |

    "orgtbl" is like tables in Emacs org-mode and orgtbl-mode. They
    are slightly different from "pipe" format by not using colons to
    define column alignment, and using a "+" sign to indicate line
    intersections:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
    ...                ["strings", "numbers"], "orgtbl"))
    | strings   |   numbers |
    |-----------+-----------|
    | spam      |   41.9999 |
    | eggs      |  451      |

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="orgtbl"))
    | spam |  41.9999 |
    | eggs | 451      |

    "rst" is like a simple table format from reStructuredText; please
    note that reStructuredText accepts also "grid" tables:

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
    ...                ["strings", "numbers"], "rst"))
    =========  =========
    strings      numbers
    =========  =========
    spam         41.9999
    eggs        451
    =========  =========

    >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="rst"))
    ====  ========
    spam   41.9999
    eggs  451
    ====  ========

    "mediawiki" produces a table markup used in Wikipedia and on other
    MediaWiki-based sites:

    >>> print(tabulate([["strings", "numbers"], ["spam", 41.9999], ["eggs", "451.0"]],
    ...                headers="firstrow", tablefmt="mediawiki"))
    {| class="wikitable" style="text-align: left;"
    |+ <!-- caption -->
    |-
    ! strings   !! align="right"|   numbers
    |-
    | spam      || align="right"|   41.9999
    |-
    | eggs      || align="right"|  451
    |}

    >>> print(tabulate([["eggs", 42], ["spam", 23]], tablefmt="mediawiki", stralign="left"))
    {| class="wikitable" style="text-align: left;"
    |+ <!-- caption -->
    |-
    | eggs || align="right"| 42
    |-
    | spam || align="right"| 23
    |}

    """

    list_of_lists, headers = _normalize_tabular_data(tabular_data, headers)

    # optimization: look for ANSI control codes once,
    # enable smart width functions only if a control code is found
    plain_text = u'\n'.join(['\t'.join(map(_text_type, headers))] + \
                            [u'\t'.join(map(_text_type, row)) for row in list_of_lists])
    has_invisible = re.search(_invisible_codes, plain_text)
    if has_invisible:
        width_fn = _visible_width
    else:
        width_fn = len

    # format rows and columns, convert numeric values to strings
    cols = list(zip(*list_of_lists))
    coltypes = list(map(_column_type, cols))
    cols = [[_format(v, ct, floatfmt, missingval) for v in c]
             for c,ct in zip(cols, coltypes)]

    # align columns
    aligns = [numalign if ct in [int,float] else stralign for ct in coltypes]
    minwidths = [width_fn(h)+2 for h in headers] if headers else [0]*len(cols)
    cols = [_align_column(c, a, minw, has_invisible)
            for c, a, minw in zip(cols, aligns, minwidths)]

    if headers:
        # align headers and add headers
        minwidths = [max(minw, width_fn(c[0])) for minw, c in zip(minwidths, cols)]
        headers = [_align_header(h, a, minw)
                   for h, a, minw in zip(headers, aligns, minwidths)]
        rows = list(zip(*cols))
    else:
        minwidths = [width_fn(c[0]) for c in cols]
        rows = list(zip(*cols))

    if not isinstance(tablefmt, TableFormat):
        tablefmt = _table_formats.get(tablefmt, _table_formats["simple"])

    return _format_table(tablefmt, headers, rows, minwidths, aligns)

def _build_row(cells, padding, begin, sep, end):
    "Return a string which represents a row of data cells."
    pad = u" "*padding
    padded_cells = [pad + cell + pad for cell in cells]
    return (begin + sep.join(padded_cells) + end).rstrip()

def _build_line(colwidths, padding, begin, fill, sep,  end):
    "Return a string which represents a horizontal line."
    cells = [fill*(w + 2*padding) for w in colwidths]
    return _build_row(cells, 0, begin, sep, end)

def _mediawiki_cell_attrs(row, colaligns):
    "Prefix every cell in a row with an HTML alignment attribute."
    alignment = { "left":    '',
                  "right":   'align="right"| ',
                  "center":  'align="center"| ',
                  "decimal": 'align="right"| ' }
    row2 = [alignment[a] + c for c, a in zip(row, colaligns)]
    return row2

def _line_segment_with_colons(linefmt, align, colwidth):
    """Return a segment of a horizontal line with optional colons which
    indicate column's alignment (as in `pipe` output format)."""
    fill = linefmt.hline
    w = colwidth
    if align in ["right", "decimal"]:
        return (fill[0] * (w - 1)) + ":"
    elif align == "center":
        return ":" + (fill[0] * (w - 2)) + ":"
    elif align == "left":
        return ":" + (fill[0] * (w - 1))
    else:
        return fill[0] * w

def _format_table(fmt, headers, rows, colwidths, colaligns):
    """Produce a plain-text representation of the table."""
    lines = []
    hidden = fmt.with_header_hide if headers else fmt.without_header_hide
    pad = fmt.padding
    headerrow = fmt.headerrow if fmt.headerrow else fmt.datarow

    if fmt.usehtmlattrs:
        headers = _mediawiki_cell_attrs(headers, colaligns)
        rows = [_mediawiki_cell_attrs(row, colaligns) for row in rows]

    if fmt.lineabove and "lineabove" not in hidden:
        lines.append(_build_line(colwidths, pad, *fmt.lineabove))

    if headers:
        lines.append(_build_row(headers, pad, *headerrow))

    if fmt.linebelowheader and "linebelowheader" not in hidden:
        begin, fill, sep, end = fmt.linebelowheader
        if fmt.usecolons:
            segs = [_line_segment_with_colons(fmt.linebelowheader, a, w + 2*pad)
                    for w,a in zip(colwidths, colaligns)]
            lines.append(_build_row(segs, 0, begin, sep, end))
        else:
            lines.append(_build_line(colwidths, pad, *fmt.linebelowheader))

    if rows and fmt.linebetweenrows and "linebetweenrows" not in hidden:
        # initial rows with a line below
        for row in rows[:-1]:
            lines.append(_build_row(row, pad, *fmt.datarow))
            lines.append(_build_line(colwidths, pad, *fmt.linebetweenrows))
        # the last row without a line below
        lines.append(_build_row(rows[-1], pad, *fmt.datarow))
    else:
        for row in rows:
            lines.append(_build_row(row, pad, *fmt.datarow))

    if fmt.linebelow and "linebelow" not in hidden:
        lines.append(_build_line(colwidths, pad, *fmt.linebelow))

    return "\n".join(lines)


text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;

namespace OpenQA.Selenium.DevTools
{
    /// <summary>
    /// Event arguments present when the ConsoleApiCalled event is raised.
    /// </summary>
    public class ConsoleApiCalledEventArgs : EventArgs
    {
        /// <summary>
        /// Gets the time stanp when the browser's console API is called.
        /// </summary>
        public DateTime Timestamp { get; internal set; }

        /// <summary>
        /// Gets the type of message when the browser's console API is called.
        /// </summary>
        public string Type { get; internal set; }

        /// <summary>
        /// Gets the arguments of the call to the browser's console API.
        /// </summary>
        public ReadOnlyCollection<ConsoleApiArgument> Arguments { get; internal set; }
    }
}


text:
module Lexer where

import Syntax
import Control.Monad
import Text.ParserCombinators.Parsec hiding (spaces)

spaces :: Parser ()
spaces = skipMany1 space

symbol :: Parser Char
symbol = oneOf "!#$%&|*+-/:<=>?@^_~"

parseString :: Parser LispVal
parseString = do    char '"'
                    x <- many (noneOf "\"")
                    char '"'
                    return $ String x

parseAtom :: Parser LispVal
parseAtom = do  first <- letter <|> symbol
                rest <- many (letter <|> digit <|> symbol)
                let atom = first:rest
                return $ case atom of
                    "#t" -> Bool True
                    "#f" -> Bool False
                    _ -> Atom atom

parseNumber :: Parser LispVal
parseNumber = liftM (Number . read) $ many1 digit

parseList :: Parser LispVal
parseList = liftM List $ sepBy parseExpr spaces

parseDottedList :: Parser LispVal
parseDottedList = do
                head <- endBy parseExpr spaces
                tail <- char '.' >> spaces >> parseExpr
                return $ DottedList head tail

parseQuoted :: Parser LispVal
parseQuoted = do
   char '\''
   x <- parseExpr
   return $ List [Atom "quote", x]

parseExpr = parseAtom
            <|> parseString
            <|> parseNumber
            <|> parseQuoted
            <|> do  char '('
                    x <- try parseList <|> parseDottedList
                    char ')'
                    return x


text:
modified-shop-dropdown
======================

An easy to customize dropdown menu for the modified:shop

## Needs testing

# Installation
- Copy the files, according to the folder structure, to your template
- include the box wherever you want (probably index.html)

```
<div id="menu-main">
	{$box_DROPDOWN}
</div>
```

# Customization
Edit smarty/dropdown.tpl to your liking. A new UL will be created for every level.

The file menu.less holds the basic statements to build a horizontal menu.

You can exclude specific categories by adding their ID to the array source/boxes/dropdown.php:$cat_exceptions()


text:
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    {{-- CSRF Token --}}
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>{{ config('app.name', 'Laravel') }}</title>
    {{-- Styles --}}
    <link rel="stylesheet" href="{{ mix('dist/css/app.css') }}">
    @stack('css')
</head>
<body>
    @yield('content')
    @stack('js')
</body>
</html>


text:
CREATE DATABASE  IF NOT EXISTS `agile` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `agile`;
-- MySQL dump 10.13  Distrib 5.6.13, for osx10.6 (i386)
--
-- Host: 127.0.0.1    Database: agile
-- ------------------------------------------------------
-- Server version	5.6.14

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `CONFIGURATION`
--

DROP TABLE IF EXISTS `CONFIGURATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONFIGURATION` (
  `ID` bigint(20) NOT NULL,
  `CONFIGINSTANCE` varchar(255) DEFAULT NULL,
  `CONFIGKEY` varchar(255) DEFAULT NULL,
  `CONFIGVALUE` varchar(255) DEFAULT NULL,
  `CONFIGDEFAULTVALUE` varchar(255) DEFAULT NULL,
  `CONFIGDESCRIPTION` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2014-08-21  9:21:16


text:
js-wireworld
============

JavaScriptで書いたWireworldの実装です。


text:
'use strict';

import {IEncoderAware} from './IEncoderAware';
import {ArrayHelper} from '../../../Helper/ArrayHelper';
import {ClassHelper} from '../../../Helper/ClassHelper';
import {IPasswordEncoder} from './IPasswordEncoder';
import {IEncoderFactory} from './IEncoderFactory';
import {BCryptPasswordEncoder} from './BCryptPasswordEncoder';
import {Pbkdf2PasswordEncoder} from './Pbkdf2PasswordEncoder';
import {MessageDigestPasswordEncoder} from './MessageDigestPasswordEncoder';
import {InvalidArgumentException} from '../../../../Exceptions/InvalidArgumentException';
import {PlaintextPasswordEncoder} from './PlaintextPasswordEncoder';
import {RuntimeException} from '../../../../Exceptions/RuntimeException';
import {BaseUser} from '../User/BaseUser';

/**
 * A generic encoder factory implementation.
 *
 * @author Álvaro de la Vega Olmedilla <alvarodlvo@gmail.com>
 */
export class EncoderFactory implements IEncoderFactory {
    private _encoders: any[];

    /**
     * Constructor.
     *
     * @param encoders
     */
    public constructor(encoders: any[]) {
        this._encoders = encoders;
    }

    /**
     * @inheritDoc
     */
    public getEncoder(user: BaseUser): IPasswordEncoder {
        let encoderKey: string = null;
        let encoderName: string = user.encoderName;

        if (user instanceof IEncoderAware && null !== encoderName) {
            if (!ArrayHelper.arrayKeyExists(encoderName, this._encoders)) {
                throw new RuntimeException(`The encoder "${encoderName}" was not configured.`);
            }
            encoderKey = encoderName;
        }

        if (null == encoderKey) {
            let account = ClassHelper.isObject(user) ? ClassHelper.getClassName(user) : user;
            throw new RuntimeException(`No encoder has been configured for account "${account}".`);
        }

        if (!this._encoders[encoderKey] instanceof IPasswordEncoder) {
            this._encoders[encoderKey] = this.createEncoder(this._encoders[encoderKey]);
        }

        return this._encoders[encoderKey];
    }

    /**
     * Creates the actual encoder instance.
     *
     * @param config
     *
     * @return IPasswordEncoder
     *
     * @throws InvalidArgumentException
     */
    private createEncoder(config: any): IPasswordEncoder {
        if (null != config.algorithm) {
            config = this.getEncoderConfigFromAlgorithm(config);
        }

        if (null == config.class) {
            throw new InvalidArgumentException(`"class" must be set in ${JSON.stringify(config)}.`);
        }

        if (null == config.arguments) {
            throw new InvalidArgumentException(`"arguments" must be set in ${JSON.stringify(config)}.`);
        }

        let encoder = <IPasswordEncoder> new config.class();

        for (let argument of config.arguments) {
            encoder.setArgument(argument, config.arguments);
        }

        return encoder;
    }

    private getEncoderConfigFromAlgorithm(config: any): any {
        switch (config.algorithm) {
            case 'plaintext':
                return {
                    arguments: {
                        ignoreCase: config.ignore_case,
                    },
                    className: PlaintextPasswordEncoder,
                };

            case 'pbkdf2':
                return {
                    arguments: {
                        encodeAsBase64: config.encode_as_base64,
                        hashAlgorithm: config.hash_algorithm,
                        iterations: config.iterations,
                        keyLength: config.key_length,
                    },
                    className: Pbkdf2PasswordEncoder,
                };

            case 'bcrypt':
                return {
                    arguments: {
                        cost: config.cost,
                    },
                    className: BCryptPasswordEncoder,
                };

            default:
                return {
                    arguments: {
                        algorithm: config.algorithm,
                        encodeAsBase64: config.encode_as_base64,
                        iterations: config.iterations,
                    },
                    className: MessageDigestPasswordEncoder,
                };
        }
    }
}


text:
<?php
// $Header: /cvsroot/html2ps/xhtml.entities.inc.php,v 1.7 2005/08/31 17:15:58 Konstantin Exp $

function process_character_references(&$html) {
  // Process symbolic character references
  global $g_html_entities;
  foreach ($g_html_entities as $entity => $code) {
    $html = str_replace("&{$entity};","&#{$code};",$html);

    // Some ill-brained webmasters write HTML symbolic references without
    // terminating semicolor (especially at www.whitehouse.gov. The following
    // replacemenet is required to fix these damaged inteties, converting them
    // to the numerical character reference.
    //
    // We use [\s<] as entity name terminator to avoid breaking up longer entity
    // names by filtering in only space or HTML-tag terminated ones.
    //
    $html = preg_replace("/&{$entity}([\s<])/","&#{$code};\\1",$html);
  };

  // Process hecadecimal character references
  while (preg_match("/&#x(..);/i", $html, $matches)) {
    // We cannot use plain str_replace, because 'x' symbol can be in both cases;
    // str_ireplace have appeared in PHP 5 only, so we cannot use it due the
    // compatibility problems

    $html = preg_replace("/&#x".$matches[1].";/i","&#".hexdec($matches[1]).";",$html);
  };
}

function escape_amp($html) {
  // Escape all ampersants not followed by a # sharp sign
  // Note that symbolic references were replaced by numeric before this!
  $html = preg_replace("/&(?!#)/si","&\\1",$html);

  // Complete all numeric character references unterminated with ';'
  $html = preg_replace("/&#(\d+)(?![\d;])/si","&#\\1;",$html);

  // Escape all ampersants followed by # sharp and NON-DIGIT symbol
  // They we're not covered by above conversions and are not a
  // symbol reference.
  // Also, don't forget that we've used &! They should not be converted too...
  //
  $html = preg_replace("/&(?!#\d|amp)/si","&\\1",$html);

  return $html;
};

function escape_lt($html) {
  // Why this loop is needed here?
  // The cause is that, for example, <<<a> sequence will not be replaced by
  // <&lt<a>, as it should be. The regular expression matches TWO symbols
  // << (actually, first < symbold, and one following it, so, the second <
  // will not be matched when script attempt to find and replace next occurrence using 'g' regexp
  // modifier. So, we will need to check for such situations agint and, possibly, restart the
  // search and replace process.
  while (preg_match("#<(\s*[^!/a-zA-Z])#",$html)) {
    $html = preg_replace("#<(\s*[^!/a-zA-Z])#si","<\\1",$html);
  };

  while (preg_match("#(<[^>]*?)<#si",$html)) {
    $html = preg_replace("#(<[^>]*?)<#si","\\1<",$html);
  };

  return $html;
};

function escape_gt($html) {
  $html = preg_replace("#([^\s\da-zA-Z'\"/-])\s*>#si","\\1>",$html);

  while (preg_match("#(>[^<]*?)>#si",$html)) {
    $html = preg_replace("#(>[^<]*?)>#si","\\1>",$html);
  };

  return $html;
};

?>


text:
As of CompatSkills 1.9.0, TConstruct Locks now pass "up" to item-level.
That way the tools are still inaccessible if a friend provides a crafted version.

## Commands
```
// Dumps all Materials
~ /ct tinkermaterials

// Dumps all Modifiers
~ /ct tinkermodifiers
```

## Tool-Creation Locks
By adding a normal ItemStack lock to any of the Tinker Tool-Types (not Part-Types!).
You can lock the creation of a Tinker Tool-Type!


text:
homebrew-update-reset() {
  local DIR

  for option in "$@"
  do
    case "$option" in
      -\?|-h|--help|--usage)          brew help update-reset; exit $? ;;
      --debug)                        HOMEBREW_DEBUG=1 ;;
      -*)
        [[ "$option" = *d* ]] && HOMEBREW_DEBUG=1
        ;;
      *)
        odie <<EOS
This command updates brew itself, and does not take formula names.
Use 'brew upgrade <formula>'.
EOS
        ;;
    esac
  done

  if [[ -n "$HOMEBREW_DEBUG" ]]
  then
    set -x
  fi

  for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/*
  do
    [[ -d "$DIR/.git" ]] || continue
    cd "$DIR" || continue
    echo "==> Fetching $DIR..."
    git fetch --tags --force origin
    echo

    echo "==> Resetting $DIR..."
    git checkout --force -B master origin/master
    echo
  done
}


text:
package im.AfriChat.messenger.app.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;

import im.AfriChat.messenger.R;
import im.AfriChat.messenger.app.util.Screen;

/**
 * Created by ex3ndr on 01.04.15.
 */
public class CoverOverlayDrawable extends Drawable {
    private Drawable bottomShadow;

    public CoverOverlayDrawable(Context context) {
        bottomShadow = context.getResources().getDrawable(R.drawable.profile_avatar_bottom_shadow);
    }

    @Override
    public void draw(Canvas canvas) {
        Rect rect = getBounds();
        bottomShadow.setBounds(rect.left, rect.bottom - Screen.dp(64), rect.right, rect.bottom);
        bottomShadow.draw(canvas);
    }

    @Override
    public void setAlpha(int alpha) {

    }

    @Override
    public void setColorFilter(ColorFilter cf) {

    }

    @Override
    public int getOpacity() {
        return 0;
    }
}


text:
<manifest
	xmlns:android="http://schemas.android.com/apk/res/android"
	package="org.jf.smali"/>


text:
var fs = require('fs'),
	buildSingle = require('./build-single'),
	args = Array.prototype.slice.call(process.argv, 2),
	projectName = args[0];

if (projectName) {

	buildSingle(projectName, function(err, data, times) {
		if (err) {
			console.error(err.message);
			return;
		}

		fs.writeFileSync('results/' + projectName + '.js', data);
		console.info(times);
	});

}
else {
	console.error('Project name required as firs argument!');
}


text:
<form action="submit.php" method="post"  onsubmit="this.submit(); return false;" target="iframe1" enctype="multipart/form-data">
    <iframe name="iframe1"></iframe>
    <input type="submit" name="I0" value="Ìá½»" />
    <input type="text" name="I1" value="input_text" />
    <input type="password" name="I2" value="input_password" />
    <input type="checkbox" name="I3" checked />
    <input type="radio" name="I4" checked />
    <input type="hidden" name="I5" value="input_hidden" />
    <input type="image" name="I6" src="google.gif" value="input_image" />
    <input type="button" name="I7" value="input_button" />
    <input type="file" name="I8" value="input_file" />
    <input type="reset" name="I9" value="input_reset" />
    <input type="text" name="I10" />
    <input type="file" name="I11" />
    <input type="radio" name="I12" />
    <input type="checkbox" name="I13" />
    <select name="S1"><option>select</option></select>
    <select name="S2"></select>
    <button name="B1" type="button">button</button>
    <textarea name="T1">textarea</textarea>
</form>


text:
@(diretorForm : Form[Diretor])

@main("Novo Diretor"){

Home

		@helper.form(action=routes.DiretorCRUD.gravar()){
			<form class="form-horizontal">
				<fieldset>
					<legend>Novo diretor</legend>

				            @helper.inputText(diretorForm("nome"))

informe o nome do diretor

				}

				            <button id="singlebutton" name="singlebutton" class="btn btn-primary">Gravar</button>

				        </form>

}


text:
package cruise.umple.implementation;

import java.io.File;

import org.junit.Test;

import cruise.umple.compiler.GenerateTarget;
import cruise.umple.compiler.UmpleModel;
import cruise.umple.util.SampleFileWriter;

public class MultipleGenerateDirectiveTest extends TemplateTest {

	@Test
	public void testConstraintJavaRubyPhp() {
		UmpleModel model = createUmpleSystem(pathToInput, "javaRubyPHPConstraint.ump");

		File javaOutput = new File(pathToInput, "Range.java");
		File rubyOutput = new File(pathToInput, "range.rb");
		File phpOutput = new File(pathToInput, "Range.php");

		//In case the test fails.
		javaOutput.deleteOnExit();
		rubyOutput.deleteOnExit();
		phpOutput.deleteOnExit();

		model.generate();

		SampleFileWriter.assertFileContent(new File(pathToInput, "/java/javaRubyPHPConstraint.java.txt"), javaOutput, false);
		SampleFileWriter.assertFileContent(new File(pathToInput, "/ruby/javaRubyPHPConstraint.ruby.txt"), rubyOutput, false);
		SampleFileWriter.assertFileContent(new File(pathToInput, "/php/javaRubyPHPConstraint.php.txt"), phpOutput, false);

		javaOutput.delete();
		rubyOutput.delete();
		phpOutput.delete();
	}

	@Test
	public void testConstraintPhpJavaRuby() {
		UmpleModel model = createUmpleSystem(pathToInput, "phpJavaRubyConstraint.ump");

		File javaOutput = new File(pathToInput, "Range.java");
		File rubyOutput = new File(pathToInput, "range.rb");
		File phpOutput = new File(pathToInput, "Range.php");

		//In case the test fails.
		javaOutput.deleteOnExit();
		rubyOutput.deleteOnExit();
		phpOutput.deleteOnExit();

		model.generate();

		SampleFileWriter.assertFileContent(new File(pathToInput, "/java/phpJavaRubyConstraint.java.txt"), javaOutput, false);
		SampleFileWriter.assertFileContent(new File(pathToInput, "/ruby/phpJavaRubyConstraint.ruby.txt"), rubyOutput, false);
		SampleFileWriter.assertFileContent(new File(pathToInput, "/php/phpJavaRubyConstraint.php.txt"), phpOutput, false);

		javaOutput.delete();
		rubyOutput.delete();
		phpOutput.delete();
	}

}


text:
package org.ovirt.engine.ui.uicommonweb.models.vms;

import org.ovirt.engine.core.common.businessentities.VM;
import org.ovirt.engine.ui.frontend.AsyncQuery;
import org.ovirt.engine.ui.frontend.INewAsyncCallback;
import org.ovirt.engine.ui.uicommonweb.UICommand;
import org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider;
import org.ovirt.engine.ui.uicommonweb.help.HelpTag;
import org.ovirt.engine.ui.uicommonweb.models.EntityModel;
import org.ovirt.engine.ui.uicommonweb.models.GridTimer;
import org.ovirt.engine.ui.uicompat.ConstantsManager;
import org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs;

@SuppressWarnings("unused")
public class VmMonitorModel extends EntityModel
{

    private UICommand privateRefreshCommand;

    public UICommand getRefreshCommand()
    {
        return privateRefreshCommand;
    }

    private void setRefreshCommand(UICommand value)
    {
        privateRefreshCommand = value;
    }

    private int cpuUsage;

    public int getCpuUsage()
    {
        return cpuUsage;
    }

    public void setCpuUsage(int value)
    {
        if (cpuUsage != value)
        {
            cpuUsage = value;
            onPropertyChanged(new PropertyChangedEventArgs("CpuUsage")); //$NON-NLS-1$
        }
    }

    private int memoryUsage;

    public int getMemoryUsage()
    {
        return memoryUsage;
    }

    public void setMemoryUsage(int value)
    {
        if (memoryUsage != value)
        {
            memoryUsage = value;
            onPropertyChanged(new PropertyChangedEventArgs("MemoryUsage")); //$NON-NLS-1$
        }
    }

    private int networkUsage;

    public int getNetworkUsage()
    {
        return networkUsage;
    }

    public void setNetworkUsage(int value)
    {
        if (networkUsage != value)
        {
            networkUsage = value;
            onPropertyChanged(new PropertyChangedEventArgs("NetworkUsage")); //$NON-NLS-1$
        }
    }

    private GridTimer refreshTimer;

    private GridTimer getRefreshTimer()
    {
        if (refreshTimer == null)
        {
            refreshTimer = new GridTimer("VmMonitorModel", getEventBus()) { //$NON-NLS-1$
                        @Override
                        public void execute() {
                            refresh();
                        }
                    };
            refreshTimer.setRefreshRate(1000);
        }

        return refreshTimer;
    }

    public VmMonitorModel()
    {
        setTitle(ConstantsManager.getInstance().getConstants().monitorTitle());
        setHelpTag(HelpTag.monitor);
        setHashName("monitor"); //$NON-NLS-1$

        setRefreshCommand(new UICommand("Refresh", this)); //$NON-NLS-1$
    }

    @Override
    public void setEntity(Object value)
    {
        super.setEntity(value);

        if (value != null)
        {
            getRefreshTimer().start();
        } else {
            getRefreshTimer().stop();
        }
    }

    @Override
    public void executeCommand(UICommand command)
    {
        super.executeCommand(command);

        if (command == getRefreshCommand())
        {
            refresh();
        }
    }

    private void refresh()
    {
        if (getEntity() == null)
        {
            return;
        }

        VM vm = (VM) getEntity();
        AsyncQuery _asyncQuery = new AsyncQuery();
        _asyncQuery.setModel(this);
        _asyncQuery.asyncCallback = new INewAsyncCallback() {
            @Override
            public void onSuccess(Object model, Object result)
            {
                VM vm1 = (VM) result;
                VmMonitorModel vmMonitorModel = (VmMonitorModel) model;
                vmMonitorModel.setCpuUsage((vm1.getUsageCpuPercent() == null ? 0 : vm1.getUsageCpuPercent()));
                vmMonitorModel.setMemoryUsage((vm1.getUsageMemPercent() == null ? 0 : vm1.getUsageMemPercent()));
                vmMonitorModel.setNetworkUsage((vm1.getUsageNetworkPercent() == null ? 0
                        : vm1.getUsageNetworkPercent()));
            }
        };
        AsyncDataProvider.getInstance().getVmById(_asyncQuery, vm.getId());
    }
}


text:
package org.wso2.carbon.apimgt.rest.api.analytics.dto;

import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Objects;

/**
 * SubscriptionCountDTO
 */
public class SubscriptionCountDTO   {
  @SerializedName("time")
  private String time = null;

  @SerializedName("count")
  private Long count = null;

  public SubscriptionCountDTO time(String time) {
    this.time = time;
    return this;
  }

   /**
   * Timestamp in UTC
   * @return time
  **/
  @ApiModelProperty(value = "Timestamp in UTC ")
  public String getTime() {
    return time;
  }

  public void setTime(String time) {
    this.time = time;
  }

  public SubscriptionCountDTO count(Long count) {
    this.count = count;
    return this;
  }

   /**
   * Number of subscriptions created
   * @return count
  **/
  @ApiModelProperty(value = "Number of subscriptions created ")
  public Long getCount() {
    return count;
  }

  public void setCount(Long count) {
    this.count = count;
  }

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SubscriptionCountDTO subscriptionCount = (SubscriptionCountDTO) o;
    return Objects.equals(this.time, subscriptionCount.time) &&
        Objects.equals(this.count, subscriptionCount.count);
  }

  @Override
  public int hashCode() {
    return Objects.hash(time, count);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SubscriptionCountDTO {\n");

    sb.append("    time: ").append(toIndentedString(time)).append("\n");
    sb.append("    count: ").append(toIndentedString(count)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}


text:
namespace gear2d {
  class parameterbase::callback {
    public:
      callback(component::base * com, component::call h)
      : com(com)
      , fp(h) { }

      void operator()(std::string pid, component::base * lastwrite, gear2d::object * owner) {
        if (com == 0) {
          throw evil("callback with null component");
        }
        if (fp == 0) {
          com->handle(pid, lastwrite, owner);
        } else {
          CALLBACK(*com, fp)(pid, lastwrite, owner);
        }
      }

    private:
      component::base * com;
      component::call fp;

      friend class parameterbase;
  };

  void parameterbase::hook(component::base * c) {
    hook(c, 0);
  }

  void parameterbase::hook(component::base * c, component::call handlefp) {
    hooked.insert(new callback(c, handlefp));
  }

void parameterbase::unhook(component::base* c)
{
  for (std::set<callback*>::iterator i = hooked.begin(); i != hooked.end(); i++)
    if ((*i)->com == c)
      hooked.erase(i);
}

  void parameterbase::pull() {
    for (std::set<callback *>::iterator i = hooked.begin(); i != hooked.end(); i++) {
      if (*i == NULL) continue;
      callback & c = *(*i);
      c(pid, lastwrite, owner);
    }
  }

  badlink::badlink() : evil("Someone is trying to access a link that is initialized!") { }

}


text:
from __future__ import print_function, division

from .list2data import list2data
from .integrate import integrate, integrate_subset
from .interpolate import interp1d_fast


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>de.dominikschadow.javawebsecurity</groupId>
		<artifactId>javawebsecurity</artifactId>
		<version>1.0.0</version>
	</parent>
	<artifactId>Ch08_CSRF</artifactId>
	<packaging>war</packaging>
	<name>Chapter 08 - CSRF</name>
	<url>https://github.com/dschadow/Java-Web-Security</url>
	<description>Chapter 8 CSRF sample project. Requires a server like Apache Tomcat. Open the web application in your browser at http://localhost:8080/Ch08_CSRF</description>

	<dependencies>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.owasp.esapi</groupId>
			<artifactId>esapi</artifactId>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
		</dependency>
	</dependencies>

	<build>
		<finalName>Ch08_CSRF</finalName>
		<plugins>
			<plugin>
                <groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<failOnMissingWebXml>false</failOnMissingWebXml>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.tomcat.maven</groupId>
				<artifactId>tomcat7-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>


text:
package org.platanios.tensorflow.api.learn.layers

import org.platanios.tensorflow.api.learn.{Mode, layers}
import org.platanios.tensorflow.api.ops
import org.platanios.tensorflow.api.ops.Output

/**
  * @author Emmanouil Antonios Platanios
  */
abstract class Activation(override val name: String) extends Layer[Output, Output](name)

object Activation {
  private[layers] trait API {
    type Activation = layers.Activation

    val Sigmoid : layers.Sigmoid.type  = layers.Sigmoid
    val ReLU    : layers.ReLU.type     = layers.ReLU
    val ReLU6   : layers.ReLU6.type    = layers.ReLU6
    val CReLU   : layers.CReLU.type    = layers.CReLU
    val ELU     : layers.ELU.type      = layers.ELU
    val SELU    : layers.SELU.type     = layers.SELU
    val Softplus: layers.Softplus.type = layers.Softplus
    val Softsign: layers.Softsign.type = layers.Softsign
  }

  object API extends API
}

case class Sigmoid(override val name: String)
    extends Activation(name) {
  override val layerType: String = "Sigmoid"

  override protected def _forward(input: Output)(implicit mode: Mode): Output = {
    ops.Math.sigmoid(input)
  }
}

case class ReLU(override val name: String, alpha: Float = 0.0f)
    extends Activation(name) {
  override val layerType: String = if (alpha > 0.0f) f"LeakyReLU($alpha%.2f)" else "ReLU"

  override protected def _forward(input: Output)(implicit mode: Mode): Output = {
    ops.NN.relu(input, alpha = alpha)
  }
}

case class ReLU6(override val name: String)
    extends Activation(name) {
  override val layerType: String = "ReLU6"

  override protected def _forward(input: Output)(implicit mode: Mode): Output = {
    ops.NN.relu6(input)
  }
}

case class CReLU(override val name: String)
    extends Activation(name) {
  override val layerType: String = "CReLU"

  override protected def _forward(input: Output)(implicit mode: Mode): Output = {
    ops.NN.crelu(input)
  }
}

case class ELU(override val name: String)
    extends Activation(name) {
  override val layerType: String = "ELU"

  override protected def _forward(input: Output)(implicit mode: Mode): Output = {
    ops.NN.elu(input)
  }
}

case class SELU(override val name: String)
    extends Activation(name) {
  override val layerType: String = "SELU"

  override protected def _forward(input: Output)(implicit mode: Mode): Output = {
    ops.NN.selu(input)
  }
}

case class Softplus(override val name: String)
    extends Activation(name) {
  override val layerType: String = "Softplus"

  override protected def _forward(input: Output)(implicit mode: Mode): Output = {
    ops.NN.softplus(input)
  }
}

case class Softsign(override val name: String)
    extends Activation(name) {
  override val layerType: String = "Softsign"

  override protected def _forward(input: Output)(implicit mode: Mode): Output = {
    ops.NN.softsign(input)
  }
}


text:
ONE_LOCATION=ENV["ONE_LOCATION"]

if !ONE_LOCATION
    RUBY_LIB_LOCATION="/usr/lib/one/ruby"
    VMDIR="/var/lib/one"
else
    RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby"
    VMDIR=ONE_LOCATION+"/var"
end

$: << RUBY_LIB_LOCATION

require 'OpenNebula'
include OpenNebula

if !(host_id=ARGV[0])
    exit -1
end

if !(mode=ARGV[1]) # By default, resubmit VMs
    mode = "-r"
end

if !(force=ARGV[2]) # By default, don't resubmit/finalize suspended VMs
    force = "n"
end

begin
    client = Client.new()
rescue Exception => e
    puts "Error: #{e}"
    exit -1
end

# Retrieve hostname
host  =  OpenNebula::Host.new_with_id(host_id, client)
exit -1 if OpenNebula.is_error?(host)
host.info
host_name = host.name

# Loop through all vms
vms = VirtualMachinePool.new(client)
exit -1 if OpenNebula.is_error?(vms)

vms.info

vm_ids_array = vms.retrieve_elements("/VM_POOL/VM[STATE=3]/HISTORY[HOSTNAME=\"#{host_name}\"]/../ID")

if vm_ids_array
    vm_ids_array.each do |vm_id|
        vm=OpenNebula::VirtualMachine.new_with_id(vm_id, client)
        vm.info

        if mode == "-r"
            vm.resubmit
        elsif mode == "-d"
            vm.finalize
        end
    end
end

if force == "y"
    vm_ids_array = vms.retrieve_elements("/VM_POOL/VM[STATE=5]/HISTORY[HOSTNAME=\"#{host_name}\"]/../ID")

    if vm_ids_array
        vm_ids_array.each do |vm_id|
            vm=OpenNebula::VirtualMachine.new_with_id(vm_id, client)
            vm.info

            if mode == "-r"
                vm.resubmit
            elsif mode == "-d"
                vm.finalize
            end
        end
    end
end


text:
require 'sensu-plugin/metric/cli'
require 'open-uri'
require 'json'

#   sidekiq-metrics
#
# DESCRIPTION:
#   Pull sidekiq metrics from a sidekiq-monitor-stats enabled endpoint.
#
#     https://github.com/harvesthq/sidekiq-monitor-stats
#
# OUTPUT:
#   metric data
#
# PLATFORMS:
#   Linux
#
# DEPENDENCIES:
#   gem: sensu-plugin
#   gem: open-uri
#   gem: json
#
# LICENSE:
#   Albert Llop albert@getharvest.com
#   Released under the same terms as Sensu (the MIT license); see LICENSE
#   for details.
#
class SidekiqMetrics < Sensu::Plugin::Metric::CLI::Graphite
  option :url,
         short: '-u URL',
         long: '--url URL',
         description: 'Url to query',
         required: true

  option :auth,
         short: '-a USER:PASSWORD',
         long: '--auth USER:PASSWORD',
         description: 'Basic auth credentials if you need them',
         proc: proc { |auth| auth.split(':') }

  option :scheme,
         description: 'Metric naming scheme, text to prepend to metric',
         short: '-s SCHEME',
         long: '--scheme SCHEME',
         default: 'sidekiq'

  def run
    begin
      stats = JSON.parse(
        if config[:auth]
          open(config[:url], http_basic_authentication: config[:auth]).read
        else
          open(config[:url]).read
        end
      )

    rescue => error
      unknown "Could not load sidekiq stats from #{config[:url]}. Error: #{error}"
    end

    total_concurrency = stats['processes'].map { |process| process['concurrency'] }.reduce(&:+) || 0
    total_busy        = stats['processes'].map { |process| process['busy'] }.reduce(&:+) || 0
    maximum_latency   = stats['queues'].map { |_name, data| data['latency'] }.max

    output "#{config[:scheme]}.concurrency", total_concurrency
    output "#{config[:scheme]}.busy",        total_busy
    output "#{config[:scheme]}.latency",     maximum_latency

    ok
  end
end


text:
rm -rf keys certs newcerts index.txt serial
mkdir keys certs newcerts
touch index.txt
echo 00 >serial

openssl req -new -config openssl.cnf -newkey rsa:4096 -days 36500 -nodes -x509 -subj "/C=DE/ST=Develpoer/L=Develpoer/O=Develpoer/CN=Developer CA" -keyout keys/ca.key  -out certs/ca.cert
openssl genrsa -out keys/server.key 4096 -subj "/C=LO/ST=Localdomain/L=Localhost/O=Dis/CN=*.dev"
openssl req -config openssl.cnf -days 36500 -new -key keys/server.key -out certs/server.csr -subj "/C=DE/ST=Develpoer/L=Develpoer/O=Develpoer/CN=*.dev"
openssl ca -batch -config openssl.cnf -policy policy_anything -out certs/server.cert -infiles certs/server.csr
mv newcerts/00.pem certs/server.pem

security delete-keychain 'Development Certificates' 2>&1
security create-keychain -p '' 'Development Certificates'
security add-trusted-cert -k 'Development Certificates' -r trustRoot certs/ca.cert
#security add-trusted-cert -k 'Development Certificates' -r trustAsRoot certs/server.pem


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="@dimen/nav_header_height"
    android:gravity="bottom"
    android:background="@color/colorPrimary"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:theme="@style/ThemeOverlay.AppCompat.Dark">

    <ImageView
        android:id="@+id/iv_header"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:paddingTop="@dimen/nav_header_vertical_spacing" />
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="@dimen/nav_header_vertical_spacing"
        android:orientation="horizontal" >
        <TextView
            android:id="@+id/textView_user"
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:text="------"
            android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
        <TextView
            android:id="@+id/textView_change_password"
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:gravity="end"
            android:text="修改密码"
            android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
    </LinearLayout>
</LinearLayout>