text:
package Driver;

# ************************************************************
# Description   : Functionality to call a workspace or project creator
# Author        : Chad Elliott
# Create Date   : 5/28/2002
# ************************************************************

# ************************************************************
# Pragmas
# ************************************************************

use strict;

use Options;
use Parser;
use Version;
use ConfigParser;

use vars qw(@ISA);
@ISA = qw(Parser Options);

# ************************************************************
# Data Section
# ************************************************************

my $index     = 0;
my @progress  = ('|', '/', '-', '\\');
my %valid_cfg = ('command_line'     => 1,
                 'default_type'     => 1,
                 'dynamic_types'    => 1,
                 'includes'         => 1,
                 'logging'          => 1,
                 'main_functions'   => 1,
                 'verbose_ordering' => 1,
                );

# ************************************************************
# Subroutine Section
# ************************************************************

sub new {
  my $class    = shift;
  my $path     = shift;
  my $name     = shift;
  my @creators = @_;
  my $self = $class->SUPER::new();

  $self->{'path'}     = $path;
  $self->{'basepath'} = ::getBasePath();
  $self->{'name'}     = $name;
  $self->{'type'}     = (lc($self->{'name'}) eq 'mwc.pl' ?
                                'WorkspaceCreator' : 'ProjectCreator');
  $self->{'types'}    = {};
  $self->{'creators'} = \@creators;
  $self->{'reldefs'}  = {};
  $self->{'relorder'} = [];

  return $self;
}

sub locate_default_type {
  my $self = shift;
  my $name = lc(shift) . lc($self->{'type'}) . '.pm';
  my $fh = new FileHandle();

  foreach my $dir (@INC) {
    if (opendir($fh, $dir)) {
      foreach my $file (readdir($fh)) {
        if (lc($file) eq $name) {
          $file =~ s/\.pm$//;
          return $file;
        }
      }
      closedir($fh);
    }
  }

  return undef;
}

sub locate_dynamic_directories {
  my($self, $cfg, $label) = @_;
  my $dtypes = $cfg->get_value($label);

  if (defined $dtypes) {
    my $count = 0;
    my @directories;
    my @unprocessed = split(/\s*,\s*/, $cfg->get_unprocessed($label));
    foreach my $dir (split(/\s*,\s*/, $dtypes)) {
      if (-d $dir) {
        if (-d "$dir/modules" || -d "$dir/config" || -d "$dir/templates") {
          push(@directories, $dir);
        }
      }
      elsif (!(defined $unprocessed[$count] &&
               $unprocessed[$count] =~ s/\$[\(\w\)]+//g &&
               $unprocessed[$count] eq $dir)) {
        $self->diagnostic("'$label' directory $dir not found.");
      }
      $count++;
    }
    return \@directories;
  }

  return undef;
}

sub add_dynamic_creators {
  my($self, $dirs) = @_;
  my $type = $self->{'type'};

  foreach my $dir (@$dirs) {
    my $fh = new FileHandle();
    if (opendir($fh, "$dir/modules")) {
      foreach my $file (readdir($fh)) {
        if ($file =~ /(.+$type)\.pm$/i) {
          my $name = $1;
          if ($^O eq 'VMS') {
            my $fh = new FileHandle();
            if (open($fh, $dir . "/modules/" . $file)) {
              my $line = <$fh>;
              if ($line =~ /^\s*package\s+(.+);/) {
                $name = $1;
              }
              close($fh);
            }
          }
          $self->debug("Pulling in $name");
          push(@{$self->{'creators'}}, $name);
        }
      }
      closedir($fh);
    }
  }
}

sub parse_line {
  my($self, $ih, $line) = @_;
  my $status = 1;
  my $errorString;

  if ($line eq '') {
  }
  elsif ($line =~ /^([\w\*]+)(\s*,\s*(.*))?$/) {
    my $name  = $1;
    my $value = $3;
    if (defined $value) {
      $value =~ s/^\s+//;
      $value =~ s/\s+$//;
    }
    if ($name =~ s/\*/.*/g) {
      foreach my $key (keys %ENV) {
        if ($key =~ /^$name$/ && !exists $self->{'reldefs'}->{$key}) {
          ## Put this value at the front since it doesn't need
          ## to be built up from anything else.  It is a stand-alone
          ## relative definition.
          $self->{'reldefs'}->{$key} = undef;
          unshift(@{$self->{'relorder'}}, $key);
        }
      }
    }
    else {
      $self->{'reldefs'}->{$name} = $value;
      if (defined $value) {
        ## This relative definition may need to be built up from an
        ## existing value, so it needs to be put at the end.
        push(@{$self->{'relorder'}}, $name);
      }
      else {
        ## Put this value at the front since it doesn't need
        ## to be built up from anything else.  It is a stand-alone
        ## relative definition.
        unshift(@{$self->{'relorder'}}, $name);
      }
    }
  }
  else {
    $status = 0;
    $errorString = "Unrecognized line: $line";
  }

  return $status, $errorString;
}

sub optionError {
  my($self, $line) = @_;

  $self->printUsage($line, $self->{'name'}, Version::get(),
                    keys %{$self->{'types'}});
  exit(defined $line ? 1 : 0);
}

sub find_file {
  my($self, $includes, $file) = @_;

  foreach my $inc (@$includes) {
    if (-r $inc . '/' . $file) {
      $self->debug("$file found in $inc");
      return $inc . '/' . $file;
    }
  }
  return undef;
}

sub determine_cfg_file {
  my($self, $cfg, $odir) = @_;
  my $ci = $self->case_insensitive();

  $odir = lc($odir) if ($ci);
  foreach my $name (@{$cfg->get_names()}) {
    my $value = $cfg->get_value($name);
    if (index($odir, ($ci ? lc($name) : $name)) == 0) {
      $self->warning("$value does not exist.") if (!-d $value);
      my $cfgfile = $value . '/MPC.cfg';
      return $cfgfile if (-e $cfgfile);
    }
  }

  return undef;
}

