text:
enum class CameraType
{
	DefaultCamera,
	FollowCamera,
	FixedCamera
};

const char* cameratype_to_string(CameraType type);

namespace gemini
{
	struct CameraState;
}

class GameCamera
{
public:
	virtual ~GameCamera();

	// returns the camera's 'eye' position
	virtual glm::vec3 get_origin() const = 0;
	virtual glm::vec3 get_target() const = 0;
	virtual glm::vec3 get_up() const = 0;
	virtual glm::vec3 get_right() const = 0;

	// return the vertical field of view for this camera
	virtual float get_fov() const = 0;

	// returns the discrete camera type
	virtual CameraType get_type() const = 0;

	// Called when the camera's should rotate by a delta
	virtual void move_view(float yaw, float pitch) = 0;

	// set absolute yaw and pitch
	virtual void set_yaw_pitch(float yaw, float pitch) = 0;

	// Called each frame
	virtual void tick(float step_interval_seconds) = 0;

	// set the vertical field of view
	virtual void set_fov(float new_fov) = 0;

	// Set the target object's moved direction.
	virtual void set_target_direction(const glm::vec3& direction) = 0;

	// Get the target object's facing direction.
	virtual glm::vec3 get_target_direction() const = 0;

	// Get the camera's facing / eye vector
	virtual glm::vec3 get_camera_direction() const = 0;

	// Reset this camera's view.
	virtual void reset_view() = 0;

	virtual void set_minimum_distance(float value) = 0;
	virtual void set_follow_distance(float value) = 0;

	// Copy CameraState to internal state
	virtual void set_initial_state(const gemini::CameraState& state) = 0;
	virtual void get_current_state(gemini::CameraState& state) = 0;

	// Sets the world position of the camera.
	// This allows the camera to perform its own collision detection and
	// response as well as allowing it to form the view matrix when parameters
	// are extracted from the camera.
	virtual void set_world_position(const glm::vec3& world_position) = 0;

	virtual void set_target_fov(float new_fov) = 0;
	virtual void set_horizontal_offset(float new_horizontal_offset) = 0;
	virtual void set_vertical_offset(float new_vertical_offset) = 0;

	virtual void collision_correct(float step_interval_seconds) = 0;
}; // GameCamera

// distance and field of view driven from pitch.

#include <sdk/physics_collisionobject.h>

template <class T>
struct AnimatedTargetValue
{
	T target_value;
	T original_value;
	T current_value;
	float target_time_seconds;
	float current_time_seconds;

	void set(const T& desired_value, float lerp_duration_seconds)
	{
		if (lerp_duration_seconds > 0.0f)
		{
			// lerp to this value over time
			target_value = desired_value;
			current_time_seconds = 0.0f;
			target_time_seconds = lerp_duration_seconds;
		}
		else
		{
			// snap to this value
			current_value = desired_value;
			target_value = desired_value;
			current_time_seconds = 0.0f;
			target_time_seconds = 0.0f;
		}
		original_value = current_value;
	}

	void update(float delta_seconds)
	{
#if 0
		if (target_time_seconds > 0.0f)
		{
			current_time_seconds += delta_seconds;
			float alpha = glm::clamp(current_time_seconds / target_time_seconds, 0.0f, 1.0f);
			if (current_time_seconds > target_time_seconds)
			{
				target_time_seconds = 0.0f;
			}

			current_value = gemini::lerp(original_value, target_value, alpha);
		}
#endif
		// exponential camera chase to desired_distance; gracefully zoom
		float vel = (current_value - target_value);
		//F = - k (p - r)

		current_value += -20.0 * (vel * delta_seconds);
		//current_value = target_value - (vel * exp(-delta_seconds / 0.45f));

		//float vel = (desired_distance - distance_to_target);
		//distance_to_target = desired_distance - (vel * exp(-step_interval_seconds / 0.45f));

		current_value = target_value;
	}

	T value() const
	{
		return current_value;
	}
};

class FixedCamera : public GameCamera
{
private:
	glm::vec3 origin;
	glm::vec3 target;
	float field_of_view;

public:
	FixedCamera(const glm::vec3& position, const glm::vec3& target, float fov);

	virtual glm::vec3 get_origin() const override;
	virtual glm::vec3 get_target() const override;
	virtual glm::vec3 get_up() const override;
	virtual glm::vec3 get_right() const override;
	virtual float get_fov() const override;
	virtual CameraType get_type() const override { return CameraType::FixedCamera; }
	virtual void move_view(float yaw, float pitch) override;
	virtual void set_yaw_pitch(float yaw, float pitch) override;
	virtual void tick(float step_interval_seconds) override;
	virtual void set_fov(float new_fov) override;
	virtual void set_target_direction(const glm::vec3& direction) override;
	virtual glm::vec3 get_target_direction() const override;
	virtual glm::vec3 get_camera_direction() const override;
	virtual void reset_view() override;
};

class CameraMixer
{
private:
	struct CameraBlend
	{
		GameCamera* camera;
		float weight;

		CameraBlend(GameCamera* game_camera = nullptr, float blend_weight = 0.0f)
			: camera(game_camera)
			, weight(blend_weight)
		{
		}
	};

	enum class CameraMixAction
	{
		Idle,
		Blend_Push,
		Blend_Pop
	};

	FixedSizeQueue<CameraBlend, 4> cameras;

	glm::vec3 origin;
	glm::vec3 view;
	glm::vec3 offset;
	glm::vec3 world_position;

	gemini::Allocator& allocator;

	float blend_alpha;
	float current_time_sec;
	float total_time_sec;
	CameraMixAction action;

	void normalize_weights(float top_weight);
public:
	CameraMixer(gemini::Allocator& allocator);
	~CameraMixer();

	// push a new camera onto the stack
	void push_camera(GameCamera* new_camera, float delay_sec);

	// pop the current camera off the stack
	void pop_camera(float delay_sec);

	GameCamera* get_top_camera();

	// get origin position
	glm::vec3 get_origin() const;

	// return camera's view vector
	glm::vec3 get_target() const;

	// return camera's up vector
	glm::vec3 get_up() const;

	// return camera's right vector
	glm::vec3 get_right() const;

	// get field of view
	float get_field_of_view() const;

	void tick(float step_interval_seconds, float step_alpha);
	void move_view(float yaw, float pitch);
	void set_yaw_pitch(float yaw, float pitch);

	// Set the direction of travel for the target object.
	void set_target_direction(const glm::vec3& direction);

	glm::vec3 get_target_direction() const;
	glm::vec3 get_camera_direction() const;

	// sets the world position of the camera mixer "node"
	void set_world_position(const glm::vec3& world_position);

	void collision_correct(float step_interval_seconds);
};

struct Camera
{
	enum CameraType
	{
		FIRST_PERSON,	// classic first-person camera (Doom/Quake)
		THIRD_PERSON,	// third-person camera (cover-based shooters)
		CHASE,			// third-person chase camera (3D platformers)
	};

	Camera(CameraType _type = FIRST_PERSON);

	// sets world position of the camera

	void invert_yaxis( bool invert ) { invert_y_axis = invert; }

	// called when the mouse moves to update the view
	void move_view( int32_t dx, int32_t dy );

	// position-based movement
	void move_left( real dt );
	void move_right( real dt );
	void move_forward( real dt );
	void move_backward( real dt );
	void move_along_vector( const glm::vec3 & v, real dt );

	// internal functions
	virtual void update_view();

	// projection type functions
	void perspective(real fovy, int32_t width, int32_t height, real nearz, real farz);
	void ortho(real left, real right, real bottom, real top, real nearz, real farz);

	const glm::mat4& get_inverse_world_transform() const { return inverse_world_transform; }
	const glm::mat4& get_inverse_rotation() const { return inverse_rotation; }

	void set_yaw(real y) { yaw = y; }
	void set_pitch(real p) { pitch = p; }
	void set_position(const glm::vec3& position);
	const glm::vec3& get_position() const { return pos; }

	void set_view(const glm::vec3& view_direction) { view = view_direction; }
	void set_type(const CameraType cameratype) { type = cameratype; }
	void set_target_offset(const glm::vec3& in_target_offset) { target_offset = in_target_offset; }

	const glm::mat4& get_modelview() const { return modelview; }
	const glm::mat4& get_projection() const { return projection; }
	const glm::vec3& get_view() const { return view; }
	const glm::vec3& get_eye_position() const { return eye_position; }

	float get_yaw() const { return yaw; }
	float get_pitch() const { return pitch; }

private:
	// camera variables
	real yaw;
	real pitch;
	glm::vec3 pos;

	glm::mat4 projection;
	glm::mat4 modelview;

	// components as matrices
	glm::mat4 inverse_rotation;
	glm::mat4 inverse_translation;

	// final inverted world matrix
	glm::mat4 inverse_world_transform;

	// directional vectors
	glm::vec3 view;
	glm::vec3 side;

	glm::vec3 target_offset;
	glm::vec3 eye_position;

	CameraType type;

	//
	// options
	real move_speed;
	real sensitivity;
	bool invert_y_axis;
	bool is_ortho;
	float aspect_ratio;
	float fovy;

	float near_clip;
	float far_clip;
}; // Camera


text:
package com.linkedin.thirdeye.bootstrap.startree.generation;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.TimeUnit;

import org.apache.commons.io.FileUtils;
import org.apache.commons.math3.random.RandomDataGenerator;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.mrunit.mapreduce.MapDriver;
import org.apache.hadoop.mrunit.types.Pair;
import org.testng.Assert;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;

import com.linkedin.thirdeye.api.DimensionKey;
import com.linkedin.thirdeye.api.MetricSchema;
import com.linkedin.thirdeye.api.MetricTimeSeries;
import com.linkedin.thirdeye.api.MetricType;
import com.linkedin.thirdeye.api.StarTreeConfig;
import com.linkedin.thirdeye.api.StarTreeNode;
import com.linkedin.thirdeye.bootstrap.startree.generation.StarTreeGenerationJob.StarTreeGenerationMapper;
import com.linkedin.thirdeye.impl.StarTreePersistanceUtil;
import com.linkedin.thirdeye.impl.StarTreeUtils;

/**
*
* @author ajaspal
*
*/

public class TestStarTreeGeneration
{
  private static final String CONF_FILE = "config.yml";
  private static MapDriver<BytesWritable, BytesWritable, BytesWritable, BytesWritable> mapDriver;
  private static StarTreeGenerationConfig starTreeGenerationConfig;
  private static String thirdEyeRoot;

