text:
<?php
namespace Yaf ;

/**
 *
\Yaf\Controller_Abstract is the heart of Yaf's system. MVC stands for Model-View-Controller and is a design pattern targeted at separating application logic from display logic.

 *

 *
Every custom controller shall inherit \Yaf\Controller_Abstract.

 *

 *
You will find that you can not define __construct function for your custom controller, thus, \Yaf\Controller_Abstract provides a magic method: \Yaf\Controller_Abstract::init().

 *

 *
If you have defined a init() method in your custom controller, it will be called as long as the controller was instantiated.

 *

 *
Action may have arguments, when a request coming, if there are the same name variable in the request parameters(see \Yaf\Request_Abstract::getParam()) after routed, Yaf will pass them to the action method (see \Yaf\Action_Abstract::execute()).

 *

 * Note:
 *
These arguments are directly fetched without filtering, it should be carefully processed before use them.

 *
 * @link http://www.php.net/manual/en/class.yaf-controller-abstract.php
 */
abstract class Controller_Abstract {

	/**
	 * @see \Yaf\Action_Abstract
	 * @var array You can also define a action method in a separate PHP script by using this property and \Yaf\Action_Abstract.
	 */
	public $actions;
	/**
	 * @var string module name
	 */
	protected $_module;
	/**
	 * @var string controller name
	 */
	protected $_name;
	/**
	 * @var \Yaf\Request_Abstract current request object
	 */
	protected $_request;
	/**
	 * @var \Yaf\Response_Abstract current response object
	 */
	protected $_response;
	/**
	 * @var array
	 */
	protected $_invoke_args;
	/**
	 * @var \Yaf\View_Interface view engine object
	 */
	protected $_view;

	/**
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.render.php
	 *
	 * @param string $tpl
	 * @param array $parameters
	 *
	 * @return string
	 */
	protected function render($tpl, array $parameters = null){ }

	/**
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.display.php
	 *
	 * @param string $tpl
	 * @param array $parameters
	 *
	 * @return bool
	 */
	protected function display($tpl, array $parameters = null){ }

	/**
	 * retrieve current request object
	 *
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.getrequest.php
	 *
	 * @return \Yaf\Request_Abstract|\Yaf\Request\Http|\Yaf\Request\Simple
	 */
	public function getRequest(){ }

	/**
	 * retrieve current response object
	 *
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.getresponse.php
	 *
	 * @return \Yaf\Response_Abstract|\Yaf\Response\Http|\Yaf\Response\Cli
	 */
	public function getResponse(){ }

	/**
	 * get the controller's module name
	 *
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.getmodulename.php
	 *
	 * @return string
	 */
	public function getModuleName(){ }

	/**
	 * retrieve view engine
	 *
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.getview.php
	 *
	 * @return \Yaf\View_Interface
	 */
	public function getView(){ }

	/**
	 * @deprecated not_implemented
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.initview.php
	 *
	 * @param array $options
	 *
	 * @return \Yaf\Response_Abstract
	 */
	public function initView(array $options = null){ }

	/**
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.setviewpath.php
	 *
	 * @param string $view_directory
	 *
	 * @return bool
	 */
	public function setViewpath($view_directory){ }

	/**
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.getviewpath.php
	 *
	 * @return string
	 */
	public function getViewpath(){ }

	/**
	 *
forward current execution process to other action.

	 *

	 * Note:
	 *
this method doesn't switch to the destination action immediately, it will take place after current flow finish.

	 *

	 * Notice, there are 3 available method signatures:
	 *
\Yaf\Controller_Abstract::forward ( string $module , string $controller , string $action [, array $parameters ] )

	 *
\Yaf\Controller_Abstract::forward ( string $controller , string $action [, array $parameters ] )

	 *
\Yaf\Controller_Abstract::forward ( string $action [, array $parameters ] )

	 *
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.forward.php
	 *
	 * @param string $module destination module name, if NULL was given, then default module name is assumed
	 * @param string $controller destination controller name
	 * @param string $action destination action name
	 * @param array $parameters calling arguments
	 *
	 * @return bool return FALSE on failure
	 */
	public function forward($module, $controller = null, $action = null, array $parameters = null){ }

	/**
	 * redirect to a URL by sending a 302 header
	 *
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.redirect.php
	 *
	 * @param string $url a location URL
	 *
	 * @return bool
	 */
	public function redirect($url){ }

	/**
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.getinvokeargs.php
	 *
	 * @return array
	 */
	public function getInvokeArgs(){ }

	/**
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.getinvokearg.php
	 * @param string $name
	 *
	 * @return null|mixed
	 */
	public function getInvokeArg($name){ }

	/**
	 *
\Yaf\Controller_Abstract::__construct() is final, which means users can not override it. but users can define \Yaf\Controller_Abstract::init(), which will be called after controller object is instantiated.

	 *
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.init.php
	 *
	 */
	public function init(){ }

	/**
	 * \Yaf\Controller_Abstract::__construct() is final, which means it can not be overridden. You may want to see \Yaf\Controller_Abstract::init() instead.
	 *
	 * @see \Yaf\Controller_Abstract::init()
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.construct.php
	 *
	 * @param \Yaf\Request_Abstract $request
	 * @param \Yaf\Response_Abstract $response
	 * @param \Yaf\View_Interface $view
	 * @param array $invokeArgs
	 */
	final public function __construct(\Yaf\Request_Abstract $request, \Yaf\Response_Abstract $response, \Yaf\View_Interface $view, array $invokeArgs = null){ }

	/**
	 * @link http://www.php.net/manual/en/yaf-controller-abstract.clone.php
	 */
	final private function __clone(){ }
}


text:
// ==========================================================================
// Project:  Ember Runtime
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

/*
  NOTE: This test is adapted from the 1.x series of unit tests.  The tests
  are the same except for places where we intend to break the API we instead
  validate that we warn the developer appropriately.

  CHANGES FROM 1.6:

  * changed obj.set() and obj.get() to Ember.set() and Ember.get()
  * changed obj.addObserver() to Ember.addObserver()
*/

var get = Ember.get, set = Ember.set;

module("Ember.Observable - Observing with @each");

test("chained observers on enumerable properties are triggered when the observed property of any item changes", function() {
  var family = Ember.Object.create({ momma: null });
  var momma = Ember.Object.create({ children: [] });

  var child1 = Ember.Object.create({ name: "Bartholomew" });
  var child2 = Ember.Object.create({ name: "Agnes" });
  var child3 = Ember.Object.create({ name: "Dan" });
  var child4 = Ember.Object.create({ name: "Nancy" });

  set(family, 'momma', momma);
  set(momma, 'children', Ember.A([child1, child2, child3]));

  var observerFiredCount = 0;
  Ember.addObserver(family, 'momma.children.@each.name', this, function() {
    observerFiredCount++;
  });

  observerFiredCount = 0;
  Ember.run(function() { get(momma, 'children').setEach('name', 'Juan'); });
  equal(observerFiredCount, 3, "observer fired after changing child names");

  observerFiredCount = 0;
  Ember.run(function() { get(momma, 'children').pushObject(child4); });
  equal(observerFiredCount, 1, "observer fired after adding a new item");

  observerFiredCount = 0;
  Ember.run(function() { set(child4, 'name', "Herbert"); });
  equal(observerFiredCount, 1, "observer fired after changing property on new object");

  set(momma, 'children', []);

  observerFiredCount = 0;
  Ember.run(function() { set(child1, 'name', "Hanna"); });
  equal(observerFiredCount, 0, "observer did not fire after removing changing property on a removed object");
});

redpajama_set_name: RedPajamaGithub


text:
@interface BATabBarController : UITabBarController

@end


text:
package org.apache.flink.api.java.operators;

import org.apache.flink.annotation.Internal;
import org.apache.flink.annotation.Public;
import org.apache.flink.api.common.functions.Function;
import org.apache.flink.api.common.functions.InvalidTypesException;
import org.apache.flink.api.common.operators.SemanticProperties;
import org.apache.flink.api.common.operators.SingleInputSemanticProperties;
import org.apache.flink.api.common.typeinfo.TypeHint;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.functions.FunctionAnnotation;
import org.apache.flink.api.java.functions.SemanticPropUtil;
import org.apache.flink.configuration.Configuration;

import java.lang.annotation.Annotation;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import static java.util.Objects.requireNonNull;

/**
 * The <tt>SingleInputUdfOperator</tt> is the base class of all unary operators that execute
 * user-defined functions (UDFs). The UDFs encapsulated by this operator are naturally UDFs that
 * have one input (such as {@link org.apache.flink.api.common.functions.RichMapFunction} or
 * {@link org.apache.flink.api.common.functions.RichReduceFunction}).
 *
 *
This class encapsulates utilities for the UDFs, such as broadcast variables, parameterization
 * through configuration objects, and semantic properties.
 * @param <IN> The data type of the input data set.
 * @param <OUT> The data type of the returned data set.
 */