sub run {
  my $self = shift;
  my @args = @_;
  my $cfgfile;

  ## Save the original directory outside of the loop
  ## to avoid calling it multiple times.
  my $orig_dir = $self->getcwd();

  ## Read the code base config file from the config directory
  ## under $MPC_ROOT
  my $cbcfg  = new ConfigParser();
  my $cbfile = "$self->{'basepath'}/config/base.cfg";
  if (-r $cbfile) {
    my($status, $error) = $cbcfg->read_file($cbfile);
    if (!$status) {
      $self->error("$error at line " . $cbcfg->get_line_number() .
                   " of $cbfile");
      return 1;
    }
    $cfgfile = $self->determine_cfg_file($cbcfg, $orig_dir);
  }

  ## If no MPC config file was found and
  ## there is one in the config directory, we will use that.
  if (!defined $cfgfile) {
    $cfgfile = $self->{'path'} . '/config/MPC.cfg';
    $cfgfile = $self->{'basepath'} . '/config/MPC.cfg' if (!-e $cfgfile);
    $cfgfile = undef if (!-e $cfgfile);
  }

  ## Read the MPC config file
  my $cfg = new ConfigParser(\%valid_cfg);
  if (defined $cfgfile) {
    my $ellipses = $cfgfile;
    $ellipses =~ s!.*(/[^/]+/[^/]+/[^/]+/[^/]+/[^/]+/[^/]+)!...$1!;
    $self->diagnostic("Using $ellipses");
    my($status, $error) = $cfg->read_file($cfgfile);
    if (!$status) {
      $self->error("$error at line " . $cfg->get_line_number() .
                   " of $cfgfile");
      return 1;
    }
    OutputMessage::set_levels($cfg->get_value('logging'));
  }

  $self->debug("CMD: $0 @ARGV");

  ## After we read the config file, see if the user has provided
  ## dynamic types
  my $dynamic = $self->locate_dynamic_directories($cfg, 'dynamic_types');
  if (defined $dynamic) {
    ## If so, add in the creators found in the dynamic directories
    $self->add_dynamic_creators($dynamic);

    ## Add the each dynamic path to the include paths
    foreach my $dynpath (@$dynamic) {
      unshift(@INC, $dynpath . '/modules');
      unshift(@args, '-include', "$dynpath/config",
                     '-include', "$dynpath/templates");
    }
  }

  ## Add in the creators found in the main MPC/modules directory
  $self->add_dynamic_creators([$self->{'basepath'}]);

  ## Dynamically load in each perl module and set up
  ## the type tags and project creators
  my $creators = $self->{'creators'};
  foreach my $creator (@$creators) {
    my $tag = $self->extractType($creator);
    $self->{'types'}->{$tag} = $creator;
  }

  ## Before we process the arguments, we will prepend the command_line
  ## config variable.
  my $cmd = $cfg->get_value('command_line');
  if (defined $cmd) {
    my $envargs = $self->create_array($cmd);
    unshift(@args, @$envargs);
  }

  ## Now add in the includes to the command line arguments.
  ## It is done this way to allow the Options module to process
  ## the include path as it does all others.
  my $incs = $cfg->get_value('includes');
  if (defined $incs) {
    foreach my $inc (split(/\s*,\s*/, $incs)) {
      ## We must add it to the front so that options provided at the end
      ## that require a parameter (but are not given one) do not gobble
      ## up the -include option.
      unshift(@args, '-include', $inc);
    }
  }

  my $options = $self->options($self->{'name'},
                               $self->{'types'},
                               1,
                               @args);

  ## If options are not defined, that means that calling options
  ## took care of whatever functionality that was required and
  ## we can now return with a good status.
  return 0 if (!defined $options);

  ## Set up a hash that we can use to keep track of what
  ## has been 'required'
  my %loaded;

  ## Set up the default creator, if no type is selected
  if (!defined $options->{'creators'}->[0]) {
    my $utype = $cfg->get_value('default_type');
    if (defined $utype) {
      my $default = $self->locate_default_type($utype);
      if (defined $default) {
        push(@{$options->{'creators'}}, $default);
      }
      else {
        $self->error("Unable to locate the module that corresponds to " .
                     "the '$utype' type.");
        return 1;
      }
    }
  }

  ## If there's still no default, issue an error
  if (!defined $options->{'creators'}->[0]) {
    $self->error('There is no longer a default project type.  Please ' .
                 'specify one in MPC.cfg or use the -type option.');
    return 1;
  }

  ## Set up additional main functions to recognize
  my $val = $cfg->get_value('main_functions');
  if (defined $val) {
    foreach my $main (split(/\s*,\s*/, $val)) {
      my $err = ProjectCreator::add_main_function($main);
      if (defined $err) {
        $self->error("$err at line " . $cfg->get_line_number() .
                     " of $cfgfile");
        return 1;
      }
    }
  }

  if ($options->{'recurse'}) {
    if (defined $options->{'input'}->[0]) {
      ## This is an error.
      ## -recurse was used and input files were specified.
      $self->optionError('No files should be ' .
                         'specified when using -recurse');
    }
    else {
      ## We have to load at least one creator here in order
      ## to call the generate_recursive_input_list virtual function.
      my $name = $options->{'creators'}->[0];
      if (!$loaded{$name}) {
        require "$name.pm";
        $loaded{$name} = 1;
      }

      ## Generate the recursive input list
      my $creator = $name->new();
      my @input = $creator->generate_recursive_input_list(
                                             '.', $options->{'exclude'});
      $options->{'input'} = \@input;

      ## If no files were found above, then we issue a warning
      ## that we are going to use the default input
      if (!defined $options->{'input'}->[0]) {
        $self->information('No files were found using the -recurse option. ' .
                           'Using the default input.');
      }
    }
  }

  ## Add the default include paths.  If the user has used the dynamic
  ## types method of adding types to MPC, we need to push the paths
  ## on.  Otherwise, we unshift them onto the front.
  if ($self->{'path'} ne $self->{'basepath'}) {
    unshift(@{$options->{'include'}}, $self->{'path'} . '/config',
                                      $self->{'path'} . '/templates');
  }
  push(@{$options->{'include'}}, $self->{'basepath'} . '/config',
                                 $self->{'basepath'} . '/templates');

  ## All includes (except the current directory) have been added by this time
  $self->debug("INCLUDES: @{$options->{'include'}}");

  ## Set the global feature file
  my $global_feature_file = (defined $options->{'gfeature_file'} &&
                             -r $options->{'gfeature_file'} ?
                                $options->{'gfeature_file'} : undef);
  if (!defined $global_feature_file) {
    my $gf = 'global.features';
    $global_feature_file = $self->find_file($options->{'include'}, $gf);
    if (!defined $global_feature_file) {
      $global_feature_file = $self->{'basepath'} . '/config/' . $gf;
    }
  }

  ## Set up default values
  push(@{$options->{'input'}}, '') if (!defined $options->{'input'}->[0]);
  $options->{'feature_file'} = $self->find_file($options->{'include'},
                                                'default.features')
                                 if (!defined $options->{'feature_file'});

  $options->{'global'} = $self->find_file($options->{'include'},
                                          'global.mpb')
                                 if (!defined $options->{'global'});

  ## Set the relative
  my $relative_file = (defined $options->{'relative_file'} &&
                             -r $options->{'relative_file'} ?
                                $options->{'relative_file'} : undef);
  if (!defined $relative_file) {
    my $gf = 'default.rel';
    $relative_file = $self->find_file($options->{'include'}, $gf);
    if (!defined $relative_file) {
      $relative_file = $self->{'basepath'} . '/config/' . $gf;
    }
  }
  if ($options->{'reldefs'}) {
    ## Only try to read the file if it exists
    if (defined $relative_file) {
      my($srel, $errorString) = $self->read_file($relative_file);
      if (!$srel) {
        $self->error("$errorString\nin $relative_file");
        return 1;
      }

      foreach my $key (@{$self->{'relorder'}}) {
        if (defined $ENV{$key} &&
            !defined $options->{'relative'}->{$key}) {
          $options->{'relative'}->{$key} = $ENV{$key};
        }
        if (defined $self->{'reldefs'}->{$key} &&
            !defined $options->{'relative'}->{$key}) {
          my $value = $self->{'reldefs'}->{$key};
          if ($value =~ /\$(\w+)(.*)?/) {
            my $var   = $1;
            my $extra = $2;
            $options->{'relative'}->{$key} =
                       (defined $options->{'relative'}->{$var} ?
                                $options->{'relative'}->{$var} : '') .
                       (defined $extra ? $extra : '');
          }
          else {
            $options->{'relative'}->{$key} = $value;
          }
        }

        ## If a relative path is defined, remove all trailing slashes
        ## and replace any two or more slashes with a single slash.
        if (defined $options->{'relative'}->{$key}) {
          $options->{'relative'}->{$key} =~ s/([\/\\])[\/\\]+/$1/g;
          $options->{'relative'}->{$key} =~ s/[\/\\]$//g;
        }
      }
    }

    ## Remove MPC_ROOT since we never want to expand it
    delete $options->{'relative'}->{'MPC_ROOT'};
  }

  ## Always add the current path to the include paths
  unshift(@{$options->{'include'}}, $orig_dir);

  ## Set up un-buffered output for the progress callback
  $| = 1;

  ## Keep the starting time for the total output
  my $startTime = time();
  my $loopTimes = 0;

  ## Generate the files
  my $status = 0;
  foreach my $cfile (@{$options->{'input'}}) {
    ## To correctly reference any pathnames in the input file, chdir to
    ## its directory if there's any directory component to the specified path.
    ## mpc_basename() always expects UNIX file format.
    $cfile =~ s/\\/\//g;
    my $base = ($cfile eq '' ? '' : $self->mpc_basename($cfile));

    $base = '' if (-d $cfile);

    foreach my $name (@{$options->{'creators'}}) {
      ++$loopTimes;

      if (!$loaded{$name}) {
        require "$name.pm";
        $loaded{$name} = 1;
      }
      my $file = $cfile;
      my $creator = $name->new($options->{'global'},
                               $options->{'include'},
                               $options->{'template'},
                               $options->{'ti'},
                               $options->{'dynamic'},
                               $options->{'static'},
                               $options->{'relative'},
                               $options->{'addtemp'},
                               $options->{'addproj'},
                               (-t 1 ? \&progress : undef),
                               $options->{'toplevel'},
                               $options->{'baseprojs'},
                               $global_feature_file,
                               $options->{'relative_file'},
                               $options->{'feature_file'},
                               $options->{'features'},
                               $options->{'hierarchy'},
                               $options->{'exclude'},
                               $options->{'make_coexistence'},
                               $options->{'name_modifier'},
                               $options->{'apply_project'},
                               $options->{'genins'},
                               $options->{'into'},
                               $options->{'language'},
                               $options->{'use_env'},
                               $options->{'expand_vars'},
                               $options->{'gendot'},
                               $options->{'comments'},
                               $options->{'for_eclipse'});

      ## Update settings based on the configuration file
      $creator->set_verbose_ordering($cfg->get_value('verbose_ordering'));

      if ($base ne $file) {
        my $dir = ($base eq '' ? $file : $self->mpc_dirname($file));
        if (!$creator->cd($dir)) {
          $self->error("Unable to change to directory: $dir");
          $status++;
          last;
        }
        $file = $base;
      }
      my $diag = 'Generating \'' . $self->extractType($name) .
                 '\' output using ';
      if ($file eq '') {
        $diag .= 'default input';
      }
      else {
        my $partial  = $self->getcwd();
        my $oescaped = $self->escape_regex_special($orig_dir) . '(/)?';
        $partial =~ s!\\!/!g;
        $partial =~ s/^$oescaped//;
        $diag .= ($partial ne '' ? "$partial/" : '') . $file;
      }
      $self->diagnostic($diag);
      my $start = time();
      if (!$creator->generate($file)) {
        $self->error("Unable to process: " .
                     ($file eq '' ? 'default input' : $file));
        $status++;
        last;
      }
      my $total = time() - $start;
      $self->diagnostic('Generation Time: ' .
                        (int($total / 60) > 0 ? int($total / 60) . 'm ' : '') .
                        ($total % 60) . 's');
      $creator->cd($orig_dir);
    }
    last if ($status);
  }

  ## If we went through the loop more than once, we need to print
  ## out the total amount of time
  if ($loopTimes > 1) {
    my $total = time() - $startTime;
    $self->diagnostic('     Total Time: ' .
                      (int($total / 60) > 0 ? int($total / 60) . 'm ' : '') .
                      ($total % 60) . 's');
  }

  return $status;
}