  private List<Pair<BytesWritable,  BytesWritable>> generateTestData() throws IOException
  {
    List<Pair<BytesWritable,  BytesWritable>> inputRecords = new ArrayList<Pair<BytesWritable,  BytesWritable>>();
    String []combination1 = {"A1", "B1", "C1"};
    DimensionKey dimKey = new DimensionKey(combination1);
    MetricTimeSeries timeSeries = TestHelper.generateRandomMetricTimeSeries(starTreeGenerationConfig);
    Pair<BytesWritable,  BytesWritable> record = new Pair<BytesWritable, BytesWritable>(new BytesWritable(dimKey.toBytes())
                                                                          , new BytesWritable(timeSeries.toBytes()));
    inputRecords.add(record);

    String []combination2 = {"A1", "B1", "C2"};
    dimKey = new DimensionKey(combination2);
    timeSeries = TestHelper.generateRandomMetricTimeSeries(starTreeGenerationConfig);
    record = new Pair<BytesWritable, BytesWritable>(new BytesWritable(dimKey.toBytes())
                                                                          , new BytesWritable(timeSeries.toBytes()));
    inputRecords.add(record);

    String []combination3 = {"A1", "B1", "C3"};
    dimKey = new DimensionKey(combination3);
    timeSeries = TestHelper.generateRandomMetricTimeSeries(starTreeGenerationConfig);
    record = new Pair<BytesWritable, BytesWritable>(new BytesWritable(dimKey.toBytes())
                                                                          , new BytesWritable(timeSeries.toBytes()));
    inputRecords.add(record);

    String []combination4 = {"A2", "B1", "C3"};
    dimKey = new DimensionKey(combination4);
    timeSeries = TestHelper.generateRandomMetricTimeSeries(starTreeGenerationConfig);
    record = new Pair<BytesWritable, BytesWritable>(new BytesWritable(dimKey.toBytes())
                                                                          , new BytesWritable(timeSeries.toBytes()));
    inputRecords.add(record);
    return inputRecords;
  }

  @BeforeSuite
  public void setUp() throws IOException
  {
    StarTreeGenerationMapper mapper = new StarTreeGenerationMapper();
    mapDriver = MapDriver.newMapDriver(mapper);
    Configuration config = mapDriver.getConfiguration();
    config.set(StarTreeGenerationConstants.STAR_TREE_GEN_CONFIG_PATH.toString(), ClassLoader.getSystemResource(CONF_FILE).toString());
    Path configPath = new Path(ClassLoader.getSystemResource(CONF_FILE).toString());
    FileSystem fs = FileSystem.get(config);
    StarTreeConfig starTreeConfig = StarTreeConfig.decode(fs.open(configPath));
    starTreeGenerationConfig = StarTreeGenerationConfig.fromStarTreeConfig(starTreeConfig);
    thirdEyeRoot = System.getProperty("java.io.tmpdir") ;
    config.set(StarTreeGenerationConstants.STAR_TREE_GEN_OUTPUT_PATH.toString(), thirdEyeRoot + File.separator + "startree_generation");
  }

  @Test
  public void testStarTreeGeneration() throws Exception
  {
    List<Pair<BytesWritable,  BytesWritable>> input = generateTestData();
    mapDriver.addAll(input);
    mapDriver.run();

    // verify that the tree can be deserialized appropriately
    String starTreeOutputPath = mapDriver.getConfiguration().get(StarTreeGenerationConstants.STAR_TREE_GEN_OUTPUT_PATH.toString());
    String collectionName = starTreeGenerationConfig.getCollectionName();
    Path pathToTree = new Path(starTreeOutputPath,  "tree.bin");
    FileSystem dfs = FileSystem.get(mapDriver.getConfiguration());
    InputStream is = dfs.open(pathToTree);
    StarTreeNode starTreeRootNode = StarTreePersistanceUtil.loadStarTree(is);
    Assert.assertNotNull(starTreeRootNode);
    Assert.assertFalse(starTreeRootNode.isLeaf());

    LinkedList<StarTreeNode> leafNodes = new LinkedList<StarTreeNode>();
    StarTreeUtils.traverseAndGetLeafNodes(leafNodes, starTreeRootNode);
    Assert.assertEquals(5, leafNodes.size());
  }

  @AfterSuite
  public void deleteStarTree() throws IOException
  {
    File f = new File(thirdEyeRoot + File.separator + "startree_generation");
    FileUtils.deleteDirectory(f);
  }
}

class TestHelper {

  public static MetricTimeSeries generateRandomMetricTimeSeries(StarTreeGenerationConfig config)
  {
    List<String> names = config.getMetricNames();
    List<MetricType> types = config.getMetricTypes();
    MetricSchema schema = new MetricSchema(names, types);
    MetricTimeSeries series = new MetricTimeSeries(schema);
    long timeStamp = TimeUnit.HOURS.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS);
    RandomDataGenerator rand = new RandomDataGenerator();
    for(int i = 0;i<names.size();i++){
      series.set(timeStamp, names.get(i), rand.nextInt(0, 100));
    }
    return series;
  }

  public static MetricSchema getMetricSchema(StarTreeGenerationConfig config)
  {
    List<String> names = config.getMetricNames();
    List<MetricType> types = config.getMetricTypes();
    return new MetricSchema(names, types);
  }
}

redpajama_set_name: RedPajamaGithub


text:
@interface LHUserModel : NSManagedObject

@property (nonatomic, retain) NSData * attributes;
@property (nonatomic, retain) NSString * identifier;
@property (nonatomic, retain) NSNumber * anonymous;
@property (nonatomic, retain) NSString * previousIdentifier;

@end


text:
				<?PHP
					$attributes = array('class' => 'form-horizontal',"role"=>"form");
					echo form_open("",$attributes);
				?>

					  Name

						<input type="text" name="name" class="form-control" placeholder="Name" value="<?PHP if(!empty($test[0]->name)) echo $test[0]->name;?>">

					  Title

						<input type="text" name="title" class="form-control" placeholder="Title" value="<?PHP if(!empty($test[0]->title)) echo $test[0]->title;?>">

					  Price

						<input type="text" name="price" class="form-control" placeholder="Price" value="<?PHP if(!empty($test[0]->price)) echo $test[0]->price;?>">

						<button type="submit" class="btn btn-info pull-right">Submit</button>
						<input type="hidden" name="id" value="<?PHP if(!empty($test[0]->id)) echo $test[0]->id;?>">

				<?php echo form_close(); ?>


text:
<!DOCTYPE html>   <meta charset="UTF-8"/>
<title>Select, add, or change Earth EC servers</title>
<link rel="stylesheet" href="../css/styles.css" type="text/css" media="all" /> <link rel="stylesheet" href="../css/containers.css" type="text/css" media="all" />

What is Google Earth Enterprise Client?

Clearing the Google Earth EC cache

EC bandwidth requirements

Select, add, or change Earth EC servers

Fix Earth EC issues

Google Earth Enterprise Documentation Home | Google Earth Enterprise client

Select, add, or change Earth EC servers

You can use Google Earth EC to view globes and maps from your own database servers.

Earth EC lets you do any of the following:

Add as many database servers as you want.

Set a default server that is automatically signed in to whenever you start Earth EC.

Connect to as many as eight servers at the same time.

Change servers, or sign in and out of servers.

Remove servers that you no longer use.

Sign in to an Earth EC server

To sign in to a server:

From Google Earth EC, select File > Server Sign In.

The Select Server window appears. When you start Google Earth EC the first time, Select Server appears automatically.

Enter your server settings as shown in the table below.

Select Server options

Setting
Description

Server
Select or enter the address for the database server that hosts the globes or maps you want to view. If you don't know the server address, ask your administrator.

Port
Select or enter the port for the server. If you don't know the port number, ask your administrator.

Always sign in to this server

Select to skip the Select Server window and automatically sign in to this server whenever you start Earth EC.

To display Select Server again, go to File > Disable Automatic Sign In.

Disable caching

Select this if you want to make sure that you're viewing the latest content from the server or if your cached files become corrupted.

Note: Disabling the cache slows down performance.

Sign out of an Earth EC server

To sign out of a server database, go to File > Server Sign Out.

Add servers to Earth EC

To add a server database, go to File > Add Database.

The Select Server window appears so that you can enter your server settings.

Connect to multiple Earth EC servers at the same time

Whenever you add another server database, Earth EC signs into the new database and stays connected to your current database. You can view data from up to eight server databases at the same time.

Change your Earth EC server

To change your Earth EC server:

Go to File > Server Sign Out.

Earth EC signs out of your current server.

Go to File > Server Sign In.

Select a server from the list that appears.

Useful resources

What is Google Earth EC?

Fix Earth EC errors

Back to top

©2015 Google


text:
import React             from 'react';
import { drinkGroups }   from '../constants';

export default class DrinkForm extends React.Component {
  static propTypes = {
    updateDrink: React.PropTypes.func.isRequired,
    drink      : React.PropTypes.any
  }

  updateDrink(event) {
    if (event.target.type === 'checkbox') {
      this.props.drink[event.target.name] = event.target.checked;
    } else {
      this.props.drink[event.target.name] = event.target.value;
    }

    this.props.updateDrink(this.props.drink);
  }

  updateDrinkIngredient(event) {
    this.props.drink.ingredients[event.target.name] = event.target.checked;
    this.props.updateDrink(this.props.drink);
  }

  render () {
    const drink = this.props.drink;
    return (

            drinc
            <input className="form-control" placeholder="getra:nc" name="name"
                   value={drink.name} onChange={(event)=>this.updateDrink(event)} />

            liter
            <input className="form-control" placeholder="liter" name="liter"
                   value={drink.liter} onChange={(event)=>this.updateDrink(event)} />

            volume
            <input className="form-control" placeholder="volume" name="volume"
                   value={drink.volume}  onChange={(event)=>this.updateDrink(event)} />

            crew
            <input className="form-control" placeholder="price-crew" name="priceCrew"
                   value={drink.priceCrew}  onChange={(event)=>this.updateDrink(event)} />

            alien
            <input className="form-control" placeholder="price-alien" name="priceAlien"
                   value={drink.priceAlien}  onChange={(event)=>this.updateDrink(event)} />

              <input name="inProgram" type="checkbox"
                     checked={drink.inProgram} onChange={(event)=>this.updateDrink(event)} />
              im programm

            group
            <select name="group" className="form-control"
                    value={drink.group}  onChange={(event)=>this.updateDrink(event)} >
              {Object.keys(drinkGroups).map((group) => <option value={group}>{drinkGroups[group]}</option>)}
            </select>

            {Object.keys(drink.ingredients).map((ingredient) =>

                  <input name={ingredient} type="checkbox"
                         checked={drink.ingredients[ingredient]}
                         onChange={(event) => this.updateDrinkIngredient(event)} />
                  {ingredient}

            )}

              soll: min
              <input type="text" ref="min" className="form-control" placeholder="min" name="min"
                     value={drink.min} onChange={(event)=>this.updateDrink(event)} />

              soll: max
              <input type="text" ref="max" className="form-control" placeholder="max" name="max"
                     value={drink.max} onChange={(event)=>this.updateDrink(event)} />

    );
  }
}


text:
require 'test_helper'

class CartsControllerTest < ActionController::TestCase
  def test_show
    get :show, :id => Cart.first
    assert_template 'show'
  end
end


