text:
package il.co.All4Students.homemovies;

import static il.co.All4Students.homemovies.app.AppConstants.INTENT_TARGET;
import static il.co.All4Students.homemovies.app.AppConstants.Item_Gallery;
import static il.co.All4Students.homemovies.app.AppConstants.Item_Take_Picture;
import static il.co.All4Students.homemovies.app.AppConstants.LOG_TAG_SCREEN_EDIT;
import static il.co.All4Students.homemovies.app.AppConstants.LOG_TAG_SCREEN_WEB;
import static il.co.All4Students.homemovies.app.AppConstants.LOG_TAG_TextToSpeech;
import static il.co.All4Students.homemovies.app.AppConstants.LOG_TAG_WEB_SITE;
import static il.co.All4Students.homemovies.app.AppConstants.RESULT_CODE_CANCEL;
import static il.co.All4Students.homemovies.app.AppConstants.RESULT_CODE_COMMIT;
import static il.co.All4Students.homemovies.app.AppConstants.RESULT_CODE_DELETE;
import il.co.All4Students.homemovies.app.ApplicationPreference;
import il.co.All4Students.homemovies.core.Item;
import il.co.All4Students.homemovies.util.db.ItemsHandler;
import il.co.All4Students.homemovies.util.dialog.RankDialog;
import il.co.All4Students.homemovies.util.dialog.ShareDialog;
import il.co.All4Students.homemovies.util.image.ExternalStorageLoader;
import il.co.All4Students.homemovies.util.json.JSONHandler;
import il.co.All4Students.homemovies.util.log.util.AppLog;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Locale;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

/**
 * Edit screen
 *
 * @author Arkadi Yoskovitz
 * @date 2013-02-08
 */
public class ScreenEdit extends Activity implements TextToSpeech.OnInitListener {

	// Attributes
	private Item mEditedItem;
	private DownloadImageTask mDownloadTask;
	private ApplicationPreference mSettings;
	private TextToSpeech mTextToSpeech;
	private boolean mIsLanguageSupported = true;

	// System Events
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.screen_edit);
		mTextToSpeech = new TextToSpeech(this, this);

	}

	@Override
	protected void onResume() {
		super.onResume();
		try {
			if (mEditedItem == null) {
				mEditedItem = getIntent().getExtras().getParcelable(
						INTENT_TARGET);
			}
			EditText text1 = (EditText) findViewById(R.id.ScreenEditEditText1);
			EditText text2 = (EditText) findViewById(R.id.ScreenEditEditText2);
			EditText text3 = (EditText) findViewById(R.id.ScreenEditEditText3);
			CheckBox checkBox = (CheckBox) findViewById(R.id.ScreenEditCheckBox);
			final ImageView screenEditImage = (ImageView) findViewById(R.id.ScreenEditImageView1);

			mSettings = new ApplicationPreference(ScreenEdit.this);

			if (mEditedItem.getSubject().length() == 0) {
				text1.setHint(mSettings.getSubject());
			} else {
				text1.setText(mEditedItem.getSubject());
			}

			if (mEditedItem.getUrlWeb().length() == 0) {
				text3.setText(mEditedItem.getUrlLocal());
			} else {
				text3.setText(mEditedItem.getUrlWeb());
			}

			text2.setText(mEditedItem.getBody());

			checkBox.setChecked(mEditedItem.getViewd());

			registerForContextMenu(screenEditImage);
		} catch (Exception e) {
			AppLog.log(ScreenEdit.this, LOG_TAG_SCREEN_EDIT, e.getMessage());
		}
	}

	@Override
	public void onBackPressed() {
		itemRefreshFromScreen();
		AppLog.log(ScreenEdit.this, LOG_TAG_SCREEN_EDIT,
				"Edit Screen - Cancel button was pressed");

		Intent returnIntent = new Intent();
		returnIntent.putExtra(INTENT_TARGET, mEditedItem);
		setResult(RESULT_CODE_CANCEL, returnIntent);
		finish();
	}

	// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	@Override
	protected void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
		itemRefreshFromScreen();
		outState.putParcelable("mItem", mEditedItem);

		ImageView imageView = (ImageView) findViewById(R.id.ScreenEditImageView1);
		BitmapDrawable drawable = (BitmapDrawable) imageView.getDrawable();
		Bitmap bitmap = drawable.getBitmap();
		outState.putParcelable("mImage", bitmap);
	}

	@Override
	protected void onRestoreInstanceState(Bundle savedInstanceState) {
		super.onRestoreInstanceState(savedInstanceState);
		mEditedItem = savedInstanceState.getParcelable("mItem");
		Bitmap bitmap = (Bitmap) savedInstanceState.getParcelable("mImage");

		ImageView editImage = (ImageView) findViewById(R.id.ScreenEditImageView1);
		if (bitmap != null) {
			editImage.setImageBitmap(bitmap);
		}
	}

	@Override
	protected void onDestroy() {
		if (mTextToSpeech != null) {
			mTextToSpeech.stop();
			mTextToSpeech.shutdown();
		}
		super.onDestroy();
	}

	// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Activity sending info Events
	// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		switch (requestCode) {
		case Item_Take_Picture:
			try {
				Bitmap thumbnail = (Bitmap) data.getExtras().get("data");
				ImageView imgTakenPhoto = (ImageView) findViewById(R.id.ScreenEditImageView1);
				imgTakenPhoto.setImageBitmap(thumbnail);
			} catch (Exception e) {
				if (data == null) {
					AppLog.log(ScreenEdit.this, LOG_TAG_SCREEN_EDIT,
							"Failed to retrive image, intent is empty");
				} else {
					AppLog.log(ScreenEdit.this, LOG_TAG_SCREEN_EDIT,
							"onActivityResult - Item_Take_Picture");
				}
			}
			break;
		case Item_Gallery:
			switch (resultCode) {
			case RESULT_CODE_CANCEL:
				try {
					mEditedItem = getIntent().getExtras().getParcelable(
							INTENT_TARGET);
				} catch (Exception e) {
					AppLog.log(ScreenEdit.this, LOG_TAG_SCREEN_EDIT,
							e.getMessage());
				}
				break;

			default:
				try {
					mEditedItem = getIntent().getExtras().getParcelable(
							INTENT_TARGET);
				} catch (Exception e) {
					AppLog.log(ScreenEdit.this, LOG_TAG_SCREEN_EDIT,
							e.getMessage());
				}
				AppLog.log(ScreenEdit.this, LOG_TAG_SCREEN_EDIT,
						"onActivityResult - Item_Gallery");
				break;
			}

			break;

		default:

			AppLog.log(ScreenEdit.this, LOG_TAG_SCREEN_EDIT,
					"onActivityResult - default");
			break;
		}
	}

	// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Menu Events
	// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	/**
	 * onCreateOptionsMenu
	 */
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		getMenuInflater().inflate(R.menu.screen_edit_menu_option, menu);
		closeKeybord();
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case R.id.screenEditOptionMenuShare:
			ShareDialog ShareDialog = new ShareDialog(mEditedItem,
					ScreenEdit.this);
			ShareDialog.showShareDialog();
			break;
		case R.id.screenEditOptionMenuSpeach:
			speakOut();
			break;

		default:
			break;
		}
		return super.onOptionsItemSelected(item);
	}

	/**
	 * onCreateContextMenu
	 */
	@Override
	public void onCreateContextMenu(ContextMenu menu, View v,
			ContextMenuInfo menuInfo) {
		super.onCreateContextMenu(menu, v, menuInfo);
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.screen_edit_menu_context, menu);
		closeKeybord();
	}

	@Override
	public boolean onContextItemSelected(MenuItem item) {

		switch (item.getItemId()) {

		case R.id.screenEditContextMenuSaveToCard:
			try {
				ImageView screenEditImage = (ImageView) findViewById(R.id.ScreenEditImageView1);
				BitmapDrawable drawable = (BitmapDrawable) screenEditImage
						.getDrawable();
				Bitmap bitmap = drawable.getBitmap();

				ExternalStorageLoader externalStogareLoader = new ExternalStorageLoader(
						ScreenEdit.this);

				mEditedItem.setUrlLocal(JSONHandler.insertURIintoJSON(
						mEditedItem.getUrlLocal(),
						externalStogareLoader.saveIamge(bitmap)));

				ItemsHandler itemsHandler = new ItemsHandler(ScreenEdit.this);
				itemsHandler.updateItem(mEditedItem);
				Toast.makeText(this, "Image saved to card", Toast.LENGTH_SHORT)
						.show();
			} catch (Exception e) {
				Toast.makeText(this, "Canot save to card at this time",
						Toast.LENGTH_SHORT).show();
				AppLog.log(ScreenEdit.this, "onContextItemSelected", e
						.getStackTrace().toString());
			}
			break;

		case R.id.screenEditContextMenuRank:
			RankDialog RankDialog = new RankDialog(mEditedItem, ScreenEdit.this);
			RankDialog.showRankDialog();
			break;
		case R.id.screenEditContextMenuViewed:
			CheckBox checkBox = (CheckBox) findViewById(R.id.ScreenEditCheckBox);
			checkBox.setChecked(!checkBox.isChecked());
			mEditedItem.setViewd(!mEditedItem.getViewd());
			break;
		case R.id.screenEditContextMenuShare:
			ShareDialog ShareDialog = new ShareDialog(mEditedItem,
					ScreenEdit.this);
			ShareDialog.showShareDialog();
			break;

		default:
			break;
		}
		return super.onContextItemSelected(item);
	}

	// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// OnClick Events
	// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	public void onClickEditCamera(View view) {
		closeKeybord();

		Intent returnIntent = new Intent();
		returnIntent.putExtra(INTENT_TARGET, mEditedItem);
		try {
			Intent cameraIntent = new Intent(
					android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
			startActivityForResult(cameraIntent, Item_Take_Picture);

		} catch (ActivityNotFoundException NOFOUND) {
			Toast.makeText(this,
					"No Canera found, device doesn't support this feature",
					Toast.LENGTH_SHORT).show();
		}

	}

	public void onClickEditGallery(View view) {
		closeKeybord();

		Intent intent = new Intent(ScreenEdit.this, ScreenGrid.class);
		intent.putExtra(INTENT_TARGET, mEditedItem);
		startActivityForResult(intent, Item_Gallery);
	}

	public void onClickEditShow(View view) {
		closeKeybord();

		EditText txtSearch = (EditText) findViewById(R.id.ScreenEditEditText3);
		if (txtSearch.getText() != null) {
			try {
				if (mDownloadTask != null) {
					if (mDownloadTask.getStatus() != AsyncTask.Status.FINISHED) {
						AppLog.log(ScreenEdit.this, LOG_TAG_SCREEN_WEB,
								"onClickWebGo - no need to start a new task");

						return;
					}
				}
				String searchString = txtSearch.getText().toString();
				mDownloadTask = new DownloadImageTask(ScreenEdit.this);
				mDownloadTask.execute(searchString);
			} catch (Exception e) {
				AppLog.log(ScreenEdit.this, LOG_TAG_WEB_SITE, "Exception: "
						+ e.getMessage().toString());
			}
		}
	}

	public void onClickEditCancel(View view) {
		closeKeybord();
		itemRefreshFromScreen();
		AppLog.log(ScreenEdit.this, LOG_TAG_SCREEN_EDIT,
				"Edit Screen - Cancel button was pressed");

		Intent returnIntent = new Intent();
		returnIntent.putExtra(INTENT_TARGET, mEditedItem);
		setResult(RESULT_CODE_CANCEL, returnIntent);
		finish();
	}

	public void onClickEditDelete(View view) {
		closeKeybord();
		itemRefreshFromScreen();
		AppLog.log(ScreenEdit.this, LOG_TAG_SCREEN_EDIT,
				"Edit Screen - Delete button was pressed");

		Intent returnIntent = new Intent();
		returnIntent.putExtra(INTENT_TARGET, mEditedItem);
		setResult(RESULT_CODE_DELETE, returnIntent);
		finish();
	}

	public void onClickEditCommit(View view) {
		closeKeybord();
		EditText subjectText = (EditText) findViewById(R.id.ScreenEditEditText1);
		EditText bodyText = (EditText) findViewById(R.id.ScreenEditEditText2);
		EditText URLText = (EditText) findViewById(R.id.ScreenEditEditText3);
		CheckBox checkBox = (CheckBox) findViewById(R.id.ScreenEditCheckBox);

		if (subjectText.getText().toString().length() == 0) {
			mEditedItem.setSubject(subjectText.getHint().toString());
			mEditedItem.setBody(bodyText.getText().toString());
			mEditedItem.setUrlWeb(URLText.getText().toString());
			mEditedItem.setViewd(checkBox.isChecked());
		} else {
			itemRefreshFromScreen();
		}
		AppLog.log(ScreenEdit.this, LOG_TAG_SCREEN_EDIT,
				"Edit Screen - Commit button was pressed");

		Intent returnIntent = new Intent();
		returnIntent.putExtra(INTENT_TARGET, mEditedItem);
		setResult(RESULT_CODE_COMMIT, returnIntent);
		finish();
	}

	// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Additional Events
	// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	@Override
	public void onInit(int status) {
		try {
			if (status == TextToSpeech.SUCCESS) {
				// int result = mTextToSpeech
				// .setLanguage(new Locale(getBaseContext().getResources()
				// .getConfiguration().locale.getLanguage()));

				int result = mTextToSpeech.setLanguage(Locale.US);

				if (result == TextToSpeech.LANG_MISSING_DATA
						|| result == TextToSpeech.LANG_NOT_SUPPORTED) {
					Log.e(LOG_TAG_TextToSpeech, "Language is not supported");
					mIsLanguageSupported = false;
				}
			}
		} catch (Exception e) {
			AppLog.log(ScreenEdit.this, LOG_TAG_TextToSpeech,
					"Initilization Failed");
			AppLog.log(ScreenEdit.this, LOG_TAG_TextToSpeech, e.getMessage()
					.toString());
		}
	}

	// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Additional Methods
	// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	private void itemRefreshFromScreen() {
		EditText text1 = (EditText) findViewById(R.id.ScreenEditEditText1);
		EditText text2 = (EditText) findViewById(R.id.ScreenEditEditText2);
		EditText text3 = (EditText) findViewById(R.id.ScreenEditEditText3);
		CheckBox checkBox = (CheckBox) findViewById(R.id.ScreenEditCheckBox);

		mEditedItem.setSubject(text1.getText().toString());
		mEditedItem.setBody(text2.getText().toString());
		mEditedItem.setUrlWeb(text3.getText().toString());
		mEditedItem.setViewd(checkBox.isChecked());
	}

	private void speakOut() {
		if (mIsLanguageSupported) {
			String subject = mEditedItem.getSubject();
			String body = mEditedItem.getBody();
			mTextToSpeech.speak(subject + "\n" + body,
					TextToSpeech.QUEUE_FLUSH, null);
		} else {
			Toast.makeText(ScreenEdit.this,
					getResources().getString(R.string.ErrorMsgTextToSpeech),
					Toast.LENGTH_LONG).show();
		}
	}

	private void closeKeybord() {
		InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
		inputManager.hideSoftInputFromWindow(
				getCurrentFocus().getWindowToken(),
				InputMethodManager.HIDE_NOT_ALWAYS);
	}

	// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Inner Classes
	// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/**
	 * DownloadImageTask
	 *
	 * @author Arkadi Yoskovitz
	 * @date 2013-02-08
	 */
	private class DownloadImageTask extends AsyncTask<String, Integer, Bitmap> {

		private Activity mActivity;
		private ProgressDialog mDialog;

		DownloadImageTask(Activity activity) {
			mActivity = activity;
			mDialog = new ProgressDialog(mActivity);
		}

		@Override
		protected Bitmap doInBackground(String... urls) {
			AppLog.log(ScreenEdit.this, "doInBackground",
					"starting download of image");
			Bitmap bitmap = null;

			if (isOnline()) {
				try {
					URL url = new URL(urls[0]);
					HttpURLConnection httpCon = (HttpURLConnection) url
							.openConnection();
					try {
						InputStream is = httpCon.getInputStream();
						int fileLength = httpCon.getContentLength();
						ByteArrayOutputStream buffer = new ByteArrayOutputStream();
						int nRead, total = 0;
						byte[] data = new byte[2048];
						// Read the image bytes in chunks of 2048 bytes
						while ((nRead = is.read(data, 0, data.length)) != -1) {
							buffer.write(data, 0, nRead);
							total += nRead;
							publishProgress(""
									+ (int) ((total * 100) / fileLength));
						}
						buffer.flush();
						byte[] imageArray = buffer.toByteArray();
						bitmap = BitmapFactory.decodeByteArray(imageArray, 0,
								imageArray.length);
						// save to sdcard
					} catch (IOException e) {
						AppLog.log(mActivity, LOG_TAG_SCREEN_EDIT, e
								.getStackTrace().toString());
					} finally {
						httpCon.disconnect();
					}
				} catch (Exception e) {
					AppLog.log(mActivity, LOG_TAG_SCREEN_EDIT, e
							.getStackTrace().toString());
				}
			} else {
				if (mEditedItem.getUrlLocal().length() != 0) {
					try {
						ArrayList<String> tmpArrayList = JSONHandler
								.getURIFromJSON(mEditedItem.getUrlLocal());

						bitmap = BitmapFactory.decodeFile(tmpArrayList.get(0));
					} catch (Exception e) {
						AppLog.log(ScreenEdit.this, LOG_TAG_SCREEN_EDIT, e
								.getStackTrace().toString());
					}
				}
			}
			return bitmap;
		}

		@Override
		protected void onPreExecute() {
			mDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
			mDialog.setCancelable(true);
			mDialog.setMessage("Loading...");
			mDialog.setMax(100);
			mDialog.setProgress(0);
			mDialog.show();
			TextView errorMsg = (TextView) mActivity
					.findViewById(R.id.ScreenEditTextViewErrorMsg);
			errorMsg.setVisibility(View.GONE);
		}

		@Override
		protected void onProgressUpdate(Integer... progress) {
			mDialog.show();
			mDialog.setProgress(progress[0]);
		}

		private void publishProgress(String... progress) {
			mDialog.setProgress(Integer.parseInt(progress[0]));
		}

		@Override
		protected void onPostExecute(Bitmap resultImage) {
			if (resultImage != null) {
				ImageView imageView = (ImageView) mActivity
						.findViewById(R.id.ScreenEditImageView1);
				imageView.setImageBitmap(resultImage);
			} else {
				TextView errorMsg = (TextView) mActivity
						.findViewById(R.id.ScreenEditTextViewErrorMsg);
				errorMsg.setVisibility(View.VISIBLE);
				errorMsg.setText("Problem downloading image. Try again later");
			}
			// Close the progress dialog
			mDialog.dismiss();
		}

		// Additional Methods
		public boolean isOnline() {
			ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
			NetworkInfo netInfo = cm.getActiveNetworkInfo();
			if (netInfo != null && netInfo.isConnectedOrConnecting()) {
				return true;
			}
			return false;
		}
	}

}