sub progress {
  ## This method will be called before each output file is written.
  print "$progress[$index]\r";
  $index++;
  $index = 0 if ($index > $#progress);
}

1;


text:
/*
 * Camel EndpointConfiguration generated by camel-api-component-maven-plugin
 */
package org.apache.camel.component.twilio;

import org.apache.camel.spi.Configurer;
import org.apache.camel.spi.ApiMethod;
import org.apache.camel.spi.ApiParam;
import org.apache.camel.spi.ApiParams;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriParams;

/**
 * Camel endpoint configuration for {@link com.twilio.rest.api.v2010.account.ShortCode}.
 */
@ApiParams(apiName = "short-code",
           description = "",
           apiMethods = {@ApiMethod(methodName = "fetcher", description="Create a ShortCodeFetcher to execute fetch", signatures={"com.twilio.rest.api.v2010.account.ShortCodeFetcher fetcher(String pathSid)", "com.twilio.rest.api.v2010.account.ShortCodeFetcher fetcher(String pathAccountSid, String pathSid)"}), @ApiMethod(methodName = "reader", description="Create a ShortCodeReader to execute read", signatures={"com.twilio.rest.api.v2010.account.ShortCodeReader reader()", "com.twilio.rest.api.v2010.account.ShortCodeReader reader(String pathAccountSid)"}), @ApiMethod(methodName = "updater", description="Create a ShortCodeUpdater to execute update", signatures={"com.twilio.rest.api.v2010.account.ShortCodeUpdater updater(String pathSid)", "com.twilio.rest.api.v2010.account.ShortCodeUpdater updater(String pathAccountSid, String pathSid)"}), }, aliases = {"^creator$=create", "^deleter$=delete", "^fetcher$=fetch", "^reader$=read", "^updater$=update"})
@UriParams
@Configurer
public final class ShortCodeEndpointConfiguration extends TwilioConfiguration {
    @UriParam
    @ApiParam(optional = false, apiMethods = {@ApiMethod(methodName = "fetcher", description="The SID of the Account that created the resource(s) to fetch"), @ApiMethod(methodName = "reader", description="The SID of the Account that created the resource(s) to read"), @ApiMethod(methodName = "updater", description="The SID of the Account that created the resource(s) to update")})
    private String pathAccountSid;
    @UriParam
    @ApiParam(optional = false, apiMethods = {@ApiMethod(methodName = "fetcher", description="The unique string that identifies this resource"), @ApiMethod(methodName = "updater", description="The unique string that identifies this resource")})
    private String pathSid;

    public String getPathAccountSid() {
        return pathAccountSid;
    }

    public void setPathAccountSid(String pathAccountSid) {
        this.pathAccountSid = pathAccountSid;
    }

    public String getPathSid() {
        return pathSid;
    }

    public void setPathSid(String pathSid) {
        this.pathSid = pathSid;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>Phaser Source: input/Touch.js</title>

	<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">

	<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">

			Phaser

					Namespaces

							Phaser

					Classes

							Animation

							AnimationManager

							AnimationParser

							ArrayList

							AudioSprite

							BitmapData

							BitmapText

							Button

							Cache

							Camera

							Canvas

							Circle

							Color

							Device

							Easing

							Back

							Bounce

							Circular

							Cubic

							Elastic

							Exponential

							Linear

							Quadratic

							Quartic

							Quintic

							Sinusoidal

							Ellipse

							Events

							Filter

							FlexGrid

							FlexLayer

							Frame

							FrameData

							Game

							GameObjectCreator

							GameObjectFactory

							Gamepad

							GamepadButton

							Graphics

							Group

							Image

							Input

							InputHandler

							Key

							Keyboard

							Line

							LinkedList

							Loader

							LoaderParser

							Math

							Mouse

							MSPointer

							Net

							Particle

							Particles

							Arcade

							Emitter

							Physics

							Arcade

							Body

							Ninja

							AABB

							Body

							Circle

							Tile

							P2

							Body

							BodyDebug

							CollisionGroup

							ContactMaterial

							DistanceConstraint

							FixtureList

							GearConstraint

							InversePointProxy

							LockConstraint

							Material

							PointProxy

							PrismaticConstraint

							RevoluteConstraint

							RotationalSpring

							Spring

							Plugin

							PluginManager

							Point

							Pointer

							Polygon

							QuadTree

							RandomDataGenerator

							Rectangle

							RenderTexture

							RequestAnimationFrame

							RetroFont

							Rope

							ScaleManager

							Signal

							SignalBinding

							SinglePad

							Sound

							SoundManager

							Sprite

							SpriteBatch

							Stage

							State

							StateManager

							Text

							Tile

							Tilemap

							TilemapLayer

							TilemapParser

							Tileset

							TileSprite

							Time

							Timer

							TimerEvent

							Touch

							Tween

							TweenManager

							Utils

							Debug

							World

Source: input/Touch.js

/**
* Phaser.Touch handles touch events with your game. Note: Android 2.x only supports 1 touch event at once, no multi-touch.
*
* @class Phaser.Touch
* @constructor
* @param {Phaser.Game} game - A reference to the currently running game.
*/
Phaser.Touch = function (game) {

    /**
    * @property {Phaser.Game} game - A reference to the currently running game.
    */
    this.game = game;

    /**
    * @property {boolean} disabled - You can disable all Touch events by setting disabled = true. While set all new touch events will be ignored.
    * @return {boolean}
    */
    this.disabled = false;

    /**
    * @property {Object} callbackContext - The context under which callbacks are called.
    */
    this.callbackContext = this.game;

    /**
    * @property {function} touchStartCallback - A callback that can be fired on a touchStart event.
    */
    this.touchStartCallback = null;

    /**
    * @property {function} touchMoveCallback - A callback that can be fired on a touchMove event.
    */
    this.touchMoveCallback = null;

    /**
    * @property {function} touchEndCallback - A callback that can be fired on a touchEnd event.
    */
    this.touchEndCallback = null;

    /**
    * @property {function} touchEnterCallback - A callback that can be fired on a touchEnter event.
    */
    this.touchEnterCallback = null;

    /**
    * @property {function} touchLeaveCallback - A callback that can be fired on a touchLeave event.
    */
    this.touchLeaveCallback = null;

    /**
    * @property {function} touchCancelCallback - A callback that can be fired on a touchCancel event.
    */
    this.touchCancelCallback = null;

    /**
    * @property {boolean} preventDefault - If true the TouchEvent will have prevent.default called on it.
    * @default
    */
    this.preventDefault = true;

    /**
    * @property {TouchEvent} event - The browser touch DOM event. Will be set to null if no touch event has ever been received.
    * @default
    */
    this.event = null;

    /**
    * @property {function} _onTouchStart - Internal event handler reference.
    * @private
    */
    this._onTouchStart = null;

    /**
    * @property {function} _onTouchMove - Internal event handler reference.
    * @private
    */
    this._onTouchMove = null;

    /**
    * @property {function} _onTouchEnd - Internal event handler reference.
    * @private
    */
    this._onTouchEnd = null;

    /**
    * @property {function} _onTouchEnter - Internal event handler reference.
    * @private
    */
    this._onTouchEnter = null;

    /**
    * @property {function} _onTouchLeave - Internal event handler reference.
    * @private
    */
    this._onTouchLeave = null;

    /**
    * @property {function} _onTouchCancel - Internal event handler reference.
    * @private
    */
    this._onTouchCancel = null;

    /**
    * @property {function} _onTouchMove - Internal event handler reference.
    * @private
    */
    this._onTouchMove = null;

};

Phaser.Touch.prototype = {

    /**
    * Starts the event listeners running.
    * @method Phaser.Touch#start
    */
    start: function () {

        if (this._onTouchStart !== null)
        {
            //  Avoid setting multiple listeners
            return;
        }

        var _this = this;

        if (this.game.device.touch)
        {
            this._onTouchStart = function (event) {
                return _this.onTouchStart(event);
            };

            this._onTouchMove = function (event) {
                return _this.onTouchMove(event);
            };

            this._onTouchEnd = function (event) {
                return _this.onTouchEnd(event);
            };

            this._onTouchEnter = function (event) {
                return _this.onTouchEnter(event);
            };

            this._onTouchLeave = function (event) {
                return _this.onTouchLeave(event);
            };

            this._onTouchCancel = function (event) {
                return _this.onTouchCancel(event);
            };

            this.game.canvas.addEventListener('touchstart', this._onTouchStart, false);
            this.game.canvas.addEventListener('touchmove', this._onTouchMove, false);
            this.game.canvas.addEventListener('touchend', this._onTouchEnd, false);
            this.game.canvas.addEventListener('touchcancel', this._onTouchCancel, false);

            if (!this.game.device.cocoonJS)
            {
                this.game.canvas.addEventListener('touchenter', this._onTouchEnter, false);
                this.game.canvas.addEventListener('touchleave', this._onTouchLeave, false);
            }
        }

    },

    /**
    * Consumes all touchmove events on the document (only enable this if you know you need it!).
    * @method Phaser.Touch#consumeTouchMove
    */
    consumeDocumentTouches: function () {

        this._documentTouchMove = function (event) {
            event.preventDefault();
        };

        document.addEventListener('touchmove', this._documentTouchMove, false);

    },

    /**
    * The internal method that handles the touchstart event from the browser.
    * @method Phaser.Touch#onTouchStart
    * @param {TouchEvent} event - The native event from the browser. This gets stored in Touch.event.
    */
    onTouchStart: function (event) {

        this.event = event;

        if (this.touchStartCallback)
        {
            this.touchStartCallback.call(this.callbackContext, event);
        }

        if (this.game.input.disabled || this.disabled)
        {
            return;
        }

        if (this.preventDefault)
        {
            event.preventDefault();
        }

        //  event.targetTouches = list of all touches on the TARGET ELEMENT (i.e. game dom element)
        //  event.touches = list of all touches on the ENTIRE DOCUMENT, not just the target element
        //  event.changedTouches = the touches that CHANGED in this event, not the total number of them
        for (var i = 0; i < event.changedTouches.length; i++)
        {
            this.game.input.startPointer(event.changedTouches[i]);
        }

    },

    /**
    * Touch cancel - touches that were disrupted (perhaps by moving into a plugin or browser chrome).
    * Occurs for example on iOS when you put down 4 fingers and the app selector UI appears.
    * @method Phaser.Touch#onTouchCancel
    * @param {TouchEvent} event - The native event from the browser. This gets stored in Touch.event.
    */
    onTouchCancel: function (event) {

        this.event = event;

        if (this.touchCancelCallback)
        {
            this.touchCancelCallback.call(this.callbackContext, event);
        }

        if (this.game.input.disabled || this.disabled)
        {
            return;
        }

        if (this.preventDefault)
        {
            event.preventDefault();
        }

        //  Touch cancel - touches that were disrupted (perhaps by moving into a plugin or browser chrome)
        //  http://www.w3.org/TR/touch-events/#dfn-touchcancel
        for (var i = 0; i < event.changedTouches.length; i++)
        {
            this.game.input.stopPointer(event.changedTouches[i]);
        }

    },

    /**
    * For touch enter and leave its a list of the touch points that have entered or left the target.
    * Doesn't appear to be supported by most browsers on a canvas element yet.
    * @method Phaser.Touch#onTouchEnter
    * @param {TouchEvent} event - The native event from the browser. This gets stored in Touch.event.
    */
    onTouchEnter: function (event) {

        this.event = event;

        if (this.touchEnterCallback)
        {
            this.touchEnterCallback.call(this.callbackContext, event);
        }

        if (this.game.input.disabled || this.disabled)
        {
            return;
        }

        if (this.preventDefault)
        {
            event.preventDefault();
        }

    },

    /**
    * For touch enter and leave its a list of the touch points that have entered or left the target.
    * Doesn't appear to be supported by most browsers on a canvas element yet.
    * @method Phaser.Touch#onTouchLeave
    * @param {TouchEvent} event - The native event from the browser. This gets stored in Touch.event.
    */
    onTouchLeave: function (event) {

        this.event = event;

        if (this.touchLeaveCallback)
        {
            this.touchLeaveCallback.call(this.callbackContext, event);
        }

        if (this.preventDefault)
        {
            event.preventDefault();
        }

    },

    /**
    * The handler for the touchmove events.
    * @method Phaser.Touch#onTouchMove
    * @param {TouchEvent} event - The native event from the browser. This gets stored in Touch.event.
    */
    onTouchMove: function (event) {

        this.event = event;

        if (this.touchMoveCallback)
        {
            this.touchMoveCallback.call(this.callbackContext, event);
        }

        if (this.preventDefault)
        {
            event.preventDefault();
        }

        for (var i = 0; i < event.changedTouches.length; i++)
        {
            this.game.input.updatePointer(event.changedTouches[i]);
        }

    },

    /**
    * The handler for the touchend events.
    * @method Phaser.Touch#onTouchEnd
    * @param {TouchEvent} event - The native event from the browser. This gets stored in Touch.event.
    */
    onTouchEnd: function (event) {

        this.event = event;

        if (this.touchEndCallback)
        {
            this.touchEndCallback.call(this.callbackContext, event);
        }

        if (this.preventDefault)
        {
            event.preventDefault();
        }

        //  For touch end its a list of the touch points that have been removed from the surface
        //  https://developer.mozilla.org/en-US/docs/DOM/TouchList
        //  event.changedTouches = the touches that CHANGED in this event, not the total number of them
        for (var i = 0; i < event.changedTouches.length; i++)
        {
            this.game.input.stopPointer(event.changedTouches[i]);
        }

    },

    /**
    * Stop the event listeners.
    * @method Phaser.Touch#stop
    */
    stop: function () {

        if (this.game.device.touch)
        {
            this.game.canvas.removeEventListener('touchstart', this._onTouchStart);
            this.game.canvas.removeEventListener('touchmove', this._onTouchMove);
            this.game.canvas.removeEventListener('touchend', this._onTouchEnd);
            this.game.canvas.removeEventListener('touchenter', this._onTouchEnter);
            this.game.canvas.removeEventListener('touchleave', this._onTouchLeave);
            this.game.canvas.removeEventListener('touchcancel', this._onTouchCancel);
        }

    }

};

Phaser.Touch.prototype.constructor = Phaser.Touch;

		Phaser Copyright © 2012-2014 Photon Storm Ltd.

		Documentation generated by JSDoc 3.3.0-dev
		on Wed Oct 22 2014 21:45:44 GMT+0100 (BST) using the DocStrap template.


text:
module.exports = {
  development: {
    isProduction: false,
    apiPort: 5050,
    db_url: 'mongodb://localhost/gsd-dev',
  },
  production: {
    isProduction: true,
    apiPort: 5050,
    db_url: 'mongodb://localhost/gsd',
  }
}[process.env.NODE_ENV || 'development'];


text:
setting
=======

Laravel 4 library that stores settings in a database


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.09.07 at 08:01:35 PM IST
//

package com.mozu.qbintegration.model.qbmodel.allgen;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for CustomDetailReportQueryRqType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="CustomDetailReportQueryRqType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <group ref="{}CustomDetailReportQuery"/>
 *       </sequence>
 *       <attribute name="requestID" type="{}STRTYPE" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CustomDetailReportQueryRqType", propOrder = {
    "customDetailReportType",
    "displayReport",
    "reportPeriod",
    "reportDateMacro",
    "reportAccountFilter",
    "reportEntityFilter",
    "reportItemFilter",
    "reportClassFilter",
    "reportTxnTypeFilter",
    "reportModifiedDateRangeFilter",
    "reportModifiedDateRangeMacro",
    "reportDetailLevelFilter",
    "reportPostingStatusFilter",
    "summarizeRowsBy",
    "includeColumn",
    "includeAccounts",
    "reportOpenBalanceAsOf",
    "reportBasis"
})
public class CustomDetailReportQueryRqType {

    @XmlElement(name = "CustomDetailReportType", required = true)
    protected String customDetailReportType;
    @XmlElement(name = "DisplayReport")
    protected String displayReport;
    @XmlElement(name = "ReportPeriod")
    protected ReportPeriod reportPeriod;
    @XmlElement(name = "ReportDateMacro")
    protected String reportDateMacro;
    @XmlElement(name = "ReportAccountFilter")
    protected ReportAccountFilter reportAccountFilter;
    @XmlElement(name = "ReportEntityFilter")
    protected ReportEntityFilter reportEntityFilter;
    @XmlElement(name = "ReportItemFilter")
    protected ReportItemFilter reportItemFilter;
    @XmlElement(name = "ReportClassFilter")
    protected ReportClassFilter reportClassFilter;
    @XmlElement(name = "ReportTxnTypeFilter")
    protected ReportTxnTypeFilter reportTxnTypeFilter;
    @XmlElement(name = "ReportModifiedDateRangeFilter")
    protected ReportModifiedDateRangeFilter reportModifiedDateRangeFilter;
    @XmlElement(name = "ReportModifiedDateRangeMacro")
    protected String reportModifiedDateRangeMacro;
    @XmlElement(name = "ReportDetailLevelFilter", defaultValue = "All")
    protected String reportDetailLevelFilter;
    @XmlElement(name = "ReportPostingStatusFilter")
    protected String reportPostingStatusFilter;
    @XmlElement(name = "SummarizeRowsBy", required = true)
    protected String summarizeRowsBy;
    @XmlElement(name = "IncludeColumn", required = true)
    protected List<String> includeColumn;
    @XmlElement(name = "IncludeAccounts")
    protected String includeAccounts;
    @XmlElement(name = "ReportOpenBalanceAsOf", defaultValue = "Today")
    protected String reportOpenBalanceAsOf;
    @XmlElement(name = "ReportBasis", defaultValue = "None")
    protected String reportBasis;
    @XmlAttribute(name = "requestID")
    protected String requestID;

    /**
     * Gets the value of the customDetailReportType property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getCustomDetailReportType() {
        return customDetailReportType;
    }

    /**
     * Sets the value of the customDetailReportType property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setCustomDetailReportType(String value) {
        this.customDetailReportType = value;
    }

    /**
     * Gets the value of the displayReport property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDisplayReport() {
        return displayReport;
    }

    /**
     * Sets the value of the displayReport property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDisplayReport(String value) {
        this.displayReport = value;
    }

    /**
     * Gets the value of the reportPeriod property.
     *
     * @return
     *     possible object is
     *     {@link ReportPeriod }
     *
     */
    public ReportPeriod getReportPeriod() {
        return reportPeriod;
    }

    /**
     * Sets the value of the reportPeriod property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportPeriod }
     *
     */
    public void setReportPeriod(ReportPeriod value) {
        this.reportPeriod = value;
    }

    /**
     * Gets the value of the reportDateMacro property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReportDateMacro() {
        return reportDateMacro;
    }

    /**
     * Sets the value of the reportDateMacro property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReportDateMacro(String value) {
        this.reportDateMacro = value;
    }

    /**
     * Gets the value of the reportAccountFilter property.
     *
     * @return
     *     possible object is
     *     {@link ReportAccountFilter }
     *
     */
    public ReportAccountFilter getReportAccountFilter() {
        return reportAccountFilter;
    }

    /**
     * Sets the value of the reportAccountFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportAccountFilter }
     *
     */
    public void setReportAccountFilter(ReportAccountFilter value) {
        this.reportAccountFilter = value;
    }

    /**
     * Gets the value of the reportEntityFilter property.
     *
     * @return
     *     possible object is
     *     {@link ReportEntityFilter }
     *
     */
    public ReportEntityFilter getReportEntityFilter() {
        return reportEntityFilter;
    }

    /**
     * Sets the value of the reportEntityFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportEntityFilter }
     *
     */
    public void setReportEntityFilter(ReportEntityFilter value) {
        this.reportEntityFilter = value;
    }

    /**
     * Gets the value of the reportItemFilter property.
     *
     * @return
     *     possible object is
     *     {@link ReportItemFilter }
     *
     */
    public ReportItemFilter getReportItemFilter() {
        return reportItemFilter;
    }

    /**
     * Sets the value of the reportItemFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportItemFilter }
     *
     */
    public void setReportItemFilter(ReportItemFilter value) {
        this.reportItemFilter = value;
    }

    /**
     * Gets the value of the reportClassFilter property.
     *
     * @return
     *     possible object is
     *     {@link ReportClassFilter }
     *
     */
    public ReportClassFilter getReportClassFilter() {
        return reportClassFilter;
    }

    /**
     * Sets the value of the reportClassFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportClassFilter }
     *
     */
    public void setReportClassFilter(ReportClassFilter value) {
        this.reportClassFilter = value;
    }

    /**
     * Gets the value of the reportTxnTypeFilter property.
     *
     * @return
     *     possible object is
     *     {@link ReportTxnTypeFilter }
     *
     */
    public ReportTxnTypeFilter getReportTxnTypeFilter() {
        return reportTxnTypeFilter;
    }

    /**
     * Sets the value of the reportTxnTypeFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportTxnTypeFilter }
     *
     */
    public void setReportTxnTypeFilter(ReportTxnTypeFilter value) {
        this.reportTxnTypeFilter = value;
    }

    /**
     * Gets the value of the reportModifiedDateRangeFilter property.
     *
     * @return
     *     possible object is
     *     {@link ReportModifiedDateRangeFilter }
     *
     */
    public ReportModifiedDateRangeFilter getReportModifiedDateRangeFilter() {
        return reportModifiedDateRangeFilter;
    }

    /**
     * Sets the value of the reportModifiedDateRangeFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link ReportModifiedDateRangeFilter }
     *
     */
    public void setReportModifiedDateRangeFilter(ReportModifiedDateRangeFilter value) {
        this.reportModifiedDateRangeFilter = value;
    }

    /**
     * Gets the value of the reportModifiedDateRangeMacro property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReportModifiedDateRangeMacro() {
        return reportModifiedDateRangeMacro;
    }

    /**
     * Sets the value of the reportModifiedDateRangeMacro property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReportModifiedDateRangeMacro(String value) {
        this.reportModifiedDateRangeMacro = value;
    }

    /**
     * Gets the value of the reportDetailLevelFilter property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReportDetailLevelFilter() {
        return reportDetailLevelFilter;
    }

    /**
     * Sets the value of the reportDetailLevelFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReportDetailLevelFilter(String value) {
        this.reportDetailLevelFilter = value;
    }

    /**
     * Gets the value of the reportPostingStatusFilter property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReportPostingStatusFilter() {
        return reportPostingStatusFilter;
    }

    /**
     * Sets the value of the reportPostingStatusFilter property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReportPostingStatusFilter(String value) {
        this.reportPostingStatusFilter = value;
    }

    /**
     * Gets the value of the summarizeRowsBy property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getSummarizeRowsBy() {
        return summarizeRowsBy;
    }

    /**
     * Sets the value of the summarizeRowsBy property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setSummarizeRowsBy(String value) {
        this.summarizeRowsBy = value;
    }

    /**
     * Gets the value of the includeColumn property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the includeColumn property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getIncludeColumn().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link String }
     *
     *
     */
    public List<String> getIncludeColumn() {
        if (includeColumn == null) {
            includeColumn = new ArrayList<String>();
        }
        return this.includeColumn;
    }

    /**
     * Gets the value of the includeAccounts property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getIncludeAccounts() {
        return includeAccounts;
    }

    /**
     * Sets the value of the includeAccounts property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setIncludeAccounts(String value) {
        this.includeAccounts = value;
    }

    /**
     * Gets the value of the reportOpenBalanceAsOf property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReportOpenBalanceAsOf() {
        return reportOpenBalanceAsOf;
    }

    /**
     * Sets the value of the reportOpenBalanceAsOf property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReportOpenBalanceAsOf(String value) {
        this.reportOpenBalanceAsOf = value;
    }

    /**
     * Gets the value of the reportBasis property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getReportBasis() {
        return reportBasis;
    }

    /**
     * Sets the value of the reportBasis property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setReportBasis(String value) {
        this.reportBasis = value;
    }

    /**
     * Gets the value of the requestID property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getRequestID() {
        return requestID;
    }

    /**
     * Sets the value of the requestID property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setRequestID(String value) {
        this.requestID = value;
    }

}


text:
package edu.umd.cs.psl.application.learning.weight.maxlikelihood;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.umd.cs.psl.application.util.Grounding;
import edu.umd.cs.psl.config.ConfigBundle;
import edu.umd.cs.psl.database.Database;
import edu.umd.cs.psl.model.Model;
import edu.umd.cs.psl.model.atom.Atom;
import edu.umd.cs.psl.model.atom.AtomEventFramework;
import edu.umd.cs.psl.model.atom.GroundAtom;
import edu.umd.cs.psl.model.atom.ObservedAtom;
import edu.umd.cs.psl.model.atom.RandomVariableAtom;
import edu.umd.cs.psl.model.kernel.GroundCompatibilityKernel;
import edu.umd.cs.psl.model.kernel.GroundKernel;
import edu.umd.cs.psl.model.kernel.Kernel;
import edu.umd.cs.psl.model.kernel.linearconstraint.GroundValueConstraint;
import edu.umd.cs.psl.model.predicate.StandardPredicate;
import edu.umd.cs.psl.reasoner.ReasonerFactory;
import edu.umd.cs.psl.util.database.Queries;

/**
 * Voted perceptron algorithm that does not require a ground model of pre-specified
 * dimensionality.
 *

 * For the gradient of the objective, the expected total incompatibility is
 * computed by finding the MPE state.
 *

 * Note that this class does not support latent variables but will not throw
 * an error if the labelDB does not include a corresponding label for a
 * RandomVariableAtom. All unspecified labels will set to their most probable
 * values conditioned on the observations in distributionDB and the labels in labelDB.
 *
 * @author Stephen Bach <bach@cs.umd.edu>
 */
public class LazyMaxLikelihoodMPE extends VotedPerceptron {

	private static final Logger log = LoggerFactory.getLogger(AtomEventFramework.class);

	private AtomEventFramework eventFramework;

	/**
	 * Constructs a new weight learner.
	 *
	 * @param model  the model for which to learn weights
	 * @param distributionDB  a Database containing all atoms for the ground distribution
	 * @param labelDB  a Database containing labels for the unknowns in the distribution
	 * @param config  configuration bundle
	 */
	public LazyMaxLikelihoodMPE(Model model, Database distributionDB, Database labelDB, ConfigBundle config) {
		super(model, distributionDB, labelDB, config);
	}

	@Override
	protected void initGroundModel()
			throws ClassNotFoundException, IllegalAccessException, InstantiationException {
		reasoner = ((ReasonerFactory) config.getFactory(REASONER_KEY, REASONER_DEFAULT)).getReasoner(config);
		eventFramework = new AtomEventFramework(rvDB, config);

		/* Registers the Model's Kernels with the AtomEventFramework */
		for (Kernel k : model.getKernels())
			k.registerForAtomEvents(eventFramework, reasoner);

		/* Grounds the model */
		Grounding.groundAll(model, eventFramework, reasoner);
		while (eventFramework.checkToActivate() > 0)
			eventFramework.workOffJobQueue();
	}

	@Override
	protected double[] computeObservedIncomp() {

		/*
		 * In order to ground out the graphical model with the label truth values,
		 * all labeled atoms with non-zero truth values are activated and constrained.
		 *
		 * Then, a loop is used to extend the network based on MPE inference and
		 * activation events, and then check for new labeled RandomVariableAtoms
		 * to constrain as necessary.
		 */

		Map<RandomVariableAtom, GroundValueConstraint> targetMap = new HashMap<RandomVariableAtom, GroundValueConstraint>();

		/* Activates all non-zero labeled atoms */
		for (StandardPredicate p : observedDB.getRegisteredPredicates()) {
			Set<GroundAtom> labeledAtoms = Queries.getAllAtoms(observedDB, p);
			for (GroundAtom labeledAtom : labeledAtoms) {
				/*
				 * Double checks that it is observed in observedDB and unobserved in rvDB,
				 * since those are the only atoms in observedDB to be considered. Also,
				 * checks if the labeled truth value is greater than 0.0, since activation
				 * would be unnecessary until the corresponding atom in rvDB had a non-zero
				 * truth value. If all three conditions are met, activates and constrains the atom.
				 */
				if (labeledAtom instanceof ObservedAtom && labeledAtom.getValue() > 0.0) {
					GroundAtom correspondingAtom = eventFramework.getAtom(labeledAtom.getPredicate(), labeledAtom.getArguments());
					if (correspondingAtom instanceof RandomVariableAtom) {
						eventFramework.activateAtom((RandomVariableAtom) correspondingAtom);
						GroundValueConstraint con = new GroundValueConstraint((RandomVariableAtom) correspondingAtom, ((ObservedAtom) labeledAtom).getValue());
						targetMap.put((RandomVariableAtom) correspondingAtom, con);
						reasoner.addGroundKernel(con);
					}
				}
			}
		}

		boolean continueGrowing;
		/* Maintains a temporary set during collection to avoid concurrent modification errors */
		Set<GroundValueConstraint> toAdd = new HashSet<GroundValueConstraint>();

		log.debug("Beginning to grow labeled network.");
		do {
			continueGrowing = false;

			/* Computes the MPE state and grows graphical model */
			do {
				eventFramework.workOffJobQueue();
				reasoner.optimize();
			}
			while (eventFramework.checkToActivate() > 0);

			/* Collects existing RandomVariableAtoms and pairs them with label constraints */
			for (GroundKernel k : reasoner.getGroundKernels()) {
				for (Atom a : k.getAtoms()) {
					if (a instanceof RandomVariableAtom) {
						RandomVariableAtom rv = (RandomVariableAtom) a;
						if (!targetMap.containsKey(rv)) {
							Atom possibleLabel = observedDB.getAtom(rv.getPredicate(), rv.getArguments());
							if (possibleLabel instanceof ObservedAtom) {
								GroundValueConstraint con = new GroundValueConstraint(rv, ((ObservedAtom) possibleLabel).getValue());
								targetMap.put(rv, con);
								toAdd.add(con);
								continueGrowing = true;
							}
						}
					}
				}
			}

			/* Adds new constraints to reasoner */
			for (GroundValueConstraint con : toAdd)
				reasoner.addGroundKernel(con);
			toAdd.clear();

		}
		while (continueGrowing);
		log.debug("Finished growing labeled network.");

		/* Computes the observed incompatibilities */
		double[] truthIncompatibility = new double[kernels.size()];
		for (int i = 0; i < kernels.size(); i++) {
			for (GroundKernel gk : reasoner.getGroundKernels(kernels.get(i))) {
				truthIncompatibility[i] += ((GroundCompatibilityKernel) gk).getIncompatibility();
			}
		}

		/* Removes label value constraints */
		for (GroundValueConstraint con : targetMap.values()) {
			reasoner.removeGroundKernel(con);
		}

		return truthIncompatibility;
	}

	@Override
	protected double[] computeExpectedIncomp() {
		double[] expIncomp = new double[kernels.size()];

		/* Computes the MPE state */
		do {
			eventFramework.workOffJobQueue();
			reasoner.optimize();
		}
		while (eventFramework.checkToActivate() > 0);

		/* Computes incompatibility */
		for (int i = 0; i < kernels.size(); i++) {
			for (GroundKernel gk : reasoner.getGroundKernels(kernels.get(i))) {
				expIncomp[i] += ((GroundCompatibilityKernel) gk).getIncompatibility();
			}
		}

		return expIncomp;
	}

	@Override
	protected double[] computeScalingFactor() {
		double[] scalingFactor = new double[kernels.size()];

		for (int i = 0; i < kernels.size(); i++) {
			Iterator<GroundKernel> itr = reasoner.getGroundKernels(kernels.get(i)).iterator();
			while(itr.hasNext()) {
				itr.next();
				scalingFactor[i]++;
			}

			if (scalingFactor[i] == 0.0)
				scalingFactor[i]++;
		}

		return scalingFactor;
	}

	@Override
	protected void cleanUpGroundModel() {
		/* Unregisters the Model's Kernels with the AtomEventFramework */
		for (Kernel k : model.getKernels())
			k.unregisterForAtomEvents(eventFramework, reasoner);
		eventFramework = null;

		super.cleanUpGroundModel();
	}

}


text:
/* eslint-disable */

'use strict';

/*::
import type { Fragment, ReaderFragment } from 'relay-runtime';
import type { FragmentType } from "relay-runtime";
declare export opaque type RelayReferenceMarkerTest1Fragment$fragmentType: FragmentType;
export type RelayReferenceMarkerTest1Fragment$data = {|
  +firstName: ?string,
  +friends: ?{|
    +edges: ?$ReadOnlyArray<?{|
      +cursor: ?string,
      +node: ?{|
        +firstName: ?string,
        +id: string,
      |},
    |}>,
  |},
  +profilePicture: ?{|
    +uri: ?string,
  |},
  +$fragmentType: RelayReferenceMarkerTest1Fragment$fragmentType,
|};
export type RelayReferenceMarkerTest1Fragment$key = {
  +$data?: RelayReferenceMarkerTest1Fragment$data,
  +$fragmentSpreads: RelayReferenceMarkerTest1Fragment$fragmentType,
  ...
};
*/

var node/*: ReaderFragment*/ = (function(){
var v0 = {
  "alias": null,
  "args": null,
  "kind": "ScalarField",
  "name": "firstName",
  "storageKey": null
};
return {
  "argumentDefinitions": [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "size"
    }
  ],
  "kind": "Fragment",
  "metadata": null,
  "name": "RelayReferenceMarkerTest1Fragment",
  "selections": [
    (v0/*: any*/),
    {
      "alias": null,
      "args": [
        {
          "kind": "Literal",
          "name": "first",
          "value": 3
        }
      ],
      "concreteType": "FriendsConnection",
      "kind": "LinkedField",
      "name": "friends",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "FriendsEdge",
          "kind": "LinkedField",
          "name": "edges",
          "plural": true,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "cursor",
              "storageKey": null
            },
            {
              "alias": null,
              "args": null,
              "concreteType": "User",
              "kind": "LinkedField",
              "name": "node",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "kind": "ScalarField",
                  "name": "id",
                  "storageKey": null
                },
                (v0/*: any*/)
              ],
              "storageKey": null
            }
          ],
          "storageKey": null
        }
      ],
      "storageKey": "friends(first:3)"
    },
    {
      "alias": null,
      "args": [
        {
          "kind": "Variable",
          "name": "size",
          "variableName": "size"
        }
      ],
      "concreteType": "Image",
      "kind": "LinkedField",
      "name": "profilePicture",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "uri",
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ],
  "type": "User",
  "abstractKey": null
};
})();

