text:
package com.lmn.Arbiter_Android.DatabaseHelpers.TableHelpers;

import java.util.ArrayList;
import java.util.HashMap;

import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.provider.BaseColumns;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
import android.util.SparseArray;

import com.lmn.Arbiter_Android.Util;
import com.lmn.Arbiter_Android.BaseClasses.GeometryColumn;
import com.lmn.Arbiter_Android.BaseClasses.Layer;
import com.lmn.Arbiter_Android.BaseClasses.Server;
import com.lmn.Arbiter_Android.Loaders.LayersListLoader;
import com.lmn.Arbiter_Android.Loaders.NotificationsLoader;

public class LayersHelper implements BaseColumns{
	public static final String LAYERS_TABLE_NAME = "layers";
	public static final String LAYER_TITLE = "layer_title";
	// Feature type with prefix ex. geonode:roads
	public static final String FEATURE_TYPE = "feature_type";
	public static final String SERVER_ID = "server_id";
	public static final String BOUNDING_BOX = "bbox";
	public static final String COLOR = "color";
	public static final String LAYER_VISIBILITY = "visibility";
	public static final String WORKSPACE = "workspace";
	public static final String LAYER_ORDER = "layerOrder";
	public static final String READ_ONLY = "readOnly";
	public static final String ADD_LAYER_ORDER_TRIGGER_NAME = "addLayerOrder";

	private LayersHelper(){}

	private static LayersHelper helper = null;

	public static LayersHelper getLayersHelper(){
		if(helper == null){
			helper = new LayersHelper();
		}

		return helper;
	}

	public void createTable(SQLiteDatabase db){
		String sql = "CREATE TABLE " + LAYERS_TABLE_NAME + " (" +
					_ID +
					" INTEGER PRIMARY KEY AUTOINCREMENT, " +
					LAYER_TITLE + " TEXT, " +
					FEATURE_TYPE + " TEXT, " +
					BOUNDING_BOX + " TEXT, " +
					COLOR + " TEXT, " +
					LAYER_VISIBILITY + " TEXT, " +
					WORKSPACE + " TEXT, " +
					SERVER_ID + " INTEGER, " +
					LAYER_ORDER + " INTEGER, " +
					READ_ONLY + " TEXT DEFAULT 'false');";

		db.execSQL(sql);

		createAutoIncrementLayerOrderTrigger(db);
	}

	private void createAutoIncrementLayerOrderTrigger(SQLiteDatabase db){

		String createTriggerSql = "CREATE TRIGGER " + ADD_LAYER_ORDER_TRIGGER_NAME + " "
				+ "AFTER INSERT ON " + LAYERS_TABLE_NAME + " "
				+ "BEGIN "
					+ "UPDATE " + LAYERS_TABLE_NAME + " SET " + LAYER_ORDER + "="
					+ "(SELECT IFNULL(MAX(" + LAYER_ORDER + "),0) + 1 FROM "
					+ LAYERS_TABLE_NAME + ") WHERE " + _ID + "= NEW." + _ID + "; "
				+ "END;";

		db.execSQL(createTriggerSql);
	}

	public ArrayList<Layer> getAll(SQLiteDatabase db){
		Util util = new Util();

		// Projection - columns to get back
		String[] columns = {
			LAYERS_TABLE_NAME + "." + _ID, // 0
			FEATURE_TYPE, // 1
			WORKSPACE, // 2
			SERVER_ID, // 3
			LAYER_TITLE, // 4
			BOUNDING_BOX, // 5
			COLOR, // 6
			LAYER_ORDER, // 7
			LAYER_VISIBILITY, // 8
			READ_ONLY // 9
		};

		// get all of the layers and
		// How to sort the results
		String orderBy = LAYER_ORDER + " DESC";

		Cursor cursor = db.query(LAYERS_TABLE_NAME, columns, null, null, null, null, orderBy);

		// Create an array list with initial capacity equal to the number of layers +1 for the default layer
		ArrayList<Layer> layers = new ArrayList<Layer>(cursor.getCount() + 1);

		//Traverse the cursors to populate the projects array
		for(cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
			layers.add(new Layer(cursor.getInt(0),
					cursor.getString(1), cursor.getString(2), cursor.getInt(3), null, null, cursor.getString(4),
					cursor.getString(5), cursor.getString(6), cursor.getInt(7),
					util.convertIntToBoolean(cursor.getInt(8)), cursor.getString(9)));
		}

		cursor.close();

		return layers;
	}

