text:
package org.reclipse.behavior.specification.ui.editpolicies;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.LayerConstants;
import org.eclipse.gef.Request;
import org.eclipse.gef.RequestConstants;
import org.eclipse.gef.editpolicies.SelectionEditPolicy;
import org.eclipse.gef.requests.SelectionRequest;

/**
 * @author Dietrich Travkin
 * @author Last Editor: $Author: lowende $
 * @version $Revision: 361 $ $Date: 2006-10-06 17:38:18 +0200 (Fr, 06 Okt 2006) $
 */
public class SelectAnotherFigureFromPrimaryLayerEditPolicy extends SelectionEditPolicy
{

   private List excludeEditPartTypes = null;

   public SelectAnotherFigureFromPrimaryLayerEditPolicy()
   {
   }

   public SelectAnotherFigureFromPrimaryLayerEditPolicy(List excludeEditPartTypes)
   {
      this.excludeEditPartTypes = excludeEditPartTypes;
   }

   /**
    * @see org.eclipse.gef.editpolicies.SelectionEditPolicy#hideSelection()
    */
   @Override
   protected void hideSelection()
   {
   }

   /**
    * @see org.eclipse.gef.editpolicies.SelectionEditPolicy#showSelection()
    */
   @Override
   protected void showSelection()
   {
   }

   /**
    * Instead of selecting the host EditPart of this policy, an other
    * EditPart from the primary layer is selected.
    *
    * @see org.eclipse.gef.EditPolicy#getTargetEditPart(org.eclipse.gef.Request)
    */
   @Override
   public EditPart getTargetEditPart(Request request)
   {
      if (this.getHost() instanceof GraphicalEditPart && RequestConstants.REQ_SELECTION.equals(request.getType())
            && request instanceof SelectionRequest)
      {
         ArrayList<IFigure> list = new ArrayList<IFigure>(1);
         IFigure exclude = ((GraphicalEditPart) this.getHost()).getFigure();
         list.add(exclude);
         IFigure layer = this.getLayer(LayerConstants.PRIMARY_LAYER);
         Point location = ((SelectionRequest) request).getLocation();
         IFigure figure = null;
         if (location != null)
         {
            figure = layer.findFigureAtExcluding(location.x, location.y, list);
         }
         EditPart result = null;
         while (figure != null && result == null)
         {
            result = (EditPart) this.getHost().getViewer().getVisualPartMap().get(figure);

            if (result != null && this.excludeEditPartTypes != null && this.excludeEditPartTypes.size() > 0)
            {
               Iterator iter = this.excludeEditPartTypes.iterator();
               while (iter.hasNext())
               {
                  Class editPartClass = (Class) iter.next();
                  if (editPartClass.isInstance(result))
                  {
                     result = null;
                     break;
                  }
               }
            }

            if (result == null)
            {
               list.add(figure);
               figure = layer.findFigureAtExcluding(location.x, location.y, list);
            }
         }
         return result;
      }
      return null;
   }
}


text:
var LIVR = require('../lib/LIVR');
var assert = require('chai').assert;

LIVR.Validator.registerDefaultRules({
    my_trim: function() {
        return function(value, undefined, outputArr) {
            if (value === undefined || value === null || typeof value === 'object' || value === '' ) return;

            value += '';
            outputArr.push( value.replace(/^\s*/, '').replace(/\s*$/, '') );
        };
    },
    my_lc: function(field) {
        return function(value, undefined, outputArr) {
            if (value === undefined || value === null || typeof value === 'object' || value === '' ) return;

            value += '';
            outputArr.push( value.toLowerCase() );
        };
    },
    my_ucfirst: function(field) {
        return function(value, undefined, outputArr) {
            if (value === undefined || value === null || typeof value === 'object' || value === '' ) return;

            value += '';
            outputArr.push( value.charAt(0).toUpperCase() + value.slice(1) );
        };
    }
});

test('Validate data with registered rules', function() {
    var validator = new LIVR.Validator({
        word1: ['my_trim', 'my_lc', 'my_ucfirst'],
        word2: ['my_trim', 'my_lc'],
        word3: ['my_ucfirst']
    });

    var output = validator.validate({
        word1: ' wordOne ',
        word2: ' wordTwo ',
        word3: 'wordThree '
    });

    assert.deepEqual( output, {
        word1: 'Wordone',
        word2: 'wordtwo',
        word3: 'WordThree '
    }, 'Should appluy changes to values' );
});

redpajama_set_name: RedPajamaGithub


text:
/**
 * ReportServiceInterface.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
 */

package com.google.api.ads.dfp.axis.v201408;

public interface ReportServiceInterface extends java.rmi.Remote {

    /**
     * Returns the URL at which the report file can be downloaded.
     *

     *         The report will be generated as a gzip archive, containing
     * the report file itself.
     *
     *
     * @param reportJobId the ID of the {@link ReportJob}
     *
     * @param exportFormat the {@link ExportFormat} for the report file
     *
     * @return the URL for report file download
     */
    public java.lang.String getReportDownloadURL(java.lang.Long reportJobId, com.google.api.ads.dfp.axis.v201408.ExportFormat exportFormat) throws java.rmi.RemoteException, com.google.api.ads.dfp.axis.v201408.ApiException;

    /**
     * Returns the URL at which the report file can be downloaded,
     * and allows for customization
     *         of the downloaded report.
     *

     *         By default, the report will be generated as a gzip archive,
     * containing the report file itself.
     *         This can be changed by setting {@link ReportDownloadOptions#useGzipCompression}
     * to false.
     *
     *
     * @param reportJobId the ID of the {@link ReportJob}
     *
     * @param reportDownloadOptions the {@link ReportDownloadOptions} for
     * the request
     *
     * @return the URL for report file download
     */
    public java.lang.String getReportDownloadUrlWithOptions(java.lang.Long reportJobId, com.google.api.ads.dfp.axis.v201408.ReportDownloadOptions reportDownloadOptions) throws java.rmi.RemoteException, com.google.api.ads.dfp.axis.v201408.ApiException;

    /**
     * Returns the {@link ReportJob} uniquely identified by the given
     * ID.
     *
     *
     * @param reportJobId the Id of the report job which must already exist
     *
     * @return the {@code ReportJob} uniquely identified by the given ID
     */
    public com.google.api.ads.dfp.axis.v201408.ReportJob getReportJob(java.lang.Long reportJobId) throws java.rmi.RemoteException, com.google.api.ads.dfp.axis.v201408.ApiException;

    /**
     * Initiates the execution of a {@link ReportQuery} on the server.
     *
     *
The following fields are required:
     *

     *
{@link ReportJob#reportQuery}

     *

     *
     *
     * @param reportJob the report job to run
     *
     * @return the report job with its ID filled in
     */
    public com.google.api.ads.dfp.axis.v201408.ReportJob runReportJob(com.google.api.ads.dfp.axis.v201408.ReportJob reportJob) throws java.rmi.RemoteException, com.google.api.ads.dfp.axis.v201408.ApiException;
}


text:
create table class_level (
  course_level              varchar(255) not null,
  course                    varchar(255),
  level                     integer,
  constraint pk_class_level primary key (course_level))
;

create table course (
  id                        varchar(255) not null,
  course_name               varchar(255),
  constraint pk_course primary key (id))
;

create table lecture (
  id                        bigint not null,
  course                    varchar(255),
  level                     varchar(255),
  topic                     varchar(255),
  description               TEXT,
  video_id                  varchar(255),
  course_level              varchar(255),
  user_id                   bigint,
  constraint pk_lecture primary key (id))
;

create table study_group (
  id                        bigint not null,
  meet_time                 timestamp,
  course                    varchar(255),
  level                     integer,
  location                  varchar(255),
  topics                    varchar(255),
  course_level              varchar(255),
  user_id                   bigint,
  user_ids                  varchar(255),
  date_created              timestamp,
  constraint pk_study_group primary key (id))
;

create table user_info (
  id                        bigint not null,
  first_name                varchar(255),
  last_name                 varchar(255),
  email                     varchar(255),
  password                  varchar(255),
  profile_pic               varchar(255),
  constraint pk_user_info primary key (id))
;

create sequence class_level_seq;

create sequence course_seq;

create sequence lecture_seq;

create sequence study_group_seq;

create sequence user_info_seq;

alter table lecture add constraint fk_lecture_user_1 foreign key (user_id) references user_info (id) on delete restrict on update restrict;
create index ix_lecture_user_1 on lecture (user_id);
alter table study_group add constraint fk_study_group_user_2 foreign key (user_id) references user_info (id) on delete restrict on update restrict;
create index ix_study_group_user_2 on study_group (user_id);

# --- !Downs

SET REFERENTIAL_INTEGRITY FALSE;

drop table if exists class_level;

drop table if exists course;

drop table if exists lecture;

drop table if exists study_group;

drop table if exists user_info;

SET REFERENTIAL_INTEGRITY TRUE;

drop sequence if exists class_level_seq;

drop sequence if exists course_seq;

drop sequence if exists lecture_seq;

drop sequence if exists study_group_seq;

drop sequence if exists user_info_seq;


text:
package com.calsoft.leave.dao.factory;

import com.calsoft.leave.dao.LeaveDaoImpl;

/*Dao Factory class for LeaveEntry Module*/

public class LeaveDaoFactory {
	public static LeaveDaoImpl leaveDaoImpl ;
	static
	{
		leaveDaoImpl = new LeaveDaoImpl();
	}
	public static LeaveDaoImpl getLeaveDao()
	{
		if(leaveDaoImpl==null)
			leaveDaoImpl = new LeaveDaoImpl();
		return leaveDaoImpl;
	}

}


text:
require("babel/register");

const config = require('./config/server');
require('./build/webpack.server')(config);

require('./src/server');


text:
//
//  GTLYouTube_Sources.m
//
// This file can be compiled into projects to avoid adding the individual
// source files for this service.
//

// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
//   YouTube Data API (youtube/v3)
// Description:
//   Programmatic access to YouTube features.
// Documentation:
//   https://developers.google.com/youtube/v3

#import "GTLYouTubeConstants.m"

#import "GTLYouTubeAccessPolicy.m"
#import "GTLYouTubeActivity.m"
#import "GTLYouTubeActivityContentDetails.m"
#import "GTLYouTubeActivityListResponse.m"
#import "GTLYouTubeActivitySnippet.m"
#import "GTLYouTubeChannel.m"
#import "GTLYouTubeChannelContentDetails.m"
#import "GTLYouTubeChannelListResponse.m"
#import "GTLYouTubeChannelSnippet.m"
#import "GTLYouTubeChannelStatistics.m"
#import "GTLYouTubeChannelStatus.m"
#import "GTLYouTubeChannelTopicDetails.m"
#import "GTLYouTubeGeoPoint.m"
#import "GTLYouTubeGuideCategory.m"
#import "GTLYouTubeGuideCategoryListResponse.m"
#import "GTLYouTubeGuideCategorySnippet.m"
#import "GTLYouTubePageInfo.m"
#import "GTLYouTubePlaylist.m"
#import "GTLYouTubePlaylistContentDetails.m"
#import "GTLYouTubePlaylistItem.m"
#import "GTLYouTubePlaylistItemContentDetails.m"
#import "GTLYouTubePlaylistItemListResponse.m"
#import "GTLYouTubePlaylistItemSnippet.m"
#import "GTLYouTubePlaylistListResponse.m"
#import "GTLYouTubePlaylistPlayer.m"
#import "GTLYouTubePlaylistSnippet.m"
#import "GTLYouTubePlaylistStatus.m"
#import "GTLYouTubeResourceId.m"
#import "GTLYouTubeSearchListResponse.m"
#import "GTLYouTubeSearchResult.m"
#import "GTLYouTubeSearchResultSnippet.m"
#import "GTLYouTubeSubscription.m"
#import "GTLYouTubeSubscriptionContentDetails.m"
#import "GTLYouTubeSubscriptionListResponse.m"
#import "GTLYouTubeSubscriptionSnippet.m"
#import "GTLYouTubeThumbnail.m"
#import "GTLYouTubeVideo.m"
#import "GTLYouTubeVideoCategory.m"
#import "GTLYouTubeVideoCategoryListResponse.m"
#import "GTLYouTubeVideoCategorySnippet.m"
#import "GTLYouTubeVideoContentDetails.m"
#import "GTLYouTubeVideoContentDetailsRegionRestriction.m"
#import "GTLYouTubeVideoListResponse.m"
#import "GTLYouTubeVideoMonetizationDetails.m"
#import "GTLYouTubeVideoPlayer.m"
#import "GTLYouTubeVideoRecordingDetails.m"
#import "GTLYouTubeVideoSnippet.m"
#import "GTLYouTubeVideoStatistics.m"
#import "GTLYouTubeVideoStatus.m"
#import "GTLYouTubeVideoTopicDetails.m"

#import "GTLQueryYouTube.m"
#import "GTLServiceYouTube.m"


text:
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.embedding.engine.systemchannels;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import io.flutter.Log;
import io.flutter.embedding.engine.dart.DartExecutor;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.StandardMethodCodec;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;

/**
 * System channel that sends 2-way communication between Flutter and Android to facilitate embedding
 * of Android Views within a Flutter application.
 *
 *
Register a {@link PlatformViewsHandler} to implement the Android side of this channel.
 */
public class PlatformViewsChannel {
  private static final String TAG = "PlatformViewsChannel";

  private final MethodChannel channel;
  private PlatformViewsHandler handler;

  public void invokeViewFocused(int viewId) {
    if (channel == null) {
      return;
    }
    channel.invokeMethod("viewFocused", viewId);
  }

  private static String detailedExceptionString(Exception exception) {
    StringWriter stringWriter = new StringWriter();
    PrintWriter printWriter = new PrintWriter(stringWriter);
    exception.printStackTrace(printWriter);
    return stringWriter.toString();
  }

  private final MethodChannel.MethodCallHandler parsingHandler =
      new MethodChannel.MethodCallHandler() {
        @Override
        public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result result) {
          // If there is no handler to respond to this message then we don't need to
          // parse it. Return.
          if (handler == null) {
            return;
          }

          Log.v(TAG, "Received '" + call.method + "' message.");
          switch (call.method) {
            case "create":
              create(call, result);
              break;
            case "dispose":
              dispose(call, result);
              break;
            case "resize":
              resize(call, result);
              break;
            case "touch":
              touch(call, result);
              break;
            case "setDirection":
              setDirection(call, result);
              break;
            case "clearFocus":
              clearFocus(call, result);
              break;
            case "synchronizeToNativeViewHierarchy":
              synchronizeToNativeViewHierarchy(call, result);
              break;
            default:
              result.notImplemented();
          }
        }

        private void create(@NonNull MethodCall call, @NonNull MethodChannel.Result result) {
          Map<String, Object> createArgs = call.arguments();
          boolean usesHybridComposition =
              createArgs.containsKey("hybrid") && (boolean) createArgs.get("hybrid");
          // In hybrid mode, the size of the view is determined by the size of the Flow layer.
          double width = (usesHybridComposition) ? 0 : (double) createArgs.get("width");
          double height = (usesHybridComposition) ? 0 : (double) createArgs.get("height");

          PlatformViewCreationRequest request =
              new PlatformViewCreationRequest(
                  (int) createArgs.get("id"),
                  (String) createArgs.get("viewType"),
                  width,
                  height,
                  (int) createArgs.get("direction"),
                  createArgs.containsKey("params")
                      ? ByteBuffer.wrap((byte[]) createArgs.get("params"))
                      : null);
          try {
            if (usesHybridComposition) {
              handler.createAndroidViewForPlatformView(request);
              result.success(null);
            } else {
              long textureId = handler.createVirtualDisplayForPlatformView(request);
              result.success(textureId);
            }
          } catch (IllegalStateException exception) {
            result.error("error", detailedExceptionString(exception), null);
          }
        }

        private void dispose(@NonNull MethodCall call, @NonNull MethodChannel.Result result) {
          Map<String, Object> disposeArgs = call.arguments();
          int viewId = (int) disposeArgs.get("id");
          boolean usesHybridComposition =
              disposeArgs.containsKey("hybrid") && (boolean) disposeArgs.get("hybrid");

          try {
            if (usesHybridComposition) {
              handler.disposeAndroidViewForPlatformView(viewId);
            } else {
              handler.disposeVirtualDisplayForPlatformView(viewId);
            }
            result.success(null);
          } catch (IllegalStateException exception) {
            result.error("error", detailedExceptionString(exception), null);
          }
        }

        private void resize(@NonNull MethodCall call, @NonNull MethodChannel.Result result) {
          Map<String, Object> resizeArgs = call.arguments();
          PlatformViewResizeRequest resizeRequest =
              new PlatformViewResizeRequest(
                  (int) resizeArgs.get("id"),
                  (double) resizeArgs.get("width"),
                  (double) resizeArgs.get("height"));
          try {
            handler.resizePlatformView(
                resizeRequest,
                new Runnable() {
                  @Override
                  public void run() {
                    result.success(null);
                  }
                });
          } catch (IllegalStateException exception) {
            result.error("error", detailedExceptionString(exception), null);
          }
        }

        private void touch(@NonNull MethodCall call, @NonNull MethodChannel.Result result) {
          List<Object> args = call.arguments();
          PlatformViewTouch touch =
              new PlatformViewTouch(
                  (int) args.get(0),
                  (Number) args.get(1),
                  (Number) args.get(2),
                  (int) args.get(3),
                  (int) args.get(4),
                  args.get(5),
                  args.get(6),
                  (int) args.get(7),
                  (int) args.get(8),
                  (float) (double) args.get(9),
                  (float) (double) args.get(10),
                  (int) args.get(11),
                  (int) args.get(12),
                  (int) args.get(13),
                  (int) args.get(14),
                  ((Number) args.get(15)).longValue());

          try {
            handler.onTouch(touch);
            result.success(null);
          } catch (IllegalStateException exception) {
            result.error("error", detailedExceptionString(exception), null);
          }
        }

        private void setDirection(@NonNull MethodCall call, @NonNull MethodChannel.Result result) {
          Map<String, Object> setDirectionArgs = call.arguments();
          int newDirectionViewId = (int) setDirectionArgs.get("id");
          int direction = (int) setDirectionArgs.get("direction");

          try {
            handler.setDirection(newDirectionViewId, direction);
            result.success(null);
          } catch (IllegalStateException exception) {
            result.error("error", detailedExceptionString(exception), null);
          }
        }

        private void clearFocus(@NonNull MethodCall call, @NonNull MethodChannel.Result result) {
          int viewId = call.arguments();
          try {
            handler.clearFocus(viewId);
            result.success(null);
          } catch (IllegalStateException exception) {
            result.error("error", detailedExceptionString(exception), null);
          }
        }