if (__DEV__) {
  (node/*: any*/).hash = "90914722103f39a1f621e4d4529be673";
}

module.exports = ((node/*: any*/)/*: Fragment<
  RelayReferenceMarkerTest1Fragment$fragmentType,
  RelayReferenceMarkerTest1Fragment$data,
>*/);


text:
var exports = module.exports;

/**
 * Table client exports.
 */

var TableService = require('./services/table/tableservice');
exports.TableService = TableService;

/**
* Creates a new TableService object.
* If no storageaccount or storageaccesskey are provided, the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables will be used.
*
* @param {string} [storageAccount]          The storage account.
* @param {string} [storageAccessKey]        The storage access key.
* @param {string} [host]                    The host address.
* @param {object} [authenticationProvider]  The authentication provider.
*/
exports.createTableService = function (storageAccount, storageAccessKey, host, authenticationProvider) {
  return new TableService(storageAccount, storageAccessKey, host, authenticationProvider);
};

/**
 * Blob client exports.
 */

var BlobService = require('./services/blob/blobservice');
exports.BlobService = BlobService;

/**
* Creates a new BlobService object.
* If no storageaccount or storageaccesskey are provided, the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables will be used.
*
* @param {string} [storageAccount]          The storage account.
* @param {string} [storageAccessKey]        The storage access key.
* @param {string} [host]                    The host address.
* @param {object} [authenticationProvider]  The authentication provider.
*/
exports.createBlobService = function (storageAccount, storageAccessKey, host, authenticationProvider) {
  return new BlobService(storageAccount, storageAccessKey, host, authenticationProvider);
};

