text:
define([
   'baranek/app/scripts/directives/directives',
   'jquery'
], function (directives) {

   directives.directive('coursesListCollapseDirective', function ($timeout,BARANEK_PATH) {
      return {
         restrict: 'A',
         link: function () {
            $timeout(function(){
               if (localStorage['calculus_animation'] === "off")
               {
                  $("*").addClass("offAnimation");
                  slideTime = 0;
               }
               else
               {
                  $("*").removeClass("offAnimation");
                  slideTime = "0.75s";
               }

               function autoCollapseEvents() {

                  jQuery('#courses_list .hider').append("

");

                  jQuery("#courses_list .hider").on('click', function (event, time) {

                     jQuery(this).siblings().slideToggle((Number.isInteger(time)) ? time : slideTime);

                     if (jQuery(this).find('div').hasClass('down-arrow'))
                     {
                        jQuery(this).find('div').remove('.down-arrow');
                        jQuery(this).append("

");
                     }
                     else
                     {
                        jQuery(this).find('div').remove('.up-arrow');
                        jQuery(this).append("

");
                     }
                  });

               };

               autoCollapseEvents();

            });

         }
      };
   });
});


text:
<?php

namespace Speelpenning\Authentication\Http\Controllers;

use Illuminate\Contracts\Config\Repository;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\View\View;
use Speelpenning\Authentication\Exceptions\LoginFailed;
use Speelpenning\Authentication\Exceptions\RememberingUserFailed;
use Speelpenning\Authentication\Exceptions\SessionHasExpired;
use Speelpenning\Authentication\Exceptions\UserIsBanned;
use Speelpenning\Authentication\Jobs\AttemptRememberingUser;
use Speelpenning\Authentication\Jobs\AttemptUserLogin;
use Speelpenning\Authentication\Jobs\PerformUserLogout;

class SessionController extends Controller
{
    use DispatchesJobs;

    /**
     * @var Repository
     */
    protected $config;

    /**
     * SessionController constructor.
     *
     * @param Repository $config
     */
    public function __construct(Repository $config)
    {
        $this->config = $config;
    }

    /**
     * Attempts to authenticate by remember token. When remembering fails the login form is shown.
     *
     * @return RedirectResponse|View
     */
    public function create()
    {
        try {
            $this->dispatch(new AttemptRememberingUser());
            return redirect()->intended($this->config->get('authentication.login.redirectUri'));
        } catch (RememberingUserFailed $e) {
            return view('authentication::session.create');
        }
    }

    /**
     * Attempts to login the user.
     *
     * @param Request $request
     * @return RedirectResponse
     */
    public function store(Request $request)
    {
        try {
            $this->dispatch(new AttemptUserLogin($request->get('email'), $request->get('password'), $request->get('remember')));
            return redirect()->intended($this->config->get('authentication.login.redirectUri'));
        } catch (LoginFailed $e) {
            return redirect()->back()->withInput()->withErrors([
                'authentication::login_error' => $e->getMessage()
            ]);
        } catch (UserIsBanned $e) {
            return redirect()->back()->withInput()->withErrors([
                'authentication::login_error' => $e->getMessage()
            ]);
        }
    }

    /**
     * Attempts to log off the user.
     *
     * @return RedirectResponse
     */
    public function destroy()
    {
        try {
            $this->dispatch(new PerformUserLogout());
            return redirect($this->config->get('authentication.logout.redirectUri'));
        } catch (SessionHasExpired $e) {
            return redirect()->route('authentication::session.create')->withErrors([
               'authentication::login_warning' => $e->getMessage()
           ]);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

/**
 * Created by Haritz Medina on 14/01/2016.
 */

var TimeUtils = require('./utils/TimeUtils');

var GCPlayerView = function GCPlayerView() {};

GCPlayerView.prototype.init = function () {
  'use strict';

  this.player.init();
};

GCPlayerView.prototype.playSong = function (song, url) {
  'use strict';
  // Play song

  this.player.playerInstance.src = url;
  this.player.play();
  // Display song info
  // Display notification
  // Display song info in playerWrapper
  var infoContainer = document.getElementById('playingSongInfo');
  infoContainer.querySelector('#artist').innerText = song.artist;
  infoContainer.querySelector('#title').innerText = song.title;
  infoContainer.querySelector('#album').innerText = song.album;
  this.player.playerInstance.dispatchEvent(window.GCPlayer.controller.songChangeEvent());
};

GCPlayerView.prototype.displayLibrarySearchSongs = function (songs) {
  'use strict';

  console.log('Displaying songs');
  var resultsDiv = document.getElementById('librarySearchResults');
  resultsDiv.innerHTML = ''; // Clean results container
  for (var i = 0; i < songs.length; i++) {
    var song = songs[i];
    this.displayLibrarySongElement(song, resultsDiv);
  }
};

GCPlayerView.prototype.displayLibrarySongElement = function (song, container) {
  'use strict';
  // TODO Display song using librarySongElement template

  var template = document.querySelector('#librarySongElement');
  var content = document.importNode(template.content, true);

  var songDiv = content.querySelector('.librarySongElement');
  songDiv.dataset.songId = song.folder + '#' + song.filename;
  var artistDiv = content.querySelector('.librarySongElementArtist');
  artistDiv.innerText = song.artist;
  var albumDiv = content.querySelector('.librarySongElementAlbum');
  albumDiv.innerText = song.album;
  var titleDiv = content.querySelector('.librarySongElementTitle');
  titleDiv.innerText = song.title;
  container.appendChild(content);
};

//// Player controls

GCPlayerView.prototype.player = {};
GCPlayerView.prototype.player.progressBar = null;
GCPlayerView.prototype.player.playerTimeValue = null;
GCPlayerView.prototype.player.playerTimeMax = null;
GCPlayerView.prototype.player.playerInstance = null;

GCPlayerView.prototype.player.init = function () {
  'use strict';

  this.progressBar = document.getElementById('playerProgressBar');
  this.playerTimeValue = document.getElementById('playerTimeValue');
  this.playerTimeMax = document.getElementById('playerTimeMax');
  this.playerInstance = document.getElementById('player');
};

GCPlayerView.prototype.player.playPause = function () {
  'use strict';

  if (this.playerInstance.paused === true) {
    this.playerInstance.play();
  } else {
    this.playerInstance.pause();
  }
  this.showHidePlayPauseButton();
};

GCPlayerView.prototype.player.play = function () {
  'use strict';

  if (this.playerInstance.paused === true) {
    this.playerInstance.play();
  }
  this.showHidePlayPauseButton();
};

GCPlayerView.prototype.player.pause = function () {
  'use strict';

  if (this.playerInstance.paused === false) {
    this.playerInstance.pause();
  }
  this.showHidePlayPauseButton();
};

GCPlayerView.prototype.player.setCurrentTime = function (seconds) {
  'use strict';

  if (this.playerInstance.duration < seconds && seconds < 0) {
    return null;
  } else {
    this.playerInstance.currentTime = seconds;
  }
};

GCPlayerView.prototype.player.updatePlayingSeconds = function (seconds) {
  'use strict';

  this.progressBar.value = seconds;
  this.playerTimeValue.textContent = TimeUtils.secondsToTimeFormat(seconds);
};

GCPlayerView.prototype.player.setMaxPlayingSeconds = function (seconds) {
  'use strict';

  this.progressBar.max = seconds;
  this.playerTimeMax.textContent = TimeUtils.secondsToTimeFormat(seconds);
};

GCPlayerView.prototype.player.showHidePlayPauseButton = function () {
  'use strict';

  var playButton = document.getElementById('play');
  var pauseButton = document.getElementById('pause');
  if (this.playerInstance.paused === true) {
    playButton.dataset.enabled = true;
    pauseButton.dataset.enabled = false;
  } else {
    playButton.dataset.enabled = false;
    pauseButton.dataset.enabled = true;
  }
};

GCPlayerView.prototype.menu = {};

GCPlayerView.prototype.menu.enableContainer = function (container) {
  'use strict';
  // Disable all the containers

  var containers = document.getElementsByClassName('contentContainer');
  for (var i = 0; i < containers.length; i++) {
    containers[i].dataset.enabled = false;
  }
  // Enable the selected container
  container.dataset.enabled = true;
};

GCPlayerView.prototype.configuration = {};

GCPlayerView.prototype.configuration.displayExtensions = function (extensions) {
  'use strict';

  var template = document.querySelector('#extension');
  var container = document.getElementById('extensions');
  for (var i = 0; i < extensions.length; i++) {
    var extension = extensions[i];
    var content = document.importNode(template.content, true);
    var nameContainer = content.querySelector('.extensionName');
    nameContainer.innerText = extension.name;
    var descriptionContainer = content.querySelector('.extensionDescription');
    descriptionContainer.innerText = extension.description;
    var versionContainer = content.querySelector('.extensionVersion');
    versionContainer.innerText = extension.version;
    var authorContainer = content.querySelector('.extensionAuthor');
    authorContainer.innerText = extension.author;
    var enabledCheckbox = content.querySelector('.extensionEnabled');
    enabledCheckbox.checked = extension.enabled;
    container.appendChild(content);
  }
};

module.exports = GCPlayerView;


text:
// Decompiled with JetBrains decompiler
// Type: TechnologySolutions.Rfid.AsciiProtocol.Commands.BatteryStatusCommand
// Assembly: TechnologySolutions.Rfid.AsciiProtocol.FX35, Version=1.1.5423.27429, Culture=neutral, PublicKeyToken=null
// MVID: 9C1072D5-BA32-4CFB-BB8E-6AC565EFDF12
// Assembly location: F:\Visual Studio\Repositories\IlukaOreSampleTracking\lib\Ascii 2 Windows\TechnologySolutions.Rfid.AsciiProtocol.FX35.dll

namespace Tsl.AsciiProtocol.Pcl.Commands
{
  /// <summary>
  /// A command to query the reader for battery status information
  ///             Note: This does not yet expose the charging status via a property but the 'CH:' line is captured in the response property
  ///
  /// </summary>
  public class BatteryStatusCommand : AsciiCommandBase
  {
    /// <summary>
    /// Gets the battery level retrieved from the reader.
    ///
    /// </summary>
    [Description("The current battery level as a percentage of full charge")]
    [Category("Response")]
    public int BatteryLevel
    {
      get
      {
        return AsciiResponseExtensions.ValueByHeaderNumber((IAsciiResponse) this.Response, "BP");
      }
    }

    /// <summary>
    /// Gets the charge status retrived from the reader.
    ///
    /// </summary>
    [Description("Indicates the current charge activitity")]
    [Category("Response")]
    public ChargeStatus ChargeStatus
    {
      get
      {
        return AsciiResponseExtensions.ValueByHeader<ChargeStatus>((IAsciiResponse) this.Response, "CH");
      }
    }

    /// <summary>
    /// Initializes a new instance of the BatteryStatusCommand class
    ///
    /// </summary>
    public BatteryStatusCommand()
      : base(".bl")
    {
      AsciiResponseExtensions.AddHeaders(this.Response, "CH: CS: BP: ER: ME: OK:");
    }
  }
}


text:
from __future__ import print_function
import six
import os, sys
import re
import inspect
import pkgutil
import importlib
import argparse
import json
import logging
import arrow
import requests
import getpass
from collections import OrderedDict
from natsort import natsorted
from .models import *
from .util import *
from .roles import Role
from . import __version__
from . import cache
from . import config as g_config

# Figure out where this script is, and change the PATH appropriately
BASE = os.path.abspath(os.path.dirname(sys.modules[__name__].__file__))
sys.path.insert(0, BASE)

# Create an argument parser
parser = argparse.ArgumentParser(description=u"Easily manage Halon nodes and clusters.")
subparsers = parser.add_subparsers(title='subcommands', dest='_mod_name', metavar='cmd')
subparsers.required = True

# All available modules and output formatters
modules = {}
formatters = {}

# Loaded configuration, configured nodes and clusters
config = {}
nodes = {}
clusters = {}

# Disable unverified HTTPS warnings - we know what we're doing
requests.packages.urllib3.disable_warnings()

# Regex that matches quick-connect nodes
quick_node_re = re.compile(r'^(?:(?P<name>[a-zA-Z0-9_-]+)=)?(?:(?P<protocol>https?)://)?(?P<data>(?P<username>[^@]+)@(?P<host>[a-zA-Z0-9\-\.]+)(?::(?P<port>[0-9]+))?)$')

def load_modules(modules_path):
	'''Load all modules from the 'modules' directory.'''

	# Figure out where all the modules are, then treat it as a package,
	# iterating over its modules and attempting to load each of them. The
	# 'module' variable in the imported module is the module instance to use -
	# register that with the application. Yay, dynamic loading abuse.
	for loader, name, ispkg in pkgutil.iter_modules(path=[modules_path]):
		mod = loader.find_module(name).load_module(name)
		if hasattr(mod, 'module'):
			register_module(name.rstrip('_'), mod.module)
		else:
			print(u"Ignoring invalid module (missing 'module' variable): {name}".format(name=name), file=sys.stderr)

def load_formatters(formatters_path):
	'''Load all formatters from the 'formatters' directory.'''

	for loader, name, ispkg in pkgutil.iter_modules(path=[formatters_path]):
		fmt = loader.find_module(name).load_module(name)
		if hasattr(fmt, 'formatter'):
			formatters[name.rstrip('_')] = fmt.formatter
		else:
			print(u"Ignoring invalid formatter (missing 'formatter' member): {name}".format(name=name), file=sys.stderr)

def register_module(name, mod):
	'''Registers a loaded module instance'''

	p = subparsers.add_parser(name, help=mod.__doc__)
	p.set_defaults(_mod=mod)
	mod.register_arguments(p)
	modules[name] = mod

def open_config():
	'''Opens a configuration file from the first found default location.'''

	config_paths = [
		os.path.abspath(os.path.join(BASE, '..', 'halonctl.json')),
		os.path.expanduser('~/.config/halonctl.json'),
		os.path.expanduser('~/halonctl.json'),
		os.path.expanduser('~/.halonctl.json'),
		'/etc/halonctl.json',
	]

	config_path = None
	for p in config_paths:
		if os.path.exists(p):
			config_path = p
			break

	if not config_path:
		print(u"No configuration file found!", file=sys.stderr)
		print(u"", file=sys.stderr)
		print(u"Please create one in one of the following locations:", file=sys.stderr)
		print(u"", file=sys.stderr)
		for p in config_paths:
			print("  - {0}".format(p), file=sys.stderr)
		print(u"", file=sys.stderr)
		print(u"Or use the -C/--config flag to specify a path.", file=sys.stderr)
		print(u"A sample config can be found at:", file=sys.stderr)
		print(u"", file=sys.stderr)
		print(u"  - {0}".format(os.path.abspath(os.path.join(BASE, 'halonctl.sample.json'))), file=sys.stderr)
		print(u"", file=sys.stderr)
		sys.exit(1)

	return open(config_path, 'rU')

def load_config(f):
	'''Loads configuration data from a given file.'''

	try:
		conf = json.load(f, encoding='utf-8', object_pairs_hook=OrderedDict)
	except ValueError as e:
		sys.exit(u"Configuration Syntax Error: {0}".format(e))

	f.close()
	g_config.config.update(conf)
	return conf

def process_config(config):
	'''Processes a configuration dictionary into usable components.'''

	nodes = OrderedDict([(name, Node(data, name)) for name, data in six.iteritems(config.get('nodes', {}))])
	clusters = {}

	for name, data in six.iteritems(config.get('clusters', {})):
		cluster = NodeList()
		cluster.name = name
		cluster.load_data(data)

		for nid in data['nodes'] if isinstance(data, dict) else data:
			if not nid in nodes:
				sys.exit(u"Configuration Error: Cluster '{cid}' references nonexistent node '{nid}'".format(cid=cluster.name, nid=nid))
			node = nodes[nid]
			node.cluster = cluster
			cluster.append(node)

		clusters[cluster.name] = cluster

	return (nodes, clusters)

def apply_slice(list_, slice_):
	if not slice_ or not list_:
		return list_

	offsets = [-1, 0, 0]
	parts = [int(p) + offsets[i] if p else None for i, p in enumerate(slice_.split(':'))]
	try:
		return list_[slice(*parts)] if len(parts) > 1 else [list_[parts[0]]]
	except IndexError:
		return []

def apply_filter(available_nodes, available_clusters, nodes, clusters, slice_=''):
	targets = OrderedDict()

	if len(nodes) == 0 and len(clusters) == 0:
		for node in six.itervalues(apply_slice(available_nodes, slice_)):
			targets[node.name] = node
	else:
		for cid in clusters:
			for node in apply_slice(available_clusters[cid], slice_):
				targets[node.name] = node

		for nid in apply_slice(nodes, slice_):
			targets[nid] = available_nodes[nid]

	return NodeList(targets.values())

def download_wsdl(nodes, verify):
	path = cache.get_path(u"wsdl.xml")
	min_mtime = arrow.utcnow().replace(hours=-12)
	if not os.path.exists(path) or arrow.get(os.path.getmtime(path)) < min_mtime:
		has_been_downloaded = False
		for node in nodes:
			try:
				r = requests.get(u"{scheme}://{host}/remote/?wsdl".format(scheme=node.scheme, host=node.host), stream=True, verify=False if node.no_verify else verify)
				if r.status_code == 200:
					with open(path, 'wb') as f:
						for chunk in r.iter_content(256):
							f.write(chunk)
					has_been_downloaded = True
					break
			except requests.exceptions.SSLError:
				print_ssl_error(node)
				sys.exit(1)
			except:
				pass

		if not has_been_downloaded:
			sys.exit("None of your nodes are available, can't download WSDL")

def main():
	# Configure logging
	logging.basicConfig(level=logging.ERROR)
	logging.getLogger('suds.client').setLevel(logging.CRITICAL)

	# Load modules and formatters
	base_paths = [BASE, os.path.expanduser('~/halonctl'), os.path.expanduser('~/.halonctl')]
	for path in base_paths:
		load_modules(os.path.join(path, 'modules'))
		load_formatters(os.path.join(path, 'formatters'))

	# Figure out the program version
	version = __version__
	try:
		head_path = os.path.join(os.path.dirname(__file__), '..', '.git', 'refs', 'heads', 'master')
		with open(head_path) as f:
			revision = f.read().strip()[:7]
			version = "{version} ({revision})".format(version=__version__, revision=revision)
	except IOError:
		pass

	# Add parser arguments
	parser.add_argument('-V', '--version', action='version', version=u"halonctl {version}".format(version=version),
		help=u"print version information and exit")

	parser.add_argument('-C', '--config', type=argparse.FileType('rU'),
		help="use specified configuration file")

	parser.add_argument('-n', '--node', dest='nodes', action='append', metavar="NODES",
		default=[], help=u"target nodes")
	parser.add_argument('-c', '--cluster', dest='clusters', action='append', metavar="CLUSTERS",
		default=[], help=u"target clusters")
	parser.add_argument('-s', '--slice', dest='slice',
		default='', help=u"slicing, as a Python slice expression")
	parser.add_argument('-d', '--dry', dest='dry_run', action='store_true',
		help=u"only list the nodes that would be affected")

	parser.add_argument('-i', '--ignore-partial', action='store_true',
		help=u"exit normally even for partial results")
	parser.add_argument('-f', '--format', choices=list(formatters.keys()), default='table',
		help=u"use the specified output format (default: table)")
	parser.add_argument('-r', '--raw', action='store_true',
		help=u"don't humanize the output, output it as raw as possible")
	parser.add_argument('-g', '--group-by', metavar="KEY",
		help=u"group output; ignored for table-like formats")
	parser.add_argument('-k', '--key', dest='group_key', action='store_true',
		help=u"assume grouper is unique, and key only a single value to it")

	parser.add_argument('--clear-cache', action='store_true',
		help=u"clear the WSDL cache")

	# Parse!
	args = parser.parse_args()

	# Clear cache if requested
	if args.clear_cache:
		os.remove(cache.get_path(u"wsdl.xml"))

	# Load configuration
	config = load_config(args.config or open_config())
	nodes, clusters = process_config(config)

	# Allow wildcard cluster- and node targeting
	if args.clusters == ['-']:
		args.clusters = list(clusters.keys())
	if args.nodes == ['-']:
		args.nodes = list(nodes.keys())

	# Allow slices without targeting, defaulting to each cluster
	if args.slice and not args.clusters and not args.nodes:
		args.clusters = list(clusters.keys())

	# Allow non-configured nodes to be specified as '[name:]username@host'
	quick_node_matches = [ quick_node_re.match(n) for n in args.nodes ]
	quick_node_args = []
	for m in [ m for m in quick_node_matches if m ]:
		arg = m.group(0)
		data = m.group('data')
		n = Node(data, name=m.group('name') or m.group('host'))
		n.no_verify = True # Don't verify SSL for quick nodes
		nodes[arg] = n
		quick_node_args.append(arg)

	if quick_node_args:
		l = NodeList([nodes[arg] for arg in quick_node_args])
		for node, (code, result) in six.iteritems(l.service.login()):
			if code == 401:
				while True:
					password = getpass.getpass(u"Password for {node.username}@{node.host}: ".format(node=node))
					if not password:
						break

					node.password = password
					code = node.service.login()[0]
					if code == 200:
						break
					elif code == 401:
						print(u"Invalid login, try again")
					elif code == 0:
						print(u"The node has gone away")
						break
					else:
						print(u"An error occurred, code {0}".format(code))
						break

	# Validate cluster and node choices
	invalid_clusters = [cid for cid in args.clusters if not cid in clusters]
	if invalid_clusters:
		print(u"Unknown clusters: {0}".format(', '.join(invalid_clusters)), file=sys.stderr)
		print(u"Available: {0}".format(', '.join(six.iterkeys(clusters))), file=sys.stderr)
		sys.exit(1)

	invalid_nodes = [nid for nid in args.nodes if not nid in nodes and nid not in quick_node_args]
	if invalid_nodes:
		print(u"Unknown nodes: {0}".format(', '.join(invalid_nodes)), file=sys.stderr)
		print(u"Available: {0}".format(', '.join(six.iterkeys(nodes))), file=sys.stderr)
		sys.exit(1)

	# Filter nodes to choices
	target_nodes = apply_filter(nodes, clusters, args.nodes, args.clusters, args.slice)

	# If this is a dry run - stop right here and just print the targets
	if args.dry_run:
		print(u"This action would have affected:")
		for node in target_nodes:
			print(u"  - {name} ({cluster})".format(name=node.name, cluster=node.cluster.name))
		return

	# Download WSDL and create client objects
	download_wsdl(target_nodes, verify=config.get('verify_ssl', True))
	for node in target_nodes:
		node.load_wsdl()

	# Run the selected module
	mod = args._mod
	retval = mod.run(target_nodes, args)

	# Normalize generator mods into lists (lets us detect emptiness)
	if inspect.isgenerator(retval):
		retval = list(retval)

	# Print something, if there's anything to print
	if retval:
		if hasattr(retval, 'draw'):
			print(retval.draw())
		elif isinstance(retval, Role):
			print(retval.raw() if args.raw else retval.human())
		else:
			print(formatters[args.format].run(retval, args))

	# Let the module decide the exit code - either by explicitly setting it, or
	# by marking the result as partial, in which case a standard exit code is
	# returned unless the user has requested partial results to be ignored
	if mod.exitcode != 0:
		sys.exit(mod.exitcode)
	elif mod.partial and not args.ignore_partial:
		sys.exit(99)

if __name__ == '__main__':
	main()


text:
package com.amazonaws.services.controltower.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.controltower.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * EnableControlRequestMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class EnableControlRequestMarshaller {

    private static final MarshallingInfo<String> CONTROLIDENTIFIER_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("controlIdentifier").build();
    private static final MarshallingInfo<String> TARGETIDENTIFIER_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("targetIdentifier").build();

    private static final EnableControlRequestMarshaller instance = new EnableControlRequestMarshaller();

    public static EnableControlRequestMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(EnableControlRequest enableControlRequest, ProtocolMarshaller protocolMarshaller) {

        if (enableControlRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(enableControlRequest.getControlIdentifier(), CONTROLIDENTIFIER_BINDING);
            protocolMarshaller.marshall(enableControlRequest.getTargetIdentifier(), TARGETIDENTIFIER_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
using System;
using System.ComponentModel;
using System.Data.Linq;
using System.Data.Linq.Mapping;

namespace derpirc.Data.Models
{
    [global::System.Data.Linq.Mapping.TableAttribute()]
    public partial class Network : IBaseModel, INotifyPropertyChanging, INotifyPropertyChanged
    {
        [Column(IsVersion = true)]
        private Binary _Version;

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private int _Id;

        private int _SessionId;

        private string _DisplayName;

        private string _Name;

        private string _HostName;

        private string _ConnectedHostName;

        private string _Ports;

        private string _Password;

        private EntitySet<Channel> _Channels;

        private EntitySet<Mention> _Mentions;

        private EntitySet<Message> _Messages;

        private EntityRef<Session> _Session;

        private EntitySet<Favorite> _Favorites;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnIdChanging(int value);
        partial void OnIdChanged();
        partial void OnSessionIdChanging(int value);
        partial void OnSessionIdChanged();
        partial void OnServerIdChanging(int value);
        partial void OnServerIdChanged();
        partial void OnDisplayNameChanging(string value);
        partial void OnDisplayNameChanged();
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        partial void OnHostNameChanging(string value);
        partial void OnHostNameChanged();
        partial void OnConnectedHostNameChanging(string value);
        partial void OnConnectedHostNameChanged();
        partial void OnPortsChanging(string value);
        partial void OnPortsChanged();
        partial void OnPasswordChanging(string value);
        partial void OnPasswordChanged();
        partial void OnIsConnectedChanging(bool value);
        partial void OnIsConnectedChanged();
        #endregion

        public Network()
        {
            this._Channels = new EntitySet<Channel>(new Action<Channel>(this.attach_Channels), new Action<Channel>(this.detach_Channels));
            this._Mentions = new EntitySet<Mention>(new Action<Mention>(this.attach_Mentions), new Action<Mention>(this.detach_Mentions));
            this._Messages = new EntitySet<Message>(new Action<Message>(this.attach_Messages), new Action<Message>(this.detach_Messages));
            this._Session = default(EntityRef<Session>);
            this._Favorites = new EntitySet<Favorite>(new Action<Favorite>(this.attach_Favorites), new Action<Favorite>(this.detach_Favorites));
            OnCreated();
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Id", AutoSync = AutoSync.OnInsert, DbType = "Int NOT NULL IDENTITY", IsPrimaryKey = true, IsDbGenerated = true)]
        public int Id
        {
            get
            {
                return this._Id;
            }
            set
            {
                if ((this._Id != value))
                {
                    this.OnIdChanging(value);
                    this.SendPropertyChanging();
                    this._Id = value;
                    this.SendPropertyChanged("Id");
                    this.OnIdChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_SessionId", DbType = "Int NOT NULL")]
        public int SessionId
        {
            get
            {
                return this._SessionId;
            }
            set
            {
                if ((this._SessionId != value))
                {
                    if (this._Session.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    this.OnSessionIdChanging(value);
                    this.SendPropertyChanging();
                    this._SessionId = value;
                    this.SendPropertyChanged("SessionId");
                    this.OnSessionIdChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_DisplayName", DbType = "NVarChar(128)")]
        public string DisplayName
        {
            get
            {
                return this._DisplayName;
            }
            set
            {
                if (string.Compare(this._DisplayName, value, StringComparison.OrdinalIgnoreCase) != 0)
                {
                    var newValue = (value ?? string.Empty).ToLowerInvariant();
                    //var newValue = !string.IsNullOrEmpty(value) ? value.ToLower() : null;
                    this.OnDisplayNameChanging(newValue);
                    this.SendPropertyChanging();
                    this._DisplayName = newValue;
                    this.SendPropertyChanged("DisplayName");
                    this.OnDisplayNameChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Name", DbType = "NVarChar(128) NOT NULL", CanBeNull = false)]
        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                if (string.Compare(this._Name, value, StringComparison.OrdinalIgnoreCase) != 0)
                {
                    var newValue = (value ?? string.Empty).ToLowerInvariant();
                    this.OnNameChanging(newValue);
                    this.SendPropertyChanging();
                    this._Name = newValue;
                    this.SendPropertyChanged("Name");
                    this.OnNameChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_HostName", DbType = "NVarChar(128) NOT NULL", CanBeNull = false)]
        public string HostName
        {
            get
            {
                return this._HostName;
            }
            set
            {
                if (string.Compare(this._HostName, value, StringComparison.OrdinalIgnoreCase) != 0)
                {
                    var newValue = (value ?? string.Empty).ToLowerInvariant();
                    this.OnHostNameChanging(newValue);
                    this.SendPropertyChanging();
                    this._HostName = newValue;
                    this.SendPropertyChanged("HostName");
                    this.OnHostNameChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_ConnectedHostName", DbType = "NVarChar(128) NOT NULL", CanBeNull = false)]
        public string ConnectedHostName
        {
            get
            {
                return this._ConnectedHostName;
            }
            set
            {
                if (string.Compare(this._ConnectedHostName, value, StringComparison.OrdinalIgnoreCase) != 0)
                {
                    var newValue = (value ?? string.Empty).ToLowerInvariant();
                    this.OnConnectedHostNameChanging(newValue);
                    this.SendPropertyChanging();
                    this._ConnectedHostName = newValue;
                    this.SendPropertyChanged("ConnectedHostName");
                    this.OnConnectedHostNameChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Ports", DbType = "NVarChar(256)")]
        public string Ports
        {
            get
            {
                return this._Ports;
            }
            set
            {
                if ((this._Ports != value))
                {
                    this.OnPortsChanging(value);
                    this.SendPropertyChanging();
                    this._Ports = value;
                    this.SendPropertyChanged("Ports");
                    this.OnPortsChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Password", DbType = "NVarChar(128)")]
        public string Password
        {
            get
            {
                return this._Password;
            }
            set
            {
                if ((this._Password != value))
                {
                    this.OnPasswordChanging(value);
                    this.SendPropertyChanging();
                    this._Password = value;
                    this.SendPropertyChanged("Password");
                    this.OnPasswordChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.AssociationAttribute(Name = "FK_Network_Channel", Storage = "_Channels", ThisKey = "Id", OtherKey = "NetworkId", DeleteRule = "CASCADE")]
        public EntitySet<Channel> Channels
        {
            get
            {
                return this._Channels;
            }
            set
            {
                this._Channels.Assign(value);
            }
        }

        [global::System.Data.Linq.Mapping.AssociationAttribute(Name = "FK_Network_Mention", Storage = "_Mentions", ThisKey = "Id", OtherKey = "NetworkId", DeleteRule = "CASCADE")]
        public EntitySet<Mention> Mentions
        {
            get
            {
                return this._Mentions;
            }
            set
            {
                this._Mentions.Assign(value);
            }
        }

        [global::System.Data.Linq.Mapping.AssociationAttribute(Name = "FK_Network_Message", Storage = "_Messages", ThisKey = "Id", OtherKey = "NetworkId", DeleteRule = "CASCADE")]
        public EntitySet<Message> Messages
        {
            get
            {
                return this._Messages;
            }
            set
            {
                this._Messages.Assign(value);
            }
        }

        [global::System.Data.Linq.Mapping.AssociationAttribute(Name = "FK_Session_Network", Storage = "_Session", ThisKey = "SessionId", OtherKey = "Id", IsForeignKey = true)]
        public Session Session
        {
            get
            {
                return this._Session.Entity;
            }
            set
            {
                Session previousValue = this._Session.Entity;
                if (((previousValue != value)
                            || (this._Session.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging();
                    if ((previousValue != null))
                    {
                        this._Session.Entity = null;
                        previousValue.Networks.Remove(this);
                    }
                    this._Session.Entity = value;
                    if ((value != null))
                    {
                        value.Networks.Add(this);
                        this._SessionId = value.Id;
                    }
                    else
                    {
                        this._SessionId = default(int);
                    }
                    this.SendPropertyChanged("Session");
                }
            }
        }

        [global::System.Data.Linq.Mapping.AssociationAttribute(Name = "FK_Network_Favorite", Storage = "_Favorites", ThisKey = "Id", OtherKey = "NetworkId", DeleteRule = "CASCADE")]
        public EntitySet<Favorite> Favorites
        {
            get
            {
                return this._Favorites;
            }
            set
            {
                this._Favorites.Assign(value);
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        private void attach_Channels(Channel entity)
        {
            this.SendPropertyChanging();
            entity.Network = this;
        }

        private void detach_Channels(Channel entity)
        {
            this.SendPropertyChanging();
            entity.Network = null;
        }

        private void attach_Mentions(Mention entity)
        {
            this.SendPropertyChanging();
            entity.Network = this;
        }

        private void detach_Mentions(Mention entity)
        {
            this.SendPropertyChanging();
            entity.Network = null;
        }

        private void attach_Messages(Message entity)
        {
            this.SendPropertyChanging();
            entity.Network = this;
        }

        private void detach_Messages(Message entity)
        {
            this.SendPropertyChanging();
            entity.Network = null;
        }

        private void attach_Favorites(Favorite entity)
        {
            this.SendPropertyChanging();
            entity.Network = this;
        }

        private void detach_Favorites(Favorite entity)
        {
            this.SendPropertyChanging();
            entity.Network = null;
        }
    }
}


text:
#include "MemUtils.hh"

/*
 * These testcases verify that synchronization behaviour for memcpy functions with respect to
 * the host.
 */

using namespace mem_utils;

// value used for memset operations
constexpr int testValue = 0x11;

/*
 * Set of helper functions handling the different cases for memcpy
 */

static inline hipMemcpyKind getMemcpyType(allocType type, bool fromHost) {
  if (fromHost) {
    switch (type) {
      case allocType::deviceMalloc:
        return hipMemcpyHostToDevice;
        break;
      case allocType::devRegistered:
        return hipMemcpyHostToDevice;
        break;
      default:  // host
        return hipMemcpyHostToHost;
        break;
    }
  } else {
    switch (type) {
      case allocType::deviceMalloc:
        return hipMemcpyDeviceToDevice;
        break;
      case allocType::devRegistered:
        return hipMemcpyDeviceToDevice;
        break;
      default:  // host
        return hipMemcpyDeviceToHost;
        break;
    }
  }
}

static inline void memcpyCheck(allocType type, memType memType, char* aPtr, MultiDData& data,
                               char* fillerData, bool async, hipStream_t stream, bool fromHost) {
  auto cpyType = getMemcpyType(type, fromHost);
  auto sizeInBytes = data.pitch * data.getH() * data.getD() * sizeof(char);
  switch (memType) {
    case memType::hipMem:
      if (async) {
        HIP_CHECK(hipMemcpyAsync(aPtr + data.offset, fillerData, sizeInBytes, cpyType, stream));
      } else {
        HIP_CHECK(hipMemcpy(aPtr + data.offset, fillerData, sizeInBytes, cpyType));
      }
      break;
    case memType::hipMem2D:
      if (async) {
        HIP_CHECK(hipMemcpy2DAsync(aPtr + data.offset, data.pitch, fillerData, sizeInBytes,
                                   data.width, data.getH(), cpyType, stream));
      } else {
        HIP_CHECK(hipMemcpy2D(aPtr + data.offset, data.pitch, fillerData, sizeInBytes, data.width,
                              data.getH(), cpyType));
      }
      break;
    case memType::hipMem3D: {
      hipMemcpy3DParms params{};
      params.kind = cpyType;
      params.srcPos = make_hipPos(0, 0, 0);
      params.dstPos = make_hipPos(data.offset, data.offset, data.offset);
      params.srcPtr = make_hipPitchedPtr(fillerData, data.width, data.width, data.getH());
      params.dstPtr = make_hipPitchedPtr(aPtr, data.pitch, data.width, data.getH());
      hipExtent extent;
      extent.width = data.width * sizeof(char);
      extent.height = data.getH();
      extent.depth = data.getD();

      params.extent = extent;
      if (async) {
        HIP_CHECK(hipMemcpy3DAsync(&params, stream));
      } else {
        HIP_CHECK(hipMemcpy3D(&params));
      }
      break;
    }
    default:
      break;
  }
}

static inline char* createFillerData(size_t count, size_t value, bool fromHost) {
  if (fromHost) {
    char* fillerData = new char[count];
    std::fill(fillerData, fillerData + count, value);
    return fillerData;
  } else {
    char* fillerData;
    HIP_CHECK(hipMalloc(&fillerData, count * sizeof(char)));
    HIP_CHECK(hipMemset(fillerData, value, count * sizeof(char)));
    return fillerData;
  }
}

static void checkForSync(hipStream_t stream, bool async, allocType type, bool fromHost) {
  if (fromHost) {
    if (type == allocType::deviceMalloc) {
      HIP_CHECK_ERROR(hipStreamQuery(stream), hipErrorNotReady);
    } else {
      HIP_CHECK(hipStreamQuery(stream));
    }
  } else {
    if (type != allocType::deviceMalloc && !async) {
      HIP_CHECK(hipStreamQuery(stream));
    } else {
      HIP_CHECK_ERROR(hipStreamQuery(stream), hipErrorNotReady);
    }
  }
}

// Helper function to run tests for hipMemset allocation types
static void runMemcpyTests(hipStream_t stream, bool async, allocType type, memType memType,
                           MultiDData data) {
  bool fromHost = GENERATE(true, false);

  std::pair<char*, char*> aPtr = initMemory<char>(type, memType, data);
  size_t sizeInBytes = data.getCount();

  // filler data for device memory created beforehand as it uses memset
  // which might interfere with synchronization testing
  auto fillerData = createFillerData(sizeInBytes, testValue, fromHost);
  CAPTURE(type, memType, data.width, data.height, data.depth, stream, async, fromHost, sizeInBytes);

  using namespace std::chrono_literals;
  const std::chrono::duration<uint64_t, std::milli> delay = 100ms;
  HipTest::runKernelForDuration(delay, stream);

  memcpyCheck(type, memType, aPtr.first, data, fillerData, async, stream, fromHost);
  checkForSync(stream, async, type, fromHost);
  // verify
  HIP_CHECK(hipStreamSynchronize(stream));
  verifyData(aPtr.first, testValue, data, type, memType);
  if (type == allocType::devRegistered) {
    freeStuff(aPtr.second, type);
  } else {
    freeStuff(aPtr.first, type);
  }
  if (fromHost) {
    delete[] fillerData;
  } else {
    HIP_CHECK(hipFree(fillerData));
  }
}

#if HT_AMD /* Disabled because frequency based wait is timing out on nvidia platforms */

TEST_CASE("Unit_hipMemcpySync") {
#if HT_AMD  // To be removed when EXSWCPHIPT-127 is fixed
  HipTest::HIP_SKIP_TEST("EXSWCPHIPT-127 - Sync behaviour differs on AMD and Nvidia");
  return;
#endif
  allocType type = GENERATE(allocType::deviceMalloc, allocType::hostMalloc, allocType::hostRegisted,
                            allocType::devRegistered);
  memType memcpy_type = memType::hipMem;
  MultiDData data;
  data.width = 1;

  doMemTest<char>(runMemcpyTests, type, memcpy_type, data);  // Uses long running kernel
}

TEST_CASE("Unit_hipMemcpy2DSync") {
#if HT_AMD
  HipTest::HIP_SKIP_TEST("EXSWCPHIPT-127 - Sync behaviour differs on AMD and Nvidia");
  return;
#endif
  allocType mallocType = GENERATE(allocType::deviceMalloc, allocType::hostMalloc,
                                  allocType::hostRegisted, allocType::devRegistered);

  memType memcpy_type = memType::hipMem2D;
  MultiDData data;
  data.width = 1;
  data.height = 1;

  doMemTest<char>(runMemcpyTests, mallocType, memcpy_type, data);
}

TEST_CASE("Unit_hipMemcpy3DSync") {
#if HT_AMD
  HipTest::HIP_SKIP_TEST("EXSWCPHIPT-127 - Sync behaviour differs on AMD and Nvidia");
  return;
#endif
  allocType mallocType = GENERATE(allocType::deviceMalloc, allocType::hostMalloc,
                                  allocType::hostRegisted, allocType::devRegistered);

  memType memcpy_type = memType::hipMem3D;
  MultiDData data;
  data.width = 1;
  data.height = 1;
  data.depth = 1;

  doMemTest<char>(runMemcpyTests, mallocType, memcpy_type, data);
}

#endif


text:
package org.inaetics.dronessimulator.discovery.api.discoverynode;

import org.inaetics.dronessimulator.discovery.api.DiscoveryPath;
import org.inaetics.dronessimulator.discovery.api.discoverynode.discoveryevent.AddedNode;
import org.inaetics.dronessimulator.discovery.api.discoverynode.discoveryevent.ChangedValue;
import org.inaetics.dronessimulator.discovery.api.discoverynode.discoveryevent.NodeEvent;
import org.inaetics.dronessimulator.discovery.api.discoverynode.discoveryevent.RemovedNode;
import org.inaetics.dronessimulator.discovery.api.tree.TreeNode;
import org.inaetics.dronessimulator.discovery.api.tree.Tuple;

import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * A node used in discovery. A tree of these nodes is built as a structure to keep the configuration and settings in.
 */
public class DiscoveryNode extends TreeNode<String, String, DiscoveryNode, DiscoveryPath> {
    /** List of the handlers for added node events. */
    private final List<NodeEventHandler<AddedNode>> addNodeHandlers;

    /** List of the handlers for changed value events. */
    private final List<NodeEventHandler<ChangedValue>> changeValueHandlers;

    /** List of the handlers for removed node events. */
    private final List<NodeEventHandler<RemovedNode>> removeNodeHandlers;

    /**
     * Instantiates a new node with the given id.
     * @param id The id of the node.
     */
    public DiscoveryNode(String id) {
        this(id, null, null);
    }

    /**
     * Instantiates a new node with the given id, parent and path.
     * @param id The id of the node.
     * @param parent The parent node.
     * @param path The discovery path of this node.
     */
    public DiscoveryNode(String id, DiscoveryNode parent, DiscoveryPath path) {
        super(id, parent, path);

        this.addNodeHandlers = new CopyOnWriteArrayList<>();
        this.changeValueHandlers = new CopyOnWriteArrayList<>();
        this.removeNodeHandlers = new CopyOnWriteArrayList<>();
    }

    @Override
    public DiscoveryNode getSelf() {
        return this;
    }

    @Override
    public void addChild(DiscoveryNode child) {
        child.setParent(this);
        super.addChild(child);
    }

    /**
     * Updates the tree of nodes and build the appropriate events.
     * Assumes the given storedNode id matches this id
     * @param storedNode The storage level node to compare against.
     * @return The list events for the changes.
     */
    public synchronized List<NodeEvent> updateTree(DiscoveryStoredNode storedNode) {
        List<NodeEvent> events = new ArrayList<>();

        List<DiscoveryStoredNode> storedChildren = storedNode.getChildren();
        Map<String, DiscoveryNode> children = this.getChildren();
        Set<String> untouched = new HashSet<>(children.keySet()); // Clone set. Otherwise, new keys get added when new elements are added

        // First add and/or update children
        for(DiscoveryStoredNode storedChild : storedChildren) {
            DiscoveryNode child = children.get(storedChild.getId());

            // Child already existed. Update
            if(child != null) {
                untouched.remove(storedChild.getId());
            // Child is new! Add
            } else {
                // Add child will set both AddNode and ChangedValue events
                Tuple<DiscoveryNode, List<NodeEvent>> addResult = this.addStoredNode(storedChild);
                child = addResult.getT1();
                events.addAll(addResult.getT2());
            }

            // Now update child regardless to also add/update directories
            events.addAll(child.updateTree(storedChild));
        }

        // Now remove the untouched
        for(String untouchedKey : untouched) {
            events.addAll(this.removeChildWithEvent(untouchedKey));
        }

        events.addAll(this.updateValues(storedNode));

        return events;
    }

    public Tuple<DiscoveryNode, List<NodeEvent>> addStoredNode(DiscoveryStoredNode storedNode) {
        List<ChangedValue> changedValueEvents = new ArrayList<>();
        List<NodeEvent> events = new ArrayList<>();

        DiscoveryNode newNode = new DiscoveryNode(storedNode.getId());

        // First set new values on node
        for(Map.Entry<String, String> value : storedNode.getValues().entrySet()) {
            newNode.setValueWithEvent(value.getKey(), value.getValue()).ifPresent(changedValueEvents::add);
        }

        // Node add as a child and trigger AddedNode event
        events.add(this.addChildWithEvent(newNode));

        // Now trigger ChangedValue events
        for(ChangedValue changedValueEvent : changedValueEvents) {
            this.bubbleValueChangeEvent(changedValueEvent);
        }

        events.addAll(changedValueEvents);

        return new Tuple<>(newNode, events);
    }

    /**
     * Updates the values for this node and build the appropriate events.
     * @param storedNode The storage level node to compare against.
     * @return The list of events for the changes.
     */
    public List<ChangedValue> updateValues(DiscoveryStoredNode storedNode) {
        List<ChangedValue> events = new ArrayList<>();
        Set<String> untouched = new HashSet<>(this.getValues().keySet());
        Map<String, String> storedValues = storedNode.getValues();

        // Set all values of storedNode in this
        for(Map.Entry<String, String> e : storedValues.entrySet()) {
            Optional<ChangedValue> event = this.setValueWithEvent(e.getKey(), e.getValue());

            event.ifPresent(events::add);
            untouched.remove(e.getKey());
        }

        // Now remove untouched
        for(String untouchedValueKey : untouched) {
            this.setValueWithEvent(untouchedValueKey, null).ifPresent(events::add);
        }

        return events;
    }

    /**
     * Replays the current state through the handler by sending added node events to the given handler for the nodes
     * that are currently present in the tree.
     * @param addHandler The handler to send the events to.
     */
    public void initializeAddHandler(NodeEventHandler<AddedNode> addHandler) {
        addHandler.handle(new AddedNode(this));

        for(Map.Entry<String, DiscoveryNode> e : this.getChildren().entrySet()) {
            e.getValue().initializeAddHandler(addHandler);
        }
    }

    /**
     * Adds a added node handler to this node.
     * @param addHandler The handler to add.
     */
    public void addAddNodeHandler(NodeEventHandler<AddedNode> addHandler) {
        this.addNodeHandlers.add(addHandler);
    }

    /**
     * Replays the current state through the handler by sending changed value events to the given handler for the keys
     * and values that are currently present in this node.
     * @param changedValueHandler The handler to send the events to.
     */
    public void initializeChangeHandler(NodeEventHandler<ChangedValue> changedValueHandler) {
        // First handle all changes for the values of this node
        for(Map.Entry<String, String> e : this.getValues().entrySet()) {
            if(e.getValue() != null) {
                changedValueHandler.handle(new ChangedValue(this, e.getKey(), null, e.getValue()));
            }
        }

        // Now handle all changes for the values of the children
        for(Map.Entry<String, DiscoveryNode> e : this.getChildren().entrySet()) {
            e.getValue().initializeChangeHandler(changedValueHandler);
        }
    }

    /**
     * Adds a changed value handler to this node.
     * @param changeHandler The handler to add.
     */
    public void addChangeValueHandler(NodeEventHandler<ChangedValue> changeHandler) {
        this.changeValueHandlers.add(changeHandler);
    }

    /**
     * Adds a removed node handler to this node.
     * @param removeHandler The handler to add.
     */
    public void addRemoveNodeHandler(NodeEventHandler<RemovedNode> removeHandler) {
        this.removeNodeHandlers.add(removeHandler);
    }

    /**
     * Sets a value on this node and sends the relevant event for the change if the new value is not equal to the old
     * value.
     * @param key The key to change.
     * @param newValue The (new) value for the given key.
     * @return An optional containing the created event, if an event was created.
     */
    public synchronized Optional<ChangedValue> setValueWithEvent(String key, String newValue) {
        ChangedValue event = null;
        String oldValue = this.getValue(key);

        // Key did not exist, value is new
        if(oldValue == null) {
            event = new ChangedValue(this, key, null, newValue);
        // Key already existed and newValue is different from oldValue
        } else if (!oldValue.equals(newValue)) {
            event = new ChangedValue(this, key, oldValue, newValue);
        }

        // Set new value regardless
        this.setValue(key, newValue);

        // Something changed, so notify everyone
        if(event != null) {
            this.bubbleValueChangeEvent(event);
        }

        return Optional.ofNullable(event);
    }

    /**
     * Sends the given changed value event to the changed value event handlers.
     * @param changedValue The event.
     */
    protected void bubbleValueChangeEvent(ChangedValue changedValue) {
        this.callHandlers(this.changeValueHandlers, changedValue);

        if(this.getParent() != null) {
            this.getParent().bubbleValueChangeEvent(changedValue);
        }
    }

    /**
     * Adds a new node to the tree as child of this node and sends an added node event to the relevant handlers.
     * @param newChild The node to add.
     * @return The created event.
     */
    public synchronized AddedNode addChildWithEvent(DiscoveryNode newChild) {
        // First add child to tree
        this.addChild(newChild);
        AddedNode result = new AddedNode(newChild);

        this.bubbleAddEvent(result);

        return result;
    }

    /**
     * Sends the given added node event to the added node event handlers.
     * @param addNode The event.
     */
    protected void bubbleAddEvent(AddedNode addNode) {
        this.callHandlers(this.addNodeHandlers, addNode);

        if(this.getParent() != null) {
            this.getParent().bubbleAddEvent(addNode);
        }
    }

    /**
     * Removes the child node with the given id recursively from the tree and sends removed node events for the removed
     * nodes to the relevant handlers.
     * @param id The id of the node to remove.
     * @return A list of the created events.
     */
    public synchronized List<NodeEvent> removeChildWithEvent(String id) {
        List<NodeEvent> removeEvents = new ArrayList<>();

        DiscoveryNode child = this.getChild(id);

        // First remove children's children if any
        for(DiscoveryNode grandChild : child.getChildren().values()) {
            removeEvents.addAll(child.removeChildWithEvent(grandChild.getId()));
        }

        // Unset values
        for(String key : child.getValues().keySet()) {
            child.setValueWithEvent(key, null).ifPresent(removeEvents::add);
        }

        // Now remove child from tree
        this.removeChild(id);

        RemovedNode result = new RemovedNode(child);
        removeEvents.add(result);
        this.bubbleRemoveEvent(result);

        return removeEvents;
    }

    /**
     * Sends the given removed node event to the removed node event handlers.
     * @param removedNode The event.
     */
    protected void bubbleRemoveEvent(RemovedNode removedNode) {
        this.callHandlers(this.removeNodeHandlers, removedNode);

        if (this.getParent() != null) {
            this.getParent().bubbleRemoveEvent(removedNode);
        }
    }

    /**
     * Calls the given handlers with the given event.
     * @param handlers The handlers to call.
     * @param toHandle The event to pass to the handlers.
     */
    private <H extends NodeEvent> void callHandlers(List<NodeEventHandler<H>> handlers, H toHandle) {
        handlers.forEach((handler) -> handler.handle(toHandle));
    }
}


text:
require 'rubygems'
require 'json'
require 'net/ssh'
require 'net/sftp'
#require 'fastlane_core'
#require 'fastlane_core/languages'

require_relative 'options'

module AppRepo
  # rubocop:disable Metrics/ClassLength

  # Responsible for performing the SFTP operation
  class Uploader
    attr_accessor :options

    #
    # These want to be an input parameters:
    #

    attr_accessor :host
    attr_accessor :user
    attr_accessor :password
    attr_accessor :rsa_keypath
    attr_accessor :ipa_path
    attr_accessor :manifest_path
    attr_accessor :appcode

    # rubocop:disable Metrics/AbcSize
    # rubocop:disable Metrics/MethodLength
    def initialize(options)
      self.options = options unless options.nil?
      self.host = options[:repo_url] # 'repo.teacloud.net'
      self.user = options[:repo_user]
      self.password = options[:repo_password]
      self.rsa_keypath = options[:repo_key] # '../assets/circle.key'
      self.ipa_path = options[:ipa] # '../sampleapp.ipa'
      self.manifest_path = options[:manifest_path] # '../assets/example_manifest.json'
      self.appcode = options[:appcode]

      # AppRepo::Uploader.new.run!
      # FastlaneCore::PrintTable.print_values(config: nil , hide_keys: [:app],
      # mask_keys: ['app_review_information.demo_password'],
      # title: "deliver #{AppRepo::VERSION} Summary") # options
    end

    #
    # Upload IPA & manifest
    #

    # rubocop:disable Metrics/AbcSize
    # rubocop:disable Metrics/MethodLength
    def upload
      # Login & Upload IPA with metadata using RSA key or username/password
      FastlaneCore::UI.message('upload...')

      if host.nil? || user.nil?
        FastlaneCore::UI.user_error('repo_url, repo_user and repo_pasdword or repo_key must be set on upload')
        return false
      end

      if rsa_keypath
        rsa_key = load_rsa_key(rsa_keypath)
        if rsa_key.nil?
          FastlaneCore::UI.user_error('Failed to load RSA key... ' + options[:rsa_keypath])
        end
      end

      success = false
      if !rsa_key.nil?
        FastlaneCore::UI.message('Logging in with RSA key...')
        Net::SSH.start(host, user, key_data: rsa_key, keys_only: true) do |ssh|
          FastlaneCore::UI.message('Uploading IPA & Manifest...')
          success = ssh_sftp_upload(ssh, ipa_path, manifest_path)
        end
      else
        FastlaneCore::UI.message('Logging in with username/password...')
        Net::SSH.start(host, user, password: password) do |ssh|
          FastlaneCore::UI.message('Uploading IPA & Manifest...')
          success = ssh_sftp_upload(ssh, ipa_path, manifest_path)
        end
      end
      success
    end

    #
    # Download metadata only
    #

    # rubocop:disable Metrics/AbcSize
    # rubocop:disable Metrics/MethodLength
    def download_manifest_only
      FastlaneCore::UI.message('download_manifest_only...')
      rsa_key = load_rsa_key(rsa_keypath)
      success = true
      if !rsa_key.nil?
        FastlaneCore::UI.message('Logging in with RSA key for download...')
        Net::SSH.start(host, user, key_data: rsa_key, keys_only: true) do |ssh|
          FastlaneCore::UI.message('Uploading UPA & Manifest...')
          success = ssh_sftp_download(ssh, manifest_path)
        end
      else
        FastlaneCore::UI.message('Logging in for download...')
        Net::SSH.start(host, user, password: password) do |ssh|
          FastlaneCore::UI.message('Uploading UPA & Manifest...')
          success = ssh_sftp_download(ssh, manifest_path)
        end
      end
      success
    end

    private

    def ssh_sftp_download(ssh, _manifest_path)
      ssh.sftp.connect do |sftp|
        FastlaneCore::UI.message('Fetching remote manifest...')
        manifest = download_manifest(sftp)
        puts '********************************************************'
        puts JSON.pretty_generate(manifest)
        puts '********************************************************'
        FastlaneCore::UI.success('Successfully fetched manifest')
        FastlaneCore::UI.command_output('TODO: Processing manifest not implemented.')
      end
    end

    def ssh_sftp_upload(ssh, local_ipa_path, manifest_path)
      ssh.sftp.connect do |sftp|
        break unless check_ipa(local_ipa_path)
        check_appcode(sftp, appcode)
        path = remote_path(appcode)
        manifest = download_manifest(sftp)
        puts JSON.pretty_generate(manifest) unless manifest.nil?
        bump_ipa(sftp, local_ipa_path, appcode)
        remote_ipa_path = get_remote_ipa_path(local_ipa_path, appcode)
        upload_ipa(sftp, local_ipa_path, remote_ipa_path)
        upload_manifest(sftp, manifest_path, remote_manifest_path(appcode))
        # Lists the entries in a directory for verification
        sftp.dir.foreach(path) do |entry|
          FastlaneCore::UI.message(entry.longname)
        end
      end
    end

    # Check IPA existence locally
    #
    # @param local_ipa_path
    def check_ipa(local_ipa_path)
      if File.exist?(local_ipa_path)
        FastlaneCore::UI.important('IPA found at ' + local_ipa_path)
        return true
      else
        FastlaneCore::UI.verbose('IPA at given path does not exist yet.')
        return false
      end
    end

    # Private methods - Remote Operations

    # Checks/creates remote APPCODE directory
    # @param sftp
    # @param [String] appcode
    def check_appcode(sftp, appcode)
      path = remote_path(appcode)
      FastlaneCore::UI.message('Checking APPCODE')
      remote_mkdir(sftp, path)
    end

    # Checks/renames remote IPA
    #
    # @params sftp
    # @params [String] local_ipa_path
    def bump_ipa(sftp, local, appcode)
      remote = get_remote_ipa_path(local, appcode)
      FastlaneCore::UI.message('Checking remote IPA')
      begin
        sftp.stat!(remote) do |response|
          if response.ok?
            begin
              sftp.rename!(remote, remote + '.bak')
            rescue
              begin
                sftp.remove(remote + '.bak') # may fail if not existent
                FastlaneCore::UI.message('Removed ' + remote + '.bak')
              rescue
                sftp.rename!(remote, remote + '.bak')
                FastlaneCore::UI.message('Bumped to ' + remote + '.bak')
              end
            end
          end
        end
      rescue
        FastlaneCore::UI.message('No previous IPA found.')
      end
    end

    # Downloads remote manifest, self.appcode required by options.
    #
    # @param sftp
    # @param [String] remote_path
    # @returns [JSON] json or nil
    def download_manifest(sftp)
      FastlaneCore::UI.message('Checking remote Manifest')
      json = nil
      remote_manifest_path = remote_manifest_path(appcode)
      begin
        sftp.stat!(remote_manifest_path) do |response|
          if response.ok?
            FastlaneCore::UI.success('Loading remote manifest:')
            manifest = sftp.download!(remote_manifest_path)
            json = JSON.parse(manifest)
          end
        end
      rescue
        FastlaneCore::UI.message('No previous Manifest found')
      end
      json
    end

    # Upload current IPA
    #
    # @param sftp
    # @param [String] local_ipa_path
    # @param [String] remote_ipa_path
    def upload_ipa(sftp, local_ipa_path, remote_ipa_path)
      msg = "[Uploading IPA] #{local_ipa_path} to #{remote_ipa_path}"
      FastlaneCore::UI.message(msg)
      result = sftp.upload!(local_ipa_path, remote_ipa_path) do |event, _uploader, *_args|
        case event
        when :open then
          putc '.'
        when :put then
          putc '.'
          $stdout.flush
        when :close then
          puts "\n"
        when :finish then
          FastlaneCore::UI.success('IPA upload successful')
        end
      end
    end

    # Upload current manifest.json
    #
    # @param sftp
    # @param [String] manifest_path
    # @param [String] remote_manifest_path
    def upload_manifest(sftp, local_path, remote_path)
      msg = '[Uploading Manifest] ' + local_path + ' to ' + remote_path
      FastlaneCore::UI.message(msg)
      result = sftp.upload!(local_path, remote_path) do |event, _uploader, *_args|
        case event
        when :finish then
          FastlaneCore::UI.success('Manifest upload successful')
        end
      end
    end

    def get_remote_ipa_path(local_ipa_path, appcode)
      remote_path(appcode) + File.basename(local_ipa_path)
    end

    def remote_path(appcode)
      generate_remote_path + appcode + '/'
    end

    def remote_manifest_path(appcode)
      remote_manifest_path = remote_path(appcode) + 'manifest.json'
    end

    def generate_remote_path
      '/home/' + user + '/repo/apps/'
    end

    def remote_mkdir(sftp, remote_path)
      sftp.mkdir remote_path
    rescue Net::SFTP::StatusException => e
      raise if e.code != 11
      msg = "Remote dir #{remote_path} exists."
      FastlaneCore::UI.message(msg)
    end

    # Private methods - Local Operations

    def load_rsa_key(rsa_keypath)
      File.open(rsa_keypath, 'r') do |file|
        rsa_key = nil
        rsa_key = [file.read]
        if !rsa_key.nil?
          FastlaneCore::UI.success('Successfully loaded RSA key...')
        else
          FastlaneCore::UI.user_error!('Failed to load RSA key...')
        end
        rsa_key
      end
    end
  end
end


text:
<?php

declare(strict_types=1);

namespace IssetBV\PushNotification\Type\Apple\Message;

use IssetBV\PushNotification\Core\Message\MessageEnvelopeAbstract;

/**
 * Class AppleMessageEnvelope.
 */
class AppleMessageEnvelope extends MessageEnvelopeAbstract
{
    /**
     * AppleMessageEnvelope constructor.
     *
     * @param AppleMessage $message
     */
    public function __construct(AppleMessage $message)
    {
        parent::__construct($message);
    }
}


text:
import path
path.dummy()
import t10471.yahoo.finance.stock.daily.html.getter as getter
import t10471.yahoo.finance.stock.daily.html.parser as parser
import t10471.model.register as register
import datetime

class Daily(object):

    def __init__(self):
        url = 'http://info.finance.yahoo.co.jp/history/?code=%s.%s&sy=%s&sm=%s&sd=%s&ey=%s&em=%s&ed=%s&tm=d'
        self.getter = getter.HtmlGetter(url)
        self.register = register.Register()
        self.parser = parser.HtmlParser(self.register)
        self.today = datetime.datetime.today()

    def run(self):
        today = self.today.strftime("%Y/%m/%d")
        for stock in self.register.getStocks():
            print(stock)
            stock_data = self.register.getTodayStockDate(stock, today)
            if stock_data.count() > 0:
                continue
            delta = 0
            if not self.register.countSotckData(stock):
                delta = 150
            for soup in self.getter.get(stock, self.today, delta):
                self.parser.setStock(stock)
                for rg in self.parser.parse(soup):
                    rg.registerStockDate()
        self.register.commit()

if __name__ == '__main__':
    Daily().run()


text:
using System.Collections.Generic;
using SchoolSystem.Framework.Core.Commands.Contracts;
using SchoolSystem.Framework.Db;
using System;

namespace SchoolSystem.Framework.Core.Commands
{
    public class StudentListMarksCommand : ICommand
    {
        private readonly IDbProvider dbProvider;

        public StudentListMarksCommand(IDbProvider dbProvider)
        {
            if (dbProvider == null)
            {
                throw new ArgumentNullException("Db provider can not be null!");
            }

            this.dbProvider = dbProvider;
        }
        public string Execute(IList<string> parameters)
        {
            var studentId = int.Parse(parameters[0]);
            var student = this.dbProvider.GetStudentById(studentId);
            return student.ListMarks();
        }
    }
}


text:
> This npm module is a building block for the [monaco-editor](https://www.npmjs.com/package/monaco-editor)
npm module and unless you are doing something special (e.g. authoring a monaco editor language that can be shipped
and consumed independently), it is best to consume the [monaco-editor](https://www.npmjs.com/package/monaco-editor) module
that contains this module and adds languages supports.

The Monaco Editor is the code editor that powers [VS Code](https://github.com/microsoft/vscode). Here is a good page describing some [editor features](https://code.visualstudio.com/docs/editor/editingevolved).

This npm module contains the core editor functionality, as it comes from the [vscode repository](https://github.com/microsoft/vscode).

## License
[MIT](https://github.com/microsoft/vscode/blob/main/LICENSE.txt)


text:
<?php

/*
* <auto-generated>
*     This code was generated by a Codezu.
*
*     Changes to this file may cause incorrect behavior and will be lost if
*     the code is regenerated.
* </auto-generated>
*/

namespace Mozu\Api\Contracts\Customer;

/**
*	The authentication information required to generate an authentication ticket for a customer account.
*/
class CustomerUserAuthInfo
{
	/**
	*The write-only password for the customer account.
	*/
	public $password;

	/**
	*The user name associated with the user profile. The customer uses the user name to access the account.
	*/
	public $username;

}

?>


text:
package org.jcodec.movtool;

import static java.lang.Integer.parseInt;
import static java.lang.Math.max;
import static org.jcodec.common.io.NIOUtils.readableChannel;
import static org.jcodec.common.io.NIOUtils.writableChannel;
import static org.jcodec.movtool.Util.forceEditList;

import org.jcodec.common.JCodecUtil2;
import org.jcodec.common.StringUtils;
import org.jcodec.common.io.NIOUtils;
import org.jcodec.common.io.SeekableByteChannel;
import org.jcodec.containers.mp4.BoxFactory;
import org.jcodec.containers.mp4.MP4Util;
import org.jcodec.containers.mp4.MP4Util.Movie;
import org.jcodec.containers.mp4.boxes.Edit;
import org.jcodec.containers.mp4.boxes.MovieBox;
import org.jcodec.containers.mp4.boxes.NodeBox;
import org.jcodec.containers.mp4.boxes.TrakBox;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;

/**
 * This class is part of JCodec ( www.jcodec.org ) This software is distributed
 * under FreeBSD License
 *
 * Cut on ref movies
 *
 * @author The JCodec project
 *
 */
public class Cut {
    public static void main1(String[] args) throws Exception {
        if (args.length < 1) {
            System.out
                    .println("Syntax: cut [-command arg]...[-command arg] [-self] <movie file>\n"
                            + "\tCreates a reference movie out of the file and applies a set of changes specified by the commands to it.");
            System.exit(-1);
        }

        List<Slice> slices = new ArrayList<Slice>();
        List<String> sliceNames = new ArrayList<String>();

        boolean selfContained = false;
        int shift = 0;
        while (true) {
            if ("-cut".equals(args[shift])) {
                String[] pt = StringUtils.splitS(args[shift + 1], ":");
                slices.add(new Slice(parseInt(pt[0]), parseInt(pt[1])));
                if (pt.length > 2)
                    sliceNames.add(pt[2]);
                else
                    sliceNames.add(null);
                shift += 2;
            } else if ("-self".equals(args[shift])) {
                ++shift;
                selfContained = true;
            } else
                break;
        }
        File source = new File(args[shift]);

        SeekableByteChannel input = null;
        SeekableByteChannel out = null;
        List<SeekableByteChannel> outs = new ArrayList<SeekableByteChannel>();
        try {
            input = readableChannel(source);
            Movie movie = MP4Util.createRefFullMovie(input, "file://" + source.getCanonicalPath());
            List<Movie> slicesMovs;
            if (!selfContained) {
                out = writableChannel(new File(source.getParentFile(), JCodecUtil2.removeExtension(source.getName())
                        + ".ref.mov"));
                slicesMovs = new Cut().cut(movie, slices);
                MP4Util.writeFullMovie(out, movie);
            } else {
                out = writableChannel(new File(source.getParentFile(), JCodecUtil2.removeExtension(source.getName())
                        + ".self.mov"));
                slicesMovs = new Cut().cut(movie, slices);
                new Strip().stripToChunks(movie.getMoov());
                new Flatten().flattenChannel(movie, out);
            }
            saveSlices(slicesMovs, sliceNames, source.getParentFile());
        } finally {
            if (input != null)
                input.close();
            if (out != null)
                out.close();
            for (SeekableByteChannel o : outs) {
                o.close();
            }
        }
    }

    private static void saveSlices(List<Movie> slices, List<String> names, File parentFile) throws IOException {
        for (int i = 0; i < slices.size(); i++) {
            if (names.get(i) == null)
                continue;
            SeekableByteChannel out = null;
            try {
                out = writableChannel(new File(parentFile, names.get(i)));
                MP4Util.writeFullMovie(out, slices.get(i));
            } finally {
                NIOUtils.closeQuietly(out);
            }
        }
    }

    public static class Slice {
        private final double inSec;
        private final double outSec;

        public Slice(double _in, double out) {
            super();
            this.inSec = _in;
            this.outSec = out;
        }
    }

    public List<Movie> cut(Movie movie, List<Slice> commands) {
        MovieBox moov = movie.getMoov();

        TrakBox videoTrack = moov.getVideoTrack();
        if (videoTrack != null && videoTrack.getTimescale() != moov.getTimescale())
            moov.fixTimescale(videoTrack.getTimescale());

        TrakBox[] tracks = moov.getTracks();
        for (TrakBox trakBox : tracks) {
            forceEditList(moov, trakBox);
            for (Slice cut : commands) {
                split(cut.inSec, moov, trakBox);
                split(cut.outSec, moov, trakBox);
            }
        }
        ArrayList<Movie> result = new ArrayList<Movie>();
        for (Slice cut : commands) {
            MovieBox clone = (MovieBox) NodeBox.cloneBox(moov, 16 * 1024 * 1024, BoxFactory.getDefault());
            for (TrakBox trakBox : clone.getTracks()) {
                selectInner(trakBox.getEdits(), cut, moov);
            }
            result.add(new Movie(movie.getFtyp(), clone));
        }

        long movDuration = 0;
        for (TrakBox trakBox : moov.getTracks()) {
            selectOuter(trakBox.getEdits(), commands, moov);
            trakBox.setEdits(trakBox.getEdits());
            movDuration = max(movDuration, trakBox.getDuration());
        }
        moov.setDuration(movDuration);

        return result;
    }

    private void selectOuter(List<Edit> edits, List<Slice> commands, MovieBox movie) {
        long[] inMv = new long[commands.size()];
        long[] outMv = new long[commands.size()];
        for (int i = 0; i < commands.size(); i++) {
            inMv[i] = (long) (commands.get(i).inSec * movie.getTimescale());
            outMv[i] = (long) (commands.get(i).outSec * movie.getTimescale());
        }
        long editStartMv = 0;
        ListIterator<Edit> lit = edits.listIterator();
        while (lit.hasNext()) {
            Edit edit = lit.next();
            for (int i = 0; i < inMv.length; i++) {
                if (editStartMv + edit.getDuration() > inMv[i] && editStartMv < outMv[i])
                    lit.remove();
            }
            editStartMv += edit.getDuration();
        }
    }

    private void selectInner(List<Edit> edits, Slice cut, MovieBox movie) {
        long inMv = (long) (movie.getTimescale() * cut.inSec);
        long outMv = (long) (movie.getTimescale() * cut.outSec);

        long editStart = 0;
        ListIterator<Edit> lit = edits.listIterator();
        while (lit.hasNext()) {
            Edit edit = lit.next();
            if (editStart + edit.getDuration() <= inMv || editStart >= outMv)
                lit.remove();
            editStart += edit.getDuration();
        }
    }

    private void split(double sec, MovieBox movie, TrakBox trakBox) {
        Util.split(movie, trakBox, (long) (sec * movie.getTimescale()));
    }
}


text:
<?php
namespace Flux;

// Add these import statements:
use Flux\Model\Flux;
use Flux\Model\FluxTable;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;

class Module{

			public function getAutoloaderConfig(){
					return array(
							'Zend\Loader\ClassMapAutoloader' => array(
									__DIR__ . '/autoload_classmap.php',
							),
							'Zend\Loader\StandardAutoloader' => array(
									'namespaces' => array(
											__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
									),
							),
					);
			}

			public function getConfig(){
					return include __DIR__ . '/config/module.config.php';
			}

     public function getServiceConfig()
     {
         return array(
             'factories' => array(
                     'Flux\Model\FluxTable' =>  function($sm) {
                     $tableGateway = $sm->get('FluxTableGateway');
                     $table = new FluxTable($tableGateway);
                     return $table;
                 },
                     'FluxTableGateway' => function ($sm) {
                     $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                     $resultSetPrototype = new ResultSet();
                     $resultSetPrototype -> setArrayObjectPrototype(new Flux());
                     return new TableGateway('flux', $dbAdapter, null, $resultSetPrototype);
                 },
             ),
         );
     }
 }


text:
"use strict";

module.exports = {
    /**
     * A writable stream where phridge will pipe phantomjs' stdout messages.
     *
     * @type {stream.Writable}
     * @default process.stdout
     */
    stdout: process.stdout,

    /**
     * A writable stream where phridge will pipe phantomjs' stderr messages.
     *
     * @type {stream.Writable}
     * @default process.stderr
     */
    stderr: process.stderr
};


text:
package org.fusesource.gateway.loadbalancer;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * Implements a sticky load balancer where a unique client ID String is requested from the
 * {@link org.fusesource.gateway.loadbalancer.ClientRequestFacade} and used to keep track of which
 * service was used last time and to use that if its possible and keep a cache of requests to
 */
public class StickyLoadBalancer<T> implements LoadBalancer<T> {
    private final LoadBalancer<T> firstRequestLoadBalancer;
    private final int maximumCacheSize;
    private final Map<String, T> requestCache;

    public StickyLoadBalancer() {
        this(LoadBalancers.STICKY_LOAD_BALANCER_DEFAULT_CACHE_SIZE);
    }

    public StickyLoadBalancer(int maximumCacheSize) {
        this(maximumCacheSize, new RoundRobinLoadBalancer<T>());
    }

    public StickyLoadBalancer(int maximumCacheSize, LoadBalancer<T> firstRequestLoadBalancer) {
        this.firstRequestLoadBalancer = firstRequestLoadBalancer;
        this.maximumCacheSize = maximumCacheSize;
        this.requestCache = new LinkedHashMap(maximumCacheSize + 1, .75F, true) {
            // This method is called just after a new entry has been added
            public boolean removeEldestEntry(Map.Entry eldest) {
                return size() > StickyLoadBalancer.this.maximumCacheSize;
            }
        };
    }

    @Override
    public String toString() {
        return "StickyLoadBalancer{" +
                "maximumCacheSize=" + maximumCacheSize +
                '}';
    }

    @Override
    public T choose(List<T> services, ClientRequestFacade requestFacade) {
        String clientKey = requestFacade.getClientRequestKey();
        T answer;
        synchronized (requestCache) {
            answer = requestCache.get(clientKey);
            if (answer == null) {
                answer = firstRequestLoadBalancer.choose(services, requestFacade);
                if (answer != null) {
                    requestCache.put(clientKey, answer);
                }
            }
        }
        return answer;
    }

    /**
     * Clears the cache of request client IDs to the bound service
     */
    public void flush() {
        synchronized (requestCache) {
            requestCache.clear();
        }
    }
}


text:
require_relative '../../../spec_helper'
require_relative '../fixtures/classes'
require_relative 'shared/basic'
require_relative 'shared/string'
require_relative 'shared/taint'

describe "Array#pack with format 'A'" do
  it_behaves_like :array_pack_basic, 'A'
  it_behaves_like :array_pack_basic_non_float, 'A'
  it_behaves_like :array_pack_no_platform, 'A'
  it_behaves_like :array_pack_string, 'A'
  it_behaves_like :array_pack_taint, 'A'

  it "adds all the bytes to the output when passed the '*' modifier" do
    ["abc"].pack("A*").should == "abc"
  end

  it "padds the output with spaces when the count exceeds the size of the String" do
    ["abc"].pack("A6").should == "abc   "
  end

  it "adds a space when the value is nil" do
    [nil].pack("A").should == " "
  end

  it "pads the output with spaces when the value is nil" do
    [nil].pack("A3").should == "   "
  end

  it "does not pad with spaces when passed the '*' modifier and the value is nil" do
    [nil].pack("A*").should == ""
  end
end

describe "Array#pack with format 'a'" do
  it_behaves_like :array_pack_basic, 'a'
  it_behaves_like :array_pack_basic_non_float, 'a'
  it_behaves_like :array_pack_no_platform, 'a'
  it_behaves_like :array_pack_string, 'a'
  it_behaves_like :array_pack_taint, 'a'

  it "adds all the bytes to the output when passed the '*' modifier" do
    ["abc"].pack("a*").should == "abc"
  end

  it "padds the output with NULL bytes when the count exceeds the size of the String" do
    ["abc"].pack("a6").should == "abc\x00\x00\x00"
  end

  it "adds a NULL byte when the value is nil" do
    [nil].pack("a").should == "\x00"
  end

  it "pads the output with NULL bytes when the value is nil" do
    [nil].pack("a3").should == "\x00\x00\x00"
  end

  it "does not pad with NULL bytes when passed the '*' modifier and the value is nil" do
    [nil].pack("a*").should == ""
  end
end


text:
package gov.nasa.arc.mct.chronology.event;

import gov.nasa.arc.mct.chronology.ChronologyDomain;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;

public class UNIXTimeInstant implements ChronologicalInstant {
	public static final String     DATE_FORMAT_STRING = "yyyy/DDD/HH:mm:ss";
	public static final DateFormat DATE_FORMAT = new SimpleDateFormat(DATE_FORMAT_STRING);
	static { DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); }

	// Used to control the actual values of slices
	private static final int[] MARK_HIERARCHY = { 1, //   1 second
		                                          5, // * 5 = 5 seconds
		                                          2, // * 2 = 10 seconds
		                                          6, // * 6 = 1 minute
		                                          5, // * 5 = 5 minutes
		                                          2, // * 2 = 10 minutes
		                                          6, // * 6 = 1 hour
		                                          3, // * 3 = 3 hours
		                                          2, // * 2 = 6 hours
		                                          4  // * 4 = 1 day
		                                          }; // Thereafter: Times ten!
	private static final int MINIMUM_INCREMENT = 1000;

	private long   timeMillis;

	public UNIXTimeInstant(long millis) {
		timeMillis = millis;
	}

	public long getTimeMillis() {
		return timeMillis;
	}

	public String toString() {
		return DATE_FORMAT.format(new Date(timeMillis));
	}

	@Override
	public int hashCode() {
		return Long.valueOf(timeMillis).intValue();
	}

	private static int getHierarchySize(int index) {
		if (index < MARK_HIERARCHY.length) return MARK_HIERARCHY[index];
		else return (index - MARK_HIERARCHY.length) % 2 == 0 ? 5 : 2;
	}

	private static final Comparator<UNIXTimeInstant> COMPARATOR =
		new Comparator<UNIXTimeInstant>() {
			@Override
			public int compare(UNIXTimeInstant o1, UNIXTimeInstant o2) {
				return Long.signum(o1.getTimeMillis() - o2.getTimeMillis());
			}
		};

	public static final ChronologyDomain<UNIXTimeInstant> DOMAIN =
		new ChronologyDomain<UNIXTimeInstant>() {

			@Override
			public UNIXTimeInstant convertToInstant(String instant)
					throws ParseException {
				return new UNIXTimeInstant(DATE_FORMAT.parse(instant).getTime());
			}

			@Override
			public Comparator<UNIXTimeInstant> getComparator() {
				return COMPARATOR;
			}

			@Override
			public double locateBetween(UNIXTimeInstant instant,
					UNIXTimeInstant a, UNIXTimeInstant b) {
				return (double) (instant.getTimeMillis() - a.getTimeMillis()) /
				       (double) (b.getTimeMillis()       - a.getTimeMillis());
			}

			@Override
			public List<UNIXTimeInstant> slice(
					ChronologicalInterval<UNIXTimeInstant> interval, int slices) {
				long increment = MINIMUM_INCREMENT;
				long intervalSize = interval.getEnd().getTimeMillis() - interval.getStart().getTimeMillis();
				intervalSize /= slices;
				int rank = 0;
				while (increment < intervalSize) {
					increment *= getHierarchySize(rank++);
				}

				List<UNIXTimeInstant> sliceList = new ArrayList<UNIXTimeInstant>();
				long sliceTime = (interval.getStart().getTimeMillis() - interval.getStart().getTimeMillis() % increment) + increment;
				while (sliceTime < interval.getEnd().getTimeMillis()) {
					sliceList.add(new UNIXTimeInstant(sliceTime));
					sliceTime += increment;
				}

				return sliceList;
			}

			@Override
			public UNIXTimeInstant instantAt(
					ChronologicalInterval<UNIXTimeInstant> interval,
					double proportion) {
				long start = interval.getStart().getTimeMillis();
				long end   = interval.getEnd().getTimeMillis();
				return new UNIXTimeInstant((long) (start + (end-start) * proportion));
			}
		};

	@Override
	public ChronologyDomain<? extends ChronologicalInstant> getDomain() {
		return DOMAIN;
	}
}


text:
```
sudo apt-get install golang-go git

./script/bootstrap
```

That will place a git-lfs binary in the `bin/` directory. Copy the binary to a directory in your path:

```
sudo cp bin/git-lfs /usr/local/bin
```

Try it:

```
[949][rubiojr@octox] git lfs
git-lfs v0.0.1

[~]
[949][rubiojr@octox] git lfs init
git lfs initialized
```

### Installing the man pages

You'll need ruby and rubygems to install the `ronn` gem:

```
sudo apt-get install ruby build-essential
sudo gem install ronn
./script/man
sudo mkdir -p /usr/local/share/man/man1
sudo cp man/*.1 /usr/local/share/man/man1
```

`git help lfs` should show the git-lfs man pages now.


text:
<?php

namespace JMS\Serializer\Construction;

use Doctrine\Instantiator\Instantiator;
use JMS\Serializer\VisitorInterface;
use JMS\Serializer\Metadata\ClassMetadata;
use JMS\Serializer\DeserializationContext;

class UnserializeObjectConstructor implements ObjectConstructorInterface
{
    /** @var Instantiator  */
    private $instantiator;

    public function construct(VisitorInterface $visitor, ClassMetadata $metadata, $data, array $type, DeserializationContext $context)
    {
        return $this->getInstantiator()->instantiate($metadata->name);
    }

    /**
     * @return Instantiator
     */
    private function getInstantiator()
    {
        if (null == $this->instantiator) {
            $this->instantiator = new Instantiator();
        }

        return $this->instantiator;
    }
}


text:
namespace Microsoft.CSharp.RuntimeBinder.Semantics
{
    // ----------------------------------------------------------------------------
    //
    // NamespaceDeclaration
    //
    // NamespaceDeclaration - a symbol representing a declaration
    // of a namspace in the source.
    //
    // firstChild/firstChild->nextChild enumerates the
    // NSDECLs and AGGDECLs declared within this declaration.
    //
    // parent is the containing namespace declaration.
    //
    // Bag() is the namespace corresponding to this declaration.
    //
    // DeclNext() is the next declaration for the same namespace.
    // ----------------------------------------------------------------------------

    internal class NamespaceDeclaration : Declaration
    {
        public NamespaceSymbol Bag()
        {
            return bag.AsNamespaceSymbol();
        }

        public NamespaceSymbol NameSpace()
        {
            return bag.AsNamespaceSymbol();
        }
    }
}