@Public
public abstract class SingleInputUdfOperator<IN, OUT, O extends SingleInputUdfOperator<IN, OUT, O>>
	extends SingleInputOperator<IN, OUT, O> implements UdfOperator<O> {
	private Configuration parameters;

	private Map<String, DataSet<?>> broadcastVariables;

	// NOTE: only set this variable via setSemanticProperties()
	private SingleInputSemanticProperties udfSemantics;

	private boolean analyzedUdfSemantics;

	// --------------------------------------------------------------------------------------------

	/**
	 * Creates a new operators with the given data set as input. The given result type
	 * describes the data type of the elements in the data set produced by the operator.
	 *
	 * @param input The data set that is the input to the operator.
	 * @param resultType The type of the elements in the resulting data set.
	 */
	protected SingleInputUdfOperator(DataSet<IN> input, TypeInformation<OUT> resultType) {
		super(input, resultType);
	}

	protected abstract Function getFunction();

	// --------------------------------------------------------------------------------------------
	// Fluent API methods
	// --------------------------------------------------------------------------------------------

	@Override
	public O withParameters(Configuration parameters) {
		this.parameters = parameters;

		@SuppressWarnings("unchecked")
		O returnType = (O) this;
		return returnType;
	}

	@Override
	public O withBroadcastSet(DataSet<?> data, String name) {
		if (data == null) {
			throw new IllegalArgumentException("Broadcast variable data must not be null.");
		}
		if (name == null) {
			throw new IllegalArgumentException("Broadcast variable name must not be null.");
		}

		if (this.broadcastVariables == null) {
			this.broadcastVariables = new HashMap<String, DataSet<?>>();
		}

		this.broadcastVariables.put(name, data);

		@SuppressWarnings("unchecked")
		O returnType = (O) this;
		return returnType;
	}

	/**
	 * Adds semantic information about forwarded fields of the user-defined function.
	 * The forwarded fields information declares fields which are never modified by the function and
	 * which are forwarded at the same position to the output or unchanged copied to another position in the output.
	 *
	 *
Fields that are forwarded at the same position are specified by their position.
	 * The specified position must be valid for the input and output data type and have the same type.
	 * For example withForwardedFields("f2") declares that the third field of a Java input tuple is
	 * copied to the third field of an output tuple.
	 *
	 *
Fields which are unchanged copied to another position in the output are declared by specifying the
	 * source field reference in the input and the target field reference in the output.
	 * {@code withForwardedFields("f0->f2")} denotes that the first field of the Java input tuple is
	 * unchanged copied to the third field of the Java output tuple. When using a wildcard ("*") ensure that
	 * the number of declared fields and their types in input and output type match.
	 *
	 *
Multiple forwarded fields can be annotated in one ({@code withForwardedFields("f2; f3->f0; f4")})
	 * or separate Strings ({@code withForwardedFields("f2", "f3->f0", "f4")}).
	 * Please refer to the JavaDoc of {@link org.apache.flink.api.common.functions.Function} or Flink's documentation for
	 * details on field references such as nested fields and wildcard.
	 *
	 *
It is not possible to override existing semantic information about forwarded fields which was
	 * for example added by a {@link org.apache.flink.api.java.functions.FunctionAnnotation.ForwardedFields} class annotation.
	 *
	 *
NOTE: Adding semantic information for functions is optional!
	 * If used correctly, semantic information can help the Flink optimizer to generate more efficient execution plans.
	 * However, incorrect semantic information can cause the optimizer to generate incorrect execution plans which compute wrong results!
	 * So be careful when adding semantic information.
	 *
	 *
	 * @param forwardedFields A list of field forward expressions.
	 * @return This operator with annotated forwarded field information.
	 *
	 * @see org.apache.flink.api.java.functions.FunctionAnnotation
	 * @see org.apache.flink.api.java.functions.FunctionAnnotation.ForwardedFields
	 */
	public O withForwardedFields(String... forwardedFields) {

		if (this.udfSemantics == null) {
			// extract semantic properties from function annotations
			setSemanticProperties(extractSemanticAnnotations(getFunction().getClass()));
		}

		if (this.udfSemantics == null
				|| this.analyzedUdfSemantics) { // discard analyzed semantic properties
			setSemanticProperties(new SingleInputSemanticProperties());
			SemanticPropUtil.getSemanticPropsSingleFromString(this.udfSemantics, forwardedFields, null, null, this.getInputType(), this.getResultType());
		} else {
			if (udfWithForwardedFieldsAnnotation(getFunction().getClass())) {
				// refuse semantic information as it would override the function annotation
				throw new SemanticProperties.InvalidSemanticAnnotationException("Forwarded field information " +
						"has already been added by a function annotation for this operator. " +
						"Cannot overwrite function annotations.");
			} else {
				SemanticPropUtil.getSemanticPropsSingleFromString(this.udfSemantics, forwardedFields, null, null, this.getInputType(), this.getResultType());
			}
		}

		@SuppressWarnings("unchecked")
		O returnType = (O) this;
		return returnType;
	}

	// ------------------------------------------------------------------------
	//  type hinting
	// ------------------------------------------------------------------------

	/**
	 * Adds a type information hint about the return type of this operator. This method
	 * can be used in cases where Flink cannot determine automatically what the produced
	 * type of a function is. That can be the case if the function uses generic type variables
	 * in the return type that cannot be inferred from the input type.
	 *
	 *
Classes can be used as type hints for non-generic types (classes without generic parameters),
	 * but not for generic types like for example Tuples. For those generic types, please
	 * use the {@link #returns(TypeHint)} method.
	 *
	 *
Use this method the following way:
	 *
{@code
	 *     DataSet<String[]> result =
	 *         data.flatMap(new FunctionWithNonInferrableReturnType())
	 *             .returns(String[].class);
	 * }

	 *
	 * @param typeClass The class of the returned data type.
	 * @return This operator with the type information corresponding to the given type class.
	 */
	public O returns(Class<OUT> typeClass) {
		requireNonNull(typeClass, "type class must not be null");

		try {
			return returns(TypeInformation.of(typeClass));
		}
		catch (InvalidTypesException e) {
			throw new InvalidTypesException("Cannot infer the type information from the class alone." +
					"This is most likely because the class represents a generic type. In that case," +
					"please use the 'returns(TypeHint)' method instead.", e);
		}
	}

	/**
	 * Adds a type information hint about the return type of this operator. This method
	 * can be used in cases where Flink cannot determine automatically what the produced
	 * type of a function is. That can be the case if the function uses generic type variables
	 * in the return type that cannot be inferred from the input type.
	 *
	 *
Use this method the following way:
	 *
{@code
	 *     DataSet<Tuple2<String, Double>> result =
	 *         data.flatMap(new FunctionWithNonInferrableReturnType())
	 *             .returns(new TypeHint<Tuple2<String, Double>>(){});
	 * }

	 *
	 * @param typeHint The type hint for the returned data type.
	 * @return This operator with the type information corresponding to the given type hint.
	 */
	public O returns(TypeHint<OUT> typeHint) {
		requireNonNull(typeHint, "TypeHint must not be null");

		try {
			return returns(TypeInformation.of(typeHint));
		}
		catch (InvalidTypesException e) {
			throw new InvalidTypesException("Cannot infer the type information from the type hint. " +
					"Make sure that the TypeHint does not use any generic type variables.");
		}
	}

	/**
	 * Adds a type information hint about the return type of this operator. This method
	 * can be used in cases where Flink cannot determine automatically what the produced
	 * type of a function is. That can be the case if the function uses generic type variables
	 * in the return type that cannot be inferred from the input type.
	 *
	 *
In most cases, the methods {@link #returns(Class)} and {@link #returns(TypeHint)}
	 * are preferable.
	 *
	 * @param typeInfo The type information for the returned data type.
	 * @return This operator using the given type information for the return type.
	 */
	public O returns(TypeInformation<OUT> typeInfo) {
		requireNonNull(typeInfo, "TypeInformation must not be null");

		fillInType(typeInfo);
		@SuppressWarnings("unchecked")
		O returnType = (O) this;
		return returnType;
	}

	// --------------------------------------------------------------------------------------------
	// Accessors
	// --------------------------------------------------------------------------------------------

	@Override
	@Internal
	public Map<String, DataSet<?>> getBroadcastSets() {
		return this.broadcastVariables == null ?
				Collections.<String, DataSet<?>>emptyMap() :
				Collections.unmodifiableMap(this.broadcastVariables);
	}

	@Override
	public Configuration getParameters() {
		return this.parameters;
	}

	@Override
	@Internal
	public SingleInputSemanticProperties getSemanticProperties() {
		if (this.udfSemantics == null || analyzedUdfSemantics) {
			SingleInputSemanticProperties props = extractSemanticAnnotations(getFunction().getClass());
			if (props != null) {
				setSemanticProperties(props);
			}
		}
		if (this.udfSemantics == null) {
			setSemanticProperties(new SingleInputSemanticProperties());
		}
		return this.udfSemantics;
	}

	/**
	 * Sets the semantic properties for the user-defined function (UDF). The semantic properties
	 * define how fields of tuples and other objects are modified or preserved through this UDF.
	 * The configured properties can be retrieved via {@link UdfOperator#getSemanticProperties()}.
	 *
	 * @param properties The semantic properties for the UDF.
	 * @see UdfOperator#getSemanticProperties()
	 */
	@Internal
	public void setSemanticProperties(SingleInputSemanticProperties properties) {
		this.udfSemantics = properties;
		this.analyzedUdfSemantics = false;
	}

	protected boolean getAnalyzedUdfSemanticsFlag() {
		return this.analyzedUdfSemantics;
	}

	protected void setAnalyzedUdfSemanticsFlag() {
		this.analyzedUdfSemantics = true;
	}

	protected SingleInputSemanticProperties extractSemanticAnnotations(Class<?> udfClass) {
		Set<Annotation> annotations = FunctionAnnotation.readSingleForwardAnnotations(udfClass);
		return SemanticPropUtil.getSemanticPropsSingle(annotations, getInputType(), getResultType());
	}

	protected boolean udfWithForwardedFieldsAnnotation(Class<?> udfClass) {
		return udfClass.getAnnotation(FunctionAnnotation.ForwardedFields.class) != null ||
				udfClass.getAnnotation(FunctionAnnotation.NonForwardedFields.class) != null;
	}
}