        private void synchronizeToNativeViewHierarchy(
            @NonNull MethodCall call, @NonNull MethodChannel.Result result) {
          boolean yes = call.arguments();
          try {
            handler.synchronizeToNativeViewHierarchy(yes);
            result.success(null);
          } catch (IllegalStateException exception) {
            result.error("error", detailedExceptionString(exception), null);
          }
        }
      };

  /**
   * Constructs a {@code PlatformViewsChannel} that connects Android to the Dart code running in
   * {@code dartExecutor}.
   *
   *
The given {@code dartExecutor} is permitted to be idle or executing code.
   *
   *
See {@link DartExecutor}.
   */
  public PlatformViewsChannel(@NonNull DartExecutor dartExecutor) {
    channel =
        new MethodChannel(dartExecutor, "flutter/platform_views", StandardMethodCodec.INSTANCE);
    channel.setMethodCallHandler(parsingHandler);
  }

  /**
   * Sets the {@link PlatformViewsHandler} which receives all events and requests that are parsed
   * from the underlying platform views channel.
   */
  public void setPlatformViewsHandler(@Nullable PlatformViewsHandler handler) {
    this.handler = handler;
  }

  /**
   * Handler that receives platform view messages sent from Flutter to Android through a given
   * {@link PlatformViewsChannel}.
   *
   *
To register a {@code PlatformViewsHandler} with a {@link PlatformViewsChannel}, see {@link
   * PlatformViewsChannel#setPlatformViewsHandler(PlatformViewsHandler)}.
   */
  public interface PlatformViewsHandler {
    /**
     * The Flutter application would like to display a new Android {@code View}, i.e., platform
     * view.
     *
     *
The Android {@code View} is added to the view hierarchy.
     */
    void createAndroidViewForPlatformView(@NonNull PlatformViewCreationRequest request);

    /**
     * The Flutter application would like to dispose of an existing Android {@code View} rendered in
     * the view hierarchy.
     */
    void disposeAndroidViewForPlatformView(int viewId);

    /**
     * The Flutter application would like to display a new Android {@code View}.
     *
     *
{@code View} is added to a {@code VirtualDisplay}. The framework uses id returned by this
     * method to lookup the texture in the engine.
     */
    long createVirtualDisplayForPlatformView(@NonNull PlatformViewCreationRequest request);

    /**
     * The Flutter application would like to dispose of an existing Android {@code View} rendered in
     * a virtual display.
     */
    void disposeVirtualDisplayForPlatformView(int viewId);

    /**
     * The Flutter application would like to resize an existing Android {@code View}, i.e., platform
     * view.
     */
    void resizePlatformView(
        @NonNull PlatformViewResizeRequest request, @NonNull Runnable onComplete);

    /**
     * The user touched a platform view within Flutter.
     *
     *
Touch data is reported in {@code touch}.
     */
    void onTouch(@NonNull PlatformViewTouch touch);

    /**
     * The Flutter application would like to change the layout direction of an existing Android
     * {@code View}, i.e., platform view.
     */
    // TODO(mattcarroll): Introduce an annotation for @TextureId
    void setDirection(int viewId, int direction);

    /** Clears the focus from the platform view with a give id if it is currently focused. */
    void clearFocus(int viewId);

    /**
     * Whether the render surface of {@code FlutterView} should be converted to a {@code
     * FlutterImageView} when a {@code PlatformView} is added.
     *
     *
This is done to syncronize the rendering of the PlatformView and the FlutterView. Defaults
     * to true.
     */
    void synchronizeToNativeViewHierarchy(boolean yes);
  }

  /** Request sent from Flutter to create a new platform view. */
  public static class PlatformViewCreationRequest {
    /** The ID of the platform view as seen by the Flutter side. */
    public final int viewId;

    /** The type of Android {@code View} to create for this platform view. */
    @NonNull public final String viewType;

    /** The density independent width to display the platform view. */
    public final double logicalWidth;

    /** The density independent height to display the platform view. */
    public final double logicalHeight;

    /**
     * The layout direction of the new platform view.
     *
     *
See {@link android.view.View#LAYOUT_DIRECTION_LTR} and {@link
     * android.view.View#LAYOUT_DIRECTION_RTL}
     */
    public final int direction;

    /** Custom parameters that are unique to the desired platform view. */
    @Nullable public final ByteBuffer params;

    /** Creates a request to construct a platform view that uses a virtual display. */
    public PlatformViewCreationRequest(
        int viewId,
        @NonNull String viewType,
        double logicalWidth,
        double logicalHeight,
        int direction,
        @Nullable ByteBuffer params) {
      this.viewId = viewId;
      this.viewType = viewType;
      this.logicalWidth = logicalWidth;
      this.logicalHeight = logicalHeight;
      this.direction = direction;
      this.params = params;
    }
  }

  /**
   * Request sent from Flutter to resize a platform view.
   *
   *
This only applies to platform views that use virtual displays.
   */
  public static class PlatformViewResizeRequest {
    /** The ID of the platform view as seen by the Flutter side. */
    public final int viewId;

    /** The new density independent width to display the platform view. */
    public final double newLogicalWidth;

    /** The new density independent height to display the platform view. */
    public final double newLogicalHeight;

    public PlatformViewResizeRequest(int viewId, double newLogicalWidth, double newLogicalHeight) {
      this.viewId = viewId;
      this.newLogicalWidth = newLogicalWidth;
      this.newLogicalHeight = newLogicalHeight;
    }
  }

  /** The state of a touch event in Flutter within a platform view. */
  public static class PlatformViewTouch {
    /** The ID of the platform view as seen by the Flutter side. */
    public final int viewId;

    /** The amount of time that the touch has been pressed. */
    @NonNull public final Number downTime;
    /** TODO(mattcarroll): javadoc */
    @NonNull public final Number eventTime;

    public final int action;
    /** The number of pointers (e.g, fingers) involved in the touch event. */
    public final int pointerCount;
    /** Properties for each pointer, encoded in a raw format. */
    @NonNull public final Object rawPointerPropertiesList;
    /** Coordinates for each pointer, encoded in a raw format. */
    @NonNull public final Object rawPointerCoords;
    /** TODO(mattcarroll): javadoc */
    public final int metaState;
    /** TODO(mattcarroll): javadoc */
    public final int buttonState;
    /** Coordinate precision along the x-axis. */
    public final float xPrecision;
    /** Coordinate precision along the y-axis. */
    public final float yPrecision;
    /** TODO(mattcarroll): javadoc */
    public final int deviceId;
    /** TODO(mattcarroll): javadoc */
    public final int edgeFlags;
    /** TODO(mattcarroll): javadoc */
    public final int source;
    /** TODO(mattcarroll): javadoc */
    public final int flags;
    /** TODO(iskakaushik): javadoc */
    public final long motionEventId;

    public PlatformViewTouch(
        int viewId,
        @NonNull Number downTime,
        @NonNull Number eventTime,
        int action,
        int pointerCount,
        @NonNull Object rawPointerPropertiesList,
        @NonNull Object rawPointerCoords,
        int metaState,
        int buttonState,
        float xPrecision,
        float yPrecision,
        int deviceId,
        int edgeFlags,
        int source,
        int flags,
        long motionEventId) {
      this.viewId = viewId;
      this.downTime = downTime;
      this.eventTime = eventTime;
      this.action = action;
      this.pointerCount = pointerCount;
      this.rawPointerPropertiesList = rawPointerPropertiesList;
      this.rawPointerCoords = rawPointerCoords;
      this.metaState = metaState;
      this.buttonState = buttonState;
      this.xPrecision = xPrecision;
      this.yPrecision = yPrecision;
      this.deviceId = deviceId;
      this.edgeFlags = edgeFlags;
      this.source = source;
      this.flags = flags;
      this.motionEventId = motionEventId;
    }
  }
}


text:
namespace Daemoniq.Framework
{
    public enum AccountType
    {
        LocalService,
        LocalSystem,
        NetworkService,
        User
    }
}


text:
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using Newtonsoft.Json;

namespace osu.Game.Users
{
    public class Country : IEquatable<Country>
    {
        /// <summary>
        /// The name of this country.
        /// </summary>
        [JsonProperty(@"name")]
        public string FullName;

        /// <summary>
        /// Two-letter flag acronym (ISO 3166 standard)
        /// </summary>
        [JsonProperty(@"code")]
        public string FlagName;

        public bool Equals(Country other) => FlagName == other?.FlagName;
    }
}


text:
// Copyright 2021 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.devtools.build.lib.platform;

import com.google.devtools.build.lib.events.ExtendedEventHandler;

/**
 * This event is fired from {@link
 * com.google.devtools.build.lib.platform.SystemSuspensionModule#suspendCallback} to indicate that
 * the user either suspended the build with a signal or put their computer to sleep.
 */
public class SystemSuspensionEvent implements ExtendedEventHandler.Postable {

  /** The possible reasons a system could be suspended. */
  public enum Reason {
    SIGTSTP("Signal SIGTSTP"),
    SIGCONT("Signal SIGCONT"),
    SLEEP("Computer put to sleep"),
    WAKE("Computer woken up");

    private final String logString;

    Reason(String logString) {
      this.logString = logString;
    }

    public String logString() {
      return logString;
    }

    /** These constants are mapped to enum in third_party/bazel/src/main/native/unix_jni.h. */
    static Reason fromInt(int number) {
      switch (number) {
        case 0:
          return SIGTSTP;
        case 1:
          return SIGCONT;
        case 2:
          return SLEEP;
        case 3:
          return WAKE;
        default:
          throw new IllegalStateException("Unknown suspension reason: " + number);
      }
    }
  };

  private final Reason reason;

  public SystemSuspensionEvent(int reason) {
    this.reason = Reason.fromInt(reason);
  }

  public Reason reason() {
    return reason;
  }

  public String logString() {
    return "SystemSuspensionEvent: " + reason.logString();
  }
}


text:
namespace BackTesting.Model.DataHandlers
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using BackTesting.Model.MarketData;
    using Events;

    public class HistoricDataHandler : IDataHandler
    {
        private readonly IEventBus eventBus;
        private readonly IMarketData marketData;
        private readonly IEnumerator<DateTime> timeEnumerator;

        public DateTime? CurrentTime { get; private set; }
        public bool ContinueBacktest { get; private set; }

        public ICollection<string> Symbols => this.marketData.Symbols;

        public HistoricDataHandler(IEventBus eventBus, IMarketData marketData)
        {
            this.eventBus = eventBus;
            this.marketData = marketData;
            this.ContinueBacktest = true;
            this.timeEnumerator = this.marketData.RowKeys.GetEnumerator();
            this.CurrentTime = null;
        }

        public Bar GetLast(string symbol)
        {
            var bars = this.marketData.Bars[symbol];

            if (bars == null)
            {
                return null;
            }

            if (!this.CurrentTime.HasValue)
            {
                return null;
            }

            var dateTime = this.CurrentTime.Value;

            if (bars.ContainsKey(dateTime))
            {
                return bars[dateTime];
            }

            var smallerDate = bars.Keys.OrderByDescending(k => k).FirstOrDefault(key => key <= dateTime);

            return bars.ContainsKey(smallerDate) ? bars[smallerDate] : null;
        }

        public decimal? GetLastClosePrice(string symbol)
        {
            return this.GetLast(symbol)?.Close;
        }

        public void Update()
        {
            if (!this.ContinueBacktest)
            {
                return;
            }

            this.CurrentTime = this.GetNextTime();

            if (this.CurrentTime.HasValue)
            {
                this.eventBus.Put(new MarketEvent(this.CurrentTime.Value));
            }
            else
            {
                this.ContinueBacktest = false;
            }
        }

        private DateTime? GetNextTime()
        {
            var moved = this.timeEnumerator.MoveNext();
            return moved ? this.timeEnumerator.Current : (DateTime?)null;
        }
    }
}