/**
 * Queue client exports.
 */

var QueueService = require('./services/queue/queueservice');
exports.QueueService = QueueService;

/**
* Creates a new QueueService object.
* If no storageAccount or storageAccessKey are provided, the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY
* environment variables will be used.
*
* @param {string} [storageAccount]          The storage account.
* @param {string} [storageAccessKey]        The storage access key.
* @param {string} [host]                    The host address.
* @param {object} [authenticationProvider]  The authentication provider.
*/
exports.createQueueService = function (storageAccount, storageAccessKey, host, authenticationProvider) {
  return new QueueService(storageAccount, storageAccessKey, host, authenticationProvider);
};

/**
* Service Bus client exports.
*/

var ServiceBusService = require('./services/serviceBus/servicebusservice');
exports.ServiceBusService = ServiceBusService;

/**
* Creates a new ServiceBusService object.
*
* @param {string} [namespace]               The service bus namespace.
* @param {string} [accessKey]               The password.
* @param {string} [issuer]                  The issuer.
* @param {string} [acsNamespace]            The acs namespace. Usually the same as the sb namespace with "-sb" suffix.
* @param {string} [host]                    The host address.
* @param {object} [authenticationProvider]  The authentication provider.
*/
exports.createServiceBusService = function (namespace, accessKey, issuer, acsNamespace, host, authenticationProvider) {
  return new ServiceBusService(namespace, accessKey, issuer, acsNamespace, host, authenticationProvider);
};