text:
class HomeController < ApplicationController
  # include ActionController::Live
  def show
  end
  # def stream
  #   response.headers['Content-Type'] = 'text/event-stream'
  #   100.times {
  #     response.stream.write "hello world\n"
  #     sleep 1
  #   }
  # ensure
  #   response.stream.close
  # end
end


text:
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Arcade.Options
  ( Options(..)
  , HasOptions(..)
  , parseOptions
  , serverUri
  ) where

import Control.Lens hiding (Setting)
import Data.Data
import Options.Applicative
import Arcade.Monitor

data Options = Options
  { _serverMonitorOptions :: MonitorOptions
  , _serverHost           :: String
  , _serverPort           :: Int
  , _serverOpen           :: Bool
  , _serverFile           :: Bool
  , _serverTimeout        :: Int
  , _serverStaticPath     :: Maybe String
  } deriving (Eq,Ord,Show,Read,Data,Typeable)

makeClassy ''Options

serverUri :: HasOptions t => t -> String
serverUri t
  | t^.serverFile = "static/index.html" -- TODO: install in data-dir and use installed path
  | otherwise = "http://" ++ t^.serverHost ++ ":" ++ show (t^.serverPort) ++ "/"

-- | Parse EKG configuration
parseOptions :: Parser Options
parseOptions = Options
  <$> parseMonitorOptions
  <*> strOption (long "host" <> short 'h' <> help "hostname for the server" <> metavar "HOST" <> action "hostname" <> value "localhost")
  <*> option (long "port" <> short 'p' <> help "port for the server" <> metavar "PORT" <> value 8080)
  <*> switch (long "open" <> short 'o' <> help "open on launch")
  <*> switch (long "file" <> short 'f' <> help "load static content via file:// on -o")
  <*> option (long "timeout" <> short 't' <> help "server timeout" <> metavar "SECONDS" <> value 30)
  <*> optional (strOption (long "static" <> short 's' <> metavar "DIR" <> help "serve content dynamically from static directory instead of from the embedded copy"))

instance HasMonitorOptions Options where
  monitorOptions = serverMonitorOptions


text:
package com.uhl;

import com.uhl.db.DBServiceLocator;
import com.uhl.db.DefaultViews;
import com.uhl.db.IDBHelper;
import com.uhl.db.Profile;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class ProfileOverviewActivity extends Activity implements OnClickListener {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        dbHelper = DBServiceLocator.getDBHelper(this);
        profile = dbHelper.loadProfile(getIntent().getExtras().getInt("ID"));
        setContentView(R.layout.display_profile_data);
        DisplayData();
        RegisterButtons();
        SetupDeleteDialog();
    }

    private AlertDialog.Builder deleteConfirmBuilder;

    private void SetupDeleteDialog() {
    	deleteConfirmBuilder = new AlertDialog.Builder(this);
    	deleteConfirmBuilder.setMessage("Are you sure you want to delete this character?")
	       .setCancelable(false)
	       .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
	           public void onClick(DialogInterface dialog, int id) {
	      		 dbHelper.deleteProfile(profile.getId());
	      		 ProfileOverviewActivity.this.setResult(Activity.RESULT_OK);
	      		 ProfileOverviewActivity.this.finish();
	           }
	       })
	       .setNegativeButton("No", new DialogInterface.OnClickListener() {
	           public void onClick(DialogInterface dialog, int id) {
	                dialog.cancel();
	           }
	       });
	}

	private void RegisterButtons() {
		(this.<Button>GetView(R.id.delete_char)).setOnClickListener(this);
		(this.<Button>GetView(R.id.go_calculate)).setOnClickListener(this);
		(this.<Button>GetView(R.id.manage_character)).setOnClickListener(this);
		(this.<Button>GetView(R.id.manage_templates)).setOnClickListener(this);
	}

	@Override
	public void onClick(View e) {
		Button button = this.<Button>GetView(e.getId());
		switch(button.getId()){
			case R.id.delete_char:DeleteConfirm();break;
			case R.id.go_calculate:
				if(profile.getDefaultViewId() == DefaultViews.melee.getId()){
					StartActivityForResult(MeleeRollCalculateActivity.class, profile.getId());
				}else{
					StartActivityForResult(CasterRollCalculateActivity.class, profile.getId());
				}
				break;
			case R.id.manage_character: StartActivityForResult(EditCharacterActivity.class, profile.getId()); break;
			case R.id.manage_templates: StartActivityForResult(ManageTemplateView.class, profile.getId()); break;
			default: break;
		}
	}

	private void StartActivityForResult(Class<?> classInput, Integer Id) {
		Intent intent = new Intent(this, classInput);
		intent.putExtra("ID", Id);
		this.startActivity(intent);
	}

	private void DeleteConfirm() {
		AlertDialog aDialog = deleteConfirmBuilder.create();
		aDialog.setOwnerActivity(this);
		aDialog.show();
	}

	private void DisplayData() {
		(this.<TextView>GetView(R.id.character_name)).setText(profile.getName());
	}

	@SuppressWarnings("unchecked")
	public <T extends View> T GetView(int id) {
		T result = null;
		try{
			result = (T)findViewById(id);}
		catch(Exception e){
		}
		return result;
	}

	private Profile profile;
	private IDBHelper dbHelper;
}


text:
import ref from 'ref-napi';

import Files from './files';
import { default as StormLib, HANDLEPtr } from './storm-lib';

class MPQ {
  static OPEN = {
    READ_ONLY:        0x00000100,
    WRITE_SHARE:      0x00000200,
    USE_BITMAP:       0x00000400,
    NO_LISTFILE:      0x00010000,
    NO_ATTRIBUTES:    0x00020000,
    NO_HEADER_SEARCH: 0x00040000,
    FORCE_MPQ_V1:     0x00080000,
    CHECK_SECTOR_CRC: 0x00100000,
  };

  static CREATE = {
    LISTFILE:   0x00100000,
    ATTRIBUTES: 0x00200000,
    SIGNATURE:  0x00400000,
    ARCHIVE_V1: 0x00000000,
    ARCHIVE_V2: 0x01000000,
    ARCHIVE_V3: 0x02000000,
    ARCHIVE_V4: 0x03000000,
  };

  constructor(path, flags, handle) {
    this.path = path;
    this.flags = flags;
    this.handle = handle;
    this.files = new Files(this);
  }

  close() {
    const handle = this.handle;
    if (handle) {
      this.handle = null;
      return StormLib.SFileCloseArchive(handle);
    }
  }

  get opened() {
    return !!this.handle;
  }

  patch(path, prefix = null) {
    if (!(this.flags & this.constructor.OPEN.READ_ONLY)) {
      throw new Error('archive must be read-only');
    }

    const flags = 0;
    return StormLib.SFileOpenPatchArchive(this.handle, path, prefix, flags);
  }

  get patched() {
    if (this.handle) {
      return StormLib.SFileIsPatchedArchive(this.handle);
    }
  }

  static get locale() {
    return StormLib.SFileGetLocale();
  }

  static set locale(locale) {
    StormLib.SFileSetLocale(locale);
  }

  static open(path, flags = 0, callback) {
    if (typeof flags === 'function' && callback === undefined) {
      return this.open(path, null, flags);
    }

    const priority = 0;
    const handlePtr = ref.alloc(HANDLEPtr);
    if (StormLib.SFileOpenArchive(path, priority, flags, handlePtr)) {
      const handle = handlePtr.deref();
      const mpq = new this(path, flags, handle);

      if (callback !== undefined) {
        callback(mpq);
        mpq.close();
        return true;
      }

      return mpq;
    }
    const errno = StormLib.GetLastError();
    throw new Error(`archive could not be found or opened (${errno})`);
  }

  static create(path, callback) {
    const flags = 0;
    const maxFileCount = 0;
    const handlePtr = ref.alloc(HANDLEPtr);
    if (StormLib.SFileCreateArchive(path, flags, maxFileCount, handlePtr)) {
      return this.open(path, callback);
    }
    const errno = StormLib.GetLastError();
    throw new Error(`archive could not be created (${errno})`);
  }
}

export default MPQ;


text:
<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;

use JMS\Serializer\Annotation\Groups;

use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Translatable\Translatable;