	public Layer get(SQLiteDatabase db, int layerId){
		Layer layer = null;

		// Projection - columns to get back
		String[] columns = {
			LAYERS_TABLE_NAME + "." + _ID, // 0
			FEATURE_TYPE, // 1
			WORKSPACE, // 2
			SERVER_ID, // 3
			LAYER_TITLE, // 4
			BOUNDING_BOX, // 5
			COLOR, // 6
			LAYER_ORDER, // 7
			LAYER_VISIBILITY, // 8
			READ_ONLY // 9

		};

		String selection = _ID + "=?";

		String[] selectionArgs = {
			Integer.toString(layerId)
		};

		Cursor cursor = db.query(LAYERS_TABLE_NAME, columns, selection, selectionArgs, null, null, null);

		if(cursor.moveToFirst()){

			Util util = new Util();

			layer = new Layer(cursor.getInt(0),
					cursor.getString(1), cursor.getString(2), cursor.getInt(3), null, null, cursor.getString(4),
					cursor.getString(5), cursor.getString(6), cursor.getInt(7),
					util.convertIntToBoolean(cursor.getInt(8)), cursor.getString(9));
		}

		cursor.close();

		return layer;
	}

	public long[] insert(SQLiteDatabase db, Context context, ArrayList<Layer> newLayers){
		db.beginTransaction();

		long[] layerIds = new long[newLayers.size()];

		try {
			ContentValues values;
			Layer layer;

			boolean somethingWentWrong = false;
			int i;

			for(i = 0; i < newLayers.size(); i++){
				values = new ContentValues();
				layer = newLayers.get(i);
				values.put(LAYER_TITLE, layer.getLayerTitle());
				values.put(SERVER_ID, layer.getServerId());
				values.put(FEATURE_TYPE, layer.getFeatureType());
				values.put(BOUNDING_BOX, layer.getLayerBBOX());
				values.put(COLOR, layer.getColor());
				values.put(LAYER_VISIBILITY, layer.isChecked());

				layerIds[i] = db.insert(LAYERS_TABLE_NAME, null, values);

				if(layerIds[i] == -1){
					somethingWentWrong = true;
					break;
				}
			}

			if(!somethingWentWrong){
				db.setTransactionSuccessful();

				LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(LayersListLoader.LAYERS_LIST_UPDATED));
			}else{
				Log.w("LAYERSHELPER", "LAYERSHELPER Something went wrong inserting layer: " + newLayers.get(i).getFeatureType());
			}
		} catch (Exception e){
			e.printStackTrace();
		} finally {
			db.endTransaction();
		}