text:
class WelcomeController < ApplicationController
  # GET /
  def index
  end
end


text:
var _ = require( 'lodash' );
var metronic = require( '../metrics' );
var log = require( '../log' )( 'autohost.websocket.adapter' );

function buildActionAlias( resourceName, actionName ) {
	return [ resourceName, actionName ].join( '.' );
}

function buildActionTopic( resourceName, action ) {
	return [ resourceName, action.topic ].join( '.' );
}

function checkPermissionFor( state, user, context, action ) {
	log.debug( 'Checking %s\'s permissions for %s', state.config.getUserString( user ), action );
	return state.authProvider.checkPermission( user, action, context )
		.then( null, function( err ) {
			log.debug( 'Error during check permissions: %s', err.stack );
			return false;
		} )
		.then( function( granted ) {
			return granted;
		} );
}

function start( state ) {
	state.socket.start( state.authProvider );
}

function stop( state ) {
	state.socket.stop();
}

function wireupResource( state, resource ) {
	var meta = { topics: {} };
	_.each( resource.actions, function( action, actionName ) {
		wireupAction( state, resource, actionName, action, meta );
	} );
	return meta;
}

function getMetadata( state, resource, actionName, action ) {
	var topic = buildActionTopic( resource.name, action );
	var alias = buildActionAlias( resource.name, actionName );
	var errors = state.metrics.meter( [ topic, 'error' ] );
	var metricKey = [ state.metrics.prefix, [ resource.name, actionName ].join( '-' ), 'ws' ];
	return {
		alias: alias,
		authAttempted: function() {
			state.metrics.authorizationAttempts.record( 1, { name: 'WS_AUTHORIZATION_ATTEMPTS' } );
		},
		authGranted: function() {
			state.metrics.authorizationGrants.record( 1, { name: 'WS_AUTHORIZATION_GRANTS' } );
		},
		authRejected: function() {
			state.metrics.authorizationRejections.record( 1, { name: 'WS_AUTHORIZATION_REJECTIONS' } );
		},
		topic: topic,
		errors: errors,
		metricKey: metricKey
	};
}

function respond( state, meta, resource, action, client, data, message, resourceTimer ) {
	var envelope = new state.Envelope( meta.topic, message, client, meta.metricKey, resourceTimer );
	var result;
	if ( state.config && state.config.handleRouteErrors ) {
		try {
			result = action.handle.apply( resource, [ envelope ] );
		} catch ( err ) {
			meta.errors.record( 1, { name: 'WS_TOPIC_ERRORS' } );
			client.publish( data.replyTo || meta.topic,
				'Server error at topic ' + meta.topic );
		}
	} else {
		result = action.handle.apply( resource, [ envelope ] );
	}
	if ( result ) {
		if ( result.then ) {
			var onResult = function onResult( x ) {
				envelope.handleReturn( state.config, resource, action, x );
			};
			result.then( onResult, onResult );
		} else {
			envelope.handleReturn( state.config, resource, action, result );
		}
	}
}

function wireupAction( state, resource, actionName, action, metadata ) {
	var meta = getMetadata( state, resource, actionName, action, metadata );
	metadata.topics[ actionName ] = { topic: meta.topic };
	log.debug( 'Mapping resource \'%s\' action \'%s\' to topic %s', resource.name, actionName, meta.alias );
	state.socket.on( meta.topic, function( message, client ) {
		var data = message.data || message;
		var resourceTimer = state.metrics.timer( [ resource.name + '-' + actionName, 'ws', 'duration' ] );
		if ( state.authProvider ) {
			checkPermissionFor( state, client.user, {}, meta.alias )
				.then( function( pass ) {
					if ( pass ) {
						meta.authGranted();
						log.debug( 'WS activation of action %s for %s granted',
							meta.alias, state.config.getUserString( client.user ) );
						respond( state, meta, resource, action, client, data, message, resourceTimer );
					} else {
						meta.authRejected();
						log.debug( 'User %s was denied WS activation of action %s',
							state.config.getUserString( client.user ), meta.alias );
						client.publish( data.replyTo || meta.topic,
							'User lacks sufficient permissions' );
					}
				} );
		} else {
			respond( state, meta, resource, action, client, data, message, resourceTimer );
		}
	} );
}

module.exports = function( config, authProvider, socket ) {
	var state = {
		authProvider: authProvider,
		config: config,
		metrics: metronic(),
		name: 'http',
		socket: socket
	};
	_.merge( state, {
		action: wireupAction.bind( undefined, state ),
		Envelope: require( './socketEnvelope.js' ),
		resource: wireupResource.bind( undefined, state ),
		start: start.bind( undefined, state ),
		stop: stop.bind( undefined, state )
	} );
	return state;
};


text:
package main

import (
	"fmt"
)

type Request struct {
	args []int
	f    func([]int) int

	resultChan chan int
}

func main() {
	clientRequests := make(chan *Request)
	go handle(clientRequests)

	request := &Request{[]int{3, 4, 5}, sum, make(chan int)}
	clientRequests <- request
	fmt.Printf("answer: %d\n", <-request.resultChan)

	request = &Request{[]int{10, 4, 5}, sum, make(chan int)}
	clientRequests <- request
	fmt.Printf("answer: %d\n", <-request.resultChan)
}

func handle(queue chan *Request) {
	for req := range queue {
		req.resultChan <- req.f(req.args)
	}
}

func sum(a []int) (s int) {
	for _, v := range a {
		s += v
	}
	return
}


text:
NAME=ldap_server
docker rm -f $NAME 2>/dev/null

docker run --env LDAP_ORGANISATION="Harbor." \
--env LDAP_DOMAIN="example.com" \
--env LDAP_ADMIN_PASSWORD="admin" \
--env LDAP_TLS_VERIFY_CLIENT="never" \
-p 389:389 \
-p 636:636 \
--detach --name $NAME osixia/openldap:1.1.7

sleep 5
docker cp ldap_test.ldif ldap_server:/
docker exec ldap_server ldapadd -x -D "cn=admin,dc=example,dc=com" -w admin -f /ldap_test.ldif -ZZ

# failed and retry
for number in {1..10}
do
    if [ ! $? -eq 0 ]; then
        sleep 6
        echo "retry in $number "
        docker exec ldap_server ldapadd -x -D "cn=admin,dc=example,dc=com" -w admin -f /ldap_test.ldif -ZZ
    else
        exit 0
    fi
done
exit 1


text:
*What Git concepts were you struggling with prior to the GPS session?

I was having some issues with proper Git workflow prior to this session, and was uncertain on when to execute certain commands.

*What concepts were clarified during the GPS?

I was more comfortable using proper git workflow, and why certain steps need to be taken.

*What questions did you ask your pair and the guide?

I had some questions about when to be working on certain branches, and the exact order of adding files when in new branches.

*What still confuses you about Git?

After finishing the week out, I feel very comfortable with Git, and not too confused on any aspect.

*How was your first experience of pairing in a GPS?

Good first session, and definitely glad I did this early in the week, and helped with other assignments when using git commands. It was good working with a partner, and learning another perspective about the workflow and how others think when it comes to assignments.


text:
// Copyright © 2010 onwards, Andrew Whewell
// All rights reserved.
//
// Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
//    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
//    * Neither the name of the author nor the names of the program's contributors may be used to endorse or promote products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VirtualRadar.Interface;
using System.IO;
using VirtualRadar.Interface.Settings;
using InterfaceFactory;
using System.Drawing;

namespace VirtualRadar.Library
{
    /// <summary>
    /// The default implementation of <see cref="IAircraftPictureManager"/>.
    /// </summary>
    sealed class AircraftPictureManager : IAircraftPictureManager
    {
        /// <summary>
        /// The log object that we'll use to record errors.
        /// </summary>
        private ILog _Log;

        private static readonly IAircraftPictureManager _Singleton = new AircraftPictureManager();
        /// <summary>
        /// See interface docs.
        /// </summary>
        public IAircraftPictureManager Singleton { get { return _Singleton; } }

        /// <summary>
        /// See interface docs.
        /// </summary>
        /// <param name="directoryCache"></param>
        /// <param name="icao24"></param>
        /// <param name="registration"></param>
        /// <returns></returns>
        public PictureDetail FindPicture(IDirectoryCache directoryCache, string icao24, string registration)
        {
            PictureDetail result = null;

            var fileName = GetImageFileName(directoryCache, icao24, registration);
            if(!String.IsNullOrEmpty(fileName)) {
                var fileInfo = new FileInfo(fileName);
                if(fileInfo != null) {
                    Image image = null;
                    try {
                        image = LoadImage(fileName);
                        if(image != null) {
                            result = new PictureDetail() {
                                FileName = fileName,
                                Width = image.Width,
                                Height = image.Height,
                                LastModifiedTime = fileInfo.LastWriteTimeUtc,
                                Length = fileInfo.Length,
                            };
                        }
                    } finally {
                        if(image != null) image.Dispose();
                    }
                }
            }

            return result;
        }

        /// <summary>
        /// See interface docs.
        /// </summary>
        /// <param name="directoryCache"></param>
        /// <param name="icao24"></param>
        /// <param name="registration"></param>
        /// <param name="existingDetail"></param>
        /// <returns></returns>
        public PictureDetail FindPicture(IDirectoryCache directoryCache, string icao24, string registration, PictureDetail existingDetail)
        {
            var result = existingDetail;

            if(existingDetail == null) result = FindPicture(directoryCache, icao24, registration);
            else {
                var fileName = GetImageFileName(directoryCache, icao24, registration);
                if(String.IsNullOrEmpty(fileName)) result = null;
                else {
                    var fileInfo = new FileInfo(fileName);
                    if(fileInfo == null) result = null;
                    else if(fileInfo.LastWriteTimeUtc != existingDetail.LastModifiedTime || fileInfo.Length != existingDetail.Length) {
                        result = FindPicture(directoryCache, icao24, registration);
                    }
                }
            }

            return result;
        }

        /// <summary>
        /// See interface docs.
        /// </summary>
        /// <param name="directoryCache"></param>
        /// <param name="icao24"></param>
        /// <param name="registration"></param>
        /// <returns></returns>
        public Image LoadPicture(IDirectoryCache directoryCache, string icao24, string registration)
        {
            Image result = null;

            var fileName = GetImageFileName(directoryCache, icao24, registration);
            if(!String.IsNullOrEmpty(fileName)) result = LoadImage(fileName);

            return result;
        }