/**
 * Category
 *
 * @ORM\Table(name="categories")
 * @ORM\Entity
 */
class Category implements Translatable
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     *
     * @Groups({"category", "operation", "categories", "calendar"})
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     * @Gedmo\Translatable
     *
     * @Groups({"category", "operation", "categories", "calendar"})
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="description", type="text", nullable=true)
     * @Gedmo\Translatable
     *
     * @Groups({"category", "operation", "categories", "calendar"})
     */
    private $description = null;

    /**
     * @var integer
     *
     * @ORM\Column(name="rank", type="integer")
     *
     * @Groups({"category", "operation", "categories", "calendar"})
     */
    private $rank = 0;

    /**
     * @var boolean
     *
     * @ORM\Column(name="isDefault", type="boolean", nullable=true)
     *
     * @Groups({"category", "operation", "categories", "calendar"})
     */
    private $isDefault = false;

    /**
     * @var boolean
     *
     * @ORM\Column(name="isHidden", type="boolean", nullable=true)
     *
     * @Groups({"category", "operation", "categories", "calendar"})
     */
    private $isHidden = false;

    /**
     *
     * @var Category
     *
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Category", cascade={"all"}, fetch="LAZY")
     *
     * @Groups({"category", "operation", "categories", "calendar"})
     */
    private $parent = null;

    /**
     * @Gedmo\Locale
     * Used locale to override Translation listener`s locale
     * this is not a mapped field of entity metadata, just a simple property
     */
    private $locale;

    /**
     * Sonata Media
     *
     * @var \Application\Sonata\MediaBundle\Entity\Media
     *
     * @ORM\ManyToOne(targetEntity="Application\Sonata\MediaBundle\Entity\Media", cascade={"all"}, fetch="LAZY")
     *
     * @Groups({"category", "operation", "categories", "calendar"})
     */
    private $icon;

    /**
     * @ORM\OneToMany(targetEntity="Operation", mappedBy="category")
     * @ORM\OrderBy({"name" = "ASC"})
     *
     * @Groups({"category", "categories", "calendar"})
     */
    private $operations;

    public function __construct() {
    }

    /**
     *
     * @return type
     */
    public function __toString() {
        return $this->getName();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Category
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set description
     *
     * @param string $description
     * @return Category
     */
    public function setDescription($description)
    {
        $this->description = $description;

        return $this;
    }

    /**
     * Get description
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Set rank
     *
     * @param integer $rank
     * @return Category
     */
    public function setRank($rank)
    {
        $this->rank = $rank;

        return $this;
    }

    /**
     * Get rank
     *
     * @return integer
     */
    public function getRank()
    {
        return $this->rank;
    }

    /**
     * Set isDefault
     *
     * @param boolean $isDefault
     * @return Category
     */
    public function setIsDefault($isDefault)
    {
        $this->isDefault = $isDefault;

        return $this;
    }

    /**
     * Get isDefault
     *
     * @return boolean
     */
    public function getIsDefault()
    {
        return $this->isDefault;
    }

    /**
     * Set isHidden
     *
     * @param boolean $isHidden
     * @return Category
     */
    public function setIsHidden($isHidden)
    {
        $this->isHidden = $isHidden;

        return $this;
    }

    /**
     * Get isHidden
     *
     * @return boolean
     */
    public function getIsHidden()
    {
        return $this->isHidden;
    }

    /**
     * Set parent
     *
     * @param Category $parent
     * @return Category
     */
    public function setParent($parent)
    {
        $this->parent = $parent;

        return $this;
    }

    /**
     * Get parent
     *
     * @return Category
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Set icon
     *
     * @param Media $icon
     * @return Category
     */
    public function setIcon($icon)
    {
        $this->icon = $icon;

        return $this;
    }

    /**
     * Get icon
     *
     * @return Media
     */
    public function getIcon()
    {
        return $this->icon;
    }

    /**
     *
     * @param type $locale
     */
    public function setTranslatableLocale($locale)
    {
        $this->locale = $locale;
    }

    /**
     * Get the operations
     *
     * @return ArrayCollection
     */
    public function getOperations()
    {
        return $this->operations;
    }

}


text:
package org.cogaen.lwjgl.ngui;

import org.cogaen.core.Core;
import org.cogaen.lwjgl.scene.Visual;
import org.cogaen.task.AbstractTask;
import org.cogaen.time.TimeService;
import org.cogaen.time.Timer;

public class HoverTask extends AbstractTask {

	private static final double SPEED = 6.0;
	private Visual visual;
	private Timer timer;
	private double startScale;
	private double pos = Math.PI * 1.5;
	private double percentage = 0.1;
	private boolean hovering;
	private boolean stopping;

	public HoverTask(Core core, Visual visual) {
		super(core);
		this.visual = visual;
		this.setTimer(TimeService.getInstance(getCore()).getTimer());
		this.startScale = visual.getScale();
		this.hovering = false;
		this.stopping = false;
	}

	@Override
	public void update() {
		if (!this.hovering) {
			return;
		}
		this.pos = this.pos + this.timer.getDeltaTime() * SPEED;
		double x = this.startScale * percentage + this.startScale * percentage * Math.sin(this.pos);
		this.visual.setScale(this.startScale + x);

		if (this.stopping) {
			if (Math.abs(x) < 0.0000001) {
				this.stopping = false;
				this.hovering = false;
				this.visual.setScale(this.startScale);
			}
		}
	}

	public void start() {
		this.hovering = true;
		this.stopping = false;
	}

	public void stop() {
		this.stopping = true;
	}

	@Override
	public void destroy() {
		this.visual.setScale(this.startScale);
	}

	public Timer getTimer() {
		return timer;
	}

	public void setTimer(Timer timer) {
		this.timer = timer;
	}

}


text:
"""Define API Snapshots."""

from google.cloud.pubsub._helpers import topic_name_from_path

class Snapshot(object):

    _DELETED_TOPIC_PATH = '_deleted-topic_'
    """Value of ``projects.snapshots.topic`` when topic has been deleted."""

    def __init__(self, name, subscription=None, topic=None, client=None):

        num_kwargs = len(
            [param for param in (subscription, topic, client) if param])
        if num_kwargs != 1:
            raise TypeError(
                "Pass only one of 'subscription', 'topic', 'client'.")

        self.name = name
        self.topic = topic or getattr(subscription, 'topic', None)
        self._subscription = subscription
        self._client = client or getattr(
            subscription, '_client', None) or topic._client

    @classmethod
    def from_api_repr(cls, resource, client, topics=None):
        """Factory:  construct a subscription given its API representation

        :type resource: dict
        :param resource: snapshot resource representation returned from the
            API.

        :type client: :class:`google.cloud.pubsub.client.Client`
        :param client: Client which holds credentials and project
                       configuration.

        :type subscriptions: dict
        :param subscriptions:
            (Optional) A Subscription to which this snapshot belongs. If not
            passed, the subscription will have a newly-created subscription.
            Must have the same topic as the snapshot.

        :rtype: :class:`google.cloud.pubsub.subscription.Subscription`
        :returns: Subscription parsed from ``resource``.
        """
        if topics is None:
            topics = {}
        topic_path = resource['topic']
        if topic_path == cls._DELETED_TOPIC_PATH:
            topic = None
        else:
            topic = topics.get(topic_path)
            if topic is None:
                # NOTE: This duplicates behavior from Topic.from_api_repr to
                #       avoid an import cycle.
                topic_name = topic_name_from_path(topic_path, client.project)
                topic = topics[topic_path] = client.topic(topic_name)
        _, _, _, name = resource['name'].split('/')
        if topic is None:
            return cls(name, client=client)
        return cls(name, topic=topic)

    @property
    def project(self):
        """Project bound to the subscription."""
        return self._client.project

    @property
    def full_name(self):
        """Fully-qualified name used in subscription APIs"""
        return 'projects/%s/snapshots/%s' % (self.project, self.name)

    @property
    def path(self):
        """URL path for the subscription's APIs"""
        return '/%s' % (self.full_name,)

    def _require_client(self, client):
        """Check client or verify over-ride.

        :type client: :class:`~google.cloud.pubsub.client.Client` or
                      ``NoneType``
        :param client: the client to use.  If not passed, falls back to the
                       ``client`` stored on the topic of the
                       current subscription.

        :rtype: :class:`google.cloud.pubsub.client.Client`
        :returns: The client passed in or the currently bound client.
        """
        if client is None:
            client = self._client
        return client

    def create(self, client=None):
        """API call:  create the snapshot

        See
        https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.snapshots/create

        :type client: :class:`~google.cloud.pubsub.client.Client` or
                      ``NoneType``
        :param client: the client to use.  If not passed, falls back to the
                       ``client`` stored on the current subscription's topic.
        """
        if not self._subscription:
            raise RuntimeError(
                'Cannot create a snapshot not bound to a subscription')

        client = self._require_client(client)
        api = client.subscriber_api
        api.snapshot_create(self.full_name, self._subscription.full_name)

    def delete(self, client=None):
        """API call:  delete the snapshot

        See
        https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.snapshots/delete

        :type client: :class:`~google.cloud.pubsub.client.Client` or
                      ``NoneType``
        :param client: the client to use.  If not passed, falls back to the
                       ``client`` stored on the current subscription's topic.
        """
        client = self._require_client(client)
        api = client.subscriber_api
        api.snapshot_delete(self.full_name)