text:
/*HOME5.CSS*/
/*-------------------------------------------------------------------------------------------------------------------------------*/
/*This is main CSS file that contains custom style rules used in this template*/
/*-------------------------------------------------------------------------------------------------------------------------------*/
/* Template Name: DIGNITY.*/
/* Version: 1.3 Update Release*/
/* Build Date: 7th Feb 2014*/
/* For more info about this version please see update log: http://designova.net/changelog/dignity.pdf */
/* Author: Designova.*/
/* Website: http://www.designova.net */
/* Copyright: (C) 2013 */
/*-------------------------------------------------------------------------------------------------------------------------------*/

#masthead{
	background-color: transparent;
}
.logo{
	float: left !important;
	margin-left: 60px !important;
}
#intro{
	height: 100%;
	background: url('../images/mask/raster.png') repeat;
}
.top-banner-caption-v5{
	text-align: right;
	display: block;
	width: 50%;
	margin-left: 50%;
	background: #fff !important;
	padding: 50px;
}
.top-banner-caption-v5 h3{
	color: #000;
font-family:"OpenSansLight";
	font-size: 14px;
	line-height: 21px;
	margin-bottom: 20px;
}
.top-banner-caption-v5 h3>span{
	padding: 5px 10px;
}
.top-banner-caption-v5 h1{
	margin-top: 0px;
	color: #000;
font-family:"NexaLight";
	text-transform: uppercase;
	font-size: 96px;
	font-weight: 100;
}


text:
package gov.nist.csd.pm.common.action;

import javax.swing.*;
import java.awt.event.ActionEvent;

/**
* Created by IntelliJ IDEA.
* User: R McHugh
* Date: 6/22/11
* Time: 11:59 AM
 * Abstraction for creating an wrapper around an Action.  This behavior is dictated by the ActionRef interface
*/
public class ActionWrapper extends AbstractActionWrapper {

    /**
     * Creates and returns a simple wrapped ActionRef
     * @param action
     * @return
     */
    public static ActionRef createReference(Action action){
        return createReference(action, null);
    }

    /**
     * Creates and returns a simple wrapped ActionRef with a specified target object.
     * Actions generally act on something specific.  This just formalizes that relationship.
     * @param action
     * @param target
     * @return
     */
    public static  ActionRef createReference(Action action, Object target){
    	ActionWrapper wrapper = new ActionWrapper(action);
    	wrapper.setTarget(target);
    	return wrapper;
    }

    public ActionWrapper(Action action){
        super(action);
    }

    /**
     * Makes an action vetoable by wrapping it in a VetoableAction.  The VetoListener will be checked
     * prior to the wrapped Action's invocation
     * @param vetoListener
     */
    @Override
    public void addVeto(VetoListener vetoListener){
        setAction(new VetoableAction(getAction(), vetoListener));
    }

    /**
     * Appends an Action to the beginning of another.  The new action is guaranteed to be run BEFORE
     * the original Action.
     * @param preActionAction
     */
    @Override
    public void addPreEventAction(Action preActionAction){
        setAction(new PreAction(getAction(), preActionAction));
    }

    /**
     * Appends an Action to the end of another.  The new action is quaranteed to be run AFTER
     * the original Action.
     * @param postActionAction
     */
    @Override
    public void addPostEventAction(Action postActionAction){
        setAction(new PostAction(getAction(), postActionAction));
    }

    private TargetedActionEvent targetAction(ActionEvent ae){
    	return
		new TargetedActionEvent(
				ae.getSource(),
				ae.getID(),
				ae.getActionCommand(),
				ae.getWhen(),
				ae.getModifiers(),
				getTarget());
    }

    @Override
    public void actionPerformed(ActionEvent ae) {
        getAction().actionPerformed(targetAction(ae));
    }

    /**
     * Replaces the currently wrapped action with the one specified.  The original action is saved
     * and can be reinstated through the use of removeActionRef().
     *
     * @param action
     */
	@Override
	public void pushAction(Action action) {
		setAction(new PushAction(getAction(), action));
	}

    /**
     * Represents a "pushed" action and provides for saving the original action.
     */
	private static class PushAction extends ActionCombiner{

		public PushAction(Action originalAction, Action newAction) {
			super(originalAction, newAction);
		}

		public void actionPerformed(ActionEvent ae){
			_combinedAction.actionPerformed(ae);
		}

	}

    /**
     * removes the Action being wrapped if it is an ActionRef.  The action represented by the ActionRef
     * becomes the new action being wrapped.  In essence an ActionWrapper can actually be a stack of ActionRef's
     * ending in an Action.  This functionality removes the most recent ActionRef from the stack.
     */
	@Override
	public void removeActionRef() {
		Action act = getAction();
		if(act instanceof ActionRef){
			ActionRef actr = (ActionRef)act;
			setAction(actr.getAction());
		}

	}
}


text:
TestPlugin::TestPlugin()
{
}

TestPlugin::~TestPlugin()
{
}


text:
var selftest = require('../tool-testing/selftest.js');
var utils = require('../utils/utils.js');

selftest.define('subset generator', function () {
  var out = [];
  utils.generateSubsetsOfIncreasingSize(['a', 'b', 'c'], function (x) {
    out.push(x);
  });
  selftest.expectEqual(out, [
    [],
    [ 'a' ],
    [ 'b' ],
    [ 'c' ],
    [ 'a', 'b' ],
    [ 'a', 'c' ],
    [ 'b', 'c' ],
    [ 'a', 'b', 'c' ]
  ]);
  out = [];
  utils.generateSubsetsOfIncreasingSize(['a', 'b', 'c'], function (x) {
    out.push(x);
    if (x[1] === 'c') {
      // stop iterating
      return true;
    }
  });
  selftest.expectEqual(out, [
    [],
    [ 'a' ],
    [ 'b' ],
    [ 'c' ],
    [ 'a', 'b' ],
    [ 'a', 'c' ]
  ]);
});

selftest.define("url has scheme", function () {
  // URL scheme must start with a letter, and then can be followed by
  // any number of alphanumerics, +, -, . RFC 2396 Appendix A.
  selftest.expectEqual(utils.hasScheme("http://example.com"), true);
  selftest.expectEqual(utils.hasScheme("https://example.com"), true);
  selftest.expectEqual(utils.hasScheme("ddp://example.com"), true);
  selftest.expectEqual(utils.hasScheme("http://example.com:80"), true);
  selftest.expectEqual(utils.hasScheme("https://example.com:443"), true);
  selftest.expectEqual(utils.hasScheme("ddp://example.com:443"), true);
  selftest.expectEqual(utils.hasScheme("ddp://example"), true);
  selftest.expectEqual(utils.hasScheme("ddp://"), true);
  selftest.expectEqual(utils.hasScheme("example.comhttp://"), true);
  selftest.expectEqual(utils.hasScheme("example+com+http://"), true);
  selftest.expectEqual(utils.hasScheme("example-com+http://"), true);

  selftest.expectEqual(utils.hasScheme("example"), false);
  selftest.expectEqual(utils.hasScheme("example.com"), false);
  selftest.expectEqual(utils.hasScheme("example.com:443"), false);
  selftest.expectEqual(utils.hasScheme("http:/example"), false);
  selftest.expectEqual(utils.hasScheme("http:example"), false);
  selftest.expectEqual(utils.hasScheme("example_com+http://"), false);
});

selftest.define("parse url", function () {
  selftest.expectEqual(utils.parseUrl("http://localhost:3000"), {
    host: "localhost",
    port: "3000",
    protocol: "http://"
  });
  selftest.expectEqual(utils.parseUrl("https://localhost:3000"), {
    host: "localhost",
    port: "3000",
    protocol: "https://"
  });
  selftest.expectEqual(utils.parseUrl("localhost:3000"), {
    host: "localhost",
    port: "3000",
    protocol: undefined
  });
  selftest.expectEqual(utils.parseUrl("3000"), {
    host: undefined,
    port: "3000",
    protocol: undefined
  });
  selftest.expectEqual(utils.parseUrl("3000example.com:3000"), {
    host: "3000example.com",
    port: "3000",
    protocol: undefined
  });
  selftest.expectEqual(utils.parseUrl("http://example.com:3000"), {
    host: "example.com",
    port: "3000",
    protocol: "http://"
  });
  selftest.expectEqual(utils.parseUrl("https://example.com:3000"), {
    host: "example.com",
    port: "3000",
    protocol: "https://"
  });
  selftest.expectEqual(utils.parseUrl("example.com:3000"), {
    host: "example.com",
    port: "3000",
    protocol: undefined
  });

  // tests for defaults
  selftest.expectEqual(utils.parseUrl("http://example.com:3000", {
    host: "foo.com",
    port: "4000",
    protocol: "https://"
  }), {
    host: "example.com",
    port: "3000",
    protocol: "http://"
  });
  selftest.expectEqual(utils.parseUrl("example.com:3000", {
    port: "4000",
    protocol: "https://"
  }), {
    host: "example.com",
    port: "3000",
    protocol: "https://"
  });
  selftest.expectEqual(utils.parseUrl("3000", {
    port: "4000",
    protocol: "https://",
    host: "example.com"
  }), {
    host: "example.com",
    port: "3000",
    protocol: "https://"
  });
});