text:
var express = require ("express");
var mongoose = require ("mongoose");
var request = require ("request");
var app = express();
var aData = null;

mongoose.connect("mongodb://localhost/BANCA");
var db = mongoose.connection;
var Document = null;
db.on("error", console.error.bind(console,"Connection error:"));
db.once('open',function(callback){

	var SAN_schema = mongoose.Schema({
	fecha: String,
	abierto: Number,
	alto: Number,
	bajo: Number,
	cierre: Number,
	volumen:Number,
	});
	Document = mongoose.model('Document', SAN_schema);

	var urlSantander = "https://www.quandl.com/api/v3/datasets/YAHOO/MC_SAN.json?api_key=HGoTu3E3A_Lsv6biw1kc";
	request({
		url: urlSantander,
		json: true
	}, function (error, response, body){

		if (!error && response.statusCode == 200){
		var parseo = body.dataset.data;
		//console.log(parseo)
		var jsonString=[];
		for(var i = 0 ; i < parseo.length; i++){
			var jsonDato={};

				jsonDato.fecha = String(parseo[i][0]);
				jsonDato.abierto = parseFloat(parseo[i][1]);
				jsonDato.alto = parseFloat(parseo[i][2]);
				jsonDato.bajo = parseFloat(parseo[i][3]);
				jsonDato.cierre = parseFloat(parseo[i][4]);
				jsonDato.volumen = parseFloat(parseo[i][5]);
				jsonString.push(jsonDato);
				//console.log(jsonDato)
			}

			var jsonArrayValor = JSON.parse(JSON.stringify(jsonString));

			var aDocs = jsonArrayValor;
			//for (var n = 0; n < aDocs.length; n++){
			for (var n = 0; n < 30; n++){
				var docToAdd = new Document(aDocs[n]);
				docToAdd.save(function(error,docToAdd){
					if (error) return console.error(error)
						//console.log(aDocs[n])
				});
			}
		}
	});
});
app.use(express.static('./'));

app.get('/', function (req, res) {
  res.sendFile('./index.html', {root: './'});
});

// Send all records when there's a GET request to `localhost:3000/test`
app.get('/BANCA', function (req, res) {
	Document.find(function(err, records){
		aData = records;
		res.send(aData);
	});
});

app.listen(8080);
console.log("Servidor conectado puerto 8080");

redpajama_set_name: RedPajamaGithub


text: stack hoogle -- server --port=8080


text:
#!/bin/bash
# Copyright 2017-2019 Frank Breedijk
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
UPSTREAM_VERSION=$1
COMMITS=$2
if [ -z $VERSION ]; then
    echo "Trying to determine version and commit count from git"
    FULLVERSION=$(git describe)
    UPSTREAM_VERSION=$(echo $FULLVERSION|sed 's/\-.*//')
    COMMITS=$(echo $FULLVERSION|sed 's/^[0-9\.]*\-//'|sed 's/\-.*//')
    if [[ "$UPSTREAM_VERSION" == "$COMMITS" ]]; then
        COMMITS=0
    fi
fi

[ -z $UPSTREAM_VERSION ] && echo "We need a version number as first argument" && exit
[ -z $COMMITS ] && echo "We a commit count as second argument" && exit

VERSION="$UPSTREAM_VERSION"
BRANCH=$(git branch | grep '*'|awk '{print $2}')

[ ! -d build ] && mkdir build
[ -d $DIR ] && rm -rf $DIR

NOSIGN="--no-sign"
if [[ "$BRANCH" == "master" ]] || [[ "$BRANCH" == "rpm-build" ]] || [[ "$BRANCH" == "releases" ]] ; then
    if [[ ! -z $SECCUBUS_GPG_KEY ]] ; then
        echo Setting up gpg
        set +x
        echo $SECCUBUS_GPG_KEY | sed 's/\\n/\n/g' > /tmp/gpg.key
        gpg --import --batch --yes /tmp/gpg.key
        rm /tmp/gpg.key
        echo "%_gpg_name Seccubus" > ~/.rpmmacros
        SIGN=" --sign "
        NOSIGN=" "
        if [[ $(grep -i centos /etc/redhat-release | wc -l) -eq 1 ]]; then
            echo
            NOPWD="rpm/nopwd.exp"
        fi
    fi
fi

set -x
echo "Creating directories"
mkdir -p /root/rpmbuild/SOURCES