/**
* ServiceManagement client exports.
*/

var ServiceManagementService = require('./services/serviceManagement/servicemanagementservice');
exports.ServiceManagementService = ServiceManagementService;

/**
* Creates a new ServiceManagementService object.
*
* @param {string} subscriptionId          The subscription ID for the account.
* @param {string} authentication          The authentication object for the client.
*                                         {
*                                            keyfile: 'path to .pem',
*                                            certfile: 'path to .pem',
*                                            keyvalue: privatekey value,
*                                            certvalue: public cert value
*                                         }
* @param {string} hostOptions             The host options to override defaults.
*                                         {
*                                            host: 'management.core.windows.net',
*                                            apiversion: '2012-03-01',
*                                            serializetype: 'XML'
*                                         }
*/
exports.createServiceManagementService = function(subscriptionId, authentication, hostOptions) {
  return new ServiceManagementService(subscriptionId, authentication, hostOptions);
};

/**
* Service Runtime exports.
*/

exports.RoleEnvironment = require('./serviceruntime/roleenvironment');

/**
* Other exports.
*/

exports.ServiceClient = require('./services/core/serviceclient');
exports.TableQuery = require('./services/table/tablequery');
exports.BatchServiceClient = require('./services/table/batchserviceclient');
exports.Constants = require('./util/constants');
exports.LinearRetryPolicyFilter = require('./services/core/linearretrypolicyfilter');
exports.ExponentialRetryPolicyFilter = require('./services/core/exponentialretrypolicyfilter');
exports.SharedAccessSignature = require('./services/blob/sharedaccesssignature');
exports.SharedKey = require('./services/blob/sharedkey');
exports.SharedKeyLite = require('./services/blob/sharedkeylite');
exports.SharedKeyTable = require('./services/table/sharedkeytable');
exports.SharedKeyLiteTable = require('./services/table/sharedkeylitetable');
exports.ISO8061Date = require('./util/iso8061date');
exports.Logger = require('./diagnostics/logger');