text:
<?php

namespace App\Http\Controllers\Auth;

use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;

class AuthController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Registration & Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users, as well as the
    | authentication of existing users. By default, this controller uses
    | a simple trait to add these behaviors. Why don't you explore it?
    |
    */

    use AuthenticatesAndRegistersUsers, ThrottlesLogins;

    /**
     * Create a new authentication controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest', ['except' => 'getLogout']);
        $this->redirectTo = '/';
    }

    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|max:255|unique:users',
            'email' => 'required|email|max:255|unique:users',
            'password' => 'required|confirmed|min:6',
        ]);
    }

    protected $filter_keys = ["agency-name", "web", "first-name", "last-name", "contact"];

    /**
     * Handle a registration request for the application.
     *
     * @param  \Illuminate\Http\Request $request
     * @return \Illuminate\Http\Response
     */
    public function postRegister(Request $request)
    {
        $validator = $this->validator($request->all());

        if ($validator->fails()) {
            $this->throwValidationException(
                $request, $validator
            );
        }

        $later = array();

        foreach ($this->filter_keys as $key) {
            if($request->request->get($key) != null) {
                $later[$key] = $request->request->get($key);
                $request->request->remove($key);
            }
        }

        $user = $this->create($request->all());

        if ($request->request->get("role") == "agency")
            DB::table("Agentura")->insert([
                "nazov" => $later["agency-name"],
                "web" => $later["web"],
                "eMail" => $request->request->get("email"),
                "IDagentury" => $user->id,
            ]);
        else
            DB::table("Umelec")->insert([
                "meno" => $later["first-name"],
                "priezvisko" => $later["last-name"],
                "kontakt" => $later["contact"],
                "IDumelca" => $user->id,
            ]);

        Auth::login($user);

        return redirect($this->redirectPath());
    }

    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array $data
     * @return User
     */
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password'])
        ]);
    }
}


text:
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

# STDLIB
import io
import os
import warnings

# THIRD-PARTY
from astropy.utils.data import get_pkg_data_contents
from astropy.utils.exceptions import AstropyUserWarning

class ModeIndicator(object):
    """
    This class adds a mode status indicator to a viewer's lower right-hand
    corner.

    Usage:
    Instantiate this class with a Ginga ImageView{Toolkit} object as the
    sole constructor argument.  Save a reference to the mode indicator
    object somewhere so it doesn't get collected.
    """

    def __init__(self, viewer):
        self.viewer = viewer

        # set to false to disable
        self.visible = True

        self.fontsize = 12

        # for displaying modal keyboard state
        self.mode_obj = None
        bm = viewer.get_bindmap()
        bm.add_callback('mode-set', self.mode_change_cb)
        viewer.add_callback('configure', self._configure_cb)

    def mode_change_cb(self, bindmap, mode, modetype):
        # delete the old indicator
        obj = self.mode_obj
        self.mode_obj = None
        #canvas = self.viewer.get_canvas()
        canvas = self.viewer.private_canvas
        if obj:
            try:
                canvas.delete_object(obj)
            except:
                pass

        if not self.visible:
            return True

        # if not one of the standard modifiers, display the new one
        if not mode in (None, 'ctrl', 'shift'):
            Text = canvas.get_draw_class('text')
            Rect = canvas.get_draw_class('rectangle')
            Compound = canvas.get_draw_class('compoundobject')

            if modetype == 'locked':
                text = '%s [L]' % (mode)
            elif modetype == 'softlock':
                text = '%s [SL]' % (mode)
            else:
                text = mode

            xsp, ysp = 4, 6
            wd, ht = self.viewer.get_window_size()
            wd, ht = int(wd), int(ht)
            if self.viewer._originUpper:
                x1, y1 = wd-self.fontsize*len(text), ht-self.fontsize
            else:
                # matplotlib case
                x1, y1 = wd-self.fontsize*len(text), self.fontsize

            o1 = Text(x1, y1, text,
                      fontsize=self.fontsize, color='yellow', coord='canvas')

            wd, ht = self.viewer.renderer.get_dimensions(o1)

            # yellow text on a black filled rectangle
            if self.viewer._originUpper:
                a1, b1, a2, b2 = x1-xsp, y1+ysp, x1+wd+xsp, y1-ht
            else:
                # matplotlib case
                a1, b1, a2, b2 = x1-xsp, y1-ysp, x1+wd+2*xsp, y1+ht+ysp
            o2 = Compound(Rect(a1, b1, a2, b2,
                               color='black', coord='canvas',
                               fill=True, fillcolor='black'),
                               o1)
            self.mode_obj = o2
            canvas.add(o2)

        return True

    def _configure_cb(self, view, width, height):
        # redraw the mode indicator since the window has been resized
        bm = view.get_bindmap()
        mode, modetype = bm.current_mode()
        self.mode_change_cb(bm, mode, modetype)

def generate_cfg_example(config_name, **kwargs):
    """Generate config file documentation for a given config name.

    If found, it will be a Python code block of the contents.
    If not found, it will have a generic message that the config
    is not available.

    Parameters
    ----------
    config_name : str
        Config name that is attached to the configuration file.
        This is the same as input for ``prefs.createCategory()``.
        For example, ``'general'``, ``'channel_Image'``, or
        ``'plugin_Zoom'``.

    kwargs : dict
        Optional keywords for :func:`~astropy.utils.data.get_pkg_data_contents`.

    Returns
    -------
    docstr : str
        Docstring to be inserted into documentation.

    """
    cfgpath = 'examples/configs'  # Where it is in pkg data
    cfgname = config_name + '.cfg'

    try:
        cfgdata = get_pkg_data_contents(
            os.path.join(cfgpath, cfgname), **kwargs)
    except Exception as e:
        warnings.warn(str(e), AstropyUserWarning)
        return ''

    homepath = '~'  # Symbol for HOME for doc only, not actual code
    userfile = os.path.join(homepath, '.ginga', cfgname)

    docstring = io.StringIO()
    docstring.write("""It is customizable using ``{0}``, where ``{1}``
is your HOME directory:

.. code-block:: Python

""".format(userfile, homepath))

    for line in cfgdata.split('\n'):
        line = line.strip()

        if len(line) == 0:
            docstring.write('\n')  # Prevent trailing spaces
        else:
            docstring.write('  {0}\n'.format(line))

    return docstring.getvalue()

#END


text:
module Reports
  class OtherProductsReportService
    include ActionView::Helpers::NumberHelper
    attr_reader :year, :organization

    # @param year [Integer]
    # @param organization [Organization]
    def initialize(year:, organization:)
      @year = year
      @organization = organization
    end

    # @return [Hash]
    def report
      @report ||= { name: 'Other Items',
                    entries: {
                      'Non-diaper products distributed' => number_with_delimiter(distributed_products),
                      '% non-diaper products donated' => "#{percent_donated.round}%",
                      '% non-diaper products bought' => "#{percent_bought.round}%",
                      'Money spent on non-diaper products' => number_to_currency(money_spent),
                      'List of non-diaper products' => product_list
                    } }
    end

    # @return [Integer]
    def distributed_products
      organization
        .distributions
        .for_year(year)
        .joins(line_items: :item)
        .merge(Item.other_categories)
        .sum('line_items.quantity')
    end

    # @return [Float]
    def percent_donated
      return 0.0 if total_products.zero?

      (donated_products / total_products.to_f) * 100
    end

    # @return [Float]
    def percent_bought
      return 0.0 if total_products.zero?

      (purchased_products / total_products.to_f) * 100
    end

    # @return [Float]
    def money_spent
      organization.purchases.for_year(year).sum(:amount_spent_on_other_cents) / 100.0
    end

    # @return [String]
    def product_list
      organization.items.other_categories.map(&:name).sort.uniq.join(', ')
    end

    # @return [Integer]
    def purchased_products
      @purchased_products ||= LineItem.joins(:item)
                                      .merge(Item.other_categories)
                                      .where(itemizable: organization.purchases.for_year(year))
                                      .sum(:quantity)
    end

    # @return [Integer]
    def total_products
      @total_products ||= purchased_products + donated_products
    end

    # @return [Integer]
    def donated_products
      @donated_products ||= LineItem.joins(:item)
                                    .merge(Item.other_categories)
                                    .where(itemizable: organization.donations.for_year(year))
                                    .sum(:quantity)
    end
  end
end


text:
package android.support.v4.app;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;

// Referenced classes of package android.support.v4.app:
//            ab, aa, Z, Y

public class ShareCompat
{

    public static final String EXTRA_CALLING_ACTIVITY = "android.support.v4.app.EXTRA_CALLING_ACTIVITY";
    public static final String EXTRA_CALLING_PACKAGE = "android.support.v4.app.EXTRA_CALLING_PACKAGE";
    private static Y a;

    public ShareCompat()
    {
    }

    static Y a()
    {
        return a;
    }

    public static void configureMenuItem(Menu menu, int i, IntentBuilder intentbuilder)
    {
        MenuItem menuitem = menu.findItem(i);
        if (menuitem == null)
        {
            throw new IllegalArgumentException((new StringBuilder()).append("Could not find menu item with id ").append(i).append(" in the supplied menu").toString());
        } else
        {
            configureMenuItem(menuitem, intentbuilder);
            return;
        }
    }

    public static void configureMenuItem(MenuItem menuitem, IntentBuilder intentbuilder)
    {
        a.a(menuitem, intentbuilder);
    }

    public static ComponentName getCallingActivity(Activity activity)
    {
        ComponentName componentname = activity.getCallingActivity();
        if (componentname == null)
        {
            componentname = (ComponentName)activity.getIntent().getParcelableExtra("android.support.v4.app.EXTRA_CALLING_ACTIVITY");
        }
        return componentname;
    }