echo "Copying files"
(cd /tmp; rm -f seccubus-$VERSION ; ln -s /root/project /tmp/seccubus-$VERSION;tar -czf /root/rpmbuild/SOURCES/seccubus-$VERSION.tar.gz --exclude "seccubus-$VERSION/tmp" --exclude "seccubus-$VERSION/build" seccubus-$VERSION/*)

echo "Building"
cat /root/project/rpm/seccubus.spec | sed "s/master$/$VERSION/" | sed "s/^Release\\:    0$/Release:    $COMMITS/" >/root/rpmbuild/SOURCES/seccubus.spec
$NOPWD /usr/bin/rpmbuild $SIGN -ba /root/rpmbuild/SOURCES/seccubus.spec

if [[ $(grep -i centos /etc/redhat-release|wc -l) -eq 1 ]]; then
    yum install -y epel-release
    yum install -y perl-libwww-perl gcc "perl(Module::Build)" "perl(JSON::PP)" "perl(IO::Socket::IP)" "perl(Pod::Parser)" \
        "perl(Canary::Stability)" "perl(common::sense)"
    curl -Ls http://cpanmin.us | perl - App::cpanminus

    [[ ! -e /tmp/cpan2rpm ]] && (cd /tmp;git clone https://github.com/ekkis/cpan2rpm.git --depth=1)
    if [[ $(/tmp/cpan2rpm/cpan2rpm -V) == '2.031' ]]; then
        (cd /tmp/;rm -rf cpan2rpm;git clone https://github.com/seccubus/cpan2rpm.git;cd cpan2rpm;git checkout fix-metacpan)
    fi

    cpanm IO::Socket::IP
    VER=$(cpanm IO::Socket::IP | sed 's/.*(//' | sed 's/).*//')
    set +x
    $NOPWD /tmp/cpan2rpm/cpan2rpm IO::Socket::IP --version $VER $NOSIGN
    cpanm List::Util
    rm -f /usr/local/lib64/perl5/Scalar/Util.pm
    $NOPWD /tmp/cpan2rpm/cpan2rpm List::Util $NOSIGN
    $NOPWD /tmp/cpan2rpm/cpan2rpm Sub::Util $NOSIGN
    $NOPWD /tmp/cpan2rpm/cpan2rpm Mojolicious $NOSIGN
    if [[ -z "$NOPWD" ]]; then
        echo y | /tmp/cpan2rpm/cpan2rpm EV $NOSIGN
        (echo y;echo y)| /tmp/cpan2rpm/cpan2rpm IO::Socket::SSL $NOSIGN
    else
        $NOPWD echo y \| /tmp/cpan2rpm/cpan2rpm EV $NOSIGN
        $NOPWD \(echo y\;echo y\) \| /tmp/cpan2rpm/cpan2rpm IO::Socket::SSL $NOSIGN
    fi
    set -x
fi

find /root/rpmbuild -name "*.rpm" -exec cp {} /root/project/build \;

if [[ $(grep -i centos /etc/redhat-release|wc -l) -eq 1 ]]; then
    for OLD in $(ls build/perl-*.noarch.rpm build/perl-*.x86_64.rpm); do
        NEW=${OLD//-1.x86_64./-1.el7.x86_64.}
        NEW=${NEW//-1.noarch./-1.el7.noarch.}
        mv $OLD $NEW
    done
fi

exit


text:
"""Network simulation adapter using a user-level UDP proxy."""
from twisted.internet import protocol
from twisted.internet import reactor

# Header bytes in each UDP packet. Used for bandwidth estimation.
OVERHEAD = 28

# Unlike nfqueue, no special action is needed to drop a packet.
DROP = lambda: None

def configure(port, proxy_port, pipes):
  """Starts a UDP proxy server on localhost.

  Returns the proxy port number, which is the same as the proxy_port param
  unless zero is passed in.
  """
  server = ProxyServer(port, pipes)
  port = reactor.listenUDP(proxy_port, server.udp)
  return port.getHost().port

class UDP(protocol.DatagramProtocol):
  """Lightweight interface for Twisted UDP functionality.

  This exists to make it easier to test the interesting stuff, by isolating all
  of the network interaction and Twisted inheritance.
  """
  def __init__(self, receiver):
    self.receiver = receiver

  def Send(self, data, address):
    self.transport.write(data, address)

  def datagramReceived(self, *args):
    """Invoked by Twisted."""
    self.receiver(*args)

class ProxyServer(object):
  """Proxies a UDP server. Incoming packets are from clients.

  Creates a UDP socket for each address it receives data from, and uses it as
  as a proxy client for the server. This is so that the port for an incoming
  packet from the server can be used to determine which client it should be
  relayed to.
  """
  def __init__(self, port, pipes):
    self.udp = UDP(self.Receive)
    self.server_address = ('127.0.0.1', port)
    self.proxy_clients = {}
    self.pipes = pipes

  def Receive(self, data, address):
    """Invoked by Twisted when a packet arrives at the client-facing port.

    Relays the packet to the server using the appropriate proxy client.
    """
    proxy_client = self._GetProxyClient(address)
    def callback():
      proxy_client.udp.Send(data, self.server_address)
    self.pipes.up.attempt(callback, DROP, len(data) + OVERHEAD)

  def _GetProxyClient(self, address):
    """Gets a proxy client for a given client address.

    Returns the new proxy client, or an existing one if the address has been
    used before.
    """
    if address in self.proxy_clients:
      proxy_client = self.proxy_clients[address]
    else:
      proxy_client = ProxyClient(self, address)
      self.proxy_clients[address] = proxy_client
      reactor.listenUDP(0, proxy_client.udp)

    return proxy_client

class ProxyClient(object):
  """Proxies a UDP client. Incoming packets are from the server."""
  def __init__(self, proxy_server, relay_address):
    self.udp = UDP(self.Receive)
    self.proxy_server = proxy_server
    self.relay_address = relay_address

  def Receive(self, data, ignore_address):
    """Invoked by Twisted when a packet arrives from the server.

    Relays the packet to the actual client, via ProxyServer.
    """
    def callback():
      self.proxy_server.udp.Send(data, self.relay_address)
    self.proxy_server.pipes.down.attempt(callback, DROP, len(data) + OVERHEAD)


text:
#include "OverlayWidget.h"

#include <QFile>
#include <QGridLayout>
#include <QHBoxLayout>
#include <QStyle>
#include <QTime>

OverlayWidget::OverlayWidget(QWidget *parent)
    : QWidget(0, Qt::FramelessWindowHint)
    , m_isPaused(false)
    , m_isMuted(false)
{
    applyStyleSheet();

    m_playIcon = QIcon(":/images/button_play.png");
    m_pauseIcon = QIcon(":/images/button_pause.png");
    m_soundOnIcon = QIcon(":/images/button_sound_on.png");
    m_soundOffIcon = QIcon(":/images/button_sound_off.png");

    m_controlButton = new PlayerButton(this);
    m_controlButton->setIcon(m_pauseIcon);
    connect(m_controlButton, SIGNAL(clicked()), this, SLOT(onControlClicked()));

    m_progressSlider = new QSlider(Qt::Horizontal, this);
    connect(m_progressSlider, SIGNAL(sliderMoved(int)), this, SLOT(onSliderMoved(int)));

    m_positionLabel = new QLabel(this);
    m_positionLabel->setText(timeToString(0));
    m_durationLabel = new QLabel(this);

    m_soundButton = new PlayerButton(this);
    m_soundButton->setIcon(m_soundOnIcon);
    connect(m_soundButton, SIGNAL(clicked()), this, SLOT(onSoundClicked()));

    m_closeButton = new PlayerButton(this);
    m_closeButton->setIcon(QIcon(":/images/button_close.png"));
    connect(m_closeButton, SIGNAL(clicked()), this, SLOT(onCloseClicked()));

    m_volumeSlider = new QSlider(Qt::Vertical, this);
    m_volumeSlider->setRange(0, 100);
    connect(m_soundButton, SIGNAL(tapAndHold()), m_volumeSlider, SLOT(show()));
    connect(m_volumeSlider, SIGNAL(sliderReleased()), this, SLOT(onVolumeSliderReleased()));
    connect(m_volumeSlider, SIGNAL(sliderMoved(int)), this, SLOT(onVolumeSliderMoved(int)));
    m_volumeSlider->hide();

    m_playerLabel = new PlayerLabel(this);
    m_playerLabel->hide();

    QBoxLayout* m_controlLayout = new QHBoxLayout;
    m_controlLayout->addWidget(m_controlButton);
    m_controlLayout->addWidget(m_positionLabel);
    m_controlLayout->addWidget(m_progressSlider);
    m_controlLayout->addWidget(m_durationLabel);

    QGridLayout* layout = new QGridLayout;
    layout->addWidget(m_closeButton, 0, 0, 1, 2, Qt::AlignRight | Qt::AlignTop);
    layout->addWidget(m_playerLabel, 1, 0, Qt::AlignCenter);
    layout->addWidget(m_volumeSlider, 1, 1);
    layout->addLayout(m_controlLayout, 2, 0, Qt::AlignBottom);
    layout->addWidget(m_soundButton, 2, 1, Qt::AlignBottom);
    setLayout(layout);

    m_hideWidgetTimer = new QTimer(this);
    m_hideWidgetTimer->setSingleShot(true);
    m_hideWidgetTimer->setInterval(3000);
    connect(m_hideWidgetTimer, SIGNAL(timeout()), this, SLOT(onTimerTimeout()));
    connect(m_progressSlider, SIGNAL(sliderPressed()), m_hideWidgetTimer, SLOT(stop()));
    connect(m_progressSlider, SIGNAL(sliderReleased()), m_hideWidgetTimer, SLOT(start()));
    connect(m_volumeSlider, SIGNAL(sliderPressed()), m_hideWidgetTimer, SLOT(stop()));

    setAttribute(Qt::WA_TranslucentBackground);
}

OverlayWidget::~OverlayWidget()
{
}

void OverlayWidget::setDuration(int duration)
{
    m_progressSlider->setMaximum(duration);
    m_durationLabel->setText(timeToString(duration));
}

void OverlayWidget::setPosition(int position)
{
    if (!m_progressSlider->isSliderDown()) {
        m_progressSlider->setValue(position);
        m_positionLabel->setText(timeToString(position));
    }
}

void OverlayWidget::setVolume(int volume)
{
    m_volumeSlider->setValue(volume);
}

void OverlayWidget::mousePressEvent(QMouseEvent *)
{
    m_hideWidgetTimer->stop();
    hide();
}

void OverlayWidget::onPlayerStopped()
{
    m_controlButton->setIcon(m_playIcon);
}

void OverlayWidget::onPlayerError()
{
    m_controlButton->setDisabled(true);
    m_progressSlider->setDisabled(true);
    m_playerLabel->onPlayerError();
    showFullScreen();
}

void OverlayWidget::onEndOfMedia()
{
    QWidget::showFullScreen();
}

void OverlayWidget::onBufferingMedia()
{
    m_playerLabel->startBufferingAnimation();
}

void OverlayWidget::onBufferedMedia()
{
    m_playerLabel->stopBufferingAnimation();
}

QString OverlayWidget::timeToString(int seconds)
{
    QTime initTime(0, 0, 0);
    QTime time = initTime.addSecs(seconds);
    return time.hour() ? time.toString("h:mm:ss") : time.toString("mm:ss");
}

void OverlayWidget::applyStyleSheet()
{
    QFile file(":/qss/OverlayWidget.qss");
    file.open(QFile::ReadOnly);
    setStyleSheet(QLatin1String(file.readAll()));
}

void OverlayWidget::onControlClicked()
{
    m_isPaused = !m_isPaused;
    if (m_isPaused) {
        m_controlButton->setIcon(m_playIcon);
        m_hideWidgetTimer->stop();
    } else {
        m_controlButton->setIcon(m_pauseIcon);
        m_hideWidgetTimer->start();
    }
    emit controlClicked(m_isPaused);
}

void OverlayWidget::onSliderMoved(int value)
{
    emit sliderMoved(value);
}

void OverlayWidget::onSoundClicked()
{
    if (m_volumeSlider->isVisible())
        m_isMuted = false;
    else
        m_isMuted = !m_isMuted;

    if (m_isMuted)
        m_soundButton->setIcon(m_soundOffIcon);
    else
        m_soundButton->setIcon(m_soundOnIcon);

    m_hideWidgetTimer->start();
    emit muted(m_isMuted);
}

void OverlayWidget::onCloseClicked()
{
    m_hideWidgetTimer->stop();
    hide();
    emit closeClicked();
}

void OverlayWidget::onVolumeSliderReleased()
{
    m_hideWidgetTimer->start();
    emit volumeChanged(m_volumeSlider->value());
    m_volumeSlider->hide();
}

void OverlayWidget::onVolumeSliderMoved(int value)
{
    emit volumeChanged(value);
}

void OverlayWidget::onTimerTimeout()
{
    if (!m_isPaused)
        hide();
}

void OverlayWidget::showFullScreen()
{
    m_hideWidgetTimer->start();
    QWidget::showFullScreen();
}


text:
deltaspike-helloworld-jms: HelloWorld JMS Example Using DeltaSpike Configuration Properties
======================
Author: Weston Price, Rafael Benevides
Level: Intermediate
Technologies: JMS, CDI, DeltaSpike
Summary: Demonstrates a JMS client using DeltaSpike configuration properties
Target Product: WFK
Source: <https://github.com/jboss-jdf/jboss-as-quickstart/>

What is it?
-----------

This quickstart demonstrates the use of  JMS clients with JBoss Enterprise Application Platform 6 or JBoss AS 7 using DeltaSpike configuration properties.

It contains the following:

1. A message producer that sends messages to a JMS destination deployed to a JBoss Enterprise Application Platform 6 or JBoss AS 7 server.

2. A message consumer that receives message from a JMS destination deployed to a JBoss Enterprise Application Platform 6 or JBoss AS 7 server.

System requirements
-------------------

All you need to build this project is Java 6.0 (Java SDK 1.6) or better, Maven 3.0 or better.

The application this project produces is designed to be run on JBoss Enterprise Application Platform 6 or JBoss AS 7.

Configure Maven
---------------

If you have not yet done so, you must [Configure Maven](../README.md#configure-maven) before testing the quickstarts.

Add an Application User
-----------------------
This quickstart uses secured management interfaces and requires that you create an application user to access the running application. Instructions to set up the quickstart application user can be found here: [Add an Application User](../README.md#add-an-application-user)

Configure the JBoss Enterprise Application Platform 6 server
------------------------------------------------------------

If you are using the JBoss AS 7 Quickstart distribution, the server configuration file already contains the JMS `test` queue and you can skip this step.

However, if you are using the JBoss Enterprise Application Platform 6 distribution, you need to add the JMS `test` queue to the application server configuration file. You can configure JMS by running the  `configure-jms.cli` script provided in the root directory of this quickstart, by using the JBoss CLI interactively, or by manually editing the configuration file.

_NOTE - Before you begin:_

1. If it is running, stop the JBoss Enterprise Application Platform 6 or JBoss AS 7 Server.
2. Backup the file: `JBOSS_HOME/standalone/configuration/standalone-full.xml`
3. After you have completed testing this quickstart, you can replace this file to restore the server to its original configuration.

#### Configure JMS by Running the JBoss CLI Script

1. Start the JBoss Enterprise Application Platform 6 or JBoss AS 7 Server by typing the following:

        For Linux:  JBOSS_HOME_SERVER_1/bin/standalone.sh -c standalone-full.xml
        For Windows:  JBOSS_HOME_SERVER_1\bin\standalone.bat -c standalone-full.xml
2. Open a new command line, navigate to the root directory of this quickstart, and run the following command, replacing JBOSS_HOME with the path to your server:

        JBOSS_HOME/bin/jboss-cli.sh --connect --file=configure-jms.cli
This script adds the `test` queue to the `messaging` subsystem in the server configuration. You should see the following result when you run the script:

        #1 jms-queue add --queue-address=testQueue --entries=queue/test,java:jboss/exported/jms/queue/test
        The batch executed successfully.
        {"outcome" => "success"}

#### Configure JMS Using the JBoss CLI Tool Interactively

1. Start the JBoss Enterprise Application Platform 6 or JBoss AS 7 Server by typing the following:

        For Linux:  JBOSS_HOME_SERVER_1/bin/standalone.sh -c standalone-full.xml
        For Windows:  JBOSS_HOME_SERVER_1\bin\standalone.bat -c standalone-full.xml
2. To start the JBoss CLI tool, open a new command line, navigate to the JBOSS_HOME directory, and type the following:

        For Linux: bin/jboss-cli.sh --connect
        For Windows: bin\jboss-cli.bat --connect
3. At the prompt, type the following:

        [standalone@localhost:9999 /] jms-queue add --queue-address=testQueue --entries=queue/test,java:jboss/exported/jms/queue/test

#### Configure JMS by Manually Editing the Server Configuration File

1.  If it is running, stop the JBoss Enterprise Application Platform 6 or JBoss AS 7 Server.
2.  Backup the file: `JBOSS_HOME/standalone/configuration/standalone-full.xml`
3.  Open the file: JBOSS_HOME/standalone/configuration/standalone-full.xml
4.  Add the JMS `test` queue as follows:
    * Find the messaging subsystem:

            <subsystem xmlns="urn:jboss:domain:messaging:1.1">
    * Scroll to the end of this section and add the following XML after the `</jms-connection-factories>` end tag but before the `</hornetq-server>` element:

                <jms-destinations>
                    <jms-queue name="testQueue">
                        <entry name="queue/test"/>
                        <entry name="java:jboss/exported/jms/queue/test"/>
                    </jms-queue>
                </jms-destinations>
    * Save the changes and close the file.

Start JBoss Enterprise Application Platform 6 or JBoss AS 7 with the Full Profile
---------------------------------------------------------------------------------

1. Open a command line and navigate to the root of the JBoss server directory.
2. The following shows the command line to start the server with the full profile:

        For Linux:   JBOSS_HOME/bin/standalone.sh -c standalone-full.xml
        For Windows: JBOSS_HOME\bin\standalone.bat -c standalone-full.xml

Build and Deploy the Quickstart
-------------------------------

_NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must include Maven setting arguments on the command line. See [Build and Deploy the Quickstarts](../README.md#build-and-deploy-the-quickstarts) for complete instructions and additional options._

1. Make sure you have started the JBoss Server as described above.
2. Open a command line and navigate to the root directory of this quickstart.
3. Type this command to build and deploy the archive:

        mvn clean package jboss-as:deploy
4. This will deploy `target/jboss-as-deltaspike-helloworld-jms.war` to the running instance of the server.

Access the application
----------------------

Access the running application in a browser at the following URL:  <http://localhost:8080/jboss-as-deltaspike-helloworld-jms/>

1. You are presented with a simple form that has some values already filled.
2. Click on `Send Messages` button.
3. Investigate the Console Output

If the command is successful, with the default configuration you will see output similar to this:

    08:46:52,961 INFO  [org.jboss.as.quickstarts.jms.controller.JmsClientController] (http--127.0.0.1-8080-2) Attempting to acquire connection factory "jms/RemoteConnectionFactory"
    08:46:53,041 INFO  [org.jboss.as.quickstarts.jms.controller.JmsClientController] (http--127.0.0.1-8080-2) Found connection factory "jms/RemoteConnectionFactory" in JNDI
    08:46:53,041 INFO  [org.jboss.as.quickstarts.jms.controller.JmsClientController] (http--127.0.0.1-8080-2) Attempting to acquire destination "jms/queue/test"
    08:46:53,050 INFO  [org.jboss.as.quickstarts.jms.controller.JmsClientController] (http--127.0.0.1-8080-2) Found destination "jms/queue/test" in JNDI
    08:46:53,151 INFO  [org.jboss.as.quickstarts.jms.controller.JmsClientController] (http--127.0.0.1-8080-2) Sending 1 messages with content: Hello, World from Deltaspike!
    08:46:53,164 INFO  [org.jboss.as.quickstarts.jms.controller.JmsClientController] (http--127.0.0.1-8080-2) Received message #1 with content: Hello, World from Deltaspike!

_Note_: After the above INFO message, you may see the following error. You can ignore the error as it is a well known error message and does not indicate the maven command was unsuccessful in any way.

    08:46:53,168 ERROR [org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1] (Remoting "config-based-naming-client-endpoint" task-3) Channel end notification received, closing channel Channel ID f777fa41 (outbound) of Remoting connection 45f04731 to null

Optional Properties
-------------------

This quickstart uses DeltaSpike to inject properties configuration.

The configuration is injected by using the `@ConfigProperty` annotation

        @Inject
        @ConfigProperty(name = "username", defaultValue = "quickstartUser")
        private String usernameConfig;

The following properties can be configured:

* `username`

    This username is used for both the JMS connection and the JNDI look-up.  Instructions to set up the quickstart application user can be found here: [Add an Application User](../README.md#add-an-application-user).

    Default: `quickstartUser`

* `password`

    This password is used for both the JMS connection and the JNDI look-up.  Instructions to set up the quickstart application user can be found here: [Add an Application User](../README.md#add-an-application-user)

    Default: `quickstartPwd1!`

* `connection.factory`

    The name of the JMS ConnectionFactory you want to use.

    Default: `jms/RemoteConnectionFactory`

* `destination`

    The name of the JMS Destination you want to use.

    Default: `jms/queue/test`

* `message.count`

    The number of JMS messages you want to produce and consume.

    Default: `1`

* `message.content`

    The content of the JMS TextMessage.

    Default: `"Hello, World!"`

* `java.naming.provider.url`

	  This property allows configuration of the JNDI directory used to lookup the JMS destination. This is useful when the client resides on another host.

    Default: `"localhost"`

You can overwrite these properties by adding the value that you want on file `src/main/resources/META-INF/apache-deltaspike.properties`

Undeploy the Archive
--------------------

1. Make sure you have started the JBoss Server as described above.
2. Open a command line and navigate to the root directory of this quickstart.
3. When you are finished testing, type this command to undeploy the archive:

        mvn jboss-as:undeploy

Remove the JMS Configuration
----------------------------

You can remove the JMS configuration by running the  `remove-jms.cli` script provided in the root directory of this quickstart or by manually restoring the back-up copy the configuration file.

#### Remove the JMS Configuration by Running the JBoss CLI Script

1. Start the JBoss Enterprise Application Platform 6 or JBoss AS 7 Server by typing the following:

        For Linux:  JBOSS_HOME_SERVER_1/bin/standalone.sh -c standalone-full.xml
        For Windows:  JBOSS_HOME_SERVER_1\bin\standalone.bat -c standalone-full.xml
2. Open a new command line, navigate to the root directory of this quickstart, and run the following command, replacing JBOSS_HOME with the path to your server:

        JBOSS_HOME/bin/jboss-cli.sh --connect --file=remove-jms.cli
This script removes the `test` queue from the `messaging` subsystem in the server configuration. You should see the following result when you run the script:

        #1 jms-queue remove --queue-address=testQueue
        The batch executed successfully.
        {"outcome" => "success"}

#### Remove the JMS Configuration Manually
1. If it is running, stop the JBoss Enterprise Application Platform 6 or JBoss AS 7 Server.
2. Replace the `JBOSS_HOME/standalone/configuration/standalone-full.xml` file with the back-up copy of the file.

Run the Quickstart in JBoss Developer Studio or Eclipse
-------------------------------------

You can also start the server and deploy the quickstarts from Eclipse using JBoss tools. For more information, see [Use JBoss Developer Studio or Eclipse to Run the Quickstarts](../README.md#use-jboss-developer-studio-or-eclipse-to-run-the-quickstarts)

Debug the Application
------------------------------------

If you want to debug the source code or look at the Javadocs of any library in the project, run either of the following commands to pull them into your local repository. The IDE should then detect them.

    mvn dependency:sources
    mvn dependency:resolve -Dclassifier=javadoc


text:
看看Android中如何绘制Text

	void OpenGLRenderer::drawText(const char* text, int bytesCount, int count, float x, float y,
	        const float* positions, const SkPaint* paint, float totalAdvance, const Rect& bounds,
	        DrawOpMode drawOpMode) {

	    if (drawOpMode == DrawOpMode::kImmediate) {
	        // The checks for corner-case ignorable text and quick rejection is only done for immediate
	        // drawing as ops from DeferredDisplayList are already filtered for these
	        if (text == nullptr || count == 0 || mState.currentlyIgnored() || canSkipText(paint) ||
	                quickRejectSetupScissor(bounds)) {
	            return;
	        }
	    }

	    const float oldX = x;
	    const float oldY = y;

	    const mat4& transform = *currentTransform();
	    const bool pureTranslate = transform.isPureTranslate();

	    if (CC_LIKELY(pureTranslate)) {
	        x = floorf(x + transform.getTranslateX() + 0.5f);
	        y = floorf(y + transform.getTranslateY() + 0.5f);
	    }

	    int alpha;
	    SkXfermode::Mode mode;
	    getAlphaAndMode(paint, &alpha, &mode);

	    FontRenderer& fontRenderer = mCaches.fontRenderer->getFontRenderer(paint);

	    if (CC_UNLIKELY(hasTextShadow(paint))) {
	        fontRenderer.setFont(paint, SkMatrix::I());
	        drawTextShadow(paint, text, bytesCount, count, positions, fontRenderer,
	                alpha, oldX, oldY);
	    }

	    const bool hasActiveLayer = hasLayer();

	    // We only pass a partial transform to the font renderer. That partial
	    // matrix defines how glyphs are rasterized. Typically we want glyphs
	    // to be rasterized at their final size on screen, which means the partial
	    // matrix needs to take the scale factor into account.
	    // When a partial matrix is used to transform glyphs during rasterization,
	    // the mesh is generated with the inverse transform (in the case of scale,
	    // the mesh is generated at 1.0 / scale for instance.) This allows us to
	    // apply the full transform matrix at draw time in the vertex shader.
	    // Applying the full matrix in the shader is the easiest way to handle
	    // rotation and perspective and allows us to always generated quads in the
	    // font renderer which greatly simplifies the code, clipping in particular.
	    SkMatrix fontTransform;
	    bool linearFilter = findBestFontTransform(transform, &fontTransform)
	            || fabs(y - (int) y) > 0.0f
	            || fabs(x - (int) x) > 0.0f;
	    fontRenderer.setFont(paint, fontTransform);
	    fontRenderer.setTextureFiltering(linearFilter);

	    // TODO: Implement better clipping for scaled/rotated text
	    const Rect* clip = !pureTranslate ? nullptr : &mState.currentClipRect();
	    Rect layerBounds(FLT_MAX / 2.0f, FLT_MAX / 2.0f, FLT_MIN / 2.0f, FLT_MIN / 2.0f);

	    bool status;
	    TextDrawFunctor functor(this, x, y, pureTranslate, alpha, mode, paint);

	    // don't call issuedrawcommand, do it at end of batch
	    bool forceFinish = (drawOpMode != DrawOpMode::kDefer);
	    if (CC_UNLIKELY(paint->getTextAlign() != SkPaint::kLeft_Align)) {
	        SkPaint paintCopy(*paint);
	        paintCopy.setTextAlign(SkPaint::kLeft_Align);
	        status = fontRenderer.renderPosText(&paintCopy, clip, text, 0, bytesCount, count, x, y,
	                positions, hasActiveLayer ? &layerBounds : nullptr, &functor, forceFinish);
	    } else {
	        status = fontRenderer.renderPosText(paint, clip, text, 0, bytesCount, count, x, y,
	                positions, hasActiveLayer ? &layerBounds : nullptr, &functor, forceFinish);
	    }

	    if ((status || drawOpMode != DrawOpMode::kImmediate) && hasActiveLayer) {
	        if (!pureTranslate) {
	            transform.mapRect(layerBounds);
	        }
	        dirtyLayerUnchecked(layerBounds, getRegion());
	    }

	    drawTextDecorations(totalAdvance, oldX, oldY, paint);

	    mDirty = true;
	}

	bool FontRenderer::renderPosText(const SkPaint* paint, const Rect* clip, const char *text,
	        uint32_t startIndex, uint32_t len, int numGlyphs, int x, int y,
	        const float* positions, Rect* bounds, TextDrawFunctor* functor, bool forceFinish) {
	    if (!mCurrentFont) {
	        ALOGE("No font set");
	        return false;
	    }

	    initRender(clip, bounds, functor);
	    mCurrentFont->render(paint, text, startIndex, len, numGlyphs, x, y, positions);

	    if (forceFinish) {
	        finishRender();
	    }

	    return mDrawn;
	}

		void FontRenderer::setFont(const SkPaint* paint, const SkMatrix& matrix) {
	    mCurrentFont = Font::create(this, paint, matrix);
	}

	void Font::render(const SkPaint* paint, const char *text, uint32_t start, uint32_t len,
	        int numGlyphs, const SkPath* path, float hOffset, float vOffset) {
	    if (numGlyphs == 0 || text == nullptr || len == 0) {
	        return;
	    }

	    text += start;

	    int glyphsCount = 0;
	    SkFixed prevRsbDelta = 0;

	    float penX = 0.0f;

	    SkPoint position;
	    SkVector tangent;

	    SkPathMeasure measure(*path, false);
	    float pathLength = SkScalarToFloat(measure.getLength());

	    if (paint->getTextAlign() != SkPaint::kLeft_Align) {
	        float textWidth = SkScalarToFloat(paint->measureText(text, len));
	        float pathOffset = pathLength;
	        if (paint->getTextAlign() == SkPaint::kCenter_Align) {
	            textWidth *= 0.5f;
	            pathOffset *= 0.5f;
	        }
	        penX += pathOffset - textWidth;
	    }

	    while (glyphsCount < numGlyphs && penX < pathLength) {
	        glyph_t glyph = GET_GLYPH(text);

	        if (IS_END_OF_STRING(glyph)) {
	            break;
	        }

	        CachedGlyphInfo* cachedGlyph = getCachedGlyph(paint, glyph);
	        penX += SkFixedToFloat(AUTO_KERN(prevRsbDelta, cachedGlyph->mLsbDelta));
	        prevRsbDelta = cachedGlyph->mRsbDelta;

	        if (cachedGlyph->mIsValid && cachedGlyph->mCacheTexture) {
	            drawCachedGlyph(cachedGlyph, penX, hOffset, vOffset, measure, &position, &tangent);
	        }

	        penX += SkFixedToFloat(cachedGlyph->mAdvanceX);

	        glyphsCount++;
	    }
	}

Android 采用了FreeType字体光栅化库。它可以用来将字符栅格化并映射成位图以及提供其他字体相关业务的支持。

>Graphics: Memory used for graphics buffer queues to display pixels to the screen, including GL surfaces, GL textures, and so on. (Note that this is memory shared with the CPU, not dedicated GPU memory.)

这里需要注意的是GL surfaces所对应的内存中,并不会存在textures的内存,textures是CPU申请是,之后交给GPU,注意这里的dequeBuffer,GL surfaces可以申请多块内存,但是同一时刻,好像只会提交一块,对于硬件加速,什么时候,申请这块内存呢?什么时候创建GLSurface,在创建CanvasContext的时候,就会创建GLSurface,这里面CanvasContext的render其实就是OpenGLRenderer

	bool CanvasContext::initialize(ANativeWindow* window) {
	    setSurface(window);
	    if (mCanvas) return false;
	    mCanvas = new OpenGLRenderer(mRenderThread.renderState());
	    mCanvas->initProperties();
	    return true;
	}

	void CanvasContext::setSurface(ANativeWindow* window) {
	    ATRACE_CALL();

	    mNativeWindow = window;

	    if (mEglSurface != EGL_NO_SURFACE) {
	        mEglManager.destroySurface(mEglSurface);
	        mEglSurface = EGL_NO_SURFACE;
	    }

	    if (window) {
	    <!--创建EglSurface-->
	        mEglSurface = mEglManager.createSurface(window);
	    }

	    if (mEglSurface != EGL_NO_SURFACE) {
	        const bool preserveBuffer = (mSwapBehavior != kSwap_discardBuffer);
	        mBufferPreserved = mEglManager.setPreserveBuffer(mEglSurface, preserveBuffer);
	        mHaveNewSurface = true;

		<!--opengl的makecurrent逻辑-->
	        makeCurrent();
	    } else {
	        mRenderThread.removeFrameCallback(this);
	    }
	}

		void CanvasContext::makeCurrent() {
	    // TODO: Figure out why this workaround is needed, see b/13913604
	    // In the meantime this matches the behavior of GLRenderer, so it is not a regression
	    EGLint error = 0;
	    mHaveNewSurface |= mEglManager.makeCurrent(mEglSurface, &error);
	    if (error) {
	        setSurface(nullptr);
	    }
	}


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"

    android:id="@+id/nearby_facilities_container"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".va.facility.FacilitiesFragment">

    <com.bhargavms.dotloader.DotLoader
        android:id="@+id/facility_progressbar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_centerHorizontal="true"
        app:color_array="@array/dot_colors"
        app:dot_radius="12dp"
        app:number_of_dots="3"/>

    <TextView
        android:id="@+id/facility_loading_textview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:gravity="center_horizontal"
        android:layout_above="@id/facility_progressbar"
        android:layout_marginLeft="@dimen/activity_horizontal_margin"
        android:layout_marginRight="@dimen/activity_horizontal_margin"
        android:layout_marginTop="@dimen/activity_vertical_margin"
        android:layout_marginBottom="@dimen/activity_vertical_margin"
        android:textSize="25sp" />

    <Button
        android:id="@+id/retry_load_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:theme="@style/button"
        android:layout_below="@id/facility_loading_textview"
        android:layout_centerHorizontal="true"
        android:text="@string/retry"
        android:visibility="invisible"/>

    <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/swipeRefreshLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recycler_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scrollbars="vertical" />

    </android.support.v4.widget.SwipeRefreshLayout>

</RelativeLayout>


text:
<?php

namespace User\Controller;

use Base\Controller\CrudController;
use User\Entity\User;
use Zend\Paginator\Adapter\ArrayAdapter;
use Zend\Paginator\Paginator;
use Zend\View\Model\ViewModel;

class UsersController extends CrudController {

    public function __construct() {
        $this->entity = 'User\Entity\User';
        $this->form = '\User\Form\User';
        $this->service = 'User\Service\User';
        $this->controller = 'user';
        $this->route = 'user-admin';
    }
}


text:
module TestingModule
  class Bare
    def initialize
    end
  end
end


text:
namespace HamcrestQt {

bool StringEndsWith::evalSubstringOf(const QString &str) const
{
    return str.endsWith(substring);
}

QString StringEndsWith::relationship() const
{
    return QStringLiteral("ending with");
}

} // namespace HamcrestQt


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

  angular
    .module("app.about")
    .run(run);

  run.$inject = ["routerHelper"];
  /* @ngInject */
  function run(routerHelper) {
    routerHelper.configureStates(getStates());
  }

  function getStates() {
    return [
      {
        state: "about",
        config: {
          url: "/about",
          templateUrl: "app/about/about.html",
          controller: "AboutCtrl",
          controllerAs: "ac"
        }
      }
    ];
  }
})();


text:
.. _dojox/html/set:

==============
dojox.html.set
==============

:Authors: Sam Foster, Bill Keese, Frederic, Marcus Reimann
:Project owner: ?
:since: V1.2

.. contents ::
   :depth: 2

Extensions to content setting utilities in dojo.html

Introduction
============

dojox.html.set and its helper dojox.html._ContentSetter extend the content-setting available in their :ref:`dojo.html <dojo/html>` counterparts, by adding support for executing scripts, adding style. The _ContentSetter provides this functionality to the :ref:`dojox.layout.ContentPane <dojox/layout/ContentPane>` widget.

Be careful: Loading content with script and style blocks is often a questionable practice. A more secure and recommended solution is, to load just pure data with the help of the available Dojo datastores. But beside this general principle, there are also valid use cases, and times when loading content with scripts is the only option available. In such cases, dojox.html.set() can help you.

Usage
=====

.. js ::

  dojo.require("dojox.html._base");
  dojox.html.set(node, content, {
      executeScripts: true,
      scriptHasHooks: false,
      renderStyles: true
  });

===========  =======================  ======================================================================
Parameter    Type                     Description
===========  =======================  ======================================================================
node         DomNode                  The parent element that will receive the content.
content      String|DomNode|NodeList  The content to be set on the parent element. This can be an HTML string, a node reference or a NodeList, dojo.NodeList, Array or other enumerable list of nodes.
params       Object                   Optional. Optional flags/properties to configure the content-setting. See dojo.html._ContentSetter
===========  =======================  ======================================================================

Examples
========

Set content with styles
-----------------------

.. code-example::

  .. js ::

        dojo.require("dojox.html._base");
        dojo.ready(function(){
            var content = "
"
                +"The content."
                + "
"
                +"
"
                + "It can be an HTML string, a node reference or a NodeList, "
                + "dojo.NodeList, Array or other enumerable list of nodes."
                + "
";
            dojox.html.set(dojo.byId("myNode1"), content, {
                executeScripts: false,
                scriptHasHooks: false,
                renderStyles: true
            });
        });

  .. html ::

I'm an empty node

See also
========

* :ref:`Quickstart Tutorial: Using Dojo Data <quickstart/data/usingdatastores>`

  As a more secure alternative for loading pure data


text:
package com.anpmech.launcher;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;

public class LaunchableActivity {

    private static final String TAG = "LaunchableActivity";

    private final String mActivityLabel;

    @DrawableRes
    private final int mIconResource;

    private final Intent mLaunchIntent;

    private final Object mLock = new Object();

    private Drawable mActivityIcon;

    private long mLastLaunchTime;

    private int mPriority;

    private long mUsageTime;

    private int mUsagesQuantity;

    public LaunchableActivity(@NonNull final Intent intent, @NonNull final String activityLabel,
            @DrawableRes final int iconResource) {
        mLaunchIntent = intent;
        mActivityLabel = activityLabel;
        mIconResource = iconResource;
    }

    /**
     * This is a convenience method to create a LaunchableActivity.
     *
     * @param info The {@link ActivityInfo} to extract information from.
     * @param pm   The PackageManager to use to extract information from.
     * @return A LaunchableActivity based off the ActivityInfo given.
     */
    public static LaunchableActivity getLaunchable(@NonNull final ActivityInfo info,
            @NonNull final PackageManager pm) {
        final Intent launchIntent = new Intent(Intent.ACTION_MAIN);
        final String label = info.loadLabel(pm).toString();
        final int iconResource = info.getIconResource();

        launchIntent.addCategory(Intent.CATEGORY_LAUNCHER);
        launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
                Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
        launchIntent.setComponent(new ComponentName(info.packageName, info.name));

        return new LaunchableActivity(launchIntent, label, iconResource);
    }

    public void addUsage() {
        mUsagesQuantity++;
    }

    public void deleteActivityIcon() {
        synchronized (mLock) {
            mActivityIcon = null;
        }
    }

    @Nullable
    public Drawable getActivityIcon(final Context context, final int iconSizePixels) {
        if (!isIconLoaded()) {
            synchronized (mLock) {
                try {
                    final PackageManager pm = context.getPackageManager();
                    final Resources resources = pm.getResourcesForActivity(getComponent());

                    //noinspection deprecation
                    mActivityIcon = resources.getDrawable(mIconResource);

                } catch (PackageManager.NameNotFoundException | Resources.NotFoundException e) {
                    Log.e(TAG, "Error when trying to inflate a launcher icon.", e);
                }

                //rescaling the icon if it is bigger than the target size
                //TODO do this when it is not a bitmap drawable?
                if (mActivityIcon instanceof BitmapDrawable) {
                    if (mActivityIcon.getIntrinsicHeight() > iconSizePixels &&
                            mActivityIcon.getIntrinsicWidth() > iconSizePixels) {
                        //noinspection deprecation
                        mActivityIcon = new BitmapDrawable(
                                Bitmap.createScaledBitmap(
                                        ((BitmapDrawable) mActivityIcon).getBitmap()
                                        , iconSizePixels, iconSizePixels, false));
                    }
                }
            }
        }
        return mActivityIcon;
    }

    public ComponentName getComponent() {
        return mLaunchIntent.getComponent();
    }

    public Intent getLaunchIntent() {
        return mLaunchIntent;
    }

    public long getLaunchTime() {
        return mLastLaunchTime;
    }

    public int getPriority() {
        return mPriority;
    }

    public int getUsageQuantity() {
        return mUsagesQuantity;
    }

    /**
     * This method returns the usage time.
     * <p>
     * The usage time will be set if it is supported by Android and the permission is
     * granted by the user.
     *
     * @return The usage time, -1L if not supported for whatever reason.
     */
    public long getUsageTime() {
        return mUsageTime;
    }

    public boolean isIconLoaded() {
        return mActivityIcon != null;
    }

    public void setLaunchTime() {
        mLastLaunchTime = System.currentTimeMillis() / 1000;
    }

    public void setLaunchTime(final long timestamp) {
        mLastLaunchTime = timestamp;
    }

    public void setPriority(final int priority) {
        mPriority = priority;
    }

    public void setUsageQuantity(final int usagesQuantity) {
        mUsagesQuantity = usagesQuantity;
    }

    /**
     * This method sets the usage time.
     *
     * @param usageTime The usage time, this shall be -1L if not supported for whatever reason.
     */
    public void setUsageTime(final long usageTime) {
        mUsageTime = usageTime;
    }

    @Override
    public String toString() {
        return mActivityLabel;
    }
}


text:
require 'rails_helper'

describe 'generate report', type: :feature, vcr: true do
  if Search.plos?
    it 'loads the visualization for multiple works', js: true do
      visit '/'
      sign_in

      fill_in 'everything', with: 'cancer'
      click_button 'Search'
      expect(page).to have_content 'Cancer-Drug Associations: A Complex System'
      expect(page).to have_button('Preview List (0)', disabled: true)

      first('.work-info').find('input.check-save-work').click
      expect(page).to have_button('Preview List (1)')
      all('.work-info')[5].find('input.check-save-work').click
      expect(page).to have_button('Preview List (2)')
      find_button('Preview List (2)').click
      expect(page).to have_content 'Cancer-Drug Associations: A Complex System'
      click_button 'Create Report'

      expect(page).to have_content('Metrics Data')

      visit '/'
      expect(page).to have_content('Your previous reports')
      expect(page).to have_css('a .number')
    end
  elsif Search.crossref?
    it "loads the visualization for a multiple works", js: true do
      visit "/"
      sign_in

      fill_in "everything",
        with: "A Future Vision for PLOS Computational Biology"

      click_button "Search"

      first(".work-info").find("input.check-save-work").click
      expect(page).to have_button("Preview List (1)")
      click_link("3")

      all(".work-info")[2].find("input.check-save-work").click

      expect(page).to have_button("Preview List (2)")
      find_button("Preview List (2)").click
      expect(page).to have_content "A Future Vision for PLOS Computational Biology"
      click_button "Create Report"

      expect(page).to have_content("Metrics Data")

      visit '/'
      expect(page).to have_content('Your previous reports')
      expect(page).to have_css('a .number')
    end
  end
end


text:
package com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile;

import com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration;
import com.netflix.spinnaker.halyard.core.resource.v1.StringResource;
import com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public abstract class TemplateBackedProfileFactory extends ProfileFactory {
  protected abstract String getTemplate();

  protected abstract Map<String, Object> getBindings(
      DeploymentConfiguration deploymentConfiguration,
      Profile profile,
      SpinnakerRuntimeSettings endpoints);

  protected List<String> requiredFiles(DeploymentConfiguration deploymentConfiguration) {
    return new ArrayList<>();
  }

  @Override
  protected Profile getBaseProfile(String name, String version, String outputFile) {
    return new Profile(name, version, outputFile, getTemplate());
  }

  @Override
  protected void setProfile(
      Profile profile,
      DeploymentConfiguration deploymentConfiguration,
      SpinnakerRuntimeSettings endpoints) {
    StringResource template = new StringResource(profile.getBaseContents());
    profile.setRequiredFiles(requiredFiles(deploymentConfiguration));
    Map<String, Object> bindings = getBindings(deploymentConfiguration, profile, endpoints);
    profile.setContents(template.setBindings(bindings).toString());
  }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.compomics.pride_asa_pipeline.core.repository.factory;

import com.compomics.pride_asa_pipeline.core.repository.FileParser;
import com.compomics.pride_asa_pipeline.core.repository.impl.MzIdentMlParser;
import com.compomics.pride_asa_pipeline.core.repository.impl.PrideXmlParser;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FilenameUtils;
import org.apache.log4j.Logger;

/**
 *
 * @author Kenneth Verheggen
 */
public class FileParserFactory {

    private static final Logger LOGGER = Logger.getLogger(FileParserFactory.class);
    private static File currentInputFile;
    private static FileParserType currentType;

    public static FileParser getFileParser(File inputFile) throws IOException {
        currentInputFile = inputFile;
        FileParser parser = null;
        String extension = FilenameUtils.getExtension(inputFile.getAbsolutePath()).toLowerCase();
        //TODO if extension =.gz ---> unzip ---> new extension
        if (extension.equalsIgnoreCase("zip")) {

        } else if (extension.equalsIgnoreCase("gz")) {

        } else if (extension.equalsIgnoreCase("rar")) {

        } else if (extension.equalsIgnoreCase("tar")) {

        }
        switch (extension.toLowerCase()) {
            case "mzid":
                LOGGER.info("Detected mzml file extension.");
                parser = new MzIdentMlParser();
                break;
            case "xml":
                LOGGER.info("Detected xml file extension.");
                parser = new PrideXmlParser();
                break;
            default:
                throw new IOException("Unsupported filetype for parameter-extraction : ." + extension);
        }
        return parser;
    }

    public static File getCurrentInputFile() {
        return currentInputFile;
    }

    public static void setCurrentInputFile(File currentInputFile) {
        FileParserFactory.currentInputFile = currentInputFile;
    }

    public static FileParserType getCurrentType() {
        return currentType;
    }

    public static void setCurrentType(FileParserType currentType) {
        FileParserFactory.currentType = currentType;
    }

}


text:
<?php
namespace Helloworld\Form;

use Zend\Form\Form;
use Zend\InputFilter\InputFilter;

class LoginFilter extends InputFilter
{
    public function __construct()
    {
        $this->add(
            array(
                'name' => 'username',
                'required' => true,
            )
        );

        $this->add(
            array(
                'name' => 'password',
                'required' => true
            )
        );
    }
}


text:
package wave

import "net/rpc"

// Server encapsulates the standard rpc.Server allowing for adding of aditional functions
// or hooking into existing rpc server functions.
type Server struct {
	*rpc.Server
}

// NewServer creates and returns a new instance of 'Server'
func NewServer() *Server {
	return &Server{
		Server: rpc.NewServer(),
	}
}

// TODO: hook into `Register` and `RegisterName` functions to provide service discovery
// functionality


text:
import { useEffect } from '@storybook/client-api';
import { tabs } from './tabs';
import { markdownDocumentationLinkBuilder } from '../../storybook-utilities/markdownDocumentationLinkBuilder';

export default {
  title: 'Components/Tabs',
  decorators: [
    (story) => `<div class="sprk-o-Box sprk-u-JavaScript">${story()}</div>`,
  ],
  parameters: {
    docs: { iframeHeight: 300 },
    info: `
${markdownDocumentationLinkBuilder('tabs')}
For this component to function properly, the
HTML must be structured correctly:

- The outer container must have the
\`data-sprk-navigation="tabs"\` attribute.
- The buttons container must have the \`role=tablist\`
attribute in order to correctly identify this control
to screen readers.
- Tabs buttons must have the following attributes:
    - \`role=tab\` to identify this control to screen readers.
    - \`aria-controls={id}\` to link the tab button
    with the associated tab content.
    - \`aria-selected=true\` when selected.
    - \`tabindex=0\` to place the control in the tab order
- Content panels must have the following attributes:
    - \`role=tabpanel\` to identify this control for screen readers.
    - \`aria-labelledby\` to link the content with the associated button.
    - \`tabindex=0\` to place the control in the tab order.
- The Tabs component makes use of the
\`sprk-u-JavaScript\` class to provide a graceful
degradation experience in environments where JavaScript
is not enabled. If \`sprk-u-JavaScript\` is not found on
the \`<html>\` element of the page, the content of all Tabs
panels will be visible. If \`sprk-u-JavaScript\` is present,
only one content panel will be visible at a time.
`,
  },
};

export const defaultStory = () => {
  useEffect(() => {
    tabs();
  }, []);

  return `

    <button
     class="sprk-c-Tabs__button sprk-c-Tabs__button--active"
     role="tab"
     aria-controls="target-1"
     aria-selected="true"
     id="tab-1"
     type="button"
     data-id="tab-1"
    >
      Tab 1
    </button>

    <button
     class="sprk-c-Tabs__button"
     role="tab"
     aria-controls="target-2"
     aria-selected="false"
     id="tab-2"
     type="button"
     data-id="tab-2"
    >
      Tab 2
    </button>

    <button
     class="sprk-c-Tabs__button"
     role="tab"
     aria-controls="target-3"
     aria-selected="false"
     id="tab-3"
     type="button"
     data-id="tab-3"
    >
      Tab 3
    </button>

Tab 1 Content Lorem ipsum dolor sit amet,
    consectetur adipiscing elit. Sed quis rhoncus ipsum. Nulla euismod nisi
    est, vel consequat ante consectetur in. Ut interdum dictum est at ornare.
    Nam nec dapibus nibh. Integer venenatis ex eu mi euismod, non ultricies
    lacus venenatis.

Tab 2 Content Lorem ipsum dolor sit amet,
    consectetur adipiscing elit. Sed quis rhoncus ipsum. Nulla euismod nisi
    est, vel consequat ante consectetur in. Ut interdum dictum est at ornare.
    Nam nec dapibus nibh.

Tab 3 Content Lorem ipsum dolor sit amet,
    consectetur adipiscing elit. Sed quis rhoncus ipsum. Nulla euismod nisi
    est, Integer venenatis ex eu mi euismod, non ultricies lacus venenatis.

`;
};

defaultStory.story = {
  name: 'Default',
  parameters: {
    jest: ['tabs'],
  },
};


text:
package ingester

import (
	"sync"
	"unsafe"

	"github.com/prometheus/common/model"
)

const (
	cacheLineSize = 64
)

// Avoid false sharing when using array of mutexes.
type paddedMutex struct {
	sync.Mutex
	pad [cacheLineSize - unsafe.Sizeof(sync.Mutex{})]byte
}

// fingerprintLocker allows locking individual fingerprints. To limit the number
// of mutexes needed for that, only a fixed number of mutexes are
// allocated. Fingerprints to be locked are assigned to those pre-allocated
// mutexes by their value. Collisions are not detected. If two fingerprints get
// assigned to the same mutex, only one of them can be locked at the same
// time. As long as the number of pre-allocated mutexes is much larger than the
// number of goroutines requiring a fingerprint lock concurrently, the loss in
// efficiency is small. However, a goroutine must never lock more than one
// fingerprint at the same time. (In that case a collision would try to acquire
// the same mutex twice).
type fingerprintLocker struct {
	fpMtxs    []paddedMutex
	numFpMtxs uint
}

// newFingerprintLocker returns a new fingerprintLocker ready for use.  At least
// 1024 preallocated mutexes are used, even if preallocatedMutexes is lower.
func newFingerprintLocker(preallocatedMutexes int) *fingerprintLocker {
	if preallocatedMutexes < 1024 {
		preallocatedMutexes = 1024
	}
	return &fingerprintLocker{
		make([]paddedMutex, preallocatedMutexes),
		uint(preallocatedMutexes),
	}
}

// Lock locks the given fingerprint.
func (l *fingerprintLocker) Lock(fp model.Fingerprint) {
	l.fpMtxs[hashFP(fp)%l.numFpMtxs].Lock()
}

// Unlock unlocks the given fingerprint.
func (l *fingerprintLocker) Unlock(fp model.Fingerprint) {
	l.fpMtxs[hashFP(fp)%l.numFpMtxs].Unlock()
}

// hashFP simply moves entropy from the most significant 48 bits of the
// fingerprint into the least significant 16 bits (by XORing) so that a simple
// MOD on the result can be used to pick a mutex while still making use of
// changes in more significant bits of the fingerprint. (The fast fingerprinting
// function we use is prone to only change a few bits for similar metrics. We
// really want to make use of every change in the fingerprint to vary mutex
// selection.)
func hashFP(fp model.Fingerprint) uint {
	return uint(fp ^ (fp >> 32) ^ (fp >> 16))
}


text:
"""Updates the Chrome reference builds.

Before running this script, you should first verify that you are authenticated
for SVN. You can do this by running:
  $ svn ls svn://svn.chromium.org/chrome/trunk/deps/reference_builds
You may need to get your SVN password from https://chromium-access.appspot.com/.

Usage:
  $ cd /tmp
  $ /path/to/update_reference_build.py
  $ cd reference_builds/reference_builds
  $ gcl change
  $ gcl upload <change>
  $ gcl commit <change>
"""

import collections
import logging
import os
import shutil
import subprocess
import sys
import urllib2
import zipfile

# Google storage location (no public web URL's), example:
# gs://chrome-unsigned/desktop-*/30.0.1595.0/precise32/chrome-precise32.zip
CHROME_GS_URL_FMT = ('gs://chrome-unsigned/desktop-*/%s/%s/%s')

def _ReportValueError(error_string):
  #TODO(aiolos): alert sheriffs via email when an error is seen.
  #This should be added when alerts are added when updating the build.
  raise ValueError(error_string)

class BuildUpdater(object):
  # Remove a platform name from this list to disable updating it.
  _REF_BUILD_PLATFORMS = ['Mac64', 'Win', 'Linux', 'Linux_x64']

  # Omaha is Chrome's autoupdate server. It reports the current versions used
  # by each platform on each channel.
  _OMAHA_PLATFORMS = ['mac', 'linux', 'win']

  # All of the information we need to update each platform.
  #   omaha: name omaha uses for the plaftorms.
  #   zip_name: name of the zip file to be retrieved from cloud storage.
  #   gs_build: name of the Chrome build platform used in cloud storage.
  #   destination: Name of the folder to download the reference build to.
  UpdateInfo = collections.namedtuple('UpdateInfo',
      'omaha, gs_build, zip_name, destination')
  _PLATFORM_MAP = { 'Mac64': UpdateInfo(omaha='mac',
                                        gs_build='mac64',
                                        zip_name='chrome-mac.zip',
                                        destination='chrome_mac'),
                    'Win': UpdateInfo(omaha='win',
                                      gs_build='win',
                                      zip_name='chrome-win.zip',
                                      destination='chrome_win'),
                    'Linux': UpdateInfo(omaha='linux',
                                        gs_build='precise32',
                                        zip_name='chrome-precise32.zip',
                                        destination='chrome_linux'),
                    'Linux_x64': UpdateInfo(omaha='linux',
                                            gs_build='precise64',
                                            zip_name='chrome-precise64.zip',
                                            destination='chrome_linux64')}

  def __init__(self):
    stable_versions = self._StableVersionsMap()
    current_versions = self._CurrentRefBuildsMap()
    self._platform_to_version_map = {}
    for platform in stable_versions:
      if (platform not in current_versions or
          stable_versions[platform] != current_versions[platform]):
        self._platform_to_version_map[platform] = stable_versions[platform]

  @classmethod
  def _StableVersionsMap(cls):
    omaha_versions_map = cls._OmahaVersionsMap()
    versions_map = {}
    for platform in cls._REF_BUILD_PLATFORMS:
      omaha_platform = cls._PLATFORM_MAP[platform].omaha
      if omaha_platform in omaha_versions_map:
        versions_map[platform] = omaha_versions_map[omaha_platform]
    return versions_map

  @classmethod
  def _OmahaReport(cls):
    url ='https://omahaproxy.appspot.com/all?channel=stable'
    lines = urllib2.urlopen(url).readlines()
    return [l.split(',') for l in lines]

  @classmethod
  def _OmahaVersionsMap(cls):
    platforms = cls._OMAHA_PLATFORMS
    rows = cls._OmahaReport()
    if (len(rows) < 1 or
        not rows[0][0:3] == ['os', 'channel', 'current_version']):
      _ReportValueError('Omaha report is not in the expected form: %s.'
                        % rows)
    versions_map = {}
    for row in rows[1:]:
      if row[1] != 'stable':
        _ReportValueError('Omaha report contains a line with the channel %s'
                          % row[1])
      if row[0] in platforms:
        versions_map[row[0]] = row[2]

    if not all(platform in versions_map for platform in platforms):
      _ReportValueError('Omaha report did not contain all desired platforms')
    return versions_map

  @classmethod
  def _CurrentRefBuildsMap(cls):
    #TODO(aiolos): Add logic for pulling the current reference build versions.
    # Return an empty dictionary to force an update until we store the builds in
    # in cloud storage.
    return {}

  @staticmethod
  def _GetCmdStatusAndOutput(args, cwd=None, shell=False):
    """Executes a subprocess and returns its exit code and output.

    Args:
      args: A string or a sequence of program arguments.
      cwd: If not None, the subprocess's current directory will be changed to
        |cwd| before it's executed.
      shell: Whether to execute args as a shell command.

    Returns:
      The tuple (exit code, output).
    """
    logging.info(str(args) + ' ' + (cwd or ''))
    p = subprocess.Popen(args=args, cwd=cwd, stdout=subprocess.PIPE,
                         stderr=subprocess.PIPE, shell=shell)
    stdout, stderr = p.communicate()
    exit_code = p.returncode
    if stderr:
      logging.critical(stderr)
    logging.info(stdout)
    return (exit_code, stdout)

  def _GetBuildUrl(self, platform, version, filename):
    """Returns the URL for fetching one file.

    Args:
      platform: Platform name, must be a key in |self._PLATFORM_MAP|.
      version: A Chrome version number, e.g. 30.0.1600.1.
      filename: Name of the file to fetch.

    Returns:
      The URL for fetching a file. This may be a GS or HTTP URL.
    """
    return CHROME_GS_URL_FMT % (
        version, self._PLATFORM_MAP[platform].gs_build, filename)

  def _FindBuildVersion(self, platform, version, filename):
    """Searches for a version where a filename can be found.

    Args:
      platform: Platform name.
      version: A Chrome version number, e.g. 30.0.1600.1.
      filename: Filename to look for.

    Returns:
      A version where the file could be found, or None.
    """
    # TODO(shadi): Iterate over official versions to find a valid one.
    return (version
            if self._DoesBuildExist(platform, version, filename) else None)

  def _DoesBuildExist(self, platform, version, filename):
    """Checks whether a file can be found for the given Chrome version.

    Args:
      platform: Platform name.
      version: Chrome version number, e.g. 30.0.1600.1.
      filename: Filename to look for.

    Returns:
      True if the file could be found, False otherwise.
    """
    url = self._GetBuildUrl(platform, version, filename)
    return self._DoesGSFileExist(url)

  def _DoesGSFileExist(self, gs_file_name):
    """Returns True if the GS file can be found, False otherwise."""
    exit_code = BuildUpdater._GetCmdStatusAndOutput(
        ['gsutil', 'ls', gs_file_name])[0]
    return not exit_code

  def _GetPlatformFiles(self, platform):
    """Returns the name of the zip file to fetch for |platform|."""
    return BuildUpdater._PLATFORM_MAP[platform].zip_name

  def _DownloadBuilds(self):
    for platform in self._platform_to_version_map:
      version = self._platform_to_version_map[platform]
      filename = self._GetPlatformFiles(platform)
      output = os.path.join('dl', platform,
                            '%s_%s_%s' % (platform,
                                          version,
                                          filename))
      if os.path.exists(output):
        logging.info('%s alread exists, skipping download', output)
        continue
      build_version = self._FindBuildVersion(platform, version, filename)
      if not build_version:
        logging.critical('Failed to find %s build for r%s\n', platform,
                         version)
        sys.exit(1)
      dirname = os.path.dirname(output)
      if dirname and not os.path.exists(dirname):
        os.makedirs(dirname)
      url = self._GetBuildUrl(platform, build_version, filename)
      self._DownloadFile(url, output)

  def _DownloadFile(self, url, output):
    logging.info('Downloading %s, saving to %s', url, output)
    BuildUpdater._GetCmdStatusAndOutput(['gsutil', 'cp', url, output])

  def _FetchSvnRepos(self):
    if not os.path.exists('reference_builds'):
      os.makedirs('reference_builds')
    BuildUpdater._GetCmdStatusAndOutput(
        ['gclient', 'config',
         'svn://svn.chromium.org/chrome/trunk/deps/reference_builds'],
        'reference_builds')
    BuildUpdater._GetCmdStatusAndOutput(
        ['gclient', 'sync'], 'reference_builds')

  def _UnzipFile(self, dl_file, dest_dir):
    """Unzips a file if it is a zip file.

    Args:
      dl_file: The downloaded file to unzip.
      dest_dir: The destination directory to unzip to.

    Returns:
      True if the file was unzipped. False if it wasn't a zip file.
    """
    if not zipfile.is_zipfile(dl_file):
      return False
    logging.info('Opening %s', dl_file)
    with zipfile.ZipFile(dl_file, 'r') as z:
      for content in z.namelist():
        dest = os.path.join(dest_dir, content[content.find('/')+1:])
        # Create dest parent dir if it does not exist.
        if not os.path.isdir(os.path.dirname(dest)):
          os.makedirs(os.path.dirname(dest))
        # If dest is just a dir listing, do nothing.
        if not os.path.basename(dest):
          continue
        if not os.path.isdir(os.path.dirname(dest)):
          os.makedirs(os.path.dirname(dest))
        with z.open(content) as unzipped_content:
          logging.info('Extracting %s to %s (%s)', content, dest, dl_file)
          with file(dest, 'wb') as dest_file:
            dest_file.write(unzipped_content.read())
          permissions = z.getinfo(content).external_attr >> 16
          if permissions:
            os.chmod(dest, permissions)
    return True

  def _ClearDir(self, directory):
    """Clears all files in |directory| except for hidden files and folders."""
    for root, dirs, files in os.walk(directory):
      # Skip hidden files and folders (like .svn and .git).
      files = [f for f in files if f[0] != '.']
      dirs[:] = [d for d in dirs if d[0] != '.']

      for f in files:
        os.remove(os.path.join(root, f))

  def _ExtractBuilds(self):
    for platform in self._platform_to_version_map:
      if os.path.exists('tmp_unzip'):
        os.path.unlink('tmp_unzip')
      dest_dir = os.path.join(
          'reference_builds', 'reference_builds',
          BuildUpdater._PLATFORM_MAP[platform].destination)
      self._ClearDir(dest_dir)
      for root, _, dl_files in os.walk(os.path.join('dl', platform)):
        for dl_file in dl_files:
          dl_file = os.path.join(root, dl_file)
          if not self._UnzipFile(dl_file, dest_dir):
            logging.info('Copying %s to %s', dl_file, dest_dir)
            shutil.copy(dl_file, dest_dir)

  def _SvnAddAndRemove(self):
    svn_dir = os.path.join('reference_builds', 'reference_builds')
    # List all changes without ignoring any files.
    stat = BuildUpdater._GetCmdStatusAndOutput(['svn', 'stat', '--no-ignore'],
                                               svn_dir)[1]
    for line in stat.splitlines():
      action, filename = line.split(None, 1)
      # Add new and ignored files.
      if action == '?' or action == 'I':
        BuildUpdater._GetCmdStatusAndOutput(
            ['svn', 'add', filename], svn_dir)
      elif action == '!':
        BuildUpdater._GetCmdStatusAndOutput(
            ['svn', 'delete', filename], svn_dir)
      filepath = os.path.join(svn_dir, filename)
      if not os.path.isdir(filepath) and os.access(filepath, os.X_OK):
        BuildUpdater._GetCmdStatusAndOutput(
            ['svn', 'propset', 'svn:executable', 'true', filename], svn_dir)

  def DownloadAndUpdateBuilds(self):
    self._DownloadBuilds()
    self._FetchSvnRepos()
    self._ExtractBuilds()
    self._SvnAddAndRemove()

def main():
  logging.getLogger().setLevel(logging.DEBUG)
  #TODO(aiolos): check that there are no options passed (argparse).
  b = BuildUpdater()
  b.DownloadAndUpdateBuilds()
  logging.info('Successfully updated reference builds. Move to '
               'reference_builds/reference_builds and make a change with gcl.')

if __name__ == '__main__':
  main()


text:
'use strict';

var request = require('request');
var check = require('checkup');

var URL =  'https://api.debitoor.com/api/v1.0/';

module.exports = function(token, customers, callback) {
    var n,
        props,
        done,
        isDone  = function(error, body) {
            --n;
            if (!n || error && !done) {
                done = true;
                callback(error, body);
            }
        };

    check(arguments, ['token', 'customers', 'callback']);

    props   = customers.shift();
    n       = customers.length;

    if (!n)
        callback(Error('Customers list is empty'));
    else
        customers.forEach(function(array) {
            var data    = getData(props, array),
                options = {
                    json    : true,
                    method  : 'POST',
                    url     : URL + 'customers',
                    body    : getCustomer(data),

                    headers : {
                        'x-token': token
                    },
                };

            request(options, function(error, response, body) {
                if (!error && body.errors)
                    error = body;

                isDone(error, body);
            });
        });
};

function getData(props, data) {
    var obj = {};

    props.forEach(function(name, i) {
        obj[name] = data[i];
    });

    return obj;
}

function getCustomer(data) {
    var json = {
        countryCode:'DK',
        paymentTermsId: 1,
    };

    Object.keys(data).forEach(function(name) {
        json[name] = data[name];
    });

    return JSON.stringify(json);
}


text:
from __future__ import print_function
from __future__ import absolute_import

from salt.utils import parsers
from salt.utils import activate_profile
from salt.utils import output_profile
from salt.utils.verify import check_user, verify_log
from salt.exceptions import SaltClientError
import salt.defaults.exitcodes  # pylint: disable=W0611

class SaltRun(parsers.SaltRunOptionParser):
    '''
    Used to execute Salt runners
    '''

    def run(self):
        '''
        Execute salt-run
        '''
        import salt.runner
        self.parse_args()

        # Setup file logging!
        self.setup_logfile_logger()
        verify_log(self.config)
        profiling_enabled = self.options.profiling_enabled

        runner = salt.runner.Runner(self.config)
        if self.options.doc:
            runner.print_docs()
            self.exit(salt.defaults.exitcodes.EX_OK)

        # Run this here so SystemExit isn't raised anywhere else when
        # someone tries to use the runners via the python API
        try:
            if check_user(self.config['user']):
                pr = activate_profile(profiling_enabled)
                try:
                    ret = runner.run()
                    if isinstance(ret, dict) and 'retcode' in ret.get('data', {}):
                        self.exit(ret['data']['retcode'])
                finally:
                    output_profile(
                        pr,
                        stats_path=self.options.profiling_path,
                        stop=True)

        except SaltClientError as exc:
            raise SystemExit(str(exc))


text:
#pragma once
#include <aws/sesv2/SESV2_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/sesv2/model/EmailTemplateContent.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace SESV2
{
namespace Model
{
  /**
   *
The following element is returned by the service.

See Also:

   * AWS
   * API Reference

   */
  class AWS_SESV2_API GetEmailTemplateResult
  {
  public:
    GetEmailTemplateResult();
    GetEmailTemplateResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    GetEmailTemplateResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
The name of the template you want to retrieve.

     */
    inline const Aws::String& GetTemplateName() const{ return m_templateName; }

    /**
     *
The name of the template you want to retrieve.

     */
    inline void SetTemplateName(const Aws::String& value) { m_templateName = value; }

    /**
     *
The name of the template you want to retrieve.

     */
    inline void SetTemplateName(Aws::String&& value) { m_templateName = std::move(value); }

    /**
     *
The name of the template you want to retrieve.

     */
    inline void SetTemplateName(const char* value) { m_templateName.assign(value); }

    /**
     *
The name of the template you want to retrieve.

     */
    inline GetEmailTemplateResult& WithTemplateName(const Aws::String& value) { SetTemplateName(value); return *this;}

    /**
     *
The name of the template you want to retrieve.

     */
    inline GetEmailTemplateResult& WithTemplateName(Aws::String&& value) { SetTemplateName(std::move(value)); return *this;}

    /**
     *
The name of the template you want to retrieve.

     */
    inline GetEmailTemplateResult& WithTemplateName(const char* value) { SetTemplateName(value); return *this;}

    /**
     *
The content of the email template, composed of a subject line, an HTML part,
     * and a text-only part.

     */
    inline const EmailTemplateContent& GetTemplateContent() const{ return m_templateContent; }

    /**
     *
The content of the email template, composed of a subject line, an HTML part,
     * and a text-only part.

     */
    inline void SetTemplateContent(const EmailTemplateContent& value) { m_templateContent = value; }

    /**
     *
The content of the email template, composed of a subject line, an HTML part,
     * and a text-only part.

     */
    inline void SetTemplateContent(EmailTemplateContent&& value) { m_templateContent = std::move(value); }

    /**
     *
The content of the email template, composed of a subject line, an HTML part,
     * and a text-only part.

     */
    inline GetEmailTemplateResult& WithTemplateContent(const EmailTemplateContent& value) { SetTemplateContent(value); return *this;}

    /**
     *
The content of the email template, composed of a subject line, an HTML part,
     * and a text-only part.

     */
    inline GetEmailTemplateResult& WithTemplateContent(EmailTemplateContent&& value) { SetTemplateContent(std::move(value)); return *this;}

  private:

    Aws::String m_templateName;

    EmailTemplateContent m_templateContent;
  };

} // namespace Model
} // namespace SESV2
} // namespace Aws


text:
<?php
/**
 * Файл конфигурации модуля
 *
 * @category YupeMigration
 * @package  yupe.modules.contentblock.install
 * @author   YupeTeam <team@yupe.ru>
 * @license  BSD https://raw.github.com/yupe/yupe/master/LICENSE
 * @link     http://yupe.ru
 **/
return [
    'module'    => [
        'class' => 'application.modules.contentblock.ContentBlockModule',
    ],
    'import'    => [],
    'component' => [],
    'rules'     => [],
];