/*
* Convenience functions.
*/
exports.isEmulated = function (host) {
  return exports.ServiceClient.isEmulated(host);
};


text:
<?php

Admin::model(\App\Customer::class)
	->form(function ()
{
	// Describing elements in create and editing forms
	FormItem::select('site_id', 'Site')
		->list(\App\Site::class)
		->required();
	FormItem::text('customer', 'Customer')->required();
	FormItem::image('file', 'Image');
	FormItem::text('date', 'Date');
	FormItem::text('url', 'URL site');

})
	->columns(function ()
{
	// Describing columns for table view
	Column::string('id', 'Id');
	Column::string('site_id', 'Site Id');
	Column::string('customer', 'Customer');
	Column::string('date', 'date');
	Column::string('url', 'URL site');
	Column::image('file');
		//Column::yesNo()->myCustomMethod();
});


text:
<?php

namespace Rhubarb\Crown\Tests\LoginProviders;

use Rhubarb\Crown\Context;
use Rhubarb\Crown\Module;
use Rhubarb\Crown\Request\WebRequest;
use Rhubarb\Crown\Response\HtmlResponse;
use Rhubarb\Crown\Response\RedirectResponse;
use Rhubarb\Crown\Tests\RhubarbTestCase;

class ValidateLoginUrlHandlerTest extends RhubarbTestCase
{
    public function testInvalidLoginRedirects()
    {
        $login = new UnitTestingLoginProvider();
        $login->logOut();

        $_SERVER["SCRIPT_NAME"] = "/cant/be/here";

        $request = new WebRequest();
        $request->initialise();

        $response = Module::generateResponseForRequest($request);

        $this->assertInstanceOf(RedirectResponse::class, $response);
    }

    public function testTheLoginUrlisExcludedFromRedirect()
    {
        $_SERVER["SCRIPT_NAME"] = "/defo/not/here/login/index/";

        $request = new WebRequest();
        $context = new Context();
        $context->Request = $request;

        $request->initialise();

        $response = Module::generateResponseForRequest($request);

        $this->assertInstanceOf(HtmlResponse::class, $response);
    }
}


text:
<?xml version="1.1" encoding="UTF-8"?>
<testsuite name="carlosgsouza.vinylshop.functional.v1.SummaryFunctionalSpec" tests="1" failures="0" errors="0" timestamp="2013-12-14T16:29:35" hostname="localhost" time="0.065">
  <properties/>
  <testcase name="should show a summary of the vinyls" classname="carlosgsouza.vinylshop.functional.v1.SummaryFunctionalSpec" time="0.065"/>
  <system-out><![CDATA[]]></system-out>
  <system-err><![CDATA[]]></system-err>
</testsuite>


text:
const Redux = require(`redux`)
const { actions } = require(`../actions`)
const nodeReducer = require(`../reducers/nodes`)
const nodeTouchedReducer = require(`../reducers/nodes-touched`)

jest.mock(`../../db/nodes`)
jest.mock(`../nodes`)

const store = Redux.createStore(
  Redux.combineReducers({ nodeReducer, nodeTouchedReducer }),
  {}
)
describe(`Create and update nodes`, () => {
  beforeEach(() => {
    store.dispatch({
      type: `DELETE_CACHE`,
    })
  })

  it(`allows creating nodes`, () => {
    const action = actions.createNode(
      {
        id: `hi`,
        children: [],
        parent: `test`,
        internal: {
          contentDigest: `hasdfljds`,
          type: `Test`,
        },
        pickle: true,
      },
      {
        name: `tests`,
      }
    )
    expect(action).toMatchSnapshot()
    expect(nodeReducer(undefined, action)).toMatchSnapshot()
  })

  it(`allows updating nodes`, () => {
    const action = actions.createNode(
      {
        id: `hi`,
        children: [],
        parent: `test`,
        internal: {
          contentDigest: `hasdfljds`,
          type: `Test`,
        },
        pickle: true,
        deep: {
          array: [
            0,
            1,
            {
              boom: true,
            },
          ],
        },
      },
      {
        name: `tests`,
      }
    )
    const updateAction = actions.createNode(
      {
        id: `hi`,
        children: [],
        parent: `test`,
        internal: {
          contentDigest: `hasdfljds`,
          type: `Test`,
        },
        pickle: false,
        deep: {
          array: [1, 2],
        },
        deep2: {
          boom: `foo`,
        },
      },
      {
        name: `tests`,
      }
    )
    let state = nodeReducer(undefined, action)
    state = nodeReducer(state, updateAction)
    expect(state.get(`hi`).pickle).toEqual(false)
    expect(state.get(`hi`).deep.array[0]).toEqual(1)
    expect(state.get(`hi`).deep2.boom).toEqual(`foo`)
  })

  it(`nodes that are added are also "touched"`, () => {
    const action = actions.createNode(
      {
        id: `hi`,
        children: [],
        parent: `test`,
        internal: {
          contentDigest: `hasdfljds`,
          type: `Test`,
        },
        pickle: true,
      },
      {
        name: `tests`,
      }
    )
    let state = nodeTouchedReducer(undefined, action)
    expect(state[`hi`]).toBe(true)
  })

  it(`allows adding fields to nodes`, () => {
    const action = actions.createNode(
      {
        id: `hi`,
        children: [],
        parent: `test`,
        internal: {
          contentDigest: `hasdfljds`,
          type: `Test`,
        },
        pickle: true,
      },
      {
        name: `tests`,
      }
    )
    let state = nodeReducer(undefined, action)

    const addFieldAction = actions.createNodeField(
      {
        node: state.get(`hi`),
        name: `joy`,
        value: `soul's delight`,
      },
      {
        name: `test`,
      }
    )
    state = nodeReducer(state, addFieldAction)
    expect(state).toMatchSnapshot()
  })

  it(`throws error if a field is updated by a plugin not its owner`, () => {
    const action = actions.createNode(
      {
        id: `hi`,
        children: [],
        parent: `test`,
        internal: {
          contentDigest: `hasdfljds`,
          type: `Test`,
        },
        pickle: true,
      },
      {
        name: `tests`,
      }
    )
    let state = nodeReducer(undefined, action)

    const addFieldAction = actions.createNodeField(
      {
        node: state.get(`hi`),
        name: `joy`,
        value: `soul's delight`,
      },
      {
        name: `test`,
      }
    )
    state = nodeReducer(state, addFieldAction)

    function callActionCreator() {
      actions.createNodeField(
        {
          node: state.get(`hi`),
          name: `joy`,
          value: `soul's delight`,
        },
        {
          name: `test2`,
        }
      )
    }
    expect(callActionCreator).toThrowErrorMatchingSnapshot()
  })

  it(`throws error if a node is created by a plugin not its owner`, () => {
    actions.createNode(
      {
        id: `hi`,
        children: [],
        parent: `test`,
        internal: {
          contentDigest: `hasdfljds`,
          type: `mineOnly`,
        },
        pickle: true,
      },
      {
        name: `pluginA`,
      }
    )

    function callActionCreator() {
      actions.createNode(
        {
          id: `hi2`,
          children: [],
          parent: `test`,
          internal: {
            contentDigest: `hasdfljds`,
            type: `mineOnly`,
          },
          pickle: true,
        },
        {
          name: `pluginB`,
        }
      )
    }

    expect(callActionCreator).toThrowErrorMatchingSnapshot()
  })

  it(`throws error if a node sets a value on "fields"`, () => {
    function callActionCreator() {
      actions.createNode(
        {
          id: `hi`,
          children: [],
          parent: `test`,
          fields: {
            test: `I can't do this but I like to test boundaries`,
          },
          internal: {
            contentDigest: `hasdfljds`,
            type: `mineOnly`,
          },
          pickle: true,
        },
        {
          name: `pluginA`,
        }
      )
    }

    expect(callActionCreator).toThrowErrorMatchingSnapshot()
  })
})


text:
namespace bp = boost::python;

void register_InOutCircFunction_class(){

    bp::class_< osgAnimation::InOutCircFunction >( "InOutCircFunction" )
        .def(
            "getValueAt"
            , (void (*)( float,float & ))( &::osgAnimation::InOutCircFunction::getValueAt )
            , ( bp::arg("t"), bp::arg("result") ) )
        .staticmethod( "getValueAt" );

}


text:
namespace gin {

namespace {

bool GenerateEntropy(unsigned char* buffer, size_t amount) {
  // TODO(abarth): Gin needs a source of entropy.
  return false;
}

const char kFlags[] = "--use_strict --harmony";

}

void Initialize() {
  v8::V8::SetArrayBufferAllocator(ArrayBufferAllocator::SharedInstance());
  v8::V8::InitializeICU();
  v8::V8::SetFlagsFromString(kFlags, strlen(kFlags));
  v8::V8::SetEntropySource(&GenerateEntropy);
  v8::V8::Initialize();

  v8::Isolate* isolate = v8::Isolate::GetCurrent();
  v8::HandleScope handle_scope(isolate);
  new PerIsolateData(isolate);
}

}  // namespace gin