text:
package org.apache.carbondata.core.datastore.page;

import org.apache.carbondata.core.datastore.page.encoding.EncodedColumnPage;

/**
 * Maintains the fallback encoded page and metadata
 */
public class FallbackEncodedColumnPage {

  /**
   * encode page
   */
  private EncodedColumnPage encodedColumnPage;

  /**
   * page index in a blocklet
   */
  private int pageIndex;

  public FallbackEncodedColumnPage(EncodedColumnPage encodedColumnPage, int pageIndex) {
    this.encodedColumnPage = encodedColumnPage;
    this.pageIndex = pageIndex;
  }

  public EncodedColumnPage getEncodedColumnPage() {
    return encodedColumnPage;
  }

  public int getPageIndex() {
    return pageIndex;
  }

}


text:
class Admin::SongsController < AdminController
  before_action :set_song, only: [:show, :edit, :update, :destroy]

  def index
    @songs = Song.alphabetical.search(params[:search]).page(params[:page])
  end

  def new
    @song = Song.new
  end

  def create
    @song = Song.new(song_params)

    respond_to do |format|
      if @song.save
        format.html { redirect_to [:admin, @song], notice: 'Song was successfully created.' }
        format.json { render action: 'show', status: :created, location: @song }
      else
        format.html { render action: 'new' }
        format.json { render json: @song.errors, status: :unprocessable_entity }
      end
    end
  end

  def update
    respond_to do |format|
      if @song.update(song_params)
        format.html { redirect_to [:admin, @song], notice: 'Song was successfully updated.' }
        format.json { head :no_content }
      else
        format.html { render action: 'edit' }
        format.json { render json: @song.errors, status: :unprocessable_entity }
      end
    end
  end

  def destroy
    @song.destroy
    respond_to do |format|
      format.html { redirect_to admin_songs_path }
      format.json { head :no_content }
    end
  end

  private

  def set_song
    @song = Song.find(params[:id])
  end

  def song_params
    params.require(:song).permit(:title, :scripture, :copyright_blurb, :featured_order)
  end
end


text:
package org.kie.workbench.common.stunner.core.client.session.command.impl;

import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Default;

import org.kie.workbench.common.stunner.core.client.canvas.CanvasGrid;
import org.kie.workbench.common.stunner.core.client.session.ClientSession;
import org.kie.workbench.common.stunner.core.client.session.command.AbstractClientSessionCommand;
import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession;

import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull;

@Dependent
@Default
public class SwitchGridSessionCommand extends AbstractClientSessionCommand<EditorSession> {

    public final static CanvasGrid[] GRIDS = new CanvasGrid[]{
            CanvasGrid.SMALL_POINT_GRID, CanvasGrid.DEFAULT_GRID,
            CanvasGrid.DRAG_GRID, null
    };

    private static final byte DEFAULT_GRID_INDEX = 0;
    private byte gridIndex;

    public SwitchGridSessionCommand() {
        super(true);
    }

    @Override
    public void bind(final EditorSession session) {
        super.bind(session);
        resetGrid();
    }

    @Override
    public boolean accepts(final ClientSession session) {
        return session instanceof EditorSession;
    }

    @Override
    public <V> void execute(final Callback<V> callback) {
        checkNotNull("callback",
                     callback);
        if (++gridIndex == GRIDS.length) {
            gridIndex = 0;
        }
        updateGrid();
        // Run the callback.
        callback.onSuccess();
    }

    @Override
    protected void doDestroy() {
        super.doDestroy();
    }

    private void resetGrid() {
        this.gridIndex = DEFAULT_GRID_INDEX;
        updateGrid();
    }

    private void updateGrid() {
        getSession().getCanvas().setGrid(GRIDS[gridIndex]);
    }
}