        /// <summary>
        /// Gets the filename of the aircraft's picture, if any.
        /// </summary>
        /// <param name="directoryCache"></param>
        /// <param name="icao24"></param>
        /// <param name="registration"></param>
        /// <returns></returns>
        private string GetImageFileName(IDirectoryCache directoryCache, string icao24, string registration)
        {
            string result = null;

            if(!String.IsNullOrEmpty(icao24)) {
                result = SearchForPicture(directoryCache, icao24, "jpg") ??
                         SearchForPicture(directoryCache, icao24, "jpeg") ??
                         SearchForPicture(directoryCache, icao24, "png") ??
                         SearchForPicture(directoryCache, icao24, "gif") ??
                         SearchForPicture(directoryCache, icao24, "bmp");
            }

            if(result == null && !String.IsNullOrEmpty(registration)) {
                var icaoCompliantRegistration = Describe.IcaoCompliantRegistration(registration);
                result = SearchForPicture(directoryCache, icaoCompliantRegistration, "jpg") ??
                         SearchForPicture(directoryCache, icaoCompliantRegistration, "jpeg") ??
                         SearchForPicture(directoryCache, icaoCompliantRegistration, "png") ??
                         SearchForPicture(directoryCache, icaoCompliantRegistration, "gif") ??
                         SearchForPicture(directoryCache, icaoCompliantRegistration, "bmp");
            }

            return result;
        }

        /// <summary>
        /// Loads the image at the filename passed across.
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        private Image LoadImage(string fileName)
        {
            Image result = null;

            if(!String.IsNullOrEmpty(fileName)) {
                try {
                    result = Image.FromFile(fileName);
                } catch(Exception ex) {
                    if(_Log == null) _Log = Factory.Singleton.Resolve<ILog>().Singleton;
                    _Log.WriteLine("AircraftPictureManager caught an exception while loading {0}: {1}", fileName, ex.ToString());
                }
            }

            return result;
        }

        /// <summary>
        /// Returns the full path to the file if the file exists or null if it does not.
        /// </summary>
        /// <param name="directoryCache"></param>
        /// <param name="fileName"></param>
        /// <param name="extension"></param>
        /// <returns></returns>
        private string SearchForPicture(IDirectoryCache directoryCache, string fileName, string extension)
        {
            return directoryCache.GetFullPath(String.Format("{0}.{1}", fileName, extension));
        }
    }
}


text:
<?php

namespace ZendTest\Mvc\Service;

use Interop\Container\ContainerInterface;
use PHPUnit_Framework_TestCase as TestCase;
use Zend\Mvc\Service\ViewFeedStrategyFactory;
use Zend\View\Renderer\FeedRenderer;
use Zend\View\Strategy\FeedStrategy;

class ViewFeedStrategyFactoryTest extends TestCase
{
    private function createContainer()
    {
        $renderer  = $this->prophesize(FeedRenderer::class);
        $container = $this->prophesize(ContainerInterface::class);
        $container->get('ViewFeedRenderer')->will(function () use ($renderer) {
            return $renderer->reveal();
        });
        return $container->reveal();
    }

    public function testReturnsFeedStrategy()
    {
        $factory = new ViewFeedStrategyFactory();
        $result  = $factory($this->createContainer(), 'ViewFeedStrategy');
        $this->assertInstanceOf(FeedStrategy::class, $result);
    }
}


text: require 'base32/crockford'


text:
Atouts

Multiplateforme Win/Mac/Linux

Très faible coût

Communauté immense, grandissante et dynamique

Plans en libre accès : licence Creative Commons (By-SA)

Outil idéal pour l'apprentissage de l'électronique


text:
/**
 * This file tests the normal operation of setAndFetchFaviconForPage.
 */

////////////////////////////////////////////////////////////////////////////////
/// Globals

const FAVICON_URI = NetUtil.newURI(do_get_file("favicon-normal32.png"));
const FAVICON_DATA = readFileData(do_get_file("favicon-normal32.png"));
const FAVICON_MIMETYPE = "image/png";

////////////////////////////////////////////////////////////////////////////////
/// Tests

function run_test()
{
  // Check that the favicon loaded correctly before starting the actual tests.
  do_check_eq(FAVICON_DATA.length, 344);
  run_next_test();
}

add_test(function test_normal()
{
  let pageURI = NetUtil.newURI("http://example.com/normal");
  waitForFaviconChanged(pageURI, FAVICON_URI,
                        function test_normal_callback() {
    checkFaviconDataForPage(pageURI, FAVICON_MIMETYPE, FAVICON_DATA,
                            run_next_test);
  });

  addVisits({ uri: pageURI, transition: TRANSITION_TYPED}, function () {
    PlacesUtils.favicons.setAndFetchFaviconForPage(pageURI, FAVICON_URI, true,
                                                   PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE);
  });
});

add_test(function test_aboutURI_bookmarked()
{
  let pageURI = NetUtil.newURI("about:testAboutURI_bookmarked");
  waitForFaviconChanged(pageURI, FAVICON_URI,
                        function test_aboutURI_bookmarked_callback() {
    checkFaviconDataForPage(pageURI, FAVICON_MIMETYPE, FAVICON_DATA,
                            run_next_test);
  });

  PlacesUtils.bookmarks.insertBookmark(
                          PlacesUtils.unfiledBookmarksFolderId, pageURI,
                          PlacesUtils.bookmarks.DEFAULT_INDEX, pageURI.spec);
  PlacesUtils.favicons.setAndFetchFaviconForPage(pageURI, FAVICON_URI, true,
                                                 PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE);
});

add_test(function test_privateBrowsing_bookmarked()
{
  if (!("@mozilla.org/privatebrowsing;1" in Cc)) {
    do_log_info("Private Browsing service is not available, bail out.");
    run_next_test();
    return;
  }

  let pageURI = NetUtil.newURI("http://example.com/privateBrowsing_bookmarked");
  waitForFaviconChanged(pageURI, FAVICON_URI,
                        function test_privateBrowsing_bookmarked_callback() {
    checkFaviconDataForPage(pageURI, FAVICON_MIMETYPE, FAVICON_DATA,
                            run_next_test);
  });

  // Enable private browsing while changing the favicon.
  let pb = Cc["@mozilla.org/privatebrowsing;1"]
           .getService(Ci.nsIPrivateBrowsingService);
  Services.prefs.setBoolPref("browser.privatebrowsing.keep_current_session",
                             true);
  pb.privateBrowsingEnabled = true;

  PlacesUtils.bookmarks.insertBookmark(
                          PlacesUtils.unfiledBookmarksFolderId, pageURI,
                          PlacesUtils.bookmarks.DEFAULT_INDEX, pageURI.spec);
  PlacesUtils.favicons.setAndFetchFaviconForPage(pageURI, FAVICON_URI, true,
                                                 PlacesUtils.favicons.FAVICON_LOAD_PRIVATE);

  // The setAndFetchFaviconForPage function calls CanAddURI synchronously,
  // thus we can exit Private Browsing Mode immediately.
  pb.privateBrowsingEnabled = false;
  Services.prefs.clearUserPref("browser.privatebrowsing.keep_current_session");
});

add_test(function test_disabledHistory_bookmarked()
{
  let pageURI = NetUtil.newURI("http://example.com/disabledHistory_bookmarked");
  waitForFaviconChanged(pageURI, FAVICON_URI,
                        function test_disabledHistory_bookmarked_callback() {
    checkFaviconDataForPage(pageURI, FAVICON_MIMETYPE, FAVICON_DATA,
                            run_next_test);
  });

  // Disable history while changing the favicon.
  Services.prefs.setBoolPref("places.history.enabled", false);

  PlacesUtils.bookmarks.insertBookmark(
                          PlacesUtils.unfiledBookmarksFolderId, pageURI,
                          PlacesUtils.bookmarks.DEFAULT_INDEX, pageURI.spec);
  PlacesUtils.favicons.setAndFetchFaviconForPage(pageURI, FAVICON_URI, true,
                                                 PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE);

  // The setAndFetchFaviconForPage function calls CanAddURI synchronously, thus
  // we can set the preference back to true immediately.  We don't clear the
  // preference because not all products enable Places by default.
  Services.prefs.setBoolPref("places.history.enabled", true);
});