		return layerIds;
	}

	/**
	 * Delete the list of layers
	 * @param db The database the layers reside in
	 * @param context The context to send a broadcast notifying the layers have been updated
	 * @param list The list of layers to be deleted
	 */
	public void delete(SQLiteDatabase projectDb, SQLiteDatabase featureDb, Context context, Layer layer) {
		projectDb.beginTransaction();

		try {

			String featureType = layer.getFeatureTypeNoPrefix();

			// Remove the featureType from the geometryColumns table
			// and drop the schema table for the feature type
			GeometryColumnsHelper.getHelper().remove(
					featureDb, featureType);

			FailedSync.getHelper().remove(projectDb, layer.getLayerId());

			FailedSync.getHelper().removeFromMediaToSend(context, projectDb, layer.getLayerId());

			String whereClause = _ID + "=?";
			String[] whereArgs = {
				Long.toString(layer.getLayerId())
			};

			projectDb.delete(LAYERS_TABLE_NAME, whereClause, whereArgs);

			projectDb.setTransactionSuccessful();

			LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(LayersListLoader.LAYERS_LIST_UPDATED));
			LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(NotificationsLoader.NOTIFICATIONS_UPDATED));

		} catch (Exception e){
			e.printStackTrace();
		} finally {
			projectDb.endTransaction();
		}

	}

	public void deleteByServerId(SQLiteDatabase projectDb, SQLiteDatabase featureDb, Context context, long serverId){
		projectDb.beginTransaction();

		try {
			// Projection - columns to get back
			String[] columns = {
				LAYERS_TABLE_NAME + "." + _ID, // 0
				FEATURE_TYPE, // 1
				SERVER_ID // 2
			};

			String where = SERVER_ID + "=?";
			String[] whereArgs = {
				Long.toString(serverId)
			};

			Cursor cursor = projectDb.query(LAYERS_TABLE_NAME,
					columns, where, whereArgs, null, null, null);

			//Traverse the cursors to populate the projects array
			for(cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
				delete(projectDb, featureDb, context, new Layer(cursor.getInt(0),
						cursor.getString(1), null, cursor.getInt(2), null, null, null,
						null, null, -1, false, "false"));
			}

			cursor.close();

			projectDb.setTransactionSuccessful();
		} catch (Exception e){
			e.printStackTrace();
		} finally {
			projectDb.endTransaction();
		}
	}

	private ContentValues getValuesFromLayer(Layer layer){

		ContentValues values = new ContentValues();

		values.put(LAYER_TITLE, layer.getLayerTitle());
		values.put(FEATURE_TYPE, layer.getFeatureType());
		values.put(BOUNDING_BOX, layer.getLayerBBOX());
		values.put(COLOR, layer.getColor());
		values.put(LAYER_VISIBILITY, layer.isChecked());
		values.put(WORKSPACE, layer.getWorkspace());
		values.put(SERVER_ID, layer.getServerId());
		values.put(LAYER_ORDER, layer.getLayerOrder());

		return values;
	}

	public void updateLayers(SQLiteDatabase db, Context context, ArrayList<Layer> layers){
		db.beginTransaction();

		try {

			Layer layer = null;

			for(int i = 0, count = layers.size(); i < count; i++){
				layer = layers.get(i);

				updateAttributeValues(db, context, layer.getLayerId(),
						getValuesFromLayer(layer), null);
			}

			db.setTransactionSuccessful();

			LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(LayersListLoader.LAYERS_LIST_UPDATED));
		} catch (Exception e){
			e.printStackTrace();
		} finally {
			db.endTransaction();
		}
	}

	public void updateAttributeValues(SQLiteDatabase db, Context context,
			long layerId, ContentValues values, Runnable callback){

		db.beginTransaction();

		try {

			String whereClause = _ID + "=?";
			String[] whereArgs = {
					Long.toString(layerId)
			};

			db.update(LAYERS_TABLE_NAME, values, whereClause, whereArgs);

			db.setTransactionSuccessful();

			if(callback != null){
				callback.run();
			}
		} catch (Exception e){
			e.printStackTrace();
		} finally {
			db.endTransaction();
		}
	}

	private ArrayList<Layer> addServerInfo(ArrayList<Layer> layers, SparseArray<Server> servers){
		Layer layer;

		for(int i = 0, count = layers.size(); i < count; i++){
			layer = layers.get(i);
			layer.setServerName(servers.get(layer.getServerId()).getName());
		}

		return layers;
	}

	private ArrayList<Layer> removeReadOnlyLayers(SQLiteDatabase featureDb, ArrayList<Layer> layers){

		// Layers entered into the geometry columns table are editable, so
		// get the table entries and remove a layer from the list of layers
		// if they're not in the geometry columns table.
		HashMap<String, GeometryColumn> geometryColumns = GeometryColumnsHelper.getHelper().getAll(featureDb);

		Layer layer;

		for(int count = layers.size(), i = count - 1, j = 0; i > j; i--){
			layer = layers.get(i);
			if(!geometryColumns.containsKey(layer.getFeatureType())){
				layers.remove(i);
			}
		}

		return layers;
	}

	public ArrayList<Layer> getEditableLayers(SQLiteDatabase appDb,
			SQLiteDatabase projectDb, SQLiteDatabase featureDb){

		SparseArray<Server> servers =
				ServersHelper.getServersHelper().getAll(appDb);

		ArrayList<Layer> layers = getAll(projectDb);

		layers = addServerInfo(layers, servers);

		return removeReadOnlyLayers(featureDb, layers);
	}
}


text:
As TFS 2015 uses a rather old version of the build agent, it can be that the node version used by the Task-Runner is to old. This can then result in an error such as the following:

	const tfsRestService = require("tfsrestservice");
	^^^^^
	Use of const in strict mode.
	at exports.runInThisContext (vm.js:73:16)
	at Module._compile (module.js:443:25)
	at Object.Module._extensions..js (module.js:478:10)
	at Module.load (module.js:355:32)
	at Function.Module._load (module.js:310:12)
	at Function.Module.runMain (module.js:501:10)
	at startup (node.js:129:16)
	at node.js:814:3

