text:
/* --------------------------------

Primary style

-------------------------------- */
*, *::after, *::before {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

*::after, *::before {
  content: '';
}

/* --------------------------------

Main components

-------------------------------- */
html, body {
  height: 100%;
}

header {
  z-index: 3;
}

.cd-logo, .cd-nav-trigger {
  position: fixed;
  display: inline-block;
}

.cd-logo {
  top: 28px;
  left: 5%;
}
.cd-logo img {
  display: block;
  height: 100%;
}

.cd-nav-trigger {
  top: 18px;
  right: 5%;
  height: 44px;
  width: 44px;
  z-index: 20;
  /* image replacement */
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
  border-radius: 50%;
  box-shadow: 0px 0px 5px rgba(89, 89, 89, 0.8)
  /*animation: triggerShadow 1s ease-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;*/
}
/*@keyframes triggerShadow {
  from {box-shadow: 0px 0px 5px rgba(89, 89, 89, 0.7);}
  to {box-shadow: 0px 0px 20px rgba(89, 89, 89, 1);}
}*/
a:hover.cd-nav-trigger::before, a:hover.cd-nav-trigger::after{
  cursor: pointer;
  background-color: #ffffff;
}
.cd-nav-trigger .cd-icon {
  /* icon created in CSS */
  position: absolute;
  left: 50%;
  top: 50%;
  bottom: auto;
  right: auto;
  -webkit-transform: translateX(-50%) translateY(-50%);
  -moz-transform: translateX(-50%) translateY(-50%);
  -ms-transform: translateX(-50%) translateY(-50%);
  -o-transform: translateX(-50%) translateY(-50%);
  transform: translateX(-50%) translateY(-50%);
  display: inline-block;
  width: 18px;
  height: 3px;
  background-color: #46ab8f;
  z-index: 10;
}
.cd-nav-trigger .cd-icon::before, .cd-nav-trigger .cd-icon:after {
  /* upper and lower lines of the menu icon */
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-color: #46ab8f;
  /* Force Hardware Acceleration in WebKit */
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -ms-transform: translateZ(0);
  -o-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* apply transition to transform property */
  -webkit-transition: -webkit-transform .3s;
  -moz-transition: -moz-transform .3s;
  transition: transform .3s;
}
.cd-nav-trigger .cd-icon::before {
  -webkit-transform: translateY(-6px) rotate(0deg);
  -moz-transform: translateY(-6px) rotate(0deg);
  -ms-transform: translateY(-6px) rotate(0deg);
  -o-transform: translateY(-6px) rotate(0deg);
  transform: translateY(-6px) rotate(0deg);
}
.cd-nav-trigger .cd-icon::after {
  -webkit-transform: translateY(6px) rotate(0deg);
  -moz-transform: translateY(6px) rotate(0deg);
  -ms-transform: translateY(6px) rotate(0deg);
  -o-transform: translateY(6px) rotate(0deg);
  transform: translateY(6px) rotate(0deg);
}
.cd-nav-trigger::before, .cd-nav-trigger::after {
  /* 2 rounded colored backgrounds for the menu icon */
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  height: 100%;
  width: 100%;
  /* Force Hardware Acceleration in WebKit */
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -ms-transform: translateZ(0);
  -o-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transition-property: -webkit-transform;
  -moz-transition-property: -moz-transform;
  transition-property: transform;
}
.cd-nav-trigger::before {
  background-color: rgba(255, 255, 255, 0.8);
  -webkit-transform: scale(1);
  -moz-transform: scale(1);
  -ms-transform: scale(1);
  -o-transform: scale(1);
  transform: scale(1);
  -webkit-transition-duration: 0.3s;
  -moz-transition-duration: 0.3s;
  transition-duration: 0.3s;
  -webkit-transition-delay: 0.4s;
  -moz-transition-delay: 0.4s;
  transition-delay: 0.4s;
}
.cd-nav-trigger::after {
  background-color: rgba(255, 255, 255, 0.8);
  -webkit-transform: scale(0);
  -moz-transform: scale(0);
  -ms-transform: scale(0);
  -o-transform: scale(0);
  transform: scale(0);
  -webkit-transition-duration: 0s;
  -moz-transition-duration: 0s;
  transition-duration: 0s;
  -webkit-transition-delay: 0s;
  -moz-transition-delay: 0s;
  transition-delay: 0s;
}
.cd-nav-trigger.close-nav::before {
  /* user clicks on the .cd-nav-trigger element - 1st rounded background disappears */
  -webkit-transform: scale(0);
  -moz-transform: scale(0);
  -ms-transform: scale(0);
  -o-transform: scale(0);
  transform: scale(0);
}
.cd-nav-trigger.close-nav::after {
  /* user clicks on the .cd-nav-trigger element - 2nd rounded background appears */
  -webkit-transform: scale(1);
  -moz-transform: scale(1);
  -ms-transform: scale(1);
  -o-transform: scale(1);
  transform: scale(1);
  -webkit-transition-duration: 0.3s;
  -moz-transition-duration: 0.3s;
  transition-duration: 0.3s;
  -webkit-transition-delay: 0.4s;
  -moz-transition-delay: 0.4s;
  transition-delay: 0.4s;
}
.cd-nav-trigger.close-nav .cd-icon {
  /* user clicks on the .cd-nav-trigger element - transform the icon */
  background-color: rgba(255, 255, 255, 0);
}
.cd-nav-trigger.close-nav .cd-icon::before, .cd-nav-trigger.close-nav .cd-icon::after {
  background-color: #46ab8f;
}
.cd-nav-trigger.close-nav .cd-icon::before {
  -webkit-transform: translateY(0) rotate(45deg);
  -moz-transform: translateY(0) rotate(45deg);
  -ms-transform: translateY(0) rotate(45deg);
  -o-transform: translateY(0) rotate(45deg);
  transform: translateY(0) rotate(45deg);
}
.cd-nav-trigger.close-nav .cd-icon::after {
  -webkit-transform: translateY(0) rotate(-45deg);
  -moz-transform: translateY(0) rotate(-45deg);
  -ms-transform: translateY(0) rotate(-45deg);
  -o-transform: translateY(0) rotate(-45deg);
  transform: translateY(0) rotate(-45deg);
}
.cd-primary-nav {
  /* by default it's hidden */
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  padding: 80px 0;
  z-index: 17;
  background-color: #a1dac4;
  overflow: hidden;
  /* this fixes the buggy scrolling on webkit browsers - mobile devices only - when overflow property is applied */
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
  opacity: 0;
  -webkit-transition: visibility 0s, opacity 0.3s;
  -moz-transition: visibility 0s, opacity 0.3s;
  transition: visibility 0s, opacity 0.3s;
}
.cd-primary-nav li {
  text-align: center;
  text-transform: capitalize;
}
/*.cd-primary-nav a {
  font-size: 20px;
  font-size: 1.25rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-transition: color 0.2s;
  -moz-transition: color 0.2s;
  transition: color 0.2s;
}
.no-touch .cd-primary-nav a:hover {
  color: #ffffff;
}*/
.cd-primary-nav.fade-in {
  /* navigation visible at the end of the circle animation */
  visibility: visible;
  opacity: 1;
}
@media only screen and (max-width: 768px) {
  .cd-primary-nav a {
    font-size: 28px;
    font-size: 1.75rem;
  }
}

.cd-overlay-nav, .cd-overlay-content {
  /* containers of the 2 main rounded backgrounds - these containers are used to position the rounded bgs behind the menu icon */
  position: fixed;
  top: 18px;
  right: 5%;
  height: 4px;
  width: 4px;
  -webkit-transform: translateX(-20px) translateY(20px);
  -moz-transform: translateX(-20px) translateY(20px);
  -ms-transform: translateX(-20px) translateY(20px);
  -o-transform: translateX(-20px) translateY(20px);
  transform: translateX(-20px) translateY(20px);
}
.cd-overlay-nav span, .cd-overlay-content span {
  display: inline-block;
  position: absolute;
  border-radius: 50%;
  /* Force Hardware Acceleration in WebKit */
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -ms-transform: translateZ(0);
  -o-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
  -webkit-transform-origin: 50% 50%;
  -moz-transform-origin: 50% 50%;
  -ms-transform-origin: 50% 50%;
  -o-transform-origin: 50% 50%;
  transform-origin: 50% 50%;
  -webkit-transform: scale(0);
  -moz-transform: scale(0);
  -ms-transform: scale(0);
  -o-transform: scale(0);
  transform: scale(0);
}
.cd-overlay-nav.is-hidden, .cd-overlay-content.is-hidden {
  /* background fades out at the end of the animation */
  opacity: 0;
  visibility: hidden;
  -webkit-transition: opacity .3s 0s, visibility 0s .3s;
  -moz-transition: opacity .3s 0s, visibility 0s .3s;
  transition: opacity .3s 0s, visibility 0s .3s;
}

.cd-overlay-nav {
  /* main rounded colored bg 1 */
  z-index: 16;
}
.cd-overlay-nav span {
  background-color: #fff;
}

.cd-overlay-content {
  /* main rounded colored bg 2 */
  z-index: 18;
}
.cd-overlay-content span {
  background-color: white;
}


text:
A silly project related to forex trading. It allows someone to tinker algos outside the limitations of MT4.

Don't do forex.

#### How to run
To compile Overlook, you need to download and install Ultimate++ and learn to how to compile programs with it. Then, you clone this repository, add it to a new assembly or copy files to MyApps directory.
To run Overlook, you need to run MQL4 script Mt4Connection, which is in the src/plugin/MQL4 folder. The MT4Connection.mq4 goes to the Scripts folder of MT4 and MT4ConnectionDll.dll goes to Libraries folder.
Run "Load Server History" in MT4 to have all data. Restart MT4 before starting Overlook to save history data to disk.

![Classic view](https://github.com/OuluLinux/Overlook/raw/master/docs/classic.jpg)

redpajama_set_name: RedPajamaGithub


text:
Ext.define('OPF.console.domain.store.ProcessFields', {
    extend: 'Ext.data.Store',
    restful: false,
    constructor: function(cfg) {
        cfg = cfg || {};
        OPF.console.domain.store.ProcessFields.superclass.constructor.call(this, Ext.apply({
            model: 'OPF.console.domain.model.ProcessFieldModel',
            proxy: {
                type: 'memory',
                reader: {
                    type: 'json',
                    root: 'processFields'
                }
            }
        }, cfg));
    }
});


text:
/*-
 * Written by J.T. Conklin <jtc@NetBSD.org>
 * Public domain.
 *
 *	$NetBSD: search.h,v 1.16 2005/02/03 04:39:32 perry Exp $
 * $FreeBSD$
 */

#ifndef _SEARCH_H_
#define _SEARCH_H_

#include <sys/cdefs.h>
#include <sys/_types.h>

#ifndef _SIZE_T_DECLARED
typedef	__size_t	size_t;
#define	_SIZE_T_DECLARED
#endif

typedef	struct entry {
	char	*key;
	void	*data;
} ENTRY;

typedef	enum {
	FIND, ENTER
} ACTION;

typedef	enum {
	preorder,
	postorder,
	endorder,
	leaf
} VISIT;

#ifdef _SEARCH_PRIVATE
typedef	struct node {
	void         *key;
	struct node  *llink, *rlink;
	signed char   balance;
} node_t;

struct que_elem {
	struct que_elem *next;
	struct que_elem *prev;
};
#endif

#if __BSD_VISIBLE
struct hsearch_data {
	struct __hsearch *__hsearch;
};
#endif

__BEGIN_DECLS
int	 hcreate(size_t);
void	 hdestroy(void);
ENTRY	*hsearch(ENTRY, ACTION);
void	 insque(void *, void *);
void	*lfind(const void *, const void *, size_t *, size_t,
	    int (*)(const void *, const void *));
void	*lsearch(const void *, void *, size_t *, size_t,
	    int (*)(const void *, const void *));
void	 remque(void *);
void	*tdelete(const void * __restrict, void ** __restrict,
	    int (*)(const void *, const void *));
void	*tfind(const void *, void * const *,
	    int (*)(const void *, const void *));
void	*tsearch(const void *, void **, int (*)(const void *, const void *));
void	 twalk(const void *, void (*)(const void *, VISIT, int));

#if __BSD_VISIBLE
int	 hcreate_r(size_t, struct hsearch_data *);
void	 hdestroy_r(struct hsearch_data *);
int	 hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
#endif

__END_DECLS

#endif /* !_SEARCH_H_ */


text:
#import "CCLayout.h"

/**
 Declares the possible directions for laying out nodes in a CCLayoutBox.
 */
typedef NS_ENUM(NSUInteger, CCLayoutBoxDirection)
{
    /// The children will be horizontally aligned.
    CCLayoutBoxDirectionHorizontal,

    /// The children will be vertically aligned.
    CCLayoutBoxDirectionVertical,
};

/**
 The box layout lays out its child nodes in a horizontal row or a vertical column. Optionally you can set a spacing between the child nodes.

 @note In order to layout nodes in a grid, you can add one or more CCLayoutBox as child node with the opposite layout direction, ie the parent
 box layout node uses vertical and the child box layout nodes use horizontal CCLayoutBoxDirection to create a grid of nodes.
 */
@interface CCLayoutBox : CCLayout

/** @name Layout Options */

/**
 The direction is either horizontal or vertical.
 @see CCLayoutBoxDirection
 */
@property (nonatomic,assign) CCLayoutBoxDirection direction;

/**
 The spacing in points between the child nodes.
 */
@property (nonatomic,assign) float spacing;

@end


text:
using System.Threading;

namespace System.Threading.Tasks
{
	abstract class TaskActionInvoker
	{
		public static readonly TaskActionInvoker Empty = new EmptyTaskActionInvoker ();
		public static readonly TaskActionInvoker Promise = new EmptyTaskActionInvoker ();
		public static readonly TaskActionInvoker Delay = new DelayTaskInvoker ();

		sealed class EmptyTaskActionInvoker : TaskActionInvoker
		{
			public override Delegate Action {
				get {
					return null;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
			}
		}

		sealed class ActionInvoke : TaskActionInvoker
		{
			readonly Action action;

			public ActionInvoke (Action action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				action ();
			}
		}

		sealed class ActionObjectInvoke : TaskActionInvoker
		{
			readonly Action<object> action;

			public ActionObjectInvoke (Action<object> action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				action (state);
			}
		}

		sealed class ActionTaskInvoke : TaskActionInvoker
		{
			readonly Action<Task> action;

			public ActionTaskInvoke (Action<Task> action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				action (owner);
			}
		}

		sealed class ActionTasksInvoke : TaskActionInvoker
		{
			readonly Action<Task[]> action;
			readonly Task[] tasks;

			public ActionTasksInvoke (Action<Task[]> action, Task[] tasks)
			{
				this.action = action;
				this.tasks = tasks;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				owner.TrySetExceptionObserved ();
				action (tasks);
			}
		}

		sealed class ActionTaskObjectInvoke : TaskActionInvoker
		{
			readonly Action<Task, object> action;

			public ActionTaskObjectInvoke (Action<Task, object> action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				action (owner, state);
			}
		}

		sealed class ActionTaskObjectInvoke<TResult> : TaskActionInvoker
		{
			readonly Action<Task<TResult>, object> action;

			public ActionTaskObjectInvoke (Action<Task<TResult>, object> action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				action ((Task<TResult>) owner, state);
			}
		}

		sealed class ActionTaskInvoke<TResult> : TaskActionInvoker
		{
			readonly Action<Task<TResult>> action;

			public ActionTaskInvoke (Action<Task<TResult>> action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				action ((Task<TResult>) owner);
			}
		}

		sealed class ActionTaskSelected : TaskActionInvoker
		{
			readonly Action<Task> action;

			public ActionTaskSelected (Action<Task> action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				action (((Task<Task>)owner).Result);
			}
		}

		sealed class FuncInvoke<TResult> : TaskActionInvoker
		{
			readonly Func<TResult> action;

			public FuncInvoke (Func<TResult> action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				((Task<TResult>) context).Result = action ();
			}
		}

		sealed class FuncTaskInvoke<TResult> : TaskActionInvoker
		{
			readonly Func<Task, TResult> action;

			public FuncTaskInvoke (Func<Task, TResult> action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				((Task<TResult>) context).Result = action (owner);
			}
		}

		sealed class FuncTasksInvoke<TResult> : TaskActionInvoker
		{
			readonly Func<Task[], TResult> action;
			readonly Task[] tasks;

			public FuncTasksInvoke (Func<Task[], TResult> action, Task[] tasks)
			{
				this.action = action;
				this.tasks = tasks;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				owner.TrySetExceptionObserved ();
				((Task<TResult>) context).Result = action (tasks);
			}
		}

		sealed class FuncTaskSelected<TResult> : TaskActionInvoker
		{
			readonly Func<Task, TResult> action;

			public FuncTaskSelected (Func<Task, TResult> action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				var result = ((Task<Task>) owner).Result;
				((Task<TResult>) context).Result = action (result);
			}
		}

		sealed class FuncTaskInvoke<TResult, TNewResult> : TaskActionInvoker
		{
			readonly Func<Task<TResult>, TNewResult> action;

			public FuncTaskInvoke (Func<Task<TResult>, TNewResult> action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				((Task<TNewResult>) context).Result = action ((Task<TResult>) owner);
			}
		}

		sealed class FuncObjectInvoke<TResult> : TaskActionInvoker
		{
			readonly Func<object, TResult> action;

			public FuncObjectInvoke (Func<object, TResult> action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				((Task<TResult>) context).Result = action (state);
			}
		}

		sealed class FuncTaskObjectInvoke<TResult> : TaskActionInvoker
		{
			readonly Func<Task, object, TResult> action;

			public FuncTaskObjectInvoke (Func<Task, object, TResult> action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				((Task<TResult>) context).Result = action (owner, state);
			}
		}

		sealed class FuncTaskObjectInvoke<TResult, TNewResult> : TaskActionInvoker
		{
			readonly Func<Task<TResult>, object, TNewResult> action;

			public FuncTaskObjectInvoke (Func<Task<TResult>, object, TNewResult> action)
			{
				this.action = action;
			}

			public override Delegate Action {
				get {
					return action;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				((Task<TNewResult>) context).Result = action ((Task<TResult>) owner, state);
			}
		}

		sealed class DelayTaskInvoker : TaskActionInvoker
		{
			public override Delegate Action {
				get {
					return null;
				}
			}

			public override void Invoke (Task owner, object state, Task context)
			{
				var mre = new ManualResetEventSlim ();
				int timeout = (int) state;
				mre.Wait (timeout, context.CancellationToken);
			}
		}

		public static TaskActionInvoker Create (Action action)
		{
			return new ActionInvoke (action);
		}

		public static TaskActionInvoker Create (Action<object> action)
		{
			return new ActionObjectInvoke (action);
		}

		public static TaskActionInvoker Create (Action<Task> action)
		{
			return new ActionTaskInvoke (action);
		}

		public static TaskActionInvoker Create (Action<Task, object> action)
		{
			return new ActionTaskObjectInvoke (action);
		}

		public static TaskActionInvoker Create<TResult> (Action<Task<TResult>> action)
		{
			return new ActionTaskInvoke<TResult> (action);
		}

		public static TaskActionInvoker Create<TResult> (Action<Task<TResult>, object> action)
		{
			return new ActionTaskObjectInvoke<TResult> (action);
		}

		public static TaskActionInvoker Create<TResult> (Func<TResult> action)
		{
			return new FuncInvoke<TResult> (action);
		}

		public static TaskActionInvoker Create<TResult> (Func<object, TResult> action)
		{
			return new FuncObjectInvoke<TResult> (action);
		}

		public static TaskActionInvoker Create<TResult> (Func<Task, TResult> action)
		{
			return new FuncTaskInvoke<TResult> (action);
		}

		public static TaskActionInvoker Create<TResult> (Func<Task, object, TResult> action)
		{
			return new FuncTaskObjectInvoke<TResult> (action);
		}

		public static TaskActionInvoker Create<TResult, TNewResult> (Func<Task<TResult>, TNewResult> action)
		{
			return new FuncTaskInvoke<TResult, TNewResult> (action);
		}

		public static TaskActionInvoker Create<TResult, TNewResult> (Func<Task<TResult>, object, TNewResult> action)
		{
			return new FuncTaskObjectInvoke<TResult, TNewResult> (action);
		}

		#region Used by ContinueWhenAll

		public static TaskActionInvoker Create (Action<Task[]> action, Task[] tasks)
		{
			return new ActionTasksInvoke (action, tasks);
		}

		public static TaskActionInvoker Create<TResult> (Func<Task[], TResult> action, Task[] tasks)
		{
			return new FuncTasksInvoke<TResult> (action, tasks);
		}

		#endregion

		#region Used by ContinueWhenAny

		public static TaskActionInvoker CreateSelected (Action<Task> action)
		{
			return new ActionTaskSelected (action);
		}

		public static TaskActionInvoker CreateSelected<TResult> (Func<Task, TResult> action)
		{
			return new FuncTaskSelected<TResult> (action);
		}

		#endregion

		public abstract Delegate Action { get; }
		public abstract void Invoke (Task owner, object state, Task context);
	}
}


text:
namespace arangodb {

namespace application_features {
class ApplicationServer;
}

namespace basics {

class DebugRaceController {
 public:
  static DebugRaceController& sharedInstance();

  DebugRaceController();

  // Reset the sotread state here, will free the stored data
  // and remove the didTrigger flag
  void reset();

  // Test if this RaceController did trigger once.
  // It can be de-activated after the first waiting
  bool didTrigger() const;

  // Access the data stored by waiting threads.
  std::vector<std::any> data() const;

  // Caller is required to COPY the data to store here.
  // Otherwise a concurrent thread might try to read it,
  // after the caller has freed the memory.
  void waitForOthers(size_t numberOfThreadsToWaitFor, std::any myData,
                     arangodb::application_features::ApplicationServer const& server);

 private:
  bool _didTrigger{false};
  std::mutex mutable _mutex{};
  std::vector<std::any> _data{};
  std::condition_variable _condVariable{};
};
}  // namespace basics
}  // namespace arangodb
// This are used to synchronize parallel locking of two shards
// in our tests. Do NOT include in production.

#endif


text:
'use strict';
var fs = require('fs');
module.exports = function(grunt) {

  // Please see the Grunt documentation for more information regarding task
  // creation: http://gruntjs.com/creating-tasks

  grunt.registerMultiTask('html_split', 'splits html files on a handle and outputs htmls surrounded by handels', function() {
    // Merge task-specific and/or target-specific options with these defaults.
    var options = this.options({
        src: "src/",
        wildcard: "*.html",
        dest: "dist/",
        handler: "<!--DS22SD-->",
        filenameSuffixPreHandler: "<html-split-title>",
        filenameSuffixPostHandler: "</html-split-title>"
    });
    var wc = ".";
    var filelist = [];
    console.log('\x1b[45m%s\x1b[0m', 'dest:= ' + options.dest);
    console.log('\x1b[45m%s\x1b[0m', 'src:= ' + options.src);
    var lastChar = options.dest.substr(-1);
    if (lastChar != '/') {
        options.dest = options.dest + '/';
    }
    lastChar = options.src.substr(-1);
    if (lastChar == '/') {
        options.src = options.src.slice(0, -1);
    }
    var target = grunt.option('target') || "";
    if(target !== ""){
        var targetArray = grunt.option('target').split(',');
        console.log('\x1b[45m%s\x1b[0m', 'target:= ' + targetArray);
        options.wildcard = 'target';
        targetArray.forEach(function(file) {
            filelist.push(options.src+'/'+file);
        });
    }
    console.log('\x1b[45m%s\x1b[0m', 'dest:= ' + options.dest);
    console.log('\x1b[45m%s\x1b[0m', 'src:= ' + options.src);

    var walk = function(dir) {
        console.log("Begining WALK with : " + dir);
        var files = fs.readdirSync(dir);
        files.forEach(function(file) {
            if (fs.statSync(dir + '/' + file).isDirectory()) {
            }
            else {
              if (file.includes(wc))
                filelist.push(dir+'/'+file);
            }
        });
    };

    var walkRecursive = function(dir) {
      console.log('\x1b[34m%s\x1b[0m', "Begining WALKRecursive with : " + dir);
        var files = fs.readdirSync(dir);
        files.forEach(function(file) {
            if (fs.statSync(dir + '/' + file).isDirectory()) {
                walkRecursive(dir + '/' + file);
            }
            else {
              if (file.includes(wc))
                filelist.push(dir+'/'+file);
            }
        });
    };

    var isEven = function(n) {
        var nin = Number(n);
        return nin === 0 || !!(nin && !(nin%2));
    }
    var isOdd = function(n) {
        return isEven(Number(n) + 1);
    }
    var lCreateDirs = function(path){
        var pathArray = path.split('/');
        var pEle = '';
        pathArray.forEach(function(ele){
            pEle += ele + '/';
            console.log('\x1b[45m%s\x1b[0m', pEle);
            if(!fs.existsSync(pEle))
                fs.mkdirSync(pEle);
        });
    }

    var applyHandler = function() {
        console.log('\x1b[32m%s\x1b[0m', "Begining applyHandler");
        filelist.forEach(function(element) {
          var filename = element.replace(/^.*[\\\/]/, '')
            var sourceHtml = fs.readFileSync(element, 'utf8');
            var sourceHtmlgArray = sourceHtml.split(options.handler);
            if(!fs.existsSync(options.dest))
                lCreateDirs(options.dest.slice(0, -1));
            var index = 0;
            var splitIndex = 0;
            sourceHtmlgArray.forEach(function(ele){
                if(isOdd(index)){
                splitIndex += 1;
                var filenameSuffix;
                var filenameSuffixArray = sourceHtmlgArray[index].split(options.filenameSuffixPreHandler);
                if (filenameSuffixArray.length >= 3 && filenameSuffixArray[1].indexOf(options.filenameSuffixPostHandler) === -1) {
                    filenameSuffix = filenameSuffixArray[1];
                } else if (filenameSuffixArray.length === 2 || (filenameSuffixArray.length >= 3 && filenameSuffixArray[1].indexOf(options.filenameSuffixPostHandler) > -1)) {
                    filenameSuffix = filenameSuffixArray[1].split(options.filenameSuffixPostHandler)[0];
                }
                if(filenameSuffix) {
                    filenameSuffix = "_" + filenameSuffix
                                        .trim()
                                        .replace(/\s+/g, "-")
                                        .toLowerCase();
                  } else {
                    filenameSuffix = "";
                  }
                  console.log('\x1b[31m%s\x1b[0m', filename);
                  var pattrn_name = filename.replace(".html", "").replace("patterns-", "");
                  pattrn_name = options.dest + pattrn_name + "/";
                  lCreateDirs(pattrn_name.slice(0, -1));
                  console.log('\x1b[31m%s\x1b[0m', pattrn_name + splitIndex + filenameSuffix + ".html");
                  console.log("Index: " + index);
                  console.log("splitIndex: " + splitIndex);
                  console.log("filenameSuffix: " + filenameSuffix);
                  fs.writeFileSync(pattrn_name + splitIndex + filenameSuffix + ".html", sourceHtmlgArray[index], 'utf-8');
                }
                index += 1;
            })
        }, this);
    };

    switch(options.wildcard) {
        case '*.*':       wc = ".";     walk(options.src);          break;
        case '*.html':    wc = ".html"; walk(options.src);          break;
        case '*.js':      wc = ".js";   walk(options.src);          break;
        case '**':        wc = ".";     walkRecursive(options.src); break;
        case '**/*':      wc = ".";     walkRecursive(options.src); break;
        case '**/*.html': wc = ".html"; walkRecursive(options.src); break;
        case '**/*.js':   wc = ".js";   walkRecursive(options.src); break;
        default:          wc = ".";
    }
    console.log('\x1b[36m%s', 'Following are the files: ');
    console.log(filelist);
    applyHandler();
  });
};


text:
package org.deeplearning4j.parallelism.trainer;

import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.deeplearning4j.nn.api.Model;
import org.deeplearning4j.nn.conf.WorkspaceMode;
import org.deeplearning4j.nn.graph.ComputationGraph;
import org.deeplearning4j.nn.multilayer.MultiLayerNetwork;
import org.deeplearning4j.optimize.listeners.SharedGradient;
import org.deeplearning4j.optimize.solvers.accumulation.GradientsAccumulator;
import org.deeplearning4j.parallelism.ParallelWrapper;

@Slf4j
public class SymmetricTrainer extends DefaultTrainer implements CommunicativeTrainer {
    protected GradientsAccumulator accumulator;

    public SymmetricTrainer(@NonNull Model originalModel, String uuid, int threadIdx, @NonNull WorkspaceMode mode,
                    @NonNull ParallelWrapper wrapper, boolean useMDS) {
        super();
        this.uuid = uuid + "_thread_" + threadIdx;
        this.useMDS = useMDS;
        this.originalModel = originalModel;
        this.threadId = threadIdx;
        this.workspaceMode = mode;
        this.parallelWrapper = wrapper;
        this.accumulator = wrapper.getGradientsAccumulator();

    }

    // FIXME: delete this method, it's not needed anymore
    @Deprecated
    public void enqueueGradient(SharedGradient gradient) {
        //
    }

    @Override
    public boolean averagingRequired() {
        return false;
    }

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

        if (accumulator == null) {
            log.warn("GradientsAccumulator is undefined, gradients sharing will be skipped");
            return;
        }

        // just pass accumulator down the hill
        if (replicatedModel instanceof ComputationGraph) {
            ((ComputationGraph) replicatedModel).setGradientsAccumulator(accumulator);
        } else if (replicatedModel instanceof MultiLayerNetwork) {
            ((MultiLayerNetwork) replicatedModel).setGradientsAccumulator(accumulator);
        }

        // need to attach this device id to accumulator's workspaces
        accumulator.touch();
    }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Acta Mycol. Sin. 12(1): 30 (1993)

#### Original name
Cercospora tecomae-heterophyllae J.M. Yen

### Remarks
null


text:
"""Grr Colab flags definitions."""
from __future__ import absolute_import
from __future__ import division

from __future__ import print_function
from __future__ import unicode_literals

import sys

from absl import flags

FLAGS = flags.FLAGS

flags.DEFINE_string(
    name='grr_http_api_endpoint',
    default=None,
    help='HTTP endpoint for GRR API')

flags.DEFINE_string(
    name='grr_auth_api_user',
    default=None,
    help='GRR API username')

flags.DEFINE_string(
    name='grr_auth_password',
    default=None,
    help='GRR API user password')

flags.DEFINE_string(
    name='grr_admin_ui_url', default=None, help='URL to GRR Admin UI')

# TODO(user): Find a better way to handle flags. Despite the fact that in
#  IPython flags are available during extension loading, Jupyter does not
#  propagate flags so for now they have to be specified with
#  `FLAGS.set_default()` method that obviously is not the best solution.
if not FLAGS.is_parsed():
  FLAGS(sys.argv, known_only=True)


text:
import { throttle } from "lodash";

import FixedDistributor from "./distributors/fixed";
import ResizeItem from "./item";
import Sizer from "./sizer";

interface IClassNames {
    // class on resize-handle
    handle?: string;
    // class on resize-handle
    reverse?: string;
    // class on resize-handle
    vertical?: string;
    // class on container
    resizing?: string;
}

export interface IConfig {
    onResizeStart?(): void;
    onResizeStop?(): void;
    onResized?(size: number, id: string, element: HTMLElement): void;
    handler?: HTMLDivElement;
}

export default class Resizer<C extends IConfig = IConfig> {
    private classNames: IClassNames;

    // TODO move vertical/horizontal to config option/container class
    // as it doesn't make sense to mix them within one container/Resizer
    constructor(
        public container: HTMLElement,
        private readonly distributorCtor: {
            new(item: ResizeItem): FixedDistributor<C, any>;
            createItem(
                resizeHandle: HTMLDivElement,
                resizer: Resizer,
                sizer: Sizer,
                container: HTMLElement
            ): ResizeItem;
            createSizer(
                containerElement: HTMLElement,
                vertical: boolean,
                reverse: boolean
            ): Sizer;
        },
        public readonly config?: C,
    ) {
        this.classNames = {
            handle: "resizer-handle",
            reverse: "resizer-reverse",
            vertical: "resizer-vertical",
            resizing: "resizer-resizing",
        };
    }

    public setClassNames(classNames: IClassNames) {
        this.classNames = classNames;
    }

    public attach() {
        const attachment = this?.config?.handler?.parentElement ?? this.container;
        attachment.addEventListener("mousedown", this.onMouseDown, false);
        window.addEventListener("resize", this.onResize);
    }

    public detach() {
        const attachment = this?.config?.handler?.parentElement ?? this.container;
        attachment.removeEventListener("mousedown", this.onMouseDown, false);
        window.removeEventListener("resize", this.onResize);
    }

    /**
    Gives the distributor for a specific resize handle, as if you would have started
    to drag that handle. Can be used to manipulate the size of an item programmatically.
    @param {number} handleIndex the index of the resize handle in the container
    @return {FixedDistributor} a new distributor for the given handle
    */
    public forHandleAt(handleIndex: number): FixedDistributor<C> {
        const handles = this.getResizeHandles();
        const handle = handles[handleIndex];
        if (handle) {
            const { distributor } = this.createSizerAndDistributor(<HTMLDivElement>handle);
            return distributor;
        }
    }

    public forHandleWithId(id: string): FixedDistributor<C> {
        const handles = this.getResizeHandles();
        const handle = handles.find((h) => h.getAttribute("data-id") === id);
        if (handle) {
            const { distributor } = this.createSizerAndDistributor(<HTMLDivElement>handle);
            return distributor;
        }
    }

    public isReverseResizeHandle(el: HTMLElement): boolean {
        return el && el.classList.contains(this.classNames.reverse);
    }

    public isResizeHandle(el: HTMLElement): boolean {
        return el && el.classList.contains(this.classNames.handle);
    }

    private onMouseDown = (event: MouseEvent) => {
        // use closest in case the resize handle contains
        // child dom nodes that can be the target
        const resizeHandle = event.target && (<HTMLDivElement>event.target).closest(`.${this.classNames.handle}`);
        const hasHandler = this?.config?.handler;
        // prevent that stacked resizer's are both activated with one mouse event
        // (this is possible because the mouse events are connected to the containers not the handles)
        if (!resizeHandle || // if no resizeHandle exist / mouse event hit the container not the handle
            (!hasHandler && resizeHandle.parentElement !== this.container) || // no handler from config -> check if the containers match
            (hasHandler && resizeHandle !== hasHandler)) { // handler from config -> check if the handlers match
            return;
        }

        // prevent starting a drag operation
        event.preventDefault();

        // mark as currently resizing
        if (this.classNames.resizing) {
            this.container?.classList?.add(this.classNames.resizing);
        }
        if (this.config.onResizeStart) {
            this.config.onResizeStart();
        }

        const { sizer, distributor } = this.createSizerAndDistributor(<HTMLDivElement>resizeHandle);
        distributor.start();

        const onMouseMove = (event) => {
            const offset = sizer.offsetFromEvent(event);
            distributor.resizeFromContainerOffset(offset);
        };

        const body = document.body;
        const finishResize = () => {
            if (this.classNames.resizing) {
                this.container?.classList?.remove(this.classNames.resizing);
            }
            distributor.finish();
            if (this.config.onResizeStop) {
                this.config.onResizeStop();
            }
            body.removeEventListener("mouseup", finishResize, false);
            document.removeEventListener("mouseleave", finishResize, false);
            body.removeEventListener("mousemove", onMouseMove, false);
        };
        body.addEventListener("mouseup", finishResize, false);
        document.addEventListener("mouseleave", finishResize, false);
        body.addEventListener("mousemove", onMouseMove, false);
    };

    private onResize = throttle(() => {
        const distributors = this.getDistributors();

        // relax all items if they had any overconstrained flexboxes
        distributors.forEach(d => d.start());
        distributors.forEach(d => d.finish());
    }, 100, { trailing: true, leading: true });

    public getDistributors = () => {
        return this.getResizeHandles().map(handle => {
            const { distributor } = this.createSizerAndDistributor(<HTMLDivElement>handle);
            return distributor;
        });
    };

    private createSizerAndDistributor(
        resizeHandle: HTMLDivElement,
    ): {sizer: Sizer, distributor: FixedDistributor<any>} {
        const vertical = resizeHandle.classList.contains(this.classNames.vertical);
        const reverse = this.isReverseResizeHandle(resizeHandle);
        const Distributor = this.distributorCtor;
        const useItemContainer = this.config && this.config.handler ? this.container : undefined;
        const sizer = Distributor.createSizer(this.container, vertical, reverse);
        const item = Distributor.createItem(resizeHandle, this, sizer, useItemContainer);
        const distributor = new Distributor(item);
        return { sizer, distributor };
    }

    private getResizeHandles(): HTMLElement[] {
        if (this?.config?.handler) {
            return [this.config.handler];
        }
        if (!this.container?.children) return [];
        return Array.from(this.container.querySelectorAll(`.${this.classNames.handle}`));
    }
}


text:
using LanguageExt;
using LanguageExt.TypeClasses;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Records
{
    public static class JObjectTestEq
    {

        public static void Test()
        {
            JObject a = (JObject)JsonConvert.DeserializeObject(JsonConvert.SerializeObject(new { A = "Hello", B = "World" }));
            JObject b = (JObject)JsonConvert.DeserializeObject(JsonConvert.SerializeObject(new { A = "Hello", B = "World" }));
            JObject c = (JObject)JsonConvert.DeserializeObject(JsonConvert.SerializeObject(new { A = "Different", B = "World" }));

            var i = new TestEqJObject(a);
            var j = new TestEqJObject(b);
            var k = new TestEqJObject(c);

            var x = i == j;
            var y = i == k;
            var z = j == k;

            var h1 = i.GetHashCode();
            var h2 = j.GetHashCode();
            var h3 = k.GetHashCode();

            var l = i > j;
            var m = i < j;

        }
    }

    public class TestEqJObject : Record<TestEqJObject>
    {
        public readonly JObject Value;

        public TestEqJObject(JObject value) =>
            Value = value;
    }

    public struct EqJObject : Eq<JObject>
    {
        public bool Equals(JObject x, JObject y) =>
            JObject.DeepEquals(x, y);

        public int GetHashCode(JObject x) =>
            x.GetHashCode();

        public Task<bool> EqualsAsync(JObject x, JObject y) =>
            Equals(x, y).AsTask();

        public Task<int> GetHashCodeAsync(JObject x) =>
            GetHashCode(x).AsTask();
    }

    public struct OrdJObject : Ord<JObject>
    {
        public int Compare(JObject x, JObject y) =>
            x.GetHashCode().CompareTo(y.GetHashCode());

        public bool Equals(JObject x, JObject y) =>
            JObject.DeepEquals(x, y);

        public int GetHashCode(JObject x) =>
            x.GetHashCode();

        public Task<bool> EqualsAsync(JObject x, JObject y) =>
            Equals(x, y).AsTask();

        public Task<int> GetHashCodeAsync(JObject x) =>
            GetHashCode(x).AsTask();

        public Task<int> CompareAsync(JObject x, JObject y) =>
            Compare(x, y).AsTask();
    }
}


text:
var renderToCubemap = require('../render-to-cubemap');
var glslifySync = require('glslify-sync');

var VERT = glslifySync(__dirname + '/glsl/downsample.vert');
var FRAG = glslifySync(__dirname + '/glsl/downsample.frag');

var quadPositions = [[-1,-1],[1,-1], [1,1],[-1,1]];
var quadFaces = [ [0, 1, 2], [0, 2, 3]];

var quadMesh = null;
var downsampleProgram = null;

function downsampleCubemap(ctx, fromCubemap, toCubemap) {
    ctx.pushState(ctx.MESH_BIT | ctx.PROGRAM_BIT); //ctx.TEXTURE_BIT
    if (!quadMesh) {
        var quadAttributes = [ { data: quadPositions, location: ctx.ATTRIB_POSITION } ];
        var quadIndices = { data: quadFaces };
        quadMesh = ctx.createMesh(quadAttributes, quadIndices);

        downsampleProgram = ctx.createProgram(VERT, FRAG);
    }

    renderToCubemap(ctx, toCubemap, function() {
        ctx.bindTexture(fromCubemap, 0);
        ctx.bindProgram(downsampleProgram);
        downsampleProgram.setUniform('uEnvMap', 0);
        downsampleProgram.setUniform('uTextureSize', toCubemap.getWidth())
        ctx.bindMesh(quadMesh);
        ctx.drawMesh();
    });
    ctx.popState(ctx.MESH_BIT | ctx.PROGRAM_BIT); //ctx.TEXTURE_BIT
}

module.exports = downsampleCubemap;


text:
class Discovery::ApplicationPolicy
  attr_reader :user, :record

  def initialize(user, record)
    @user = user
    @record = record
  end

  def index?
    false
  end

  def show?
    scope.where(:id => record.id).exists?
  end

  def create?
    user.present? && user.admin?
  end

  def new?
    create?
  end

  def update?
    user.present? && user.admin?
  end

  def edit?
    update?
  end

  def destroy?
    update?
  end

  def scope
    record.class
  end
end


text:
<button type="button" class="btn btn-primary" (click)="showModal()">Open a modal</button>

{{message}}

Modal

        <button type="button" class="close pull-right" aria-label="Close" (click)="modal.hide()">
          ×
        </button>

        Just another modal

        Click ×, press Esc or click on backdrop to close modal.


text:
package com.happydroids.droidtowers.scenes.components;

import com.happydroids.droidtowers.TowerAssetManager;

import static com.happydroids.droidtowers.TowerAssetManager.assetManager;

public class AssetLoadProgressPanel extends ProgressPanel {
  @Override
  public void act(float delta) {
    super.act(delta);

    TowerAssetManager.assetManager().update();

    setProgress((int) (assetManager().getProgress() * 100f));
  }
}


text:
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )

package ${package}.api;

import javax.xml.ws.WebFault;

/**
 * Thrown when an attempt is made to do something without the correct permissions.
 *
 * @author Ryan Heaton
 */
@WebFault
public class PermissionDeniedException extends Exception {
}


text:
package main

import (
	conio ".."
	"fmt"
)

func test1(message, want_text string, want_result bool) {
	text, result := conio.ReadLinePromptStr(message)
	fmt.Printf("  -> text='%v' result='%v'\n", text, result)
	if text != want_text {
		fmt.Printf("got '%v' want '%v'", text, want_text)
	}
	if result != want_result {
		fmt.Printf("got '%v' want '%v'", result, want_result)
	}

}

func main() {
	fmt.Println("--- Test for ReadLinePromptStr ---")
	test1("Please Type 'foo'+Enter>", "foo", true)
	test1("Please Type Anything+CTRL-C>", "", true)
	test1("Please Type CTRL-D only>", "", false)
}


text:
using System;
using Posttrack.Data.Interfaces;

namespace Posttrack.BLL
{
    public class SettingsService : Interfaces.ISettingsService
    {
        public SettingsService(ISettingDAO settingDAO)
        {
            SparkPostApiKey = settingDAO.Load("SparkPostApiKey");
            HttpSearchUrl = new Uri(settingDAO.Load("HttpSearchUrl"));
            HistoryRegex = settingDAO.Load("HistoryRegex");
            InactivityPeriodMonths = int.Parse(settingDAO.Load("InactivityPeriodMonths"));
        }

        public string SparkPostApiKey { get; }

        public int InactivityPeriodMonths { get; }

        public string HistoryRegex { get; }

        public Uri HttpSearchUrl { get; }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Subsetter (Jailer Subsetter API)</title>
<meta name="date" content="2022-06-07">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

net.sf.jailer.api

Class Subsetter

java.lang.Object

net.sf.jailer.api.Subsetter

public class Subsetter
extends java.lang.Object

Generates a subset of a relational database that respects foreign key constraints.

Author:

Ralf Wisser

Constructor Summary

Constructors

Constructor and Description

Subsetter()

Default constructor.

Subsetter(javax.sql.DataSource dataSource,
         DBMS dbms,
         java.io.File dataModel,
         java.io.File extractionModel,
         ScriptFormat scriptFormat)

Creates a new Subsetter with all mandatory attributes.

Subsetter(javax.sql.DataSource dataSource,
         DBMS dbms,
         java.net.URL dataModel,
         java.net.URL extractionModel,
         ScriptFormat scriptFormat)

Creates a new Subsetter with all mandatory attributes.

Subsetter(Subsetter other)

Copy constructor.

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods

Modifier and Type
Method and Description

ExportStatistic
execute(java.lang.String whereClause,
       java.io.File exportScriptFile)

Generates the export-script.

ExportStatistic
execute(java.lang.String whereClause,
       java.io.File exportScriptFile,
       java.io.File deleteScriptFile)

Generates the export- and/or delete-script.

java.net.URL
getDataModelURL()

Gets URL of the current data model (the datamodel's base folder)

javax.sql.DataSource
getDataSource()

Gets the data-source to connect with the database.

DBMS
getDbms()

Gets the DBMS of the database.

ExecutionContext
getExecutionContext()

Gets the ExecutionContext.

java.net.URL
getExtractionModelURL()

Gets the URL of the extraction model.

java.lang.String
getImportFilterMappingTableSchema()

Gets schema in which the import-filter mapping tables will be created

java.lang.Integer
getIsolationLevel()

Gets IsolationLevel.

java.lang.String
getLocalDatabaseStorage()

int
getModelPoolSize()

boolean
getNoRowid()

Deprecated.

use getUseRowid()

boolean
getNoSorting()

If true, The exported rows will not be sorted according to
 foreign key constraints

int
getNumberOfEntities()

Gets maximum number of entities per insert-statement (in export-file,
 default is 10)

int
getNumberOfThreads()

Gets number of parallel threads (default is 1) to be used.

java.util.Map<java.lang.String,java.lang.String>
getParameters()

Gets parameters.

java.util.Map<java.lang.String,java.lang.String>
getSchemaMapping()

Gets schema map for destination database.

WorkingTableScope
getScope()

Gets scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASE

 Default is GLOBAL.

ScriptFormat
getScriptFormat()

Gets the script format.

java.util.Map<java.lang.String,java.lang.String>
getSourceSchemaMapping()

Gets schema map for source database.

DBMS
getTargetDBMS()

Gets target-DBMS.

boolean
getTransactional()

If true, export rows in a single transaction.

boolean
getUpsertOnly()

If true, Generate 'upsert'-statements for all entities (in
 export-file)

boolean
getUseRowid()

If true, use rowid/ctid-column to determine row identity (instead
 of primary keys)

boolean
getUseRowIdsOnlyForTablesWithoutPK()

If true, use rowid/ctid-column only for tables without primary key.

boolean
getUTF8()

If true, Use uTF-8 encoding

java.lang.String
getWorkingTableSchema()

Gets schema in which the working tables will be created

java.lang.String
getXmlDatePattern()

Gets pattern for dates in XML and LIQUIBASE_XML export file

java.lang.String
getXmlRootTag()

Gets root tag of XML export file

java.lang.String
getXmlTimePattern()

Gets pattern for times in XML and LIQUIBASE_XML export file

java.lang.String
getXmlTimeStampPattern()

Gets pattern for time-stamps in XML and LIQUIBASE_XML export file

boolean
isAbortInCaseOfInconsistency()

void
setAbortInCaseOfInconsistency(boolean abortInCaseOfInconsitency)

void
setDataModelBaseFolder(java.io.File datamodelBaseFolder)

Sets the current data model as File

void
setDataModelURL(java.net.URL datamodelURL)

Sets URL of the current data model (the datamodel's base folder)

void
setDataSource(javax.sql.DataSource dataSource)

Sets the data-source to connect with the database.

void
setDbms(DBMS dbms)

Sets the DBMS of the database.

void
setExtractionModelURL(java.net.URL extractionModelURL)

Sets the URL of the extraction model.

void
setImportFilterMappingTableSchema(java.lang.String importFilterMappingTableSchema)

Sets schema in which the import-filter mapping tables will be created

void
setIsolationLevel(java.lang.Integer isolationLevel)

Sets IsolationLevel.

void
setLocalDatabaseStorage(java.io.File localDatabaseStorage)

Sets the folder where the local database will be stored.

void
setLocalDatabaseStorage(java.lang.String localDatabaseStorage)

Sets the folder where the local database will be stored.

void
setModelPoolSize(int modelPoolSize)

void
setNoRowid(boolean noRowid)

Deprecated.

use setUseRowid(boolean)

void
setNoSorting(boolean noSorting)

If true, The exported rows will not be sorted according to
 foreign key constraints

void
setNumberOfEntities(int numberOfEntities)

Sets maximum number of entities per insert-statement (in export-file,
 default is 10)

void
setNumberOfThreads(int numberOfThreads)

Sets number of parallel threads (default is 1) to be used

void
setParameter(java.lang.String name,
            java.lang.String value)

Sets a parameter.

void
setSchemaMapping(java.util.Map<java.lang.String,java.lang.String> schemaMapping)

Sets schema map for destination database.

void
setScope(WorkingTableScope scope)

Sets scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASE

void
setScriptFormat(ScriptFormat scriptFormat)

Sets the script format.

void
setSourceSchemaMapping(java.util.Map<java.lang.String,java.lang.String> sourceSchemaMapping)

Sets schema map for source database.

void
setTargetDBMS(DBMS targetDBMS)

Sets target-DBMS.

void
setTransactional(boolean transactional)

If true, export rows in a single transaction.

void
setUpsertOnly(boolean upsertOnly)

If true, Generate 'upsert'-statements for all entities (in
 export-file)

void
setUseRowid(boolean useRowid)

If true, use rowid/ctid-column to determine row identity (instead
 of primary keys)

void
setUseRowIdsOnlyForTablesWithoutPK(boolean useRowIdsOnlyForTablesWithoutPK)

If true, use rowid/ctid-column only for tables without primary key.

void
setUTF8(boolean uTF8)

If true, use UTF-8 encoding

void
setWorkingTableSchema(java.lang.String workingTableSchema)

Sets schema in which the working tables will be created

void
setXmlDatePattern(java.lang.String xmlDatePattern)

Sets pattern for dates in XML and LIQUIBASE_XML export file

void
setXmlRootTag(java.lang.String xmlRootTag)

Sets root tag of XML export file

void
setXmlTimePattern(java.lang.String xmlTimePattern)

Sets pattern for times in XML and LIQUIBASE_XML export file

void
setXmlTimeStampPattern(java.lang.String xmlTimeStampPattern)

Sets pattern for time-stamps in XML and LIQUIBASE_XML export file

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Subsetter

public Subsetter()

Default constructor.

Subsetter

public Subsetter(Subsetter other)

Copy constructor.

Subsetter

public Subsetter(javax.sql.DataSource dataSource,
                 DBMS dbms,
                 java.net.URL dataModel,
                 java.net.URL extractionModel,
                 ScriptFormat scriptFormat)

Creates a new Subsetter with all mandatory attributes.

Parameters:

dataSource - the data-source to connect with the source database

dbms - the DBMS of the source database

dataModel - URL of the current data model (the datamodel's base folder)

extractionModel - URL of the extraction model

scriptFormat - script format

Subsetter

public Subsetter(javax.sql.DataSource dataSource,
                 DBMS dbms,
                 java.io.File dataModel,
                 java.io.File extractionModel,
                 ScriptFormat scriptFormat)

Creates a new Subsetter with all mandatory attributes.

Parameters:

dataSource - the data-source to connect with the source database

dbms - the DBMS of the source database

dataModel - the current data model (the datamodel's base folder)

extractionModel - the extraction model

scriptFormat - script format

Method Detail

execute

public ExportStatistic execute(java.lang.String whereClause,
                               java.io.File exportScriptFile)
                        throws java.sql.SQLException,
                               java.io.IOException

Generates the export-script.

Parameters:

whereClause - if not null, overrides the extraction model's subject condition

exportScriptFile - the export-script file (compressed if it ends with '.zip' or '.gz')

Returns:

export statistic

Throws:

InconsistentSubsettingResultException - if ExecutionContext.isAbortInCaseOfInconsistency() and the number of exported rows differs from that of the collected ones

java.sql.SQLException

java.io.IOException

execute

public ExportStatistic execute(java.lang.String whereClause,
                               java.io.File exportScriptFile,
                               java.io.File deleteScriptFile)
                        throws java.sql.SQLException,
                               java.io.IOException

Generates the export- and/or delete-script.

Parameters:

whereClause - if not null, overrides the extraction model's subject condition

exportScriptFile - the export-script file (compressed if it ends with '.zip' or '.gz'), optional

deleteScriptFile - the delete-script file (compressed if it ends with '.zip' or '.gz'), optional

Returns:

export statistic

Throws:

InconsistentSubsettingResultException - if ExecutionContext.isAbortInCaseOfInconsistency() and the number of exported rows differs from that of the collected ones

java.sql.SQLException

java.io.IOException

getDataSource

public javax.sql.DataSource getDataSource()

Gets the data-source to connect with the database.

Returns:

the data-source to connect with the database

setDataSource

public void setDataSource(javax.sql.DataSource dataSource)

Sets the data-source to connect with the database.

Parameters:

dataSource - the data-source to connect with the database

getDbms

public DBMS getDbms()

Gets the DBMS of the database.

Returns:

the DBMS

setDbms

public void setDbms(DBMS dbms)

Sets the DBMS of the database.

 Note that it's not necessary to set the DBMS if BasicDataSource is used.

Parameters:

dbms - the DBMS

getDataModelURL

public java.net.URL getDataModelURL()

Gets URL of the current data model (the datamodel's base folder)

setDataModelURL

public void setDataModelURL(java.net.URL datamodelURL)

Sets URL of the current data model (the datamodel's base folder)

setDataModelBaseFolder

public void setDataModelBaseFolder(java.io.File datamodelBaseFolder)

Sets the current data model as File

Parameters:

datamodelBaseFolder - represents the folder. Will be converted to an URL an set as datamodel URL

See Also:

setDataModelURL(URL)

getExtractionModelURL

public java.net.URL getExtractionModelURL()

Gets the URL of the extraction model.

Returns:

the URL of the extraction model

setExtractionModelURL

public void setExtractionModelURL(java.net.URL extractionModelURL)

Sets the URL of the extraction model.

Parameters:

extractionModelURL - the URL of the extraction model

getScriptFormat

public ScriptFormat getScriptFormat()

Gets the script format.

Returns:

the script format

setScriptFormat

public void setScriptFormat(ScriptFormat scriptFormat)

Sets the script format.

getUTF8

public boolean getUTF8()

If true, Use uTF-8 encoding

Returns:

true if use UTF-8 encoding

setUTF8

public void setUTF8(boolean uTF8)

If true, use UTF-8 encoding

Parameters:

uTF8 - true if use UTF-8 encoding

getTargetDBMS

public DBMS getTargetDBMS()

Gets target-DBMS.

Returns:

target-DBMS

setTargetDBMS

public void setTargetDBMS(DBMS targetDBMS)

Sets target-DBMS.

Parameters:

targetDBMS - target-DBMS. If it's null, target DBMS is assumed to be the same as getDbms()

getXmlRootTag

public java.lang.String getXmlRootTag()

Gets root tag of XML export file

Returns:

root tag of XML export file

setXmlRootTag

public void setXmlRootTag(java.lang.String xmlRootTag)

Sets root tag of XML export file

Parameters:

xmlRootTag - root tag of XML export file

getXmlDatePattern

public java.lang.String getXmlDatePattern()

Gets pattern for dates in XML and LIQUIBASE_XML export file

Returns:

pattern for dates in XML and LIQUIBASE_XML export file

setXmlDatePattern

public void setXmlDatePattern(java.lang.String xmlDatePattern)

Sets pattern for dates in XML and LIQUIBASE_XML export file

Parameters:

xmlDatePattern - pattern for dates in XML and LIQUIBASE_XML export file

getXmlTimePattern

public java.lang.String getXmlTimePattern()

Gets pattern for times in XML and LIQUIBASE_XML export file

Returns:

pattern for times in XML and LIQUIBASE_XML export file

setXmlTimePattern

public void setXmlTimePattern(java.lang.String xmlTimePattern)

Sets pattern for times in XML and LIQUIBASE_XML export file

Parameters:

xmlTimePattern - pattern for times in XML and LIQUIBASE_XML export file

getXmlTimeStampPattern

public java.lang.String getXmlTimeStampPattern()

Gets pattern for time-stamps in XML and LIQUIBASE_XML export file

Returns:

pattern for time-stamps in XML and LIQUIBASE_XML export file

setXmlTimeStampPattern

public void setXmlTimeStampPattern(java.lang.String xmlTimeStampPattern)

Sets pattern for time-stamps in XML and LIQUIBASE_XML export file

Parameters:

xmlTimeStampPattern - pattern for time-stamps in XML and LIQUIBASE_XML export file

getNumberOfThreads

public int getNumberOfThreads()

Gets number of parallel threads (default is 1) to be used.

Returns:

number of threads (default is 1)

setNumberOfThreads

public void setNumberOfThreads(int numberOfThreads)

Sets number of parallel threads (default is 1) to be used

Parameters:

numberOfThreads - number of threads

getTransactional

public boolean getTransactional()

If true, export rows in a single transaction. (default is false)

Returns:

true if Import rows in a single transaction

setTransactional

public void setTransactional(boolean transactional)

If true, export rows in a single transaction. (default is false)

Parameters:

transactional - true if import rows in a single transaction

getIsolationLevel

public java.lang.Integer getIsolationLevel()

Gets IsolationLevel.

See Also:

Connection.setTransactionIsolation(int)

setIsolationLevel

public void setIsolationLevel(java.lang.Integer isolationLevel)

Sets IsolationLevel.

See Also:

Connection.setTransactionIsolation(int)

getNumberOfEntities

public int getNumberOfEntities()

Gets maximum number of entities per insert-statement (in export-file,
 default is 10)

Returns:

maximum number of entities per insert-statement (in export-file,
         default is 10)

setNumberOfEntities

public void setNumberOfEntities(int numberOfEntities)

Sets maximum number of entities per insert-statement (in export-file,
 default is 10)

Parameters:

numberOfEntities - maximum number of entities per insert-statement (in
            export-file, default is 10)

getUpsertOnly

public boolean getUpsertOnly()

If true, Generate 'upsert'-statements for all entities (in
 export-file)

Returns:

true if Generate 'upsert'-statements for all
         entities (in export-file)

setUpsertOnly

public void setUpsertOnly(boolean upsertOnly)

If true, Generate 'upsert'-statements for all entities (in
 export-file)

Parameters:

upsertOnly - true if Generate 'upsert'-statements for all
            entities (in export-file)

getScope

public WorkingTableScope getScope()

Gets scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASE

 Default is GLOBAL.

Returns:

scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASE

setScope

public void setScope(WorkingTableScope scope)

Sets scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASE

Parameters:

scope - scope of working tables, GLOBAL, SESSION_LOCAL or
            LOCAL_DATABASE

getWorkingTableSchema

public java.lang.String getWorkingTableSchema()

Gets schema in which the working tables will be created

Returns:

schema in which the working tables will be created

setWorkingTableSchema

public void setWorkingTableSchema(java.lang.String workingTableSchema)

Sets schema in which the working tables will be created

Parameters:

workingTableSchema - schema in which the working tables will be created

getNoSorting

public boolean getNoSorting()

If true, The exported rows will not be sorted according to
 foreign key constraints

Returns:

true if The exported rows will not be sorted
         according to foreign key constraints

setNoSorting

public void setNoSorting(boolean noSorting)

If true, The exported rows will not be sorted according to
 foreign key constraints

Parameters:

noSorting - true if The exported rows will not be sorted
            according to foreign key constraints

getNoRowid

public boolean getNoRowid()

Deprecated. use getUseRowid()

setNoRowid

public void setNoRowid(boolean noRowid)

Deprecated. use setUseRowid(boolean)

getUseRowid

public boolean getUseRowid()

If true, use rowid/ctid-column to determine row identity (instead
 of primary keys)

Returns:

if true use rowid/ctid-column to determine row identity
         (instead of primary keys)

setUseRowid

public void setUseRowid(boolean useRowid)

If true, use rowid/ctid-column to determine row identity (instead
 of primary keys)

Parameters:

useRowid - if true use rowid/ctid-column to determine row
            identity (instead of primary keys)

getUseRowIdsOnlyForTablesWithoutPK

public boolean getUseRowIdsOnlyForTablesWithoutPK()

If true, use rowid/ctid-column only for tables without primary key.

Returns:

true if use rowid/ctid-column only for tables without primary key

See Also:

getUseRowIdsOnlyForTablesWithoutPK()

setUseRowIdsOnlyForTablesWithoutPK

public void setUseRowIdsOnlyForTablesWithoutPK(boolean useRowIdsOnlyForTablesWithoutPK)

If true, use rowid/ctid-column only for tables without primary key.

Parameters:

useRowIdsOnlyForTablesWithoutPK - true if use rowid/ctid-column only for tables without primary key

See Also:

setUseRowid(boolean)

getImportFilterMappingTableSchema

public java.lang.String getImportFilterMappingTableSchema()

Gets schema in which the import-filter mapping tables will be created

Returns:

schema in which the import-filter mapping tables will be created

setImportFilterMappingTableSchema

public void setImportFilterMappingTableSchema(java.lang.String importFilterMappingTableSchema)

Sets schema in which the import-filter mapping tables will be created

Parameters:

importFilterMappingTableSchema - schema in which the import-filter mapping tables will be
            created

getParameters

public java.util.Map<java.lang.String,java.lang.String> getParameters()

Gets parameters.

Returns:

parameters

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String value)

Sets a parameter.

Parameters:

name - parameter name

value - value

getSchemaMapping

public java.util.Map<java.lang.String,java.lang.String> getSchemaMapping()

Gets schema map for destination database.

Returns:

schema map

setSchemaMapping

public void setSchemaMapping(java.util.Map<java.lang.String,java.lang.String> schemaMapping)

Sets schema map for destination database.

Parameters:

schemaMapping - schema map

setSourceSchemaMapping

public void setSourceSchemaMapping(java.util.Map<java.lang.String,java.lang.String> sourceSchemaMapping)

Sets schema map for source database.

Parameters:

sourceSchemaMapping - the sourceSchemaMapping to set

getSourceSchemaMapping

public java.util.Map<java.lang.String,java.lang.String> getSourceSchemaMapping()

Gets schema map for source database.

Returns:

the sourceSchemaMapping to set

isAbortInCaseOfInconsistency

public boolean isAbortInCaseOfInconsistency()

Returns:

if true, the Subsetter throws an exception if the result is inconsistent due to insufficient transaction isolation

setAbortInCaseOfInconsistency

public void setAbortInCaseOfInconsistency(boolean abortInCaseOfInconsitency)

Parameters:

abortInCaseOfInconsitency - if true, abort the process if the result is inconsistent due to insufficient transaction isolation

getModelPoolSize

public int getModelPoolSize()

Returns:

the size of extraction-model pool (default is 10)

setModelPoolSize

public void setModelPoolSize(int modelPoolSize)

Parameters:

modelPoolSize - size of extraction-model pool (default is 10)

getLocalDatabaseStorage

public java.lang.String getLocalDatabaseStorage()

Returns:

the folder where the local database will be stored. If null, default temp folder is used.

setLocalDatabaseStorage

public void setLocalDatabaseStorage(java.io.File localDatabaseStorage)

Sets the folder where the local database will be stored.

Parameters:

localDatabaseStorage - the folder where the local database will be stored. If null, default temp folder is used.

setLocalDatabaseStorage

public void setLocalDatabaseStorage(java.lang.String localDatabaseStorage)

Sets the folder where the local database will be stored.

Parameters:

localDatabaseStorage - the folder where the local database will be stored. If null, default temp folder is used.

getExecutionContext

public ExecutionContext getExecutionContext()

Gets the ExecutionContext.

 Use this to set parameters that are not accessible via this facade.

Returns:

the ExecutionContext

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
using System;

namespace EncompassRest.Loans
{
    /// <summary>
    /// EscrowDisbursementTransaction
    /// </summary>
    public sealed partial class EscrowDisbursementTransaction : DirtyExtensibleObject, IIdentifiable
    {
        private DirtyValue<string?>? _comments;
        private DirtyValue<string?>? _createdById;
        private DirtyValue<string?>? _createdByName;
        private DirtyValue<DateTime?>? _createdDateTimeUtc;
        private DirtyValue<DateTime?>? _disbursementDueDate;
        private DirtyValue<int?>? _disbursementNumber;
        private DirtyValue<string?>? _disbursementType;
        private DirtyValue<string?>? _guid;
        private DirtyValue<string?>? _id;
        private DirtyValue<string?>? _institutionName;
        private DirtyValue<string?>? _modifiedById;
        private DirtyValue<string?>? _modifiedByName;
        private DirtyValue<DateTime?>? _modifiedDateTimeUtc;
        private DirtyValue<string?>? _servicingPaymentMethod;
        private DirtyValue<string?>? _servicingTransactionType;
        private DirtyValue<decimal?>? _transactionAmount;
        private DirtyValue<DateTime?>? _transactionDate;

        /// <summary>
        /// EscrowDisbursementTransaction Comments
        /// </summary>
        public string? Comments { get => _comments; set => SetField(ref _comments, value); }

        /// <summary>
        /// EscrowDisbursementTransaction CreatedById
        /// </summary>
        public string? CreatedById { get => _createdById; set => SetField(ref _createdById, value); }

        /// <summary>
        /// EscrowDisbursementTransaction CreatedByName
        /// </summary>
        public string? CreatedByName { get => _createdByName; set => SetField(ref _createdByName, value); }

        /// <summary>
        /// EscrowDisbursementTransaction CreatedDateTimeUtc
        /// </summary>
        public DateTime? CreatedDateTimeUtc { get => _createdDateTimeUtc; set => SetField(ref _createdDateTimeUtc, value); }

        /// <summary>
        /// EscrowDisbursementTransaction DisbursementDueDate
        /// </summary>
        public DateTime? DisbursementDueDate { get => _disbursementDueDate; set => SetField(ref _disbursementDueDate, value); }

        /// <summary>
        /// EscrowDisbursementTransaction DisbursementNumber
        /// </summary>
        public int? DisbursementNumber { get => _disbursementNumber; set => SetField(ref _disbursementNumber, value); }

        /// <summary>
        /// EscrowDisbursementTransaction DisbursementType
        /// </summary>
        public string? DisbursementType { get => _disbursementType; set => SetField(ref _disbursementType, value); }

        /// <summary>
        /// EscrowDisbursementTransaction Guid
        /// </summary>
        public string? Guid { get => _guid; set => SetField(ref _guid, value); }

        /// <summary>
        /// EscrowDisbursementTransaction Id
        /// </summary>
        public string? Id { get => _id; set => SetField(ref _id, value); }

        /// <summary>
        /// EscrowDisbursementTransaction InstitutionName
        /// </summary>
        public string? InstitutionName { get => _institutionName; set => SetField(ref _institutionName, value); }

        /// <summary>
        /// EscrowDisbursementTransaction ModifiedById
        /// </summary>
        public string? ModifiedById { get => _modifiedById; set => SetField(ref _modifiedById, value); }

        /// <summary>
        /// EscrowDisbursementTransaction ModifiedByName
        /// </summary>
        public string? ModifiedByName { get => _modifiedByName; set => SetField(ref _modifiedByName, value); }

        /// <summary>
        /// EscrowDisbursementTransaction ModifiedDateTimeUtc
        /// </summary>
        public DateTime? ModifiedDateTimeUtc { get => _modifiedDateTimeUtc; set => SetField(ref _modifiedDateTimeUtc, value); }

        /// <summary>
        /// EscrowDisbursementTransaction ServicingPaymentMethod
        /// </summary>
        public string? ServicingPaymentMethod { get => _servicingPaymentMethod; set => SetField(ref _servicingPaymentMethod, value); }

        /// <summary>
        /// EscrowDisbursementTransaction ServicingTransactionType
        /// </summary>
        public string? ServicingTransactionType { get => _servicingTransactionType; set => SetField(ref _servicingTransactionType, value); }

        /// <summary>
        /// EscrowDisbursementTransaction TransactionAmount
        /// </summary>
        public decimal? TransactionAmount { get => _transactionAmount; set => SetField(ref _transactionAmount, value); }

        /// <summary>
        /// EscrowDisbursementTransaction TransactionDate
        /// </summary>
        public DateTime? TransactionDate { get => _transactionDate; set => SetField(ref _transactionDate, value); }
    }
}


text:
package org.apache.ignite.internal.managers;

import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.spi.IgniteSpi;
import org.apache.ignite.spi.IgniteSpiAdapter;
import org.apache.ignite.spi.IgniteSpiException;
import org.apache.ignite.spi.IgniteSpiNoop;
import org.apache.ignite.testframework.GridStringLogger;
import org.apache.ignite.testframework.junits.GridTestKernalContext;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.jetbrains.annotations.Nullable;

/**
 * Tests manager with {@link org.apache.ignite.spi.IgniteSpiNoop} SPI's.
 */
public class GridNoopManagerSelfTest extends GridCommonAbstractTest {
    /**
     *
     */
    public void testEnabledManager() throws IgniteCheckedException {
        GridTestKernalContext ctx = new GridTestKernalContext(new GridStringLogger());

        assertTrue(new Manager(ctx, new Spi()).enabled());
        assertFalse(new Manager(ctx, new NoopSpi()).enabled());
        assertTrue(new Manager(ctx, new Spi(), new NoopSpi()).enabled());
        assertTrue(new Manager(ctx, new NoopSpi(), new Spi()).enabled());
    }

    /**
     *
     */
    private static class Manager extends GridManagerAdapter<IgniteSpi> {
        /**
         * @param ctx  Kernal context.
         * @param spis Specific SPI instance.
         */
        protected Manager(GridKernalContext ctx, IgniteSpi... spis) {
            super(ctx, spis);
        }

        /** {@inheritDoc} */
        @Override public void start() throws IgniteCheckedException {
            // No-op.
        }

        /** {@inheritDoc} */
        @Override public void stop(boolean cancel) throws IgniteCheckedException {
            // No-op.
        }
    }

    /**
     *
     */
    private static interface TestSpi extends IgniteSpi {
        // No-op.
    }

    /**
     *
     */
    private static class Spi extends IgniteSpiAdapter implements TestSpi {
        /** {@inheritDoc} */
        @Override public void spiStart(@Nullable String gridName) throws IgniteSpiException {
            // No-op.
        }

        /** {@inheritDoc} */
        @Override public void spiStop() throws IgniteSpiException {
            // No-op.
        }
    }

    /**
     *
     */
    @IgniteSpiNoop
    private static class NoopSpi extends Spi {
        // No-op.
    }
}


text:
package java.sql;

public class SQLNonTransientException extends SQLException {

    private static final long serialVersionUID = -9104382843534716547L;

    /**
     * Creates an SQLNonTransientException object. The Reason string is set to
     * null, the SQLState string is set to null and the Error Code is set to 0.
     */
    public SQLNonTransientException() {
    }

    /**
     * Creates an SQLNonTransientException object. The Reason string is set to
     * the given reason string, the SQLState string is set to null and the Error
     * Code is set to 0.
     *
     * @param reason
     *            the string to use as the Reason string
     */
    public SQLNonTransientException(String reason) {
        super(reason, null, 0);
    }

    /**
     * Creates an SQLNonTransientException object. The Reason string is set to
     * the given reason string, the SQLState string is set to the given SQLState
     * string and the Error Code is set to 0.
     *
     * @param reason
     *            the string to use as the Reason string
     * @param sqlState
     *            the string to use as the SQLState string
     */
    public SQLNonTransientException(String reason, String sqlState) {
        super(reason, sqlState, 0);
    }

    /**
     * Creates an SQLNonTransientException object. The Reason string is set to
     * the given reason string, the SQLState string is set to the given SQLState
     * string and the Error Code is set to the given error code value.
     *
     * @param reason
     *            the string to use as the Reason string
     * @param sqlState
     *            the string to use as the SQLState string
     * @param vendorCode
     *            the integer value for the error code
     */
    public SQLNonTransientException(String reason, String sqlState,
            int vendorCode) {
        super(reason, sqlState, vendorCode);
    }

    /**
     * Creates an SQLNonTransientException object. The Reason string is set to
     * the null if cause == null or cause.toString() if cause!=null,and the
     * cause Throwable object is set to the given cause Throwable object.
     *
     * @param cause
     *            the Throwable object for the underlying reason this
     *            SQLException
     */
    public SQLNonTransientException(Throwable cause) {
        super(cause);
    }

    /**
     * Creates an SQLNonTransientException object. The Reason string is set to
     * the given and the cause Throwable object is set to the given cause
     * Throwable object.
     *
     * @param reason
     *            the string to use as the Reason string
     * @param cause
     *            the Throwable object for the underlying reason this
     *            SQLException
     */
    public SQLNonTransientException(String reason, Throwable cause) {
        super(reason, cause);
    }

    /**
     * Creates an SQLNonTransientException object. The Reason string is set to
     * the given reason string, the SQLState string is set to the given SQLState
     * string and the cause Throwable object is set to the given cause Throwable
     * object.
     *
     * @param reason
     *            the string to use as the Reason string
     * @param sqlState
     *            the string to use as the SQLState string
     * @param cause
     *            the Throwable object for the underlying reason this
     *            SQLException
     */
    public SQLNonTransientException(String reason, String sqlState,
            Throwable cause) {
        super(reason, sqlState, cause);
    }

    /**
     * Creates an SQLNonTransientException object. The Reason string is set to
     * the given reason string, the SQLState string is set to the given SQLState
     * string , the Error Code is set to the given error code value, and the
     * cause Throwable object is set to the given cause Throwable object.
     *
     * @param reason
     *            the string to use as the Reason string
     * @param sqlState
     *            the string to use as the SQLState string
     * @param vendorCode
     *            the integer value for the error code
     * @param cause
     *            the Throwable object for the underlying reason this
     *            SQLException
     */
    public SQLNonTransientException(String reason, String sqlState,
            int vendorCode, Throwable cause) {
        super(reason, sqlState, vendorCode, cause);
    }
}


text:
package com.hiwhitley.easy.day20;

/**
 * Created by hiwhitley on 2016/9/19.
 */
public class CountAndSay_38 {
    public static String countAndSay(int n) {
        if (n == 1) return "1";
        String preString = countAndSay(n - 1);
        char c = preString.charAt(0);
        int count = 1, strLen = preString.length();
        StringBuilder sb = new StringBuilder();
        for (int i = 1; i < strLen; i++) {
            if (c != preString.charAt(i)) {
                sb.append(count).append(c);
                c = preString.charAt(i);
                count = 1;
            } else {
                count ++;
            }
        }
        sb.append(count).append(c);
        return sb.toString();
    }

    public static void main(String[] args) {
        System.out.println(countAndSay(2));
    }
}


text:
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

/*!
Support for parsing unsupported, old syntaxes, for the
purpose of reporting errors. Parsing of these syntaxes
is tested by compile-test/obsolete-syntax.rs.

Obsolete syntax that becomes too hard to parse can be
removed.
*/

use core::prelude::*;

use ast::{expr, expr_lit, lit_nil};
use ast;
use codemap::{span, respan};
use parse::parser::Parser;
use parse::token::Token;
use parse::token;

use core::str;
use core::to_bytes;

/// The specific types of unsupported syntax
#[deriving(Eq)]
pub enum ObsoleteSyntax {
    ObsoleteLowerCaseKindBounds,
    ObsoleteLet,
    ObsoleteFieldTerminator,
    ObsoleteStructCtor,
    ObsoleteWith,
    ObsoleteClassTraits,
    ObsoletePrivSection,
    ObsoleteModeInFnType,
    ObsoleteMoveInit,
    ObsoleteBinaryMove,
    ObsoleteUnsafeBlock,
    ObsoleteUnenforcedBound,
    ObsoleteImplSyntax,
    ObsoleteTraitBoundSeparator,
    ObsoleteMutOwnedPointer,
    ObsoleteMutVector,
    ObsoleteTraitImplVisibility,
    ObsoleteRecordType,
    ObsoleteRecordPattern,
    ObsoletePostFnTySigil,
    ObsoleteBareFnType,
    ObsoleteNewtypeEnum,
    ObsoleteMode,
    ObsoleteImplicitSelf,
    ObsoleteLifetimeNotation,
    ObsoleteConstManagedPointer,
    ObsoletePurity,
    ObsoleteStaticMethod,
    ObsoleteConstItem,
    ObsoleteFixedLengthVectorType,
}

impl to_bytes::IterBytes for ObsoleteSyntax {
    #[inline(always)]
    fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
        (*self as uint).iter_bytes(lsb0, f);
    }
}

pub impl Parser {
    /// Reports an obsolete syntax non-fatal error.
    fn obsolete(&self, sp: span, kind: ObsoleteSyntax) {
        let (kind_str, desc) = match kind {
            ObsoleteLowerCaseKindBounds => (
                "lower-case kind bounds",
                "the `send`, `copy`, `const`, and `owned` \
                 kinds are represented as traits now, and \
                 should be camel cased"
            ),
            ObsoleteLet => (
                "`let` in field declaration",
                "declare fields as `field: Type`"
            ),
            ObsoleteFieldTerminator => (
                "field declaration terminated with semicolon",
                "fields are now separated by commas"
            ),
            ObsoleteStructCtor => (
                "struct constructor",
                "structs are now constructed with `MyStruct { foo: val }` \
                 syntax. Structs with private fields cannot be created \
                 outside of their defining module"
            ),
            ObsoleteWith => (
                "with",
                "record update is done with `..`, e.g. \
                 `MyStruct { foo: bar, .. baz }`"
            ),
            ObsoleteClassTraits => (
                "class traits",
                "implemented traits are specified on the impl, as in \
                 `impl foo : bar {`"
            ),
            ObsoletePrivSection => (
                "private section",
                "the `priv` keyword is applied to individual items, methods, \
                 and fields"
            ),
            ObsoleteModeInFnType => (
                "mode without identifier in fn type",
                "to use a (deprecated) mode in a fn type, you should \
                 give the argument an explicit name (like `&&v: int`)"
            ),
            ObsoleteMoveInit => (
                "initializer-by-move",
                "Write `let foo = move bar` instead"
            ),
            ObsoleteBinaryMove => (
                "binary move",
                "Write `foo = move bar` instead"
            ),
            ObsoleteUnsafeBlock => (
                "non-standalone unsafe block",
                "use an inner `unsafe { ... }` block instead"
            ),
            ObsoleteUnenforcedBound => (
                "unenforced type parameter bound",
                "use trait bounds on the functions that take the type as \
                 arguments, not on the types themselves"
            ),
            ObsoleteImplSyntax => (
                "colon-separated impl syntax",
                "write `impl Trait for Type`"
            ),
            ObsoleteTraitBoundSeparator => (
                "space-separated trait bounds",
                "write `+` between trait bounds"
            ),
            ObsoleteMutOwnedPointer => (
                "const or mutable owned pointer",
                "mutability inherits through `~` pointers; place the `~` box
                 in a mutable location, like a mutable local variable or an \
                 `@mut` box"
            ),
            ObsoleteMutVector => (
                "const or mutable vector",
                "mutability inherits through `~` pointers; place the vector \
                 in a mutable location, like a mutable local variable or an \
                 `@mut` box"
            ),
            ObsoleteTraitImplVisibility => (
                "visibility-qualified trait implementation",
                "`pub` or `priv` is meaningless for trait implementations, \
                 because the `impl...for...` form defines overloads for \
                 methods that already exist; remove the `pub` or `priv`"
            ),
            ObsoleteRecordType => (
                "structural record type",
                "use a structure instead"
            ),
            ObsoleteRecordPattern => (
                "structural record pattern",
                "use a structure instead"
            ),
            ObsoletePostFnTySigil => (
                "fn sigil in postfix position",
                "Rather than `fn@`, `fn~`, or `fn&`, \
                 write `@fn`, `~fn`, and `&fn` respectively"
            ),
            ObsoleteBareFnType => (
                "bare function type",
                "use `&fn` or `extern fn` instead"
            ),
            ObsoleteNewtypeEnum => (
                "newtype enum",
                "instead of `enum Foo = int`, write `struct Foo(int)`"
            ),
            ObsoleteMode => (
                "obsolete argument mode",
                "replace `-` or `++` mode with `+`"
            ),
            ObsoleteImplicitSelf => (
                "implicit self",
                "use an explicit `self` declaration or declare the method as \
                 static"
            ),
            ObsoleteLifetimeNotation => (
                "`/` lifetime notation",
                "instead of `&foo/bar`, write `&'foo bar`; instead of \
                 `bar/&foo`, write `&bar<'foo>"
            ),
            ObsoleteConstManagedPointer => (
                "const `@` pointer",
                "instead of `@const Foo`, write `@Foo`"
            ),
            ObsoletePurity => (
                "pure function",
                "remove `pure`"
            ),
            ObsoleteStaticMethod => (
                "`static` notation",
                "`static` is superfluous; remove it"
            ),
            ObsoleteConstItem => (
                "`const` item",
                "`const` items are now `static` items; replace `const` with \
                 `static`"
            ),
            ObsoleteFixedLengthVectorType => (
                "fixed-length vector notation",
                "instead of `[T * N]`, write `[T, ..N]`"
            ),
        };

        self.report(sp, kind, kind_str, desc);
    }

    // Reports an obsolete syntax non-fatal error, and returns
    // a placeholder expression
    fn obsolete_expr(&self, sp: span, kind: ObsoleteSyntax) -> @expr {
        self.obsolete(sp, kind);
        self.mk_expr(sp.lo, sp.hi, expr_lit(@respan(sp, lit_nil)))
    }

    priv fn report(&self, sp: span, kind: ObsoleteSyntax, kind_str: &str,
                   desc: &str) {
        self.span_err(sp, fmt!("obsolete syntax: %s", kind_str));

        if !self.obsolete_set.contains(&kind) {
            self.sess.span_diagnostic.handler().note(fmt!("%s", desc));
            self.obsolete_set.insert(kind);
        }
    }

    fn token_is_obsolete_ident(&self, ident: &str, token: Token) -> bool {
        match token {
            token::IDENT(copy sid, _) => {
                str::eq_slice(*self.id_to_str(sid), ident)
            }
            _ => false
        }
    }

    fn is_obsolete_ident(&self, ident: &str) -> bool {
        self.token_is_obsolete_ident(ident, *self.token)
    }

    fn eat_obsolete_ident(&self, ident: &str) -> bool {
        if self.is_obsolete_ident(ident) {
            self.bump();
            true
        } else {
            false
        }
    }

    fn try_parse_obsolete_struct_ctor(&self) -> bool {
        if self.eat_obsolete_ident("new") {
            self.obsolete(*self.last_span, ObsoleteStructCtor);
            self.parse_fn_decl(|p| p.parse_arg());
            self.parse_block();
            true
        } else {
            false
        }
    }

    fn try_parse_obsolete_with(&self) -> bool {
        if *self.token == token::COMMA
            && self.token_is_obsolete_ident("with",
                                            self.look_ahead(1u)) {
            self.bump();
        }
        if self.eat_obsolete_ident("with") {
            self.obsolete(*self.last_span, ObsoleteWith);
            self.parse_expr();
            true
        } else {
            false
        }
    }

    fn try_parse_obsolete_priv_section(&self) -> bool {
        if self.is_keyword(&~"priv") && self.look_ahead(1) == token::LBRACE {
            self.obsolete(copy *self.span, ObsoletePrivSection);
            self.eat_keyword(&~"priv");
            self.bump();
            while *self.token != token::RBRACE {
                self.parse_single_class_item(ast::private);
            }
            self.bump();
            true
        } else {
            false
        }
    }

}


text:
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import usersComponent from './users.component';
import usersDetailComponent from './detail/detail.component';
import usersAddComponent from './useradd/useradd.component';

import toaster from 'angular-toastr';

let usersModule = angular.module('users', [
  uiRouter,
  toaster
])

.config(($stateProvider, $urlRouterProvider) => {
  "ngInject";

  $urlRouterProvider.otherwise('/');

  $stateProvider
    .state('users', {
      url: '/users',
      component: 'users',
      data: {
        permission: {
          only : ['admin']
        }
      }
    })
    .state('userAdd', {
      url: '/users/tambah',
      component: 'usersadd',
      data: {
        permission: {
          only : ['admin']
        }
      }
    })
    .state('userdetail', {
      url: '/users/:user_id',
      component: 'usersDetail',
      resolve: {
        userDetail : ($http, $stateParams, User, appConfig, blockUI) =>  {
          const request = {
            method: 'GET',
            url: appConfig.api_url + '/user/' + $stateParams.user_id,
            cache: true,
            headers: {
              'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8',
              'Authorization': 'Bearer' + ' ' + User.getAuth().access_token
            }
          };

          blockUI.start();
          return $http(request).then((result) => {
            return result.data.data;
          })
          .finally(() => blockUI.stop());
        }
      },
      data: {
        permission: {
          only : ['admin']
        }
      }
    });
})

.component('users', usersComponent)
.component('usersDetail', usersDetailComponent)
.component('usersadd', usersAddComponent)

.name;

export default usersModule;


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System.Collections.Immutable;
using System.Diagnostics;

namespace Microsoft.CodeAnalysis.CSharp
{
    internal struct ArgumentAnalysisResult
    {
        public readonly ImmutableArray<int> ArgsToParamsOpt;
        public readonly int ArgumentPosition;
        public readonly int ParameterPosition;
        public readonly ArgumentAnalysisResultKind Kind;

        public int ParameterFromArgument(int arg)
        {
            Debug.Assert(arg >= 0);
            if (ArgsToParamsOpt.IsDefault)
            {
                return arg;
            }
            Debug.Assert(arg < ArgsToParamsOpt.Length);
            return ArgsToParamsOpt[arg];
        }

        private ArgumentAnalysisResult(ArgumentAnalysisResultKind kind,
                                    int argumentPosition,
                                    int parameterPosition,
                                    ImmutableArray<int> argsToParamsOpt)
        {
            this.Kind = kind;
            this.ArgumentPosition = argumentPosition;
            this.ParameterPosition = parameterPosition;
            this.ArgsToParamsOpt = argsToParamsOpt;
        }

        public bool IsValid
        {
            get
            {
                return this.Kind < ArgumentAnalysisResultKind.FirstInvalid;
            }
        }

        public static ArgumentAnalysisResult NameUsedForPositional(int argumentPosition)
        {
            return new ArgumentAnalysisResult(ArgumentAnalysisResultKind.NameUsedForPositional, argumentPosition, 0, default(ImmutableArray<int>));
        }

        public static ArgumentAnalysisResult NoCorrespondingParameter(int argumentPosition)
        {
            return new ArgumentAnalysisResult(ArgumentAnalysisResultKind.NoCorrespondingParameter, argumentPosition, 0, default(ImmutableArray<int>));
        }

        public static ArgumentAnalysisResult NoCorrespondingNamedParameter(int argumentPosition)
        {
            return new ArgumentAnalysisResult(ArgumentAnalysisResultKind.NoCorrespondingNamedParameter, argumentPosition, 0, default(ImmutableArray<int>));
        }

        public static ArgumentAnalysisResult RequiredParameterMissing(int parameterPosition)
        {
            return new ArgumentAnalysisResult(ArgumentAnalysisResultKind.RequiredParameterMissing, 0, parameterPosition, default(ImmutableArray<int>));
        }

        public static ArgumentAnalysisResult BadNonTrailingNamedArgument(int argumentPosition)
        {
            return new ArgumentAnalysisResult(ArgumentAnalysisResultKind.BadNonTrailingNamedArgument, argumentPosition, 0, default(ImmutableArray<int>));
        }

        public static ArgumentAnalysisResult NormalForm(ImmutableArray<int> argsToParamsOpt)
        {
            return new ArgumentAnalysisResult(ArgumentAnalysisResultKind.Normal, 0, 0, argsToParamsOpt);
        }

        public static ArgumentAnalysisResult ExpandedForm(ImmutableArray<int> argsToParamsOpt)
        {
            return new ArgumentAnalysisResult(ArgumentAnalysisResultKind.Expanded, 0, 0, argsToParamsOpt);
        }

#if DEBUG
        private string Dump()
        {
            string s = "";
            switch (Kind)
            {
                case ArgumentAnalysisResultKind.Normal:
                    s += "Valid in normal form.";
                    break;
                case ArgumentAnalysisResultKind.Expanded:
                    s += "Valid in expanded form.";
                    break;
                case ArgumentAnalysisResultKind.NameUsedForPositional:
                    s += "Invalid because argument " + ArgumentPosition + " had a name.";
                    break;
                case ArgumentAnalysisResultKind.NoCorrespondingParameter:
                    s += "Invalid because argument " + ArgumentPosition + " has no corresponding parameter.";
                    break;
                case ArgumentAnalysisResultKind.NoCorrespondingNamedParameter:
                    s += "Invalid because named argument " + ArgumentPosition + " has no corresponding parameter.";
                    break;
                case ArgumentAnalysisResultKind.RequiredParameterMissing:
                    s += "Invalid because parameter " + ParameterPosition + " has no corresponding argument.";
                    break;
                case ArgumentAnalysisResultKind.BadNonTrailingNamedArgument:
                    s += "Invalid because named argument " + ParameterPosition + " is used out of position but some following argument(s) are not named.";
                    break;
            }

            if (!ArgsToParamsOpt.IsDefault)
            {
                for (int i = 0; i < ArgsToParamsOpt.Length; ++i)
                {
                    s += "\nArgument " + i + " corresponds to parameter " + ArgsToParamsOpt[i];
                }
            }

            return s;
        }
#endif

    }
}