    public static String getCallingPackage(Activity activity)
    {
        String s = activity.getCallingPackage();
        if (s == null)
        {
            s = activity.getIntent().getStringExtra("android.support.v4.app.EXTRA_CALLING_PACKAGE");
        }
        return s;
    }

    static
    {
        if (android.os.Build.VERSION.SDK_INT >= 16)
        {
            a = new ab();
        } else
        if (android.os.Build.VERSION.SDK_INT >= 14)
        {
            a = new aa();
        } else
        {
            a = new Z();
        }
    }
}


text:
package src.java.org.apache.cassandra.locator;

import java.io.IOException;

/**
 * PropertyFileEndPointSnitchMBean
 *
 * PropertyFileEndPointSnitchMBean is the management interface for Digg's EndpointSnitch MBean
 *
 * @author Sammy Yu <syu@sammyyu.net>
 *
 */
public interface PropertyFileEndPointSnitchMBean {
    /**
     * The object name of the mbean.
     */
    public static String MBEAN_OBJECT_NAME = "org.apache.cassandra.locator:type=EndPointSnitch";

    /**
     * Reload the rack configuration
     */
    public void reloadConfiguration() throws IOException;

    /**
     * Display the current configuration
     */
    public String displayConfiguration();

}


text:
package org.smurve.hsr2014.domain;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by wgiersche on 28/02/14.
 */
@Entity(name = "Customer")
@Table(name = "CUSTOMERS")
public class Customer extends SecureResource {

    private String customerId;

    private String firstName;
    private String lastName;

    private Customer() {
    } // for JPA

    public Customer(String customerId, String firstName, String lastName ) {
        this.customerId = customerId;
        this.firstName = firstName;
        this.lastName = lastName;
    }

    public String getCustomerId() {
        return customerId;
    }

    public void setCustomerId(String customerId) {
        this.customerId = customerId;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
}


text:
<?php

namespace Skinny\Application\Response;

/**
 * Description of ResponseBase
 *
 * @author Daro
 */
abstract class ResponseBase implements ResponseInterface {

    protected $_body;
    protected $_code;
    protected $_headers = array();

    abstract public function respond();

    public function setBody($body) {
        $this->_body = $body;
    }

    public function setHeader($name, $value, $code = null) {
        if (null !== $code) {
            $this->setCode($code);
        }

        $this->_headers[$name] = $value;
    }

    public function setCode($code) {
        $this->_code = $code;
    }

}


text:
/**
 * Base Typescript file for handling PGN (Portable Game Notation).
 */
/// <reference path='chess.js.d.ts' />
import { Chess } from 'chess.js'
import { parse } from "./pgn-parser"
import { PgnMove } from "./move"

export class PgnGame {
    startPosition: string;
    result: string;
    config: Object
    pgnString: string

    pgnMoves: PgnMove[]

    chess: Chess
    /**
     * Creates an instance of PgnGame. Is constructed normally be the PgnReader.
     * @param config a hash with all parameters given
     * @memberOf PGN
     *
     */
    constructor(pgnMoves: PgnMove[], startPosition: string, result: string, pgnString: string) {
        this.chess = new Chess()
        this.pgnString = pgnString
        this.pgnMoves = pgnMoves
        this.result = result
        if (pgnString !== undefined) {
            this.pgnString = pgnString
        }
        if ( (startPosition === undefined) || (startPosition === null) ) {
            this.chess.reset()
            this.startPosition = this.chess.fen()
        } else {
            this.startPosition = startPosition
            this.chess.load(this.startPosition)
        }
    }

   /**
    * Returns the pgnString. Needed for debugging purpose (only?).
    * @returns the original PGN string
    *
    * @memberOf PGN
    */
    public getPgnString() {
        return this.pgnString
    }

    /**
     * Returns the moves of the game.
     */
    public getMoves() {
        return this.pgnMoves
    }

    /**
     * getResult returns the result of the game (if any)
     */
    public getResult() {
        return this.getResult
    }

}


text:
In the command line, run:

```ruby
gem install 'nytimes-top-stories'
```

## Usage

This gem scrapes data from the New York Times website and presents the top stories
on the front page, here defined as those with a headline, byline, and summary.
Upon execution, the user will be presented with a numbered list of headlines for stories
meeting these criteria. Enter the number of the headline for more information
about the story, type "list" to scrape the site again, or type exit to terminate the program.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/weezwo/nytimes-top-stories.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
//
//  RACTuple.h
//  ReactiveObjC
//
//  Created by Josh Abernathy on 4/12/12.
//  Copyright (c) 2012 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "metamacros.h"

@class RACSequence;

/// Creates a new tuple with the given values. At least one value must be given.
/// Values can be nil.
#define RACTuplePack(...) \
    RACTuplePack_(__VA_ARGS__)

/// Declares new object variables and unpacks a RACTuple into them.
///
/// This macro should be used on the left side of an assignment, with the
/// tuple on the right side. Nothing else should appear on the same line, and the
/// macro should not be the only statement in a conditional or loop body.
///
/// If the tuple has more values than there are variables listed, the excess
/// values are ignored.
///
/// If the tuple has fewer values than there are variables listed, the excess
/// variables are initialized to nil.
///
/// Examples
///
///   RACTupleUnpack(NSString *string, NSNumber *num) = [RACTuple tupleWithObjects:@"foo", @5, nil];
///   NSLog(@"string: %@", string);
///   NSLog(@"num: %@", num);
///
///   /* The above is equivalent to: */
///   RACTuple *t = [RACTuple tupleWithObjects:@"foo", @5, nil];
///   NSString *string = t[0];
///   NSNumber *num = t[1];
///   NSLog(@"string: %@", string);
///   NSLog(@"num: %@", num);
#define RACTupleUnpack(...) \
        RACTupleUnpack_(__VA_ARGS__)

NS_ASSUME_NONNULL_BEGIN

/// A sentinel object that represents nils in the tuple.
///
/// It should never be necessary to create a tuple nil yourself. Just use
/// +tupleNil.
@interface RACTupleNil : NSObject <NSCopying, NSCoding>
/// A singleton instance.
+ (RACTupleNil *)tupleNil;
@end

/// A tuple is an ordered collection of objects. It may contain nils, represented
/// by RACTupleNil.
@interface RACTuple : NSObject <NSCoding, NSCopying, NSFastEnumeration>

@property (nonatomic, readonly) NSUInteger count;

/// These properties all return the object at that index or nil if the number of
/// objects is less than the index.
@property (nonatomic, readonly, nullable) id first;
@property (nonatomic, readonly, nullable) id second;
@property (nonatomic, readonly, nullable) id third;
@property (nonatomic, readonly, nullable) id fourth;
@property (nonatomic, readonly, nullable) id fifth;
@property (nonatomic, readonly, nullable) id last;

/// Creates a new tuple out of the array. Does not convert nulls to nils.
+ (instancetype)tupleWithObjectsFromArray:(NSArray *)array;

/// Creates a new tuple out of the array. If `convert` is YES, it also converts
/// every NSNull to RACTupleNil.
+ (instancetype)tupleWithObjectsFromArray:(NSArray *)array convertNullsToNils:(BOOL)convert;

/// Creates a new tuple with the given objects. Use RACTupleNil to represent
/// nils.
+ (instancetype)tupleWithObjects:(id)object, ... NS_REQUIRES_NIL_TERMINATION;

/// Returns the object at `index` or nil if the object is a RACTupleNil. Unlike
/// NSArray and friends, it's perfectly fine to ask for the object at an index
/// past the tuple's count - 1. It will simply return nil.
- (nullable id)objectAtIndex:(NSUInteger)index;

/// Returns an array of all the objects. RACTupleNils are converted to NSNulls.
- (NSArray *)allObjects;

/// Appends `obj` to the receiver.
///
/// obj - The object to add to the tuple. This argument may be nil.
///
/// Returns a new tuple.
- (instancetype)tupleByAddingObject:(nullable id)obj;

@end

@interface RACTuple (RACSequenceAdditions)

/// Returns a sequence of all the objects. RACTupleNils are converted to NSNulls.
@property (nonatomic, copy, readonly) RACSequence *rac_sequence;

@end

@interface RACTuple (ObjectSubscripting)
/// Returns the object at that index or nil if the number of objects is less
/// than the index.
- (nullable id)objectAtIndexedSubscript:(NSUInteger)idx;
@end

/// This and everything below is for internal use only.
///
/// See RACTuplePack() and RACTupleUnpack() instead.
#define RACTuplePack_(...) \
    ([RACTuple tupleWithObjectsFromArray:@[ metamacro_foreach(RACTuplePack_object_or_ractuplenil,, __VA_ARGS__) ]])

#define RACTuplePack_object_or_ractuplenil(INDEX, ARG) \
    (ARG) ?: RACTupleNil.tupleNil,

#define RACTupleUnpack_(...) \
    metamacro_foreach(RACTupleUnpack_decl,, __VA_ARGS__) \
    \
    int RACTupleUnpack_state = 0; \
    \
    RACTupleUnpack_after: \
        ; \
        metamacro_foreach(RACTupleUnpack_assign,, __VA_ARGS__) \
        if (RACTupleUnpack_state != 0) RACTupleUnpack_state = 2; \
        \
        while (RACTupleUnpack_state != 2) \
            if (RACTupleUnpack_state == 1) { \
                goto RACTupleUnpack_after; \
            } else \
                for (; RACTupleUnpack_state != 1; RACTupleUnpack_state = 1) \
                    [RACTupleUnpackingTrampoline trampoline][ @[ metamacro_foreach(RACTupleUnpack_value,, __VA_ARGS__) ] ]

#define RACTupleUnpack_state metamacro_concat(RACTupleUnpack_state, __LINE__)
#define RACTupleUnpack_after metamacro_concat(RACTupleUnpack_after, __LINE__)
#define RACTupleUnpack_loop metamacro_concat(RACTupleUnpack_loop, __LINE__)

#define RACTupleUnpack_decl_name(INDEX) \
    metamacro_concat(metamacro_concat(RACTupleUnpack, __LINE__), metamacro_concat(_var, INDEX))

#define RACTupleUnpack_decl(INDEX, ARG) \
    __strong id RACTupleUnpack_decl_name(INDEX);

#define RACTupleUnpack_assign(INDEX, ARG) \
    __strong ARG = RACTupleUnpack_decl_name(INDEX);

#define RACTupleUnpack_value(INDEX, ARG) \
    [NSValue valueWithPointer:&RACTupleUnpack_decl_name(INDEX)],

@interface RACTupleUnpackingTrampoline : NSObject

+ (instancetype)trampoline;
- (void)setObject:(nullable RACTuple *)tuple forKeyedSubscript:(NSArray *)variables;

@end

NS_ASSUME_NONNULL_END


text:
package kingpin

import (
	"encoding/hex"
	"fmt"
	"regexp"
	"strconv"
	"time"
)

// This file is autogenerated by "go generate .". Do not modify.

// -- bool Value
type boolValue struct{ v *bool }

func newBoolValue(p *bool) *boolValue {
	return &boolValue{p}
}

func (f *boolValue) Set(s string) error {
	v, err := strconv.ParseBool(s)
	if err == nil {
		*f.v = (bool)(v)
	}
	return err
}

func (f *boolValue) Get() interface{} { return (bool)(*f.v) }

func (f *boolValue) String() string { return fmt.Sprintf("%v", *f.v) }

// Bool parses the next command-line value as bool.
func (p *Clause) Bool() (target *bool) {
	target = new(bool)
	p.BoolVar(target)
	return
}

func (p *Clause) BoolVar(target *bool) {
	p.SetValue(newBoolValue(target))
}

// BoolList accumulates bool values into a slice.
func (p *Clause) BoolList() (target *[]bool) {
	target = new([]bool)
	p.BoolListVar(target)
	return
}

func (p *Clause) BoolListVar(target *[]bool) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newBoolValue(v.(*bool))
	}))
}