text:
This is a simple example of an application that consumes the [Mendeley](http://www.mendeley.com) API, using the [Python SDK](http://mendeley-python.readthedocs.org/).

For more information on the API, see the [developer portal](http://dev.mendeley.com).

## About the application ##

The application is a website that allows you to see the documents in your Mendeley library, together with their annotations.  It also allows you to look up a document by [DOI](http://www.doi.org/).

It's built with [Flask](http://flask.pocoo.org/) and [Jinja2](http://jinja.pocoo.org/docs/).

## How to run ##

1. Install [Python](https://www.python.org/) and [Pip](https://pip.pypa.io/en/latest/).
2. Register your client at the [developer portal](http://dev.mendeley.com). Use `http://localhost:5000/oauth` as your  Redirect URI. This will give you a client ID and secret.
3. Rename the config.yml.example file to config.yml, and fill in your client ID and secret in this file.
4. Run the following command to install dependencies:

        pip install -r requirements.txt

5. Start the server:

		python mendeley-example.py

6. Go to http://localhost:5000 in your browser.

## Build status ##

![Travis CI](https://travis-ci.org/Mendeley/mendeley-api-python-example.svg?branch=master)


text:
<?php
class Script extends CI_Model {

	function __construct() {
        parent::__construct();
        $this->load->library('email');
        $this->limit_per_page = $this->config->item('limit_per_page');

    }

    public function get_brokers() {
        $this->db->select('*')->from('broker_info');
        $result = $this->db->get();
        if($result->num_rows()>0){
			return $result->result_array();
        } else {
			return false;
		}
    }

	/**
	 * Getting brokers list for dropdown on add load
	 */

	public function getBrokersList() {
		$this->db->select('TruckCompanyName,id,MCNumber');
		$whereCondition = array('black_list' => 0, 'MCNumber !=' => 0 );
		$this->db->where($whereCondition)->order_by("TruckCompanyName","asc");
		$result = $this->db->get('broker_info');
		if ( $result->num_rows() > 0 ) {
			return $result->result_array();
		} else {
			return array();
		}
	}

	/**
	 * Fetching information from backup table 'broker_info_revert'
	 */

	public function getBrokerslistingRevertTable() {
		$this->db->select("id,MCNumber,PointOfContact,REPLACE(REPLACE(REPLACE(REPLACE(`PointOfContactPhone`,'(',''),')',''),'-',''),' ','') as pointPhoneNumber,REPLACE(REPLACE(REPLACE(REPLACE(`TruckCompanyPhone`,'(',''),')',''),'-',''),' ','') as truckPhoneNumber,TruckCompanyEmail,TruckCompanyPhone,TruckCompanyFax");
		$result = $this->db->get('broker_info_revert');
		if ( $result->num_rows() > 0 ) {
			return $result->result_array();
		} else {
			return array();
		}
	}

	/**
	 * Fetching information from loads table to update fields
	 */

	public function getLoadslisting() {
		$this->db->select("id,broker_id");
		$result = $this->db->get('loads');
		if ( $result->num_rows() > 0 ) {
			return $result->result_array();
		} else {
			return array();
		}
	}

	/**
	 * Fetching information from broker info table using its id
	 */

	public function getBrokerInfo( $brokerId = null ) {
		$this->db->select("id,MCNumber,PointOfContact,PointOfContactPhone,TruckCompanyPhone,TruckCompanyEmail,TruckCompanyFax");
		$this->db->where('id',$brokerId);
		$result = $this->db->get('broker_info');
		if ( $result->num_rows() > 0 ) {
			return $result->row_array();
		} else {
			return array();
		}
	}

	/**
	 * Updating loads table 5 fields with broker info  talbe fields
	 */

	public function updateLoadsTable( $data = array(), $loadId = null ) {
		$this->db->where('loads.id',$loadId);
		$this->db->update('loads',$data);
		return true;
	}

	public function updateBrokerInfoTable( $data = array(), $mc_number = null ) {
		$this->db->where('broker_info.MCNumber',$mc_number);
		$this->db->update('broker_info',$data);
		return true;
	}

	/**
	 * Fetching all records from loads table
	 */

	public function fetchAllLoads() {
		$this->db->select('id,PickupAddress,OriginCity,OriginState,OriginCountry,DestinationAddress,DestinationCity,DestinationState,DestinationCountry');
		return $this->db->get('loads')->result_array();
	}

	/**
	 * updating the loads table fields by splitting
	 */

	public function saveLoadData($data = array(), $loadId = null) {
		$this->db->where('loads.id',$loadId);
		$this->db->update('loads',$data);
		return true;
	}

	/**
	 * Fetching all records from extra Stops table
	 */

	public function fetchAllExtraStops() {
		$this->db->select('id,extraStopAddress');
		return $this->db->get('extra_stops')->result_array();
	}

	/**
	 * updating the loads table fields by splitting
	 */

	public function saveExtraStopData($data = array(), $stopId = null) {
		$this->db->where('extra_stops.id',$stopId);
		$this->db->update('extra_stops',$data);
		return true;
	}

	/**
	* Fetching driver logs from logs table
	*/

	public function getDriverLogs($entity) {
		$this->db->where('entity_name',$entity);
		$result = $this->db->get('activity_log');
		return $result->result_array();

	}

}


text:
import RiotControl from 'riotcontrol'
import ActionTypes from '../action/app.actiontypes'
import AppStore from '../store/app.store'
import AppAction from '../action/app.action'

import "./common/login.tag"
import "./home/home.tag"
import "./work/work.view.tag"

class Router{

  constructor(){

    this._checkInitialPath();
    this.registerRoutes();

    this._mount(AppStore.config.views.root);

  }
  _checkInitialPath(){

    if(window.location.pathname.match(AppStore.config.path.work_page)){
      RiotControl.trigger(ActionTypes.ON_INITIAL_LOCATION,AppStore.config.path.work_page)
    }
  }
  _mount = (tagName , option = {}) =>
  {

    // WORK/*
    if(tagName == AppStore.config.views.work){
      riot.mount('div#work-overlay' , tagName , option);
    // HOME..
    }else{
      riot.mount('div#main' , tagName , option);
    }
  };

  registerRoutes(){

    route("portfolio/*",(name)=>{

      AppAction.getPost(name)
      .then(()=>{
        RiotControl.trigger(ActionTypes.ON_ROUTE_CHANGED,AppStore.config.views.work)
        this._mount(AppStore.config.views.work,name);

      })

    })
    //ルーター(イベントリスナーも兼ねてる)
    route((action='home') =>{
      console.log('route on home ',action)
      AppAction.onresize()
      RiotControl.trigger(ActionTypes.ON_NAV_MENU_CLICKED,action)

    });

    route.base('/') // use history api rather than #
    route.start(true);
  }
}

export default Router


text:
package com.vipul.hp_hp.layout_to_image;

import android.graphics.Bitmap;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.vipul.hp_hp.library.Layout_to_Image;

public class MainActivity extends ActionBarActivity {

    Layout_to_Image layout_to_image;

    RelativeLayout relativeLayout;

    Bitmap bitmap;

    ImageView imageView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        relativeLayout=(RelativeLayout)findViewById(R.id.container);
        imageView=(ImageView)findViewById(R.id.imageView2);

        layout_to_image=new Layout_to_Image(MainActivity.this,relativeLayout);

        bitmap=layout_to_image.convert_layout();

        imageView.setImageBitmap(bitmap);

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}


text:
<!doctype html>

	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<title>Home — Jeremy Sarda</title>

	<link rel="manifest" href="manifest.json">

	<link rel="shortcut icon" href="/img/icons/favicon.ico" type="image/x-icon"/>
	<link rel="apple-touch-icon" sizes="57x57" href="/img/icons/apple-touch-icon-57x57.png">
	<link rel="apple-touch-icon" sizes="60x60" href="/img/icons/apple-touch-icon-60x60.png">
	<link rel="apple-touch-icon" sizes="72x72" href="/img/icons/apple-touch-icon-72x72.png">
	<link rel="apple-touch-icon" sizes="76x76" href="/img/icons/apple-touch-icon-76x76.png">
	<link rel="apple-touch-icon" sizes="114x114" href="/img/icons/apple-touch-icon-114x114.png">
	<link rel="apple-touch-icon" sizes="120x120" href="/img/icons/apple-touch-icon-120x120.png">
	<link rel="apple-touch-icon" sizes="144x144" href="/img/icons/apple-touch-icon-144x144.png">
	<link rel="apple-touch-icon" sizes="152x152" href="/img/icons/apple-touch-icon-152x152.png">
	<link rel="apple-touch-icon" sizes="180x180" href="/img/icons/apple-touch-icon-180x180.png">
	<link rel="icon" type="image/png" href="/img/icons/favicon-16x16.png" sizes="16x16">
	<link rel="icon" type="image/png" href="/img/icons/favicon-32x32.png" sizes="32x32">
	<link rel="icon" type="image/png" href="/img/icons/favicon-96x96.png" sizes="96x96">
	<link rel="icon" type="image/png" href="/img/icons/android-chrome-192x192.png" sizes="192x192">
	<meta name="msapplication-square70x70logo" content="/img/icons/smalltile.png"/>
	<meta name="msapplication-square150x150logo" content="/img/icons/mediumtile.png"/>
	<meta name="msapplication-wide310x150logo" content="/img/icons/widetile.png"/>
	<meta name="msapplication-square310x310logo" content="/img/icons/largetile.png"/>

<app-shell>

</app-shell>

<app-view></app-view>


text:
#region Apache License
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to you 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.
//
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Net;
using System.Net.Sockets;

using Thrift;
using Thrift.Collections;
using Thrift.Protocol;
using Thrift.Transport;

using log4net.Layout;
using log4net.Core;
using log4net.Util;

namespace log4net.Appender
{
    /// <summary>
    /// Sends logging events to a Scribe server.
    /// </summary>
    /// <remarks>
    /// <para>
    /// For more information regarding Scribe, please refer to the Scribe project page: https://github.com/facebook/scribe/.
    /// </para>
    /// </remarks>
    /// <example>
    /// <code lang="XML" escaped="true">
    /// <appender name="ScribeAppender" type="log4net.Appender.ScribeAppender, ScribeAppender">
    ///     <remoteHost value="ScribeServer" />
    ///     <remotePort value="8080" />
    ///     <scribeTimeout value="200" />
    ///     <category value="Example" />
    ///     <layout type="log4net.Layout.PatternLayout" value="%-5level %logger [%ndc] - %message%newline" />
    /// </appender>
    /// </code>
    /// </example>
    /// <author>Neal Sebastian</author>
    public class ScribeAppender : AppenderSkeleton
    {
        #region Public Instance Constructors

		/// <summary>
		/// Initializes a new instance of the <see cref="ScribeAppender" /> class.
		/// </summary>
		/// <remarks>
		/// The default constructor initializes all fields to their default values.
		/// </remarks>
        public ScribeAppender()
		{

		}

		#endregion Public Instance Constructors

        #region Public Instance Properties

        /// <summary>
        /// Gets or sets the hostname or IP address of the Scribe server to which the logging event should be sent.
        /// </summary>
        /// <value>
        /// The hostname or IP address of the Scribe server.
        /// </value>
        public string RemoteHost
        {
            get { return remoteHost; }
            set { remoteHost = value; }
        }

        /// <summary>
        /// Gets or sets the TCP port number of the Scribe server to which the logging event should be sent.
        /// </summary>
        /// <value>
        /// An integer value in the range <see cref="IPEndPoint.MinPort" /> to <see cref="IPEndPoint.MaxPort" />
		/// indicating the TCP port number of the remote host or multicast group to which the logging event
		/// will be sent.
        /// </value>
        public int RemotePort
        {
            get { return remotePort; }
            set
            {
                if (value < IPEndPoint.MinPort || value > IPEndPoint.MaxPort)
                {
                    throw log4net.Util.SystemInfo.CreateArgumentOutOfRangeException("value", (object)value,
                        "The value specified is less than " +
                        IPEndPoint.MinPort.ToString(NumberFormatInfo.InvariantInfo) +
                        " or greater than " +
                        IPEndPoint.MaxPort.ToString(NumberFormatInfo.InvariantInfo) + ".");
                }
                else
                {
                    remotePort = value;
                }
            }
        }

        /// <summary>
        /// Gets or sets the time interval to determine if the connecetion to the Scribe server is lost.
        /// </summary>
        /// <value>
        /// An integer value in the range 1 to <see cref="Int32.MaxValue" />
        /// </value>
        public int ScribeTimeout
        {
            get { return scribeTimeout; }
            set
            {
                if (value < 0)
                {
                    throw log4net.Util.SystemInfo.CreateArgumentOutOfRangeException("value", (object)value,
                        "The value specified is less than 0.");
                }
            }
        }

        /// <summary>
        /// Gets or sets the category of the log message
        /// </summary>
        /// <value>
        /// Any string.
        /// </value>
        public string Category
        {
            get { return this.category; }
            set { this.category = value; }
        }

        /// <summary>
        /// RFU
        /// </summary>
        public Encoding Encoding
        {
            get { return messageEncoding; }
            set { messageEncoding = value; }
        }

        #endregion Public Instance Properties

        #region Protected Instance Properties

        /// <summary>
        /// Gets or sets the underlying <see cref="TSocket" />
        /// </summary>
        protected TSocket ThriftSocket
        {
            get { return this.thriftSocket; }
            set { this.thriftSocket = value; }
        }

        /// <summary>
        /// Gets or sets the underlying <see cref="TFramedTransport" />
        /// </summary>
        protected TFramedTransport ThriftFramedTransport
        {
            get { return this.thriftFramedTransport; }
            set { this.thriftFramedTransport = value; }
        }

        /// <summary>
        /// Gets or sets the underlying <see cref="ThriftBinaryProtocol" />
        /// </summary>
        protected TBinaryProtocol ThriftBinaryProtocol
        {
            get { return this.thriftBinaryProtocol; }
            set { this.thriftBinaryProtocol = value; }
        }

        /// <summary>
        /// Gets or sets the underlying <see cref="scribe.Client" />
        /// </summary>
        protected scribe.Client ScribeClient
        {
            get { return this.scribeClient; }
            set { this.scribeClient = value; }
        }

        #endregion Protected Instance Properties

        #region Private Instance Fields

        /// <summary>
        /// The IP address of the remote host or multicast group to which
        /// the logging event will be sent.
        /// </summary>
        private string remoteHost;

        /// <summary>
        /// The TCP port number of the remote host or multicast group to
        /// which the logging event will be sent.
        /// </summary>
        private int remotePort;

        /// <summary>
        /// Default timeout if <see cref="scribeTimeout" /> is not specified in the configuration file.
        /// </summary>
        private const int defaultTimeout = 300;
        /// <summary>
        /// The timeout used by the internal Scribe client
        /// </summary>
        private int scribeTimeout = defaultTimeout;

        /// <summary>
        /// The underlying <see cref="TSocket" /> used by the internal Scribe client
        /// </summary>
        private TSocket thriftSocket;

        /// <summary>
        /// The underlying <see cref="TFramedTransport" /> used by the internal Scribe client
        /// </summary>
        private TFramedTransport thriftFramedTransport;

        /// <summary>
        /// The underlying <see cref="TBinaryProtocol" /> used by the internal Scribe client
        /// </summary>
        private TBinaryProtocol thriftBinaryProtocol;

        /// <summary>
        /// The internal <see cref="scribe.Client" />
        /// </summary>
        private scribe.Client scribeClient;

        /// <summary>
        /// The category of the logging event.
        /// </summary>
        private string category;

        /// <summary>
        /// The encoding to use for the message.
        /// </summary>
        private Encoding messageEncoding = Encoding.Default;

        #endregion Private Instance Fields

        #region Implementation of IOptionHandler

        /// <summary>
        /// Initialize the appender based on the options set.
        /// </summary>
        /// <remarks>
        /// <para>
        /// This is part of the <see cref="IOptionHandler"/> delayed object
        /// activation scheme. The <see cref="ActivateOptions"/> method must
        /// be called on this object after the configuration properties have
        /// been set. Until <see cref="ActivateOptions"/> is called this
        /// object is in an undefined state and must not be used.
        /// </para>
        /// <para>
        /// If any of the configuration properties are modified then
        /// <see cref="ActivateOptions"/> must be called again.
        /// </para>
        /// <para>
        /// The appender will be ignored if no <see cref="RemoteHost" /> was specified or
        /// an invalid remote TCP port number was specified.
        /// </para>
        /// </remarks>
        /// <exception cref="ArgumentNullException">The required property <see cref="RemoteHost" /> was not specified.</exception>
        /// <exception cref="ArgumentOutOfRangeException">The TCP port number assigned to <see cref="RemotePort" /> is less than <see cref="IPEndPoint.MinPort" /> or greater than <see cref="IPEndPoint.MaxPort" />.</exception>
        public override void ActivateOptions()
		{
			base.ActivateOptions();

			if (this.RemoteHost == null)
			{
				throw new ArgumentNullException("The required property 'RemoteHost' was not specified.");
			}
			else if (this.RemotePort < IPEndPoint.MinPort || this.RemotePort > IPEndPoint.MaxPort)
			{
				throw log4net.Util.SystemInfo.CreateArgumentOutOfRangeException("this.RemotePort", (object)this.RemotePort,
					"The RemotePort is less than " +
					IPEndPoint.MinPort.ToString(NumberFormatInfo.InvariantInfo) +
					" or greater than " +
					IPEndPoint.MaxPort.ToString(NumberFormatInfo.InvariantInfo) + ".");
			}
            else if (this.Category == null)
            {
                throw new ArgumentNullException("The required property 'Category' was not specified.");
            }
			else
			{
				this.InitializeClientConnection();
			}
        }

        #endregion Implementation of IOptionHandler

        #region Override implementation of AppenderSkeleton

        /// <summary>
        /// This method is called by the <see cref="AppenderSkeleton.DoAppend(LoggingEvent)"/> method.
        /// </summary>
        /// <param name="loggingEvent">The event to log.</param>
        /// <remarks>
        /// <para>
        /// Sends the event to a Scribe server.
        /// </para>
        /// <para>
        /// Exceptions are passed to the <see cref="AppenderSkeleton.ErrorHandler"/>.
        /// </para>
        /// </remarks>
        protected override void Append(LoggingEvent loggingEvent)
        {
            try
            {
                var log = new LogEntry();
                log.Category = this.category;
                log.Message = RenderLoggingEvent(loggingEvent);
                var logs = new List<LogEntry>();
                logs.Add(log);
                var result = this.ScribeClient.Log(logs);
                if (result != ResultCode.OK)
                {
                    throw new ApplicationException("Scribe Log() returned " + result.ToString() + ".");
                }
            }
            catch (Exception ex)
            {
                ErrorHandler.Error(
                    "Unable to send logging event to remote host " +
                    this.RemoteHost +
                    " on port " +
                    this.RemotePort + ".",
                    ex,
                    ErrorCode.WriteFailure);
            }
        }

        /// <summary>
        /// This method is called by the <see cref="AppenderSkeleton.DoAppend(LoggingEvent[])"/> method.
        /// </summary>
        /// <param name="loggingEvent">The event to log.</param>
        /// <remarks>
        /// <para>
        /// Sends the event to a Scribe server.
        /// </para>
        /// <para>
        /// Exceptions are passed to the <see cref="AppenderSkeleton.ErrorHandler"/>.
        /// </para>
        /// </remarks>
        protected override void Append(LoggingEvent[] loggingEvents)
        {
            try
            {
                var logs = new List<LogEntry>();
                foreach (LoggingEvent le in loggingEvents)
                {
                    var log = new LogEntry();
                    log.Category = this.Category;
                    log.Message = RenderLoggingEvent(le);
                    logs.Add(log);
                }
                var result = this.ScribeClient.Log(logs);
                if (result != ResultCode.OK)
                {
                    throw new ApplicationException("Scribe Log() returned " + result.ToString() + ".");
                }
            }
            catch (Exception ex)
            {
                ErrorHandler.Error(
                    "Unable to send logging event to remote host " +
                    this.RemoteHost +
                    " on port " +
                    this.RemotePort + ".",
                    ex,
                    ErrorCode.WriteFailure);
            }
        }

        /// <summary>
        /// This appender requires a <see cref="Layout"/> to be set.
        /// </summary>
        /// <value><c>true</c></value>
        /// <remarks>
        /// <para>
        /// This appender requires a <see cref="Layout"/> to be set.
        /// </para>
        /// </remarks>
        override protected bool RequiresLayout
        {
            get { return true; }
        }

        /// <summary>
        /// Closes the Scribe connection and releases all resources associated with
        /// this <see cref="ScribeAppender" /> instance.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Disables the underlying <see cref="scribe.Client" /> and releases all managed
        /// and unmanaged resources associated with the <see cref="ScribeAppender" />.
        /// </para>
        /// </remarks>
        override protected void OnClose()
        {
            base.OnClose();

            if (this.ScribeClient != null)
            {
                this.ThriftFramedTransport.Close();
                this.ThriftSocket = null;
                this.ThriftFramedTransport = null;
                this.ThriftBinaryProtocol = null;
                this.ScribeClient = null;
            }
        }

        #endregion Override implementation of AppenderSkeleton

        #region Protected Instance Methods

        /// <summary>
        /// Initializes the underlying  <see cref="scribe.Client" /> connection.
        /// </summary>
        /// <remarks>
        /// <para>
        /// The underlying <see cref="scribe.Client"/> is initialized and binds to the
        /// port number from which you intend to communicate.
        /// </para>
        /// <para>
        /// Exceptions are passed to the <see cref="AppenderSkeleton.ErrorHandler"/>.
        /// </para>
        /// </remarks>
        protected virtual void InitializeClientConnection()
        {
            try
            {
                this.ThriftSocket = new TSocket(this.RemoteHost, this.RemotePort, this.ScribeTimeout);
                this.ThriftFramedTransport = new TFramedTransport(this.ThriftSocket);
                this.ThriftBinaryProtocol = new TBinaryProtocol(this.ThriftFramedTransport, false, false);
                this.ScribeClient = new scribe.Client(this.ThriftBinaryProtocol);
                this.ThriftFramedTransport.Open();
            }
            catch (Exception ex)
            {
                ErrorHandler.Error(
                    "Could not initialize the scribe connection to " +
                    this.RemoteHost + ":" +
                    this.RemotePort.ToString(NumberFormatInfo.InvariantInfo),
                    ex,
                    ErrorCode.GenericFailure);
                this.ThriftSocket = null;
                this.ThriftFramedTransport = null;
                this.ThriftBinaryProtocol = null;
                this.ScribeClient = null;
            }
        }

        #endregion Protected Instance Methods
    }
}


text:
@interface AppDelegate : NSObject <NSApplicationDelegate>

@property (weak) IBOutlet NSWindow *window;
@property (strong) AF2OAuth1Client *twitterClient;

@end


text:
package liquibase.integration.ant;

import liquibase.Contexts;
import liquibase.Liquibase;
import liquibase.exception.LiquibaseException;
import org.apache.tools.ant.BuildException;

import java.io.IOException;
import java.io.Writer;

public class DatabaseRollbackFutureTask extends AbstractChangeLogBasedTask {
    @Override
    public void executeWithLiquibaseClassloader() throws BuildException {
        Liquibase liquibase = getLiquibase();
        try (Writer outputFileWriter = getOutputFileWriter()) {
            liquibase.futureRollbackSQL(new Contexts(getContexts()), getLabels(), outputFileWriter);
        } catch (LiquibaseException e) {
            throw new BuildException("Unable to generate future rollback SQL: " + e.getMessage(), e);
        } catch (IOException e) {
            throw new BuildException("Unable to generate future rollback SQL. Error creating output writer.", e);
        }
    }

    @Override
    protected void validateParameters() {
        super.validateParameters();

        if(getOutputFile() == null) {
            throw new BuildException("Output file is required.");
        }
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Cheilaria helicis Desm., 1847

### Remarks
null


text:
namespace SchoolSystem.Persons
{
    using System.Collections.Generic;

    public class Teacher : Person, ICommentable
    {
        public Teacher(string inputName, List<Discipline> inputDisciplines)
            : base(inputName)
        {
            this.Disciplines = inputDisciplines;
        }

        public List<Discipline> Disciplines { get; set; }

        public override string ToString()
        {
            return string.Format("Teacher name: {0}\nList of disciplines:\n{1}\nComment for this teacher: {2}\n", this.Name, string.Join("\n", this.Disciplines), this.Comment);
        }
    }
}


text:
<?php

namespace PhpToZephir\Converter\Printer\Expr\AssignOp;

use PhpParser\Node\Expr;
use PhpParser\Node\Expr\AssignOp;
use PhpToZephir\Converter\SimplePrinter;

class MulPrinter extends SimplePrinter
{
    public static function getType()
    {
        return 'pExpr_AssignOp_Mul';
    }

    public function convert(AssignOp\Mul $node)
    {
        return 'let '.$this->dispatcher->pInfixOp('Expr_AssignOp_Mul', $node->var, ' *= ', $node->expr);
    }
}


text:
package jp.co.opentone.bsol.framework.test.util;

import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateUtils;

import junit.framework.Assert;

/**
 * Map型のデータとPOJO型オブジェクト内のデータを比較するユーティリティクラス.
 *

 * Mapに登録されているキーをフィールド名として、比較対象オブジェクト内から
 * フィールド値を取得して値を比較します.
 *

 * 例)
 * Map("projectId", "123-456")のように値が格納されている場合、
 * 比較対象オブジェクトのgetProjectIdで得られる値と内容を比較します.
 *

 * Mapのキー値とフィールド名が異なる場合や、一部のキー値を比較対象から除外する
 * 場合は、フィールドexceptMapを使用します.
 * @author opentone
 */
public class AssertMapComparer {

    /**
     * 比較方法を表す列挙値.
     */
    // CHECKSTYLE:OFF
    public enum AssertCompareType {
        STRING,         // 文字列型(デフォルト)
        BIGDECIMAL,     // BigDecimal型
        DATE,           // 日付型
        TIMESTAMP,      // 時刻型
    };
    // CHECKSTYLE:ON

    /**
     * 日付を比較する際の変換書式.
     */
    public static final String FORMAT_DATE = "yyyy/MM/dd";

    /**
     * 時刻を比較する際の変換書式.
     */
    public static final String FORMAT_TIME = "yyyy/MM/dd HH:mm:ss";

    /**
     * 比較するテーブル列名とその比較型.
     *

     * Map内のキー名は設定名を大文字にした名前が対応する比較される.
     * Object内のフィールド名はアンダースコア後ろを大文字にしたフィールドが対応する.
     *

     * 例)
     * compMapに"project_id"を設定した場合は、
     * Mapの要素"PROJECT_ID"とObjectのフィールド名projectIdを比較する.
     *

     */
    private Map<String, AssertCompareType> compareKeys;

    /**
     * 比較対象のMap.
     */
    private Map<String, Object> compareMap;

    /**
     * 比較対象オブジェクト.
     */
    private Object compareObj;

    /**
     * 検証結果リスト.
     */
    private List<String> compareResult = new ArrayList<String>();

    /**
     * デフォルトコンストラクタ.
     */
    public AssertMapComparer() {
        compareKeys = new HashMap<String, AssertCompareType>();
    }

    /**
     * コンストラクタ.
     * @param compareMap 比較対象のMap
     * @param compareObj 比較対象のオブジェクト
     */
    public AssertMapComparer(Map<String, Object> compareMap, Object compareObj) {
        this();
        this.compareMap = compareMap;
        this.compareObj = compareObj;
    }

    /**
     * 比較キーを1件、文字列型で登録する.
     * @param compareKey 比較キー
     */
    public void addCompareKey(String compareKey) {
        this.compareKeys.put(compareKey, AssertCompareType.STRING);
    }

    /**
     * 比較キーを複数件、文字列型で登録する.
     * @param compareKeyArray 比較キー配列
     */
    public void addCompareKey(String[] compareKeyArray) {
        if (null != compareKeyArray) {
            for (String compareKey : compareKeyArray) {
                addCompareKey(compareKey);
            }
        }
    }

    /**
     * 比較キーを1件、指定した型で登録する.
     * キーが登録済みの場合は更新します.
     * @param compareKey 比較キー
     * @param compareType 比較タイプ
     */
    public void addCompareKey(String compareKey, AssertCompareType compareType) {
        if (StringUtils.isNotEmpty(compareKey)) {
            if (this.compareKeys.containsKey(compareKey)) {
                this.compareKeys.remove(compareKey);
            }
            this.compareKeys.put(compareKey, compareType);
        }
    }

    /**
     * 比較キーを1件、指定した型で登録する.
     * キーが未登録の場合は何も処理を行いません.
     * @param compareKey 比較キー
     * @param compareType 比較タイプ
     */
    public void updateCompareKey(String compareKey, AssertCompareType compareType) {
        if (StringUtils.isNotEmpty(compareKey)) {
            if (this.compareKeys.containsKey(compareKey)) {
                this.compareKeys.remove(compareKey);
                this.compareKeys.put(compareKey, compareType);
            }
        }
    }

    /**
     * 比較キーをクリアする.
     */
    public void clearCompareKey() {
        this.compareKeys.clear();
    }

    /**
     * 比較対象のMapを取得します.
     * @return 比較対象のMap.
     */
    public Map<String, Object> getCompareMap() {
        return compareMap;
    }

    /**
     * 比較対象のMapを設定します.
     * @param compareMap 比較対象のMap.
     */
    public void setCompareMap(Map<String, Object> compareMap) {
        this.compareMap = compareMap;
    }

    /**
     * 比較対象オブジェクトを取得します.
     * @return 比較対象オブジェクト.
     */
    public Object getCompareObj() {
        return compareObj;
    }

    /**
     * 比較対象オブジェクトを設定します.
     * @param compareObj 比較対象オブジェクト.
     */
    public void setCompareObj(Object compareObj) {
        this.compareObj = compareObj;
    }

    /**
     * 検証結果リスト.を取得します.
     * @return 検証結果リスト.
     */
    public List<String> getCompareResult() {
        return compareResult;
    }

    /**
     * 比較を行います.
     */
    public void assertCompare() {
        compareResult.clear();
        if (null == compareMap || null == compareObj) {
            throw new RuntimeException("Field[compareMap] and field[compareDto] must be set.");
        }
        if (null == compareKeys || 0 == compareKeys.size()) {
            throw new RuntimeException("Field[compareKeys] must be set.");
        }
        Set<Entry<String, AssertCompareType>> keySet = compareKeys.entrySet();
        Iterator<Entry<String, AssertCompareType>> iterator = keySet.iterator();
        while (iterator.hasNext()) {
            Entry<String, AssertCompareType> entry = iterator.next();
            String orgKey = entry.getKey();

            String mapKey = orgKey.toUpperCase();
            String objFieldName = toFieldName(orgKey);
            if (null != objFieldName) {
                Object mapValue =  compareMap.get(mapKey);
                Object objValue = getObjectValue(objFieldName);
                compare(orgKey, mapValue, objValue);
            }
        }
    }

    /**
     * 値を比較する.
     * @param mapKey キー名
     * @param mapValue 比較する値1
     * @param objValue 比較する値2
     */
    private void compare(String mapKey, Object mapValue, Object objValue) {
        // 両方がnullの場合は比較不要
        AssertCompareType ruledType = compareKeys.get(mapKey);
        if (null != mapValue && null != objValue) {
            Object convertMapValue = getTypeValue(ruledType, mapValue);
            Object convertObjValue = getTypeValue(ruledType, objValue);
            Assert.assertEquals(convertMapValue, convertObjValue);

            String resultMessage
                = String.format("compare[type=%s]:[key=%s]:exp=[%s], act=[%s]",
                        ruledType.toString(),
                        mapKey,
                        convertMapValue.toString(),
                        convertObjValue.toString());
            compareResult.add(resultMessage);
        } else if (null != mapValue || null != objValue) {
            Assert.assertEquals(String.format("varName=[%s]", mapKey), mapValue, objValue);
            if (null == mapValue) {
                compareResult.add(
                        String.format("compare[type=%s]:[key=%s]:exp=null, act=[%s]",
                                ruledType.toString(), mapKey, objValue.toString()));
            } else {
                compareResult.add(
                        String.format("compare[type=%s]:[key=%s]:exp=[%s], act=null",
                                ruledType.toString(), mapKey, mapValue.toString()));
            }
        } else {
            compareResult.add(
                    String.format("compare[type=%s]:[key=%s]:exp=null, act=null",
                            ruledType.toString(), mapKey));
        }
    }

    /**
     * 指定した比較タイプに応じたオブジェクト値の変換を行う.
     * @param type 比較タイプ
     * @param obj 変換対象のオブジェクト
     * @return 変換後のオブジェクト
     */
    private Object getTypeValue(AssertCompareType type, Object obj) {
        Object result = null;
        if (AssertCompareType.BIGDECIMAL == type) {
            result = toBigDecimal(obj);
        } else if (AssertCompareType.DATE == type) {
            result = toDate(obj);
        } else if (AssertCompareType.TIMESTAMP == type) {
            result = toTimestamp(obj);
        } else {
            result = obj;
        }
        return result;
    }
    /**
     * Reflectionを利用して、オブジェクトからgetter経由で値を取得する.
     * @param dtoKey フィールド名
     * @return 取得値. 取得できなかった場合はn
     */
    private Object getObjectValue(String objFieldName)
        throws IllegalArgumentException {
        if (StringUtils.isEmpty(objFieldName)) {
            throw new IllegalArgumentException("Arg[dtoFieldName] must not be empty.");
        }
        Object value = null;
        try {
            String methodName = String.format("%s%s%s",
                                            "get",
                                            objFieldName.substring(0, 1).toUpperCase(),
                                            objFieldName.substring(1));
            Method method = compareObj.getClass().getMethod(methodName, (Class[]) null);
            value = method.invoke(compareObj, (Object[]) null);
        } catch (Exception exp) {
            exp.printStackTrace();
            throw new RuntimeException(exp);
        }
        return value;
    }

    /**
     * 引数objから変換したBigDecimal型を返す.
     * objがBigDecimal型の場合は引数をそのまま返す.
     * @param obj 変換対象のオブジェクト
     * @return 変換したBigDecimalオブジェクト
     */
    private BigDecimal toBigDecimal(Object obj) {
        BigDecimal result = null;
        if (obj instanceof BigDecimal) {
            result = (BigDecimal) obj;
        } else {
            result = new BigDecimal(obj.toString());
        }
        return result;
    }

    /**
     * 引数objから生成した日付文字列を返す.
     * objがDate型でない場合は単にtoString()の結果を返す.
     * @param obj 対象のオブジェクト
     * @return 生成した文字列
     */
    private Date toDate(Object obj) {
        return convertDate(obj, FORMAT_DATE);
    }

    /**
     * 引数objから生成した時刻文字列を返す.
     * objがDate型でない場合は単にtoString()の結果を返す.
     * @param obj 対象のオブジェクト
     * @return 生成した文字列
     */
    private Date toTimestamp(Object obj) {
        return convertDate(obj, FORMAT_TIME);
    }

    /**
     * Dateオブジェクトを作成する.
     * objがDate型の場合は、そのままの内容を返す.
     * @param obj 対象のオブジェクト
     * @param format 書式
     * @return 生成した文字列
     */
    private Date convertDate(Object obj, String format) {
        Date result = null;
        try {
            if (null != obj) {
                if (obj instanceof Date) {
                    result = (Date) obj;
                } else if (obj instanceof oracle.sql.Datum) {
                    if (obj instanceof oracle.sql.TIMESTAMP) {
                        java.sql.Timestamp t
                            = (java.sql.Timestamp) ((oracle.sql.TIMESTAMP) obj).toJdbc();
                        result = new Date(t.getTime());
                    } else if (obj instanceof oracle.sql.DATE) {
                        java.sql.Date d
                        = (java.sql.Date) ((oracle.sql.DATE) obj).toJdbc();
                        result = new Date(d.getTime());
                    } else {
                        throw new IllegalArgumentException(
                            "not implemented. type[" + obj.getClass().toString() + "]");
                    }
                } else {
                    result = DateUtils.parseDate(
                            obj.toString(), new String[] {format});
                }
            }
        } catch (ParseException pe) {
            pe.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return result;
    }

    /**
     * キー名からフィールド名を生成する.
     *

     * "project_id"が引数の場合は"projectId"が戻り値となる。
     * @param keyName 変換対象のキー名
     * @return フィールド名
     */
    private String toFieldName(String keyName) {
        String fieldName = null;
        if (null != keyName) {
            StringBuilder builder = new StringBuilder();
            boolean isPrevUnderScore = false;
            for (int i = 0; i < keyName.length(); i++) {
                char ch = keyName.charAt(i);
                if ('_' == ch) {
                    isPrevUnderScore = true;
                } else {
                    if (isPrevUnderScore) {
                        builder.append(Character.toUpperCase(ch));
                        isPrevUnderScore = false;
                    } else {
                        builder.append(ch);
                    }
                }
            }
            fieldName = builder.toString();
        }
        return fieldName;
    }
}


text:
import flask_s3
import sys
import os
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/..')
from application import application
import config

application.config['AWS_ACCESS_KEY_ID'] = config.AWS_ACCESS_KEY_ID
application.config['AWS_SECRET_ACCESS_KEY'] = config.AWS_SECRET_ACCESS_KEY
application.config['S3_BUCKET_NAME'] = config.AWS_STORAGE_BUCKET_NAME
s3 = flask_s3.FlaskS3()
s3.init_app(application)
flask_s3.create_all(application)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Xml;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using CiCiCard.ConfigClass;

namespace CiCiCard.Dialogs
{
    /// <summary>
    /// ScoreDialog.xaml 的交互逻辑
    /// </summary>
    public partial class ScoreDialog : Window
    {
        public string LeftScore { get; set; }
        public string MiddleScore { get; set; }
        public string RightScore { get; set; }

        public ScoreDialog()
        {
            InitializeComponent();
        }

        private void buttonOK_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ScoreInfo score = null;
            using (Stream stream = File.Open(Environment.CurrentDirectory + "\\Score.bin", FileMode.Open))
            {
                BinaryFormatter formatter = new BinaryFormatter();
                score = (ScoreInfo)formatter.Deserialize(stream);
                stream.Close();
            }
            labelLeft.Content += score.LeftScore.ToString();
            labelMiddle.Content += score.MiddleScore.ToString();
            labelRight.Content += score.RightScore.ToString();

            if (LeftScore!= null && LeftScore != string.Empty)
            {
                labelLeft.Content += LeftScore;
            }
            if (MiddleScore != null && MiddleScore != string.Empty)
            {
                labelMiddle.Content += MiddleScore;
            }
            if (RightScore != null && RightScore != string.Empty)
            {
                labelRight.Content += RightScore;
            }
        }

        private void buttonNewGame_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            this.DialogResult = true;
        }
    }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using Windows.Storage;
using Windows.UI.Xaml.Controls;

namespace HoloLensCommander
{
    /// <summary>
    /// Delegate defining the method signature for handling the AppInstalled event.
    /// </summary>
    /// <param name="sender">The object sending the event.</param>
    public delegate void AppInstalledEventHandler(DeviceMonitorControl sender);

    /// <summary>
    /// Delegate defining the method signature for handling the AppUninstalled event.
    /// </summary>
    /// <param name="sender">The object sending the event.</param>
    public delegate void AppUninstalledEventHandler(DeviceMonitorControl sender);

    /// <summary>
    /// Delegate defining the method signature for handling the DeviceDisconnected event.
    /// </summary>
    /// <param name="sender">The object sending the event.</param>
    public delegate void DeviceDisconnectedEventHandler(DeviceMonitorControl sender);

    /// <summary>
    /// Delegate defining the method signature for handling the IsSelectedChanged event.
    /// </summary>
    /// <param name="sender">The object sending the event.</param>
    public delegate void IsSelectionChangedEventHander(DeviceMonitorControl sender);

    /// <summary>
    /// Delegate defining the method signature for handling the TagChanged event.
    /// </summary>
    /// <param name="sender">The object sending the event.</param>
    public delegate void TagChangedEventHandler(DeviceMonitorControl sender);

    /// <summary>
    /// The class that implements the custom xaml control used to monitor a connected device.
    /// </summary>
    public sealed partial class DeviceMonitorControl : Page, IDisposable
    {
        /// <summary>
        /// Event that is sent when an application install has completed.
        /// </summary>
        public event AppInstalledEventHandler AppInstalled;

        /// <summary>
        /// Event that is sent when an application uninstall has completed.
        /// </summary>
        public event AppUninstalledEventHandler AppUninstalled;

        /// <summary>
        /// Event that is sent when the device has been disconnected.
        /// </summary>
        public event DeviceDisconnectedEventHandler DeviceDisconnected;

        /// <summary>
        /// Event that is sent when the device's selection state has been changed.
        /// </summary>
        public event IsSelectionChangedEventHander SelectedChanged;

        /// <summary>
        /// Event that is sent when the data tagged to the device has been changed.
        /// </summary>
        public event TagChangedEventHandler TagChanged;

        /// <summary>
        /// Gets this page's DataContext as the underlying object's type.
        /// </summary>
        internal DeviceMonitorControlViewModel ViewModel
        {
            get
            {
                return this.DataContext as DeviceMonitorControlViewModel;
            }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DeviceMonitorControl" /> class.
        /// </summary>
        /// <param name="monitor">The DeviceMonitor that is responsible for communication with the device.</param>
        public DeviceMonitorControl(
            DeviceMonitor monitor)
        {
            this.DataContext = new DeviceMonitorControlViewModel(
                this,
                monitor);
            this.InitializeComponent();
        }

        /// <summary>
        /// Finalizer so that we are assured we clean up all encapsulated resources.
        /// </summary>
        /// <remarks>Call Dispose on this object to avoid running the finalizer.</remarks>
        ~DeviceMonitorControl()
        {
            this.Dispose();
        }

        /// <summary>
        /// Cleans up objects managed by the DeviceMonitorControl.
        /// </summary>
        /// <remarks>
        /// Failure to call this method will result in the object not being collected until
        /// finalization occurs.
        /// </remarks>
        public void Dispose()
        {
            try
            {
                this.ViewModel.Dispose();
            }
            catch
            {
                // TODO: Investigate what causes this.DataContext to throw.
            }
            GC.SuppressFinalize(this);
        }

        /// <summary>
        /// Closes all applications running on this device.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        internal async Task CloseAllAppsAsync()
        {
            await this.ViewModel.CloseAllAppsAsync();
        }

        /// <summary>
        /// Disconnect from this device.
        /// </summary>
        internal void Disconnect()
        {
            this.ViewModel.Disconnect();
        }

        /// <summary>
        /// Queries the device for the names of all installed applications.
        /// </summary>
        /// <returns>List of application names.</returns>
        internal async Task<List<string>> GetInstalledAppNamesAsync()
        {
            return await this.ViewModel.GetInstalledAppNamesAsync();
        }

        /// <summary>
        /// Downloads the mixed reality capture files on the device.
        /// </summary>
        /// <param name="parentFolder">The name of the folder in which to download the files.</param>
        /// <param name="deleteAfterDownload">True to remove the downloaded files from the device.</param>
        /// <returns>Task object used for tracking method completion.</returns>
        internal async Task GetMixedRealityFilesAsync(
            StorageFolder parentFolder,
            bool deleteAfterDownload)
        {
            await this.ViewModel.GetMixedRealityFilesAsync(
                parentFolder,
                deleteAfterDownload);
        }

        /// <summary>
        /// Installs an application on this device.
        /// </summary>
        /// <param name="installFiles">Object describing the file(s) required to install an application.</param>
        /// <returns>Task object used for tracking method completion.</returns>
        internal async Task InstallAppAsync(AppInstallFiles installFiles)
        {
            await this.ViewModel.InstallAppAsync(installFiles);
        }

        /// <summary>
        /// Launches an application on this device.
        /// </summary>
        /// <param name="appName">The name of the application to launch.</param>
        /// <returns>The process identifier of the running application.</returns>
        internal async Task<int> LaunchAppAsync(string appName)
        {
            return await this.ViewModel.LaunchAppAsync(appName);
        }

        /// <summary>
        /// Sends the AppIninstalled event to registered handlers.
        /// </summary>
        internal void NotifyAppInstall()
        {
            this.AppInstalled?.Invoke(this);
        }

        /// <summary>
        /// Sends the AppUninstalled event to registered handlers.
        /// </summary>
        internal void NotifyAppUninstall()
        {
            this.AppUninstalled?.Invoke(this);
        }

        /// <summary>
        /// Sends the Disconnected event to registered handlers.
        /// </summary>
        internal void NotifyDisconnected()
        {
            this.DeviceDisconnected?.Invoke(this);
        }

        /// <summary>
        /// Sends the SelectedChanged event to registered handlers.
        /// </summary>
        internal void NotifySelectedChanged()
        {
            this.SelectedChanged?.Invoke(this);
        }

        /// <summary>
        /// Sends the TagChanged event to registered handlers.
        /// </summary>
        internal void NotifyTagChanged()
        {
            this.TagChanged?.Invoke(this);
        }

        /// <summary>
        /// Reboots this device.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        internal async Task RebootAsync()
        {
            await this.ViewModel.RebootAsync();
        }

        /// <summary>
        /// Shuts down this device.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        internal async Task ShutdownAsync()
        {
            await this.ViewModel.ShutdownAsync();
        }

        /// <summary>
        /// Starts recording a mixed reality video on this device.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        internal async Task StartMixedRealityRecordingAsync()
        {
            await this.ViewModel.StartMixedRealityRecordingAsync();
        }

        /// <summary>
        /// Stops thea mixed reality recording on this device.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        internal async Task StopMixedRealityRecordingAsync()
        {
            await this.ViewModel.StopMixedRealityRecordingAsync();
        }

        /// <summary>
        /// Uninstalls an application on this device.
        /// </summary>
        /// <param name="appName">The name of the application to uninstall.</param>
        /// <returns>Task object used for tracking method completion.</returns>
        internal async Task UninstallAppAsync(string appName)
        {
            await this.ViewModel.UninstallAppAsync(appName);
        }
    }
}