text:
package org.apache.camel.component.telegram.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Location {

    @JsonProperty("latitude")
    private double latitude;

    @JsonProperty("longitude")
    private double longitude;

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(float latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(float longitude) {
        this.longitude = longitude;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Location{");
        sb.append("longitude='").append(longitude).append('\'');
        sb.append(", latitude=").append(latitude);
        sb.append('}');
        return sb.toString();
    }
}


text:
import { Trans } from '@lingui/macro'
import withLang from '../components/withLang'
import LangSwitcher from '../components/LangSwitcher'

const Two = () => (

    <Trans>Page two. </Trans>

    <LangSwitcher />

)

export default withLang(Two)


text:
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.10">
  <compounddef id="_s_map_8hpp" kind="file" language="C++">
    <compoundname>SMap.hpp</compoundname>
    <includes refid="_map_8hpp" local="yes">Map.hpp</includes>
    <includedby refid="_server_8hpp" local="yes">/home/clemente/projects/Troll-Killers/Server.hpp</includedby>
    <includedby refid="_s_map_8cpp" local="yes">/home/clemente/projects/Troll-Killers/SMap.cpp</includedby>
    <incdepgraph>
      <node id="1964">
        stdint.h
      </node>
      <node id="1962">
        Enums.hpp
        <link refid="_enums_8hpp"/>
      </node>
      <node id="1963">
        _object.hpp
        <link refid="__object_8hpp"/>
        <childnode refid="1964" relation="include">
        </childnode>
      </node>
      <node id="1969">
        fstream
      </node>
      <node id="1961">
        Map.hpp
        <link refid="_map_8hpp"/>
        <childnode refid="1962" relation="include">
        </childnode>
        <childnode refid="1963" relation="include">
        </childnode>
        <childnode refid="1965" relation="include">
        </childnode>
        <childnode refid="1967" relation="include">
        </childnode>
        <childnode refid="1968" relation="include">
        </childnode>
        <childnode refid="1969" relation="include">
        </childnode>
      </node>
      <node id="1965">
        _data.hpp
        <link refid="__data_8hpp"/>
        <childnode refid="1964" relation="include">
        </childnode>
        <childnode refid="1966" relation="include">
        </childnode>
      </node>
      <node id="1967">
        sstream
      </node>
      <node id="1960">
        /home/clemente/projects/Troll-Killers/SMap.hpp
        <link refid="SMap.hpp"/>
        <childnode refid="1961" relation="include">
        </childnode>
      </node>
      <node id="1968">
        Defines.hpp
        <link refid="_defines_8hpp"/>
      </node>
      <node id="1966">
        cstring
      </node>
    </incdepgraph>
    <invincdepgraph>
      <node id="1973">
        /home/clemente/projects/Troll-Killers/Server.cpp
        <link refid="_server_8cpp"/>
      </node>
      <node id="1971">
        /home/clemente/projects/Troll-Killers/Server.hpp
        <link refid="_server_8hpp"/>
        <childnode refid="1972" relation="include">
        </childnode>
        <childnode refid="1973" relation="include">
        </childnode>
      </node>
      <node id="1970">
        /home/clemente/projects/Troll-Killers/SMap.hpp
        <link refid="SMap.hpp"/>
        <childnode refid="1971" relation="include">
        </childnode>
        <childnode refid="1974" relation="include">
        </childnode>
      </node>
      <node id="1972">
        /home/clemente/projects/Troll-Killers/mainServer.cpp
        <link refid="main_server_8cpp"/>
      </node>
      <node id="1974">
        /home/clemente/projects/Troll-Killers/SMap.cpp
        <link refid="_s_map_8cpp"/>
      </node>
    </invincdepgraph>
    <innerclass refid="class_s_map" prot="public">SMap</innerclass>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="preprocessor">#ifndef<sp/>SMAP_HPP</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>SMAP_HPP</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"<ref refid="_map_8hpp" kindref="compound">Map.hpp</ref>"</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight></codeline>
<codeline lineno="6" refid="class_s_map" refkind="compound"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="class_s_map" kindref="compound">SMap</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="class_map" kindref="compound">Map</ref>{</highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight><highlight class="keyword">private</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="8"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>spawnCounter;</highlight></codeline>
<codeline lineno="9"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="struct__object" kindref="compound">_object</ref><sp/>**spawnList;</highlight></codeline>
<codeline lineno="10"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>*inUse;</highlight></codeline>
<codeline lineno="11"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>nSpawn;</highlight></codeline>
<codeline lineno="12"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="13"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="class_s_map_1a6ef62d8e6b17c21f21c535a4139e230e" kindref="member">calculateSpawn</ref>();</highlight></codeline>
<codeline lineno="14"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="struct__object" kindref="compound">_object</ref><sp/>*<ref refid="class_s_map_1a3577067cfaf16adb3afd60c30f7093b7" kindref="member">getSpaw</ref>();</highlight></codeline>
<codeline lineno="15"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="class_s_map_1a951815986813fc94884108ee2b72a4f1" kindref="member">useSpawn</ref>(<ref refid="struct__object" kindref="compound">_object</ref><sp/>*spawn);</highlight></codeline>
<codeline lineno="16"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//void<sp/>freeSpawn(_object<sp/>spawn);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal">};</highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight></codeline>
    </programlisting>
    <location file="/home/clemente/projects/Troll-Killers/SMap.hpp"/>
  </compounddef>
</doxygen>


text:
require "atomy/pattern"

class Atomy::Pattern
  class Equality < self
    attr_reader :value

    def initialize(value)
      @value = value
    end

    def matches?(val)
      @value == val
    end

    def inline_matches?(gen)
      push_value(gen)
      gen.swap
      gen.send(:==, 1)
    end

    def target
      @value.class
    end

    private

    def push_value(gen)
      case @value
      when true
        gen.push_true
      when false
        gen.push_false
      when nil
        gen.push_nil
      when Integer
        gen.push_int(@value)
      else
        gen.push_literal(@value)
      end
    end
  end
end


text:
javac -classpath Robot.jar Ubot.java

# Create Ubot.jar
jar cf Ubot.jar Ubot.class

# Execute the main (debug)
echo "Main : "
java Ubot


text:
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { actions } from 'react-native-navigation-redux-helpers';
import { Tab, Tabs, Input, Picker, Item, Footer, FooterTab, Container, Header, Title, Content, Button, Icon, Text, Left, Right, Body, List, ListItem, View } from 'native-base';
import { Actions } from 'react-native-router-flux';
import { openDrawer, closeDrawer } from '../../actions/drawer';
import styles from './styles';
import TabDescription from './tabDescription';
import TabACL from './tabACL';
import I18n from '../../translations/';

class ProjectAdd extends Component {

  render() {
    return (
      <Container style={styles.container}>
        <Header>
          <Left>
            <Button transparent onPress={Actions.pop}>
              <Icon name="arrow-back" />
            </Button>
          </Left>
          <Body>
            <Title>{I18n.t('projectAddTitle')}</Title>
          </Body>
        </Header>

          <Tabs>
              <Tab heading={I18n.t('projectAddTabDescription')}>
                  <TabDescription />
              </Tab>
              <Tab heading={I18n.t('projectAddTabACL')}>
                  <TabACL />
              </Tab>
          </Tabs>

      </Container>
    );
  }
}

export default ProjectAdd;


text:
require 'user_pb'

class UsersController < ApplicationController
  before_action :assign_user, only: %i[show omniauth]
  skip_before_action :require_login, except: %i[show omniauth]

  def new
    @form = CreateUserForm.new
  end

  def create
    @form = CreateUserForm.new(params[:user])
    if @form.valid?
      req = Soapbox::CreateUserRequest.new(name: @form.name, email: @form.email, password: @form.password)
      @user = $api_client.users.create_user(req)
      session[:current_user_email] = @user.email
      redirect_to profile_user_path
    else
      render :new
    end
  end

  def login
    @form = LoginUserForm.new
  end

  def attempt_login
    @form = LoginUserForm.new(params[:user])
    if @form.valid?
      req = Soapbox::LoginUserRequest.new(email: @form.email, password: @form.password)
      res = $api_client.users.login_user(req)
      if !res.error.blank?
        @form.errors.add(:password, :invalid)
        render :login
      else
        session[:current_user_email] = res.user.email
        session[:login_token] = res.hmac
        redirect_to profile_user_path
      end
    else
      render :login
    end
  end

  def logout
    @_current_user = nil
    session[:current_user_email] = nil
    redirect_to profile_user_path
  end

  def omniauth
    auth = request.env['omniauth.auth']
    @user.github_oauth_access_token = auth['credentials']['token']
    @user = $api_client.users.assign_github_omniauth_token_to_user(@user, user_metadata)
    refresh_user
    redirect_to profile_user_path
  end

  private

    def assign_user
      @user = current_user
    end
end


text:
using Moq;
using Serilog.Debugging;
using Serilog.Events;
using Serilog.Formatting.Display;
using Serilog.Parsing;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Serilog.Formatting;
using Xunit;

namespace Serilog.Sinks.Email.Tests
{
    public class EmailSinkTests
    {
        [Fact(Skip = "Requires a localhost mail server")]
        public void Works()
        {
            var selfLogMessages = new List<string>();
            SelfLog.Enable(selfLogMessages.Add);

            using (var emailLogger = new LoggerConfiguration()
                .WriteTo.Email(
                    fromEmail: "from@localhost.local",
                    toEmail: "to@localhost.local",
                    mailServer: "localhost",
                    outputTemplate: "[{Level}] {Message}{NewLine}{Exception}",
                    mailSubject: "subject")
                .CreateLogger())
            {
                emailLogger.Information("test {test}", "test");
            }

            Assert.Equal(Enumerable.Empty<string>(), selfLogMessages);
        }

        [Fact(Skip = "Requires a smtp mail server")]
        public void WorksMulitpleEventsInOneMail()
        {
            var selfLogMessages = new List<string>();
            SelfLog.Enable(selfLogMessages.Add);

            using (var emailLogger = new LoggerConfiguration()
                .WriteTo.Email(
                    fromEmail: "from@smtpserver.local",
                    toEmail: "to@smtpserver.local",
                    mailServer: "smtpserver.local",
                    outputTemplate: "[{Level}] {Message}{NewLine}{Exception}",
                    mailSubject: "test subject")
                .CreateLogger())
            {
                emailLogger.Information("first test {test}", "test1");
                emailLogger.Error("second {test}", "test2");
                emailLogger.Fatal("third {test}", "test3");
            }

            Assert.Equal(Enumerable.Empty<string>(), selfLogMessages);
        }

        [Fact]
        public void EmailTransportIsCreatedWhenEmailSinkIsConstructed()
        {
            var (emailConnectionInfoMock, emailTransportMock) = CreateEmailTransportConnectionInfoMocks();
            CreateDefaultEmailSink(emailConnectionInfoMock.Object);

            emailConnectionInfoMock.Verify(eci => eci.CreateEmailTransport(), Times.Once);
            emailTransportMock.Verify(eci => eci.Dispose(), Times.Never);
        }

        [Fact]
        public void EmailTransportIsDisposedWhenEmailSinkIsDisposed()
        {
            var (emailConnectionInfoMock, emailTransportMock) = CreateEmailTransportConnectionInfoMocks();
            var emailSink = CreateDefaultEmailSink(emailConnectionInfoMock.Object);

            emailSink.Dispose();

            emailTransportMock.Verify(eci => eci.Dispose(), Times.Once);
        }

        [Fact]
        [UseCulture("en-us")]
        public async Task SendEmailIsCorrectlyCalledWhenEventAreLogged()
        {
            EmailMessage actual = null;
            var (emailConnectionInfoMock, emailTransportMock) =
                CreateEmailTransportConnectionInfoMocks(email => actual = email);
            var emailConnectionInfo = emailConnectionInfoMock.Object;
            emailConnectionInfo.ToEmail = "to@localhost.local";
            emailConnectionInfo.FromEmail = "from@localhost.local";
            emailConnectionInfo.IsBodyHtml = true;
            var emailSink = CreateDefaultEmailSink(emailConnectionInfoMock.Object);

            await emailSink.EmitBatchAsync(new[] {
                new LogEvent(
                    DateTimeOffset.Now,
                    LogEventLevel.Error,
                    new ArgumentOutOfRangeException("parameter1", "Message of the exception"),
                    new MessageTemplate(@"Subject",
                        new MessageTemplateToken[]
                        {
                            new PropertyToken("Message", "A multiline" + Environment.NewLine
                                                                       + "Message")
                        })
                    , Enumerable.Empty<LogEventProperty>())});
            emailSink.Dispose();

            emailTransportMock.Verify(et => et.SendMailAsync(It.IsAny<EmailMessage>()), Times.Once);

            Assert.Equal("[Error] A multiline" + Environment.NewLine
                        + "Message" + Environment.NewLine
                        + "System.ArgumentOutOfRangeException: Message of the exception"
#if NEW_ARGUMENTOUTOFRANGEEXCEPTION_MESSAGE
                        + " (Parameter 'parameter1')"
#else
                        + Environment.NewLine + "Parameter name: parameter1"
#endif
                        + Environment.NewLine + "", actual.Body);
            Assert.Equal(@"[Error] A multiline" + Environment.NewLine
                        + "Message" + Environment.NewLine
                        + "System.ArgumentOutOfRangeException: Message of the exception"
#if NEW_ARGUMENTOUTOFRANGEEXCEPTION_MESSAGE
                        + " (Parameter 'parameter1')"
#else
                        + Environment.NewLine + "Parameter name: parameter1"
#endif
                        + Environment.NewLine + "", actual.Subject);
            Assert.Equal("from@localhost.local", actual.From);
            Assert.Equal(new[] { "to@localhost.local" }, actual.To);
            Assert.True(actual.IsBodyHtml);
        }

        [Fact]
        public void WorksWithIBatchTextFormatter()
        {
            var body = "SendMailAsync was not called";
            var selfLogMessages = new List<string>();
            SelfLog.Enable(selfLogMessages.Add);

            var emailConnectionInfo = new Mock<EmailConnectionInfo>();
            emailConnectionInfo.Object.ToEmail = "to@example.com";
            var emailTransport = new Mock<IEmailTransport>();
            emailTransport.Setup(x => x.SendMailAsync(It.IsAny<EmailMessage>())).Callback<EmailMessage>(m => body = m.Body).Returns(Task.FromResult(false));
            emailConnectionInfo.Setup(x => x.CreateEmailTransport()).Returns(emailTransport.Object);
            using (var emailLogger = new LoggerConfiguration()
                .WriteTo.Email(emailConnectionInfo.Object, new HtmlTableFormatter())
                .CreateLogger())
            {
                emailLogger.Information("Information");
                emailLogger.Warning("Warning");
                emailLogger.Error("<Error>");
            }

            Assert.Empty(selfLogMessages);
            Assert.Equal("

Information

Warning

<Error>

", body);
        }

        private class HtmlTableFormatter : IBatchTextFormatter
        {
            public void FormatBatch(IEnumerable<LogEvent> logEvents, TextWriter output)
            {
                output.Write("
");
                foreach (var logEvent in logEvents)
                {
                    Format(logEvent, output);
                }
                output.Write("
");
            }

            public void Format(LogEvent logEvent, TextWriter output)
            {
                output.Write("
");
                using var buffer = new StringWriter();
                logEvent.RenderMessage(buffer);
                output.Write(WebUtility.HtmlEncode(buffer.ToString()));
                output.Write("
");
            }
        }

        private EmailSink CreateDefaultEmailSink(EmailConnectionInfo emailConnectionInfo)
        {
            var formatter = new MessageTemplateTextFormatter("[{Level}] {Message}{NewLine}{Exception}", null);
            var subjectLineFormatter = new MessageTemplateTextFormatter("[{Level}] {Message}{NewLine}{Exception}", null);

            var emailSink = new EmailSink(
                emailConnectionInfo,
                formatter,
                subjectLineFormatter);
            return emailSink;
        }

        private (Mock<EmailConnectionInfo> EmailConnectionInfoMock, Mock<IEmailTransport> EmailTransportMock)
            CreateEmailTransportConnectionInfoMocks()
        {
            return CreateEmailTransportConnectionInfoMocks(_ => { });
        }

        private (Mock<EmailConnectionInfo> EmailConnectionInfoMock, Mock<IEmailTransport> EmailTransportMock)
            CreateEmailTransportConnectionInfoMocks(Action<EmailMessage> emailSend)
        {
            var emailTransportMock = new Mock<IEmailTransport>();
            emailTransportMock.Setup(et => et.SendMailAsync(It.IsAny<EmailMessage>()))
                .Callback<EmailMessage>(email => emailSend(email))
                .Returns(Task.Factory.StartNew(() => { }));
            var emailTransport = emailTransportMock.Object;
            var emailConnectionInfoMock = new Mock<EmailConnectionInfo>();
            emailConnectionInfoMock
                .Setup(eci => eci.CreateEmailTransport())
                .Returns(emailTransport);
            return (emailConnectionInfoMock, emailTransportMock);
        }
    }
}


text:
using namespace OpenZWave;

enum ManufacturerSpecificCmd
{
	ManufacturerSpecificCmd_Get		= 0x04,
	ManufacturerSpecificCmd_Report	= 0x05
};

map<uint16,string> ManufacturerSpecific::s_manufacturerMap;
map<int64,ManufacturerSpecific::Product*> ManufacturerSpecific::s_productMap;
bool ManufacturerSpecific::s_bXmlLoaded = false;

//-----------------------------------------------------------------------------
// <ManufacturerSpecific::RequestState>
// Request current state from the device
//-----------------------------------------------------------------------------
bool ManufacturerSpecific::RequestState
(
	uint32 const _requestFlags,
	uint8 const _instance,
	Driver::MsgQueue const _queue
)
{
	if( ( _requestFlags & RequestFlag_Static ) && HasStaticRequest( StaticRequest_Values ) )
	{
		return RequestValue( _requestFlags, 0, _instance, _queue );
	}

	return false;
}

//-----------------------------------------------------------------------------
// <ManufacturerSpecific::RequestValue>
// Request current value from the device
//-----------------------------------------------------------------------------
bool ManufacturerSpecific::RequestValue
(
	uint32 const _requestFlags,
	uint8 const _dummy1,	// = 0 (not used)
	uint8 const _instance,
	Driver::MsgQueue const _queue
)
{
	if( _instance != 1 )
	{
		// This command class doesn't work with multiple instances
		return false;
	}
	if ( IsGetSupported() )
	{
		Msg* msg = new Msg( "ManufacturerSpecificCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
		msg->Append( GetNodeId() );
		msg->Append( 2 );
		msg->Append( GetCommandClassId() );
		msg->Append( ManufacturerSpecificCmd_Get );
		msg->Append( GetDriver()->GetTransmitOptions() );
		GetDriver()->SendMsg( msg, _queue );
		return true;
	} else {
		Log::Write(  LogLevel_Info, GetNodeId(), "ManufacturerSpecificCmd_Get Not Supported on this node");
	}
	return false;
}

string ManufacturerSpecific::SetProductDetails
(
	Node* node,
	uint16 manufacturerId,
	uint16 productType,
	uint16 productId
)
{
	char str[64];

	if (!s_bXmlLoaded) LoadProductXML();

	snprintf( str, sizeof(str), "Unknown: id=%.4x", manufacturerId );
	string manufacturerName = str;

	snprintf( str, sizeof(str), "Unknown: type=%.4x, id=%.4x", productType, productId );
	string productName = str;

	string configPath = "";

	// Try to get the real manufacturer and product names
	map<uint16,string>::iterator mit = s_manufacturerMap.find( manufacturerId );
	if( mit != s_manufacturerMap.end() )
	{
		// Replace the id with the real name
		manufacturerName = mit->second;

		// Get the product
		map<int64,Product*>::iterator pit = s_productMap.find( Product::GetKey( manufacturerId, productType, productId ) );
		if( pit != s_productMap.end() )
		{
			productName = pit->second->GetProductName();
			configPath = pit->second->GetConfigPath();
		}
	}

	// Set the values into the node

	// Only set the manufacturer and product name if they are
	// empty - we don't want to overwrite any user defined names.
	if( node->GetManufacturerName() == "" )
	{
		node->SetManufacturerName( manufacturerName );
	}

	if( node->GetProductName() == "" )
	{
		node->SetProductName( productName );
	}

	snprintf( str, sizeof(str), "%.4x", manufacturerId );
	node->SetManufacturerId( str );

	snprintf( str, sizeof(str), "%.4x", productType );
	node->SetProductType( str );

	snprintf( str, sizeof(str), "%.4x", productId );
	node->SetProductId( str );

	return configPath;
}

//-----------------------------------------------------------------------------
// <ManufacturerSpecific::HandleMsg>
// Handle a message from the Z-Wave network
//-----------------------------------------------------------------------------
bool ManufacturerSpecific::HandleMsg
(
	uint8 const* _data,
	uint32 const _length,
	uint32 const _instance	// = 1
)
{
	if( ManufacturerSpecificCmd_Report == (ManufacturerSpecificCmd)_data[0] )
	{

		// first two bytes are manufacturer id code
		uint16 manufacturerId = (((uint16)_data[1])<<8) | (uint16)_data[2];

		// next four are product type and product id
		uint16 productType = (((uint16)_data[3])<<8) | (uint16)_data[4];
		uint16 productId = (((uint16)_data[5])<<8) | (uint16)_data[6];

		if( Node* node = GetNodeUnsafe() )
		{
			// Attempt to create the config parameters
			string configPath = SetProductDetails( node, manufacturerId, productType, productId);
			if( configPath.size() > 0 )
			{
				LoadConfigXML( node, configPath );
			}

			Log::Write( LogLevel_Info, GetNodeId(), "Received manufacturer specific report from node %d: Manufacturer=%s, Product=%s",
				    GetNodeId(), node->GetManufacturerName().c_str(), node->GetProductName().c_str() );
			ClearStaticRequest( StaticRequest_Values );
			node->m_manufacturerSpecificClassReceived = true;
		}

		// Notify the watchers of the name changes
		Notification* notification = new Notification( Notification::Type_NodeNaming );
		notification->SetHomeAndNodeIds( GetHomeId(), GetNodeId() );
		GetDriver()->QueueNotification( notification );

		return true;
	}

	return false;
}

//-----------------------------------------------------------------------------
// <ManufacturerSpecific::LoadProductXML>
// Load the XML that maps manufacturer and product IDs to human-readable names
//-----------------------------------------------------------------------------
bool ManufacturerSpecific::LoadProductXML
(
)
{
	s_bXmlLoaded = true;

	// Parse the Z-Wave manufacturer and product XML file.
	string configPath;
	Options::Get()->GetOptionAsString( "ConfigPath", &configPath );

	string filename =  configPath + "manufacturer_specific.xml";

	TiXmlDocument* pDoc = new TiXmlDocument();
	if( !pDoc->LoadFile( filename.c_str(), TIXML_ENCODING_UTF8 ) )
	{
		delete pDoc;
		Log::Write( LogLevel_Info, "Unable to load %s", filename.c_str() );
		return false;
	}

	TiXmlElement const* root = pDoc->RootElement();

	char const* str;
	char* pStopChar;

	TiXmlElement const* manufacturerElement = root->FirstChildElement();
	while( manufacturerElement )
	{
		str = manufacturerElement->Value();
		if( str && !strcmp( str, "Manufacturer" ) )
		{
			// Read in the manufacturer attributes
			str = manufacturerElement->Attribute( "id" );
			if( !str )
			{
				Log::Write( LogLevel_Info, "Error in manufacturer_specific.xml at line %d - missing manufacturer id attribute", manufacturerElement->Row() );
				delete pDoc;
				return false;
			}
			uint16 manufacturerId = (uint16)strtol( str, &pStopChar, 16 );

			str = manufacturerElement->Attribute( "name" );
			if( !str )
			{
				Log::Write( LogLevel_Info, "Error in manufacturer_specific.xml at line %d - missing manufacturer name attribute", manufacturerElement->Row() );
				delete pDoc;
				return false;
			}

			// Add this manufacturer to the map
			s_manufacturerMap[manufacturerId] = str;

			// Parse all the products for this manufacturer
			TiXmlElement const* productElement = manufacturerElement->FirstChildElement();
			while( productElement )
			{
				str = productElement->Value();
				if( str && !strcmp( str, "Product" ) )
				{
					str = productElement->Attribute( "type" );
					if( !str )
					{
						Log::Write( LogLevel_Info, "Error in manufacturer_specific.xml at line %d - missing product type attribute", productElement->Row() );
						delete pDoc;
						return false;
					}
					uint16 productType = (uint16)strtol( str, &pStopChar, 16 );

					str = productElement->Attribute( "id" );
					if( !str )
					{
						Log::Write( LogLevel_Info, "Error in manufacturer_specific.xml at line %d - missing product id attribute", productElement->Row() );
						delete pDoc;
						return false;
					}
					uint16 productId = (uint16)strtol( str, &pStopChar, 16 );

					str = productElement->Attribute( "name" );
					if( !str )
					{
						Log::Write( LogLevel_Info, "Error in manufacturer_specific.xml at line %d - missing product name attribute", productElement->Row() );
						delete pDoc;
						return false;
					}
					string productName = str;

					// Optional config path
					string configPath;
					str = productElement->Attribute( "config" );
					if( str )
					{
						configPath = str;
					}

					// Add the product to the map
					Product* product = new Product( manufacturerId, productType, productId, productName, configPath );
					if ( s_productMap[product->GetKey()] != NULL )
					{
						Product *c = s_productMap[product->GetKey()];
						Log::Write( LogLevel_Info, "Product name collision: %s type %x id %x manufacturerid %x, collides with %s, type %x id %x manufacturerid %x", productName.c_str(), productType, productId, manufacturerId, c->GetProductName().c_str(), c->GetProductType(), c->GetProductId(), c->GetManufacturerId());
						delete product;
					}
					else
					{
						s_productMap[product->GetKey()] = product;
					}
				}

				// Move on to the next product.
				productElement = productElement->NextSiblingElement();
			}
		}

		// Move on to the next manufacturer.
		manufacturerElement = manufacturerElement->NextSiblingElement();
	}

	delete pDoc;
	return true;
}

//-----------------------------------------------------------------------------
// <ManufacturerSpecific::UnloadProductXML>
// Free the XML that maps manufacturer and product IDs
//-----------------------------------------------------------------------------
void ManufacturerSpecific::UnloadProductXML
(
)
{
	if (s_bXmlLoaded)
	{
		map<int64,Product*>::iterator pit = s_productMap.begin();
		while( !s_productMap.empty() )
		{
		  	delete pit->second;
			s_productMap.erase( pit );
			pit = s_productMap.begin();
		}

		map<uint16,string>::iterator mit = s_manufacturerMap.begin();
		while( !s_manufacturerMap.empty() )
		{
			s_manufacturerMap.erase( mit );
			mit = s_manufacturerMap.begin();
		}

		s_bXmlLoaded = false;
	}
}

//-----------------------------------------------------------------------------
// <ManufacturerSpecific::LoadConfigXML>
// Try to find and load an XML file describing the device's config params
//-----------------------------------------------------------------------------
bool ManufacturerSpecific::LoadConfigXML
(
	Node* _node,
	string const& _configXML
)
{
	string configPath;
	Options::Get()->GetOptionAsString( "ConfigPath", &configPath );

	string filename =  configPath + _configXML;

	TiXmlDocument* doc = new TiXmlDocument();
	Log::Write( LogLevel_Info, _node->GetNodeId(), "  Opening config param file %s", filename.c_str() );
	if( !doc->LoadFile( filename.c_str(), TIXML_ENCODING_UTF8 ) )
	{
		delete doc;
		Log::Write( LogLevel_Info, _node->GetNodeId(), "Unable to find or load Config Param file %s", filename.c_str() );
		return false;
	}

	Node::QueryStage qs = _node->GetCurrentQueryStage();
	if( qs == Node::QueryStage_ManufacturerSpecific1 )
	{
		_node->ReadDeviceProtocolXML( doc->RootElement() );
	}
	else
	{
		if( !_node->m_manufacturerSpecificClassReceived )
		{
			_node->ReadDeviceProtocolXML( doc->RootElement() );
		}
		_node->ReadCommandClassesXML( doc->RootElement() );
	}

	delete doc;
	return true;
}

//-----------------------------------------------------------------------------
// <ManufacturerSpecific::ReLoadConfigXML>
// Reload previously discovered device configuration.
//-----------------------------------------------------------------------------
void ManufacturerSpecific::ReLoadConfigXML
(
)
{
	if( Node* node = GetNodeUnsafe() )
	{
		if (!s_bXmlLoaded) LoadProductXML();

		uint16 manufacturerId = (uint16)strtol( node->GetManufacturerId().c_str(), NULL, 16 );
		uint16 productType = (uint16)strtol( node->GetProductType().c_str(), NULL, 16 );
		uint16 productId = (uint16)strtol( node->GetProductId().c_str(), NULL, 16 );

		map<uint16,string>::iterator mit = s_manufacturerMap.find( manufacturerId );
		if( mit != s_manufacturerMap.end() )
		{
			map<int64,Product*>::iterator pit = s_productMap.find( Product::GetKey( manufacturerId, productType, productId ) );
			if( pit != s_productMap.end() )
			{
				string configPath = pit->second->GetConfigPath();
				if( configPath.size() > 0 )
				{
					LoadConfigXML( node, configPath );
				}
			}
		}
	}
}


text:
#ifndef QWINEXTRASGLOBAL_H
#define QWINEXTRASGLOBAL_H

#include <QtCore/qglobal.h>

QT_BEGIN_NAMESPACE

#ifndef QT_STATIC
#  if defined(QT_BUILD_WINEXTRAS_LIB)
#    define Q_WINEXTRAS_EXPORT Q_DECL_EXPORT
#  else
#    define Q_WINEXTRAS_EXPORT Q_DECL_IMPORT
#  endif
#else
#  define Q_WINEXTRAS_EXPORT
#endif

QT_END_NAMESPACE

#endif // QWINEXTRASGLOBAL_H


text:
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
	jaxb:version="2.0" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
	jaxb:extensionBindingPrefixes="xjc">

 	<jaxb:globalBindings generateElementProperty="false">
 		<jaxb:javaType name="java.util.Calendar" xmlType="xs:date"
 			parseMethod="javax.xml.bind.DatatypeConverter.parseDate" printMethod="com.litle.sdk.CalendarPrinter.printDate" />
 		<jaxb:javaType name="java.lang.Long" xmlType="xp:transactionAmountType"
 			parseMethod="java.lang.Long.valueOf" printMethod="java.lang.Long.toString" />
 		<jaxb:javaType name="java.lang.String" xmlType="xs:base64Binary"
 			parseMethod="java.lang.String.valueOf" printMethod="java.lang.String.valueOf" />
 		<xjc:simple />
 	</jaxb:globalBindings>

</jaxb:bindings>


text:
  var errorLog = "";

  function _logData(data) {
    var old = document.form_out.form_text.value;
    document.form_out.form_text.value = data + '\n\n' + old;
  }

  function scb() {
    _logData("Data network connection is released");
  }

  function ecb(e) {
     _logData(errorLog + '\n\n' + "error callback is called! " + e.message + " : " + e.code);
  }

  var statuscb = {
    onsuccess: function() {
      _logData("Data network connection is connected");
    },
    ondisconnected: function() {
      _logData("Data network connection is disconnected");
    }
  }

  var statuscba = {
    onsuccess: function() {
      _logData("Data network connection is connected");
      tizen.networkbearerselection.releaseRouteToHost("CELLULAR", "crosswalk-project.org", scb, ecb)
    },
    ondisconnected: function() {
      _logData("Data network connection is disconnected");
    }
  }

$(document).ready(function() {

  $('#btn_request').click(function() {
    errorLog = "Request to set up the network connection.";
    tizen.networkbearerselection.requestRouteToHost("CELLULAR", "crosswalk-project.org", statuscb, ecb);
  })

  $('#btn_release').click(function() {
    errorLog = "Request to release the network connection.";
    tizen.networkbearerselection.requestRouteToHost("CELLULAR", "crosswalk-project.org", statuscba, ecb);
  })
});