## Updating Node on the Agent
In order to resolve this issue node has to be updated on **all** the agents that run the TriggerBuild or Wait Task.
Updating node is done simply by going to the [node.js Download Page](https://nodejs.org/en/download/) and fetch the latest version for your agent.
However the agent itself uses its own version of node, that is stored under the agent directory. On TFS 2015 Agent this is usually located somewhere here (this depends on your configuration of the Agent however):
*C:\agent\Agent\Worker\Handlers\Node\node.exe*

In order to update node now, please copy the *node.exe* from Program Files (or wherever you just installed the newest version to) and paste it into the agent folder. You might want to rename the original *node.exe* first in order to be able to go back to the original state.

Now rerun the Task, the above error should not occur anymore and you should be able to run the Task normally.

**If you have any issues regarding this update, plesae see following [Issue](https://github.com/huserben/TfsExtensions/issues/56) about the problem. Feel free to ask further questions in this issue. If you have another problem please create a new issue.**

redpajama_set_name: RedPajamaGithub


text:
module VainRoutes
   class RoutesController < ApplicationController
	layout 'vain_routes/base'
    unloadable

    def index
      @routes = Rails.application.routes.routes
    end

	def filter_routes(routes)
		routes.reject! { |r| r.path.to_s =~ %r{/rails/info/properties} } # Skip the route if it's internal info route
	end

	# def view_html_routes
	   # system("#{platform_specific_open_command} #{@out_file}")
	# end

	# def generate_html_routes!(routes)
	  # routes = filter_routes(routes)

	  # template = File.open(File.join(@view_path, 'routes.html.erb'), "r"){|f| f.read }
	  # rendered_routes = ERB.new(template).result(binding)

	  # File.open(@out_file, 'w') {|f| f.write(rendered_routes) }
   # end

  end
end


text:
<?php
/**
 * English language strings for Dashboards
 *
 * @package modx
 * @subpackage lexicon
 * @language en
 */
$_lang['dashboard'] = 'Kokpit';
$_lang['dashboard_add'] = 'Dodaj Kokpit';
$_lang['dashboard_create'] = 'Utwórz Kokpit';
$_lang['dashboard_desc_name'] = 'Nazwa Kokpitu.';
$_lang['dashboard_desc_description'] = 'Krótki opis Kokpitu.';
$_lang['dashboard_desc_hide_trees'] = 'Zaznacz, aby po zalogowaniu Kokpit był widoczny na całej szerokości ekranu.';
$_lang['dashboard_hide_trees'] = 'Ukryj drzewo po lewej stronie';
$_lang['dashboard_duplicate'] = 'Duplikuj Kokpit';
$_lang['dashboard_remove'] = 'Usuń Kokpit';
$_lang['dashboard_remove_confirm'] = 'Czy na pewno chcesz usunąć ten Kokpit?';
$_lang['dashboard_remove_multiple'] = 'Remove Dashboards';
$_lang['dashboard_remove_multiple_confirm'] = 'Czy na pewno chcesz usunąć zaznaczone Kokpity?';
$_lang['dashboard_update'] = 'Edytuj Kokpit';
$_lang['dashboard_err_ae_name'] = 'Kokpit o nazwie "[[+ nazwa]]" już istnieje! Wpisz inną nazwę.';
$_lang['dashboard_err_duplicate'] = 'Wystąpił błąd podczas próby powielenia kokpitu.';
$_lang['dashboard_err_nf'] = 'Kokpitu nie znaleziono.';
$_lang['dashboard_err_ns'] = 'Dashboard not specified.';
$_lang['dashboard_err_ns_name'] = 'Please specify a name for the widget.';
$_lang['dashboard_err_remove'] = 'Wystąpił błąd podczas próby usunięcia Kokpitu.';
$_lang['dashboard_err_remove_default'] = 'Nie można usunąć domyślnego Kokpitu!';
$_lang['dashboard_err_save'] = 'Wystąpił błąd podczas próby zapisania Kokpitu.';
$_lang['dashboard_usergroup_add'] = 'Przypisz Kokpit do Grupy Użytkowników';
$_lang['dashboard_usergroup_remove'] = 'Usuń przypisanie Kokpitu do Grupy';
$_lang['dashboard_usergroup_remove_confirm'] = 'Czy na pewno chcesz przypisać domyślny Kokpit tej Grupie Użytkowników?';
$_lang['dashboard_usergroups.intro_msg'] = 'Oto Grupy Użytkowników przypisane do tego Kokpitu.';
$_lang['dashboard_widget_err_placed'] = 'This widget is already placed in this Dashboard!';
$_lang['dashboard_widgets.intro_msg'] = 'Here you can add, manage, and remove Widgets from this Dashboard. You can also drag and drop the rows in the grid to rearrange them.';
$_lang['dashboards'] = 'Kokpity';
$_lang['dashboards.intro_msg'] = 'Here you can manage all the available Dashboards for this MODX manager.';
$_lang['rank'] = 'Rank';
$_lang['user_group_filter'] = 'By User Group';
$_lang['widget'] = 'Widget';
$_lang['widget_content'] = 'Widget Content';
$_lang['widget_create'] = 'Utwórz nowy Widget';
$_lang['widget_err_ae_name'] = 'A widget with the name "[[+name]]" already exists! Please try another name.';
$_lang['widget_err_nf'] = 'Widget not found!';
$_lang['widget_err_ns'] = 'Widget not specified!';
$_lang['widget_err_ns_name'] = 'Please specify a name for the widget.';
$_lang['widget_err_remove'] = 'An error occurred while trying to remove the Widget.';
$_lang['widget_err_save'] = 'An error occurred while trying to save the Widget.';
$_lang['widget_file'] = 'File';
$_lang['widget_dashboards.intro_msg'] = 'Below is a list of all the Dashboards that this Widget has been placed on.';
$_lang['widget_dashboard_remove'] = 'Remove Widget From Dashboard';
$_lang['widget_description_desc'] = 'A description, or Lexicon Entry key, of the Widget and what it does.';
$_lang['widget_html'] = 'HTML';
$_lang['widget_lexicon_desc'] = 'The Lexicon Topic to load with this Widget. Useful for providing translations for the name and description, as well as any text in the widget.';
$_lang['widget_name_desc'] = 'The name, or Lexicon Entry key, of the Widget.';
$_lang['widget_new'] = 'New Widget';
$_lang['widget_remove'] = 'Delete Widget';
$_lang['widget_remove_confirm'] = 'Are you sure you want to remove this Dashboard Widget? This is permanent, and will remove the Widget from all Dashboards.';
$_lang['widget_remove_multiple'] = 'Delete Multiple Widgets';
$_lang['widget_remove_multiple_confirm'] = 'Are you sure you want to remove these Dashboard Widgets? This is permanent, and will remove the Widgets from all their assigned Dashboards.';
$_lang['widget_namespace'] = 'Namespace';
$_lang['widget_namespace_desc'] = 'The Namespace that this widget will be loaded into. Useful for custom paths.';
$_lang['widget_php'] = 'Inline PHP Widget';
$_lang['widget_place'] = 'Place Widget';
$_lang['widget_size'] = 'Size';
$_lang['widget_size_desc'] = 'The size of the widget. Can either be a half-screen wide ("Half"), the width of the screen ("Full"), or a full screen width and two rows ("Double").';
$_lang['widget_size_double'] = 'Double';
$_lang['widget_size_full'] = 'Full';
$_lang['widget_size_half'] = 'Half';
$_lang['widget_snippet'] = 'Snippet';
$_lang['widget_type'] = 'Widget Type';
$_lang['widget_type_desc'] = 'The type of widget this is. "Snippet" widgets are MODX Snippets that are run and return their output. "HTML" widgets are just straight HTML. "File" widgets are loaded directly from files, which can either return their output or the name of the modDashboardWidgetClass-extended class to load. "Inline PHP" Widgets are widgets that are straight PHP in the widget content, similar to a Snippet.';
$_lang['widget_unplace'] = 'Remove Widget from Dashboard';
$_lang['widget_update'] = 'Update Widget';
$_lang['widgets'] = 'Widgets';
$_lang['widgets.intro_msg'] = 'Below is a list of all the installed Dashboard Widgets you have.';

$_lang['w_configcheck'] = 'Configuration Check';
$_lang['w_configcheck_desc'] = 'Displays a configuration check that ensures your MODX install is secure.';
$_lang['w_newsfeed'] = 'MODX News Feed';
$_lang['w_newsfeed_desc'] = 'Displays the MODX News Feed';
$_lang['w_recentlyeditedresources'] = 'Ostatnio edytowane';
$_lang['w_recentlyeditedresources_desc'] = 'Shows a list of the most recently edited resources by the user.';
$_lang['w_securityfeed'] = 'MODX Security Feed';
$_lang['w_securityfeed_desc'] = 'Displays the MODX Security Feed';
$_lang['w_whosonline'] = 'Aktywni użytkownicy';
$_lang['w_whosonline_desc'] = 'Shows a list of online users.';


text:
from logging import getLogger, basicConfig
basicConfig()
logger = getLogger("glue")


text:
package com.manvendrask.creatingstreams;

import java.util.stream.Stream;

/**
 * @author Manvendra SK
 */
public class EmptyStreams {

    void emptyStream() {
        Stream<String> singleStream = Stream.empty();
        singleStream.forEach(System.out::println);
    }

    public static void main(String... args) {

        EmptyStreams streamFromValues = new EmptyStreams();
        streamFromValues.emptyStream();
    }
}


text:
using Acquaint.Abstractions;
using ObjCRuntime;

namespace Acquaint.Common.iOS
{
    public class EnvironmentService : IEnvironmentService
    {
        #region IEnvironmentService implementation

        public bool IsRealDevice => Runtime.Arch == Arch.DEVICE;

        #endregion
    }
}


text:
#pragma once

//   This file is part of Gusty's Serpents, licensed under the terms of the MIT License
//   (further described below).
//
//   Copyright (C) 2009-2014  Augustin Preda (thegusty999@gmail.com)
//
//   Permission is hereby granted, free of charge, to any person obtaining a copy
//   of this software and associated documentation files (the "Software"), to deal
//   in the Software without restriction, including without limitation the rights
//   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//   copies of the Software, and to permit persons to whom the Software is
//   furnished to do so, subject to the following conditions:
//
//   The above copyright notice and this permission notice shall be included in
//   all copies or substantial portions of the Software.
//
//   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//   THE SOFTWARE.
//
//   Camera handling utility.
//
//    Last change:  $LastChangedDate: 2014-07-04 08:56:45 +0300 (V, 04 iul. 2014) $
//    Revision:    $Revision: 663 $

//
// Includes
//

//
// C++ system headers
//

// none

//
// Other libraries' headers
//

#include "OgrePrerequisites.h"
#include "OgreVector3.h"

//
// This project's headers.
//

// Forward declaration to avoid inclusion of header.
namespace Ogre
{
  class Camera;
  class Viewport;
};

namespace Serpents
{
  /**
    Helper class, containing an Ogre camera.
    TODO(Augustin Preda, 2014.07.01): improve the camera movement. Currently it is rather ... "blocky".
    Use quaternion nlerp/slerp and keep a slower camera movement, so that it's not instant.
  */
  class SerpentsCamera
  {
  private:
    Ogre::Camera* camera_;        //  the Ogre camera to do the actual rendering.
    Ogre::Vector3 targetPos_;
    Ogre::Quaternion originalOrientation;  // Original orientation
    Ogre::Vector3 originalPos;    //  original location
    Ogre::Real zoomLevel;      //  zoom level to use. 0 = no zoom; 1 = max zoom
    Ogre::Real zoomStep;            // steps between zooms; (units travelled in 1 sec.)
    Ogre::Real zoomMax;

    class Impl;
    SerpentsCamera::Impl* impl_;

  public:
    /**
      Constructor.
      Requires an Ogre camera to operate.
    */
    explicit SerpentsCamera(Ogre::Camera* camera);

    /**
      Destructor.
    */
    virtual ~SerpentsCamera(void);

    /**
      Getter for the camera.
    */
    virtual Ogre::Camera* getCamera() const;

    /**
      Setter for the target point of the camera.
    */
    virtual void setTargetPos(const Ogre::Vector3& newTarget);

    /**
      Getter for the target point of the camera.
    */
    virtual Ogre::Vector3 getTargetPos() const;

    /**
      Utility function to allow easier sliding, keeping the same orientation.
      This will be most likely used in classic 3rd person games, where a constant
      position relative to the character should be kept.
      @param newPosition The position to slide to.
    */
    virtual void slideToLocation(const Ogre::Vector3& newPosition);

    /**
      Similar to the standard camera lookAt, also taking the zoom level into account.
    */
    virtual void lookAt(const Ogre::Vector3& lookTarget);

    /**
      Reset the camera orientation to its initial value
    */
    virtual void resetOrientation();

    /**
      Allow the user to override the default Field Of View.
    */
    void setFOV(const Ogre::Real& fov);

    //
    // ---------------- Zoom functions ---------------------
    //

    /**
      Getter for the zoom step.
    */
    virtual Ogre::Real getZoomStep() const;

    /**
      Setter for the zoom step.
    */
    virtual void setZoomStep(const Ogre::Real& value);

    /**
      Getter for the maximum allowed zoom level.
    */
    Ogre::Real getZoomMax() const;

    /**
      Setter for the maximum allowed zoom level.
    */
    void setZoomMax(const Ogre::Real& zoom);

    /**
      Set the zoom level to use.
    */
    void setZoomLevel(const Ogre::Real& zoom);

    /**
      Get the current zoom level
    */
    Ogre::Real getZoomLevel() const;

    //
    // -------------- Compositor operations --------------------------
    //

    /**
      Add a compositor to the camera's viewport.
      @param compositorName The name of the compositor to use.

      @author Augustin Preda
    */
    void addCompositorByName(const char* compositorName);

    /**
      Remove a compositor from the camera's viewport.
      @param compositorName The name of the compositor to use.

      @author Augustin Preda
    */
    void removeCompositorByName(const char* compositorName);

    /**
      Remove a chain of compositors for the camera's viewport.

      @author Augustin Preda
    */
    void removeCompositorChain();

    /**
      Set the enabled or disabled status of a compositor for the camera's viewport.
      @param compositorName The name of the compositor to use.
      @param status  On/Off flag.

      @author Augustin Preda
    */
    void setCompositorEnabledByName(const char* compositorName, bool status);

    //
    // ------------------------------- Static compositor - viewport functions --------------------
    //

    /**
      Add a compositor to a viewport.
      @param compositorName The name of the compositor to use.
      @param vp The viewport object to add the compositor to.
    */
    static void addCompositorToViewportByName(const char* compositorName, Ogre::Viewport* vp);

    /**
      Remove a compositor from a viewport.
      @param compositorName The name of the compositor to use.
      @param vp The viewport object to remove the compositor from.
    */
    static void removeCompositorFromViewportByName(const char* compositorName, Ogre::Viewport* vp);

    /**
      Remove a chain of compositors for a viewport.
      @param vp The viewport object to remove the compositor from.
    */
    static void removeCompositorChainFromViewport(Ogre::Viewport* vp);

    /**
      Set the enabled or disabled status of a compositor for a viewport.
      @param compositorName The name of the compositor to use.
      @param vp The viewport object to set the compositor status for.
      @param status  On/Off flag.
    */
    static void setCompositorEnabledForViewportByName(const char* compositorName, Ogre::Viewport* vp, bool status);
  };
}


text:
package com.ibm.database.compatibility;

import java.io.BufferedWriter;
import java.io.Closeable;
import java.io.File;
import java.io.FileWriter;
import java.io.Flushable;
import java.io.IOException;
import java.io.Writer;

public class TestResultWriter implements Flushable, Closeable {

	private final BufferedWriter bufferedWriter;

	public TestResultWriter(String pathToFile) throws IOException {
		this(new FileWriter(pathToFile));
	}

	public TestResultWriter(File file) throws IOException {
		this(new FileWriter(file));
	}

	public TestResultWriter(Writer writer) {
		this.bufferedWriter = new BufferedWriter(writer);
	}

	public void write(TestResult result) throws IOException {
		bufferedWriter.write(GsonUtils.newGson().toJson(result));
		bufferedWriter.newLine();
	}

	@Override
	public void close() throws IOException {
		bufferedWriter.close();
	}

	@Override
	public void flush() throws IOException {
		bufferedWriter.flush();
	}

}


text:
=====
Usage
=====

To use gobii_mde in a project::

    import gobii_mde