// -- string Value
type stringValue struct{ v *string }

func newStringValue(p *string) *stringValue {
	return &stringValue{p}
}

func (f *stringValue) Set(s string) error {
	v, err := s, error(nil)
	if err == nil {
		*f.v = (string)(v)
	}
	return err
}

func (f *stringValue) Get() interface{} { return (string)(*f.v) }

func (f *stringValue) String() string { return string(*f.v) }

// String parses the next command-line value as string.
func (p *Clause) String() (target *string) {
	target = new(string)
	p.StringVar(target)
	return
}

func (p *Clause) StringVar(target *string) {
	p.SetValue(newStringValue(target))
}

// Strings accumulates string values into a slice.
func (p *Clause) Strings() (target *[]string) {
	target = new([]string)
	p.StringsVar(target)
	return
}

func (p *Clause) StringsVar(target *[]string) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newStringValue(v.(*string))
	}))
}

// -- uint Value
type uintValue struct{ v *uint }

func newUintValue(p *uint) *uintValue {
	return &uintValue{p}
}

func (f *uintValue) Set(s string) error {
	v, err := strconv.ParseUint(s, 0, 64)
	if err == nil {
		*f.v = (uint)(v)
	}
	return err
}

func (f *uintValue) Get() interface{} { return (uint)(*f.v) }

func (f *uintValue) String() string { return fmt.Sprintf("%v", *f.v) }

// Uint parses the next command-line value as uint.
func (p *Clause) Uint() (target *uint) {
	target = new(uint)
	p.UintVar(target)
	return
}

func (p *Clause) UintVar(target *uint) {
	p.SetValue(newUintValue(target))
}

// Uints accumulates uint values into a slice.
func (p *Clause) Uints() (target *[]uint) {
	target = new([]uint)
	p.UintsVar(target)
	return
}

func (p *Clause) UintsVar(target *[]uint) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newUintValue(v.(*uint))
	}))
}

// -- uint8 Value
type uint8Value struct{ v *uint8 }

func newUint8Value(p *uint8) *uint8Value {
	return &uint8Value{p}
}

func (f *uint8Value) Set(s string) error {
	v, err := strconv.ParseUint(s, 0, 8)
	if err == nil {
		*f.v = (uint8)(v)
	}
	return err
}

func (f *uint8Value) Get() interface{} { return (uint8)(*f.v) }

func (f *uint8Value) String() string { return fmt.Sprintf("%v", *f.v) }

// Uint8 parses the next command-line value as uint8.
func (p *Clause) Uint8() (target *uint8) {
	target = new(uint8)
	p.Uint8Var(target)
	return
}

func (p *Clause) Uint8Var(target *uint8) {
	p.SetValue(newUint8Value(target))
}

// Uint8List accumulates uint8 values into a slice.
func (p *Clause) Uint8List() (target *[]uint8) {
	target = new([]uint8)
	p.Uint8ListVar(target)
	return
}

func (p *Clause) Uint8ListVar(target *[]uint8) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newUint8Value(v.(*uint8))
	}))
}

// -- uint16 Value
type uint16Value struct{ v *uint16 }

func newUint16Value(p *uint16) *uint16Value {
	return &uint16Value{p}
}

func (f *uint16Value) Set(s string) error {
	v, err := strconv.ParseUint(s, 0, 16)
	if err == nil {
		*f.v = (uint16)(v)
	}
	return err
}

func (f *uint16Value) Get() interface{} { return (uint16)(*f.v) }

func (f *uint16Value) String() string { return fmt.Sprintf("%v", *f.v) }

// Uint16 parses the next command-line value as uint16.
func (p *Clause) Uint16() (target *uint16) {
	target = new(uint16)
	p.Uint16Var(target)
	return
}

func (p *Clause) Uint16Var(target *uint16) {
	p.SetValue(newUint16Value(target))
}

// Uint16List accumulates uint16 values into a slice.
func (p *Clause) Uint16List() (target *[]uint16) {
	target = new([]uint16)
	p.Uint16ListVar(target)
	return
}

func (p *Clause) Uint16ListVar(target *[]uint16) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newUint16Value(v.(*uint16))
	}))
}

// -- uint32 Value
type uint32Value struct{ v *uint32 }

func newUint32Value(p *uint32) *uint32Value {
	return &uint32Value{p}
}

func (f *uint32Value) Set(s string) error {
	v, err := strconv.ParseUint(s, 0, 32)
	if err == nil {
		*f.v = (uint32)(v)
	}
	return err
}

func (f *uint32Value) Get() interface{} { return (uint32)(*f.v) }

func (f *uint32Value) String() string { return fmt.Sprintf("%v", *f.v) }

// Uint32 parses the next command-line value as uint32.
func (p *Clause) Uint32() (target *uint32) {
	target = new(uint32)
	p.Uint32Var(target)
	return
}

func (p *Clause) Uint32Var(target *uint32) {
	p.SetValue(newUint32Value(target))
}

// Uint32List accumulates uint32 values into a slice.
func (p *Clause) Uint32List() (target *[]uint32) {
	target = new([]uint32)
	p.Uint32ListVar(target)
	return
}

func (p *Clause) Uint32ListVar(target *[]uint32) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newUint32Value(v.(*uint32))
	}))
}

// -- uint64 Value
type uint64Value struct{ v *uint64 }

func newUint64Value(p *uint64) *uint64Value {
	return &uint64Value{p}
}

func (f *uint64Value) Set(s string) error {
	v, err := strconv.ParseUint(s, 0, 64)
	if err == nil {
		*f.v = (uint64)(v)
	}
	return err
}

func (f *uint64Value) Get() interface{} { return (uint64)(*f.v) }

func (f *uint64Value) String() string { return fmt.Sprintf("%v", *f.v) }

// Uint64 parses the next command-line value as uint64.
func (p *Clause) Uint64() (target *uint64) {
	target = new(uint64)
	p.Uint64Var(target)
	return
}

func (p *Clause) Uint64Var(target *uint64) {
	p.SetValue(newUint64Value(target))
}

// Uint64List accumulates uint64 values into a slice.
func (p *Clause) Uint64List() (target *[]uint64) {
	target = new([]uint64)
	p.Uint64ListVar(target)
	return
}

func (p *Clause) Uint64ListVar(target *[]uint64) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newUint64Value(v.(*uint64))
	}))
}

// -- int Value
type intValue struct{ v *int }

func newIntValue(p *int) *intValue {
	return &intValue{p}
}

func (f *intValue) Set(s string) error {
	v, err := strconv.ParseFloat(s, 64)
	if err == nil {
		*f.v = (int)(v)
	}
	return err
}

func (f *intValue) Get() interface{} { return (int)(*f.v) }

func (f *intValue) String() string { return fmt.Sprintf("%v", *f.v) }

// Int parses the next command-line value as int.
func (p *Clause) Int() (target *int) {
	target = new(int)
	p.IntVar(target)
	return
}

func (p *Clause) IntVar(target *int) {
	p.SetValue(newIntValue(target))
}

// Ints accumulates int values into a slice.
func (p *Clause) Ints() (target *[]int) {
	target = new([]int)
	p.IntsVar(target)
	return
}

func (p *Clause) IntsVar(target *[]int) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newIntValue(v.(*int))
	}))
}

// -- int8 Value
type int8Value struct{ v *int8 }

func newInt8Value(p *int8) *int8Value {
	return &int8Value{p}
}

func (f *int8Value) Set(s string) error {
	v, err := strconv.ParseInt(s, 0, 8)
	if err == nil {
		*f.v = (int8)(v)
	}
	return err
}

func (f *int8Value) Get() interface{} { return (int8)(*f.v) }

func (f *int8Value) String() string { return fmt.Sprintf("%v", *f.v) }

// Int8 parses the next command-line value as int8.
func (p *Clause) Int8() (target *int8) {
	target = new(int8)
	p.Int8Var(target)
	return
}

func (p *Clause) Int8Var(target *int8) {
	p.SetValue(newInt8Value(target))
}

// Int8List accumulates int8 values into a slice.
func (p *Clause) Int8List() (target *[]int8) {
	target = new([]int8)
	p.Int8ListVar(target)
	return
}

func (p *Clause) Int8ListVar(target *[]int8) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newInt8Value(v.(*int8))
	}))
}

// -- int16 Value
type int16Value struct{ v *int16 }

func newInt16Value(p *int16) *int16Value {
	return &int16Value{p}
}

func (f *int16Value) Set(s string) error {
	v, err := strconv.ParseInt(s, 0, 16)
	if err == nil {
		*f.v = (int16)(v)
	}
	return err
}

func (f *int16Value) Get() interface{} { return (int16)(*f.v) }

func (f *int16Value) String() string { return fmt.Sprintf("%v", *f.v) }

// Int16 parses the next command-line value as int16.
func (p *Clause) Int16() (target *int16) {
	target = new(int16)
	p.Int16Var(target)
	return
}

func (p *Clause) Int16Var(target *int16) {
	p.SetValue(newInt16Value(target))
}

// Int16List accumulates int16 values into a slice.
func (p *Clause) Int16List() (target *[]int16) {
	target = new([]int16)
	p.Int16ListVar(target)
	return
}

func (p *Clause) Int16ListVar(target *[]int16) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newInt16Value(v.(*int16))
	}))
}

// -- int32 Value
type int32Value struct{ v *int32 }

func newInt32Value(p *int32) *int32Value {
	return &int32Value{p}
}

func (f *int32Value) Set(s string) error {
	v, err := strconv.ParseInt(s, 0, 32)
	if err == nil {
		*f.v = (int32)(v)
	}
	return err
}

func (f *int32Value) Get() interface{} { return (int32)(*f.v) }

func (f *int32Value) String() string { return fmt.Sprintf("%v", *f.v) }

// Int32 parses the next command-line value as int32.
func (p *Clause) Int32() (target *int32) {
	target = new(int32)
	p.Int32Var(target)
	return
}

func (p *Clause) Int32Var(target *int32) {
	p.SetValue(newInt32Value(target))
}

// Int32List accumulates int32 values into a slice.
func (p *Clause) Int32List() (target *[]int32) {
	target = new([]int32)
	p.Int32ListVar(target)
	return
}

func (p *Clause) Int32ListVar(target *[]int32) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newInt32Value(v.(*int32))
	}))
}

// -- int64 Value
type int64Value struct{ v *int64 }

func newInt64Value(p *int64) *int64Value {
	return &int64Value{p}
}

func (f *int64Value) Set(s string) error {
	v, err := strconv.ParseInt(s, 0, 64)
	if err == nil {
		*f.v = (int64)(v)
	}
	return err
}

func (f *int64Value) Get() interface{} { return (int64)(*f.v) }

func (f *int64Value) String() string { return fmt.Sprintf("%v", *f.v) }

// Int64 parses the next command-line value as int64.
func (p *Clause) Int64() (target *int64) {
	target = new(int64)
	p.Int64Var(target)
	return
}

func (p *Clause) Int64Var(target *int64) {
	p.SetValue(newInt64Value(target))
}

// Int64List accumulates int64 values into a slice.
func (p *Clause) Int64List() (target *[]int64) {
	target = new([]int64)
	p.Int64ListVar(target)
	return
}

func (p *Clause) Int64ListVar(target *[]int64) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newInt64Value(v.(*int64))
	}))
}

// -- float64 Value
type float64Value struct{ v *float64 }

func newFloat64Value(p *float64) *float64Value {
	return &float64Value{p}
}

func (f *float64Value) Set(s string) error {
	v, err := strconv.ParseFloat(s, 64)
	if err == nil {
		*f.v = (float64)(v)
	}
	return err
}

func (f *float64Value) Get() interface{} { return (float64)(*f.v) }

func (f *float64Value) String() string { return fmt.Sprintf("%v", *f.v) }

// Float64 parses the next command-line value as float64.
func (p *Clause) Float64() (target *float64) {
	target = new(float64)
	p.Float64Var(target)
	return
}

func (p *Clause) Float64Var(target *float64) {
	p.SetValue(newFloat64Value(target))
}

// Float64List accumulates float64 values into a slice.
func (p *Clause) Float64List() (target *[]float64) {
	target = new([]float64)
	p.Float64ListVar(target)
	return
}

func (p *Clause) Float64ListVar(target *[]float64) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newFloat64Value(v.(*float64))
	}))
}

// -- float32 Value
type float32Value struct{ v *float32 }

func newFloat32Value(p *float32) *float32Value {
	return &float32Value{p}
}

func (f *float32Value) Set(s string) error {
	v, err := strconv.ParseFloat(s, 32)
	if err == nil {
		*f.v = (float32)(v)
	}
	return err
}

func (f *float32Value) Get() interface{} { return (float32)(*f.v) }

func (f *float32Value) String() string { return fmt.Sprintf("%v", *f.v) }

// Float32 parses the next command-line value as float32.
func (p *Clause) Float32() (target *float32) {
	target = new(float32)
	p.Float32Var(target)
	return
}

func (p *Clause) Float32Var(target *float32) {
	p.SetValue(newFloat32Value(target))
}

// Float32List accumulates float32 values into a slice.
func (p *Clause) Float32List() (target *[]float32) {
	target = new([]float32)
	p.Float32ListVar(target)
	return
}

func (p *Clause) Float32ListVar(target *[]float32) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newFloat32Value(v.(*float32))
	}))
}

// ExistingFiles accumulates string values into a slice.
func (p *Clause) ExistingFiles() (target *[]string) {
	target = new([]string)
	p.ExistingFilesVar(target)
	return
}

func (p *Clause) ExistingFilesVar(target *[]string) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newExistingFileValue(v.(*string))
	}))
}

// ExistingDirs accumulates string values into a slice.
func (p *Clause) ExistingDirs() (target *[]string) {
	target = new([]string)
	p.ExistingDirsVar(target)
	return
}

func (p *Clause) ExistingDirsVar(target *[]string) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newExistingDirValue(v.(*string))
	}))
}

// ExistingFilesOrDirs accumulates string values into a slice.
func (p *Clause) ExistingFilesOrDirs() (target *[]string) {
	target = new([]string)
	p.ExistingFilesOrDirsVar(target)
	return
}

func (p *Clause) ExistingFilesOrDirsVar(target *[]string) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newExistingFileOrDirValue(v.(*string))
	}))
}

// -- *regexp.Regexp Value
type regexpValue struct{ v **regexp.Regexp }

func newRegexpValue(p **regexp.Regexp) *regexpValue {
	return &regexpValue{p}
}

func (f *regexpValue) Set(s string) error {
	v, err := regexp.Compile(s)
	if err == nil {
		*f.v = (*regexp.Regexp)(v)
	}
	return err
}

func (f *regexpValue) Get() interface{} { return (*regexp.Regexp)(*f.v) }

func (f *regexpValue) String() string { return fmt.Sprintf("%v", *f.v) }

// Regexp parses the next command-line value as *regexp.Regexp.
func (p *Clause) Regexp() (target **regexp.Regexp) {
	target = new(*regexp.Regexp)
	p.RegexpVar(target)
	return
}

func (p *Clause) RegexpVar(target **regexp.Regexp) {
	p.SetValue(newRegexpValue(target))
}

// RegexpList accumulates *regexp.Regexp values into a slice.
func (p *Clause) RegexpList() (target *[]*regexp.Regexp) {
	target = new([]*regexp.Regexp)
	p.RegexpListVar(target)
	return
}

func (p *Clause) RegexpListVar(target *[]*regexp.Regexp) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newRegexpValue(v.(**regexp.Regexp))
	}))
}

// -- []byte Value
type hexBytesValue struct{ v *[]byte }

func newHexBytesValue(p *[]byte) *hexBytesValue {
	return &hexBytesValue{p}
}

func (f *hexBytesValue) Set(s string) error {
	v, err := hex.DecodeString(s)
	if err == nil {
		*f.v = ([]byte)(v)
	}
	return err
}

func (f *hexBytesValue) Get() interface{} { return ([]byte)(*f.v) }

func (f *hexBytesValue) String() string { return fmt.Sprintf("%v", *f.v) }

// Bytes as a hex string.
func (p *Clause) HexBytes() (target *[]byte) {
	target = new([]byte)
	p.HexBytesVar(target)
	return
}

func (p *Clause) HexBytesVar(target *[]byte) {
	p.SetValue(newHexBytesValue(target))
}

// HexBytesList accumulates []byte values into a slice.
func (p *Clause) HexBytesList() (target *[][]byte) {
	target = new([][]byte)
	p.HexBytesListVar(target)
	return
}

func (p *Clause) HexBytesListVar(target *[][]byte) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newHexBytesValue(v.(*[]byte))
	}))
}

// -- time.Duration Value
type durationValue struct{ v *time.Duration }

func newDurationValue(p *time.Duration) *durationValue {
	return &durationValue{p}
}

func (f *durationValue) Set(s string) error {
	v, err := time.ParseDuration(s)
	if err == nil {
		*f.v = (time.Duration)(v)
	}
	return err
}

func (f *durationValue) Get() interface{} { return (time.Duration)(*f.v) }

func (f *durationValue) String() string { return fmt.Sprintf("%v", *f.v) }

// Time duration.
func (p *Clause) Duration() (target *time.Duration) {
	target = new(time.Duration)
	p.DurationVar(target)
	return
}

func (p *Clause) DurationVar(target *time.Duration) {
	p.SetValue(newDurationValue(target))
}

// DurationList accumulates time.Duration values into a slice.
func (p *Clause) DurationList() (target *[]time.Duration) {
	target = new([]time.Duration)
	p.DurationListVar(target)
	return
}

func (p *Clause) DurationListVar(target *[]time.Duration) {
	p.SetValue(newAccumulator(target, func(v interface{}) Value {
		return newDurationValue(v.(*time.Duration))
	}))
}