text:
/* @flow strict */
import { createStore, applyMiddleware, compose } from "redux";
import { electronEnhancer } from "redux-electron-store";
import { middlewares as coreMiddlewares } from "@nteract/core";

import reducers from "./reducers.js";

const middlewares = [];

/* istanbul ignore if -- only used for debugging */
if (process.env.DEBUG === "true") {
  middlewares.push(coreMiddlewares.logger());
}

export default function configureStore() {
  return createStore(
    reducers,
    compose(
      applyMiddleware(...middlewares),
      electronEnhancer()
    )
  );
}

redpajama_set_name: RedPajamaGithub


text:
package ariba.ui.aribaweb.core;

import java.util.Iterator;
import java.util.Map;

public class AWSetValue extends AWBindableElement
{
    protected static final int Append_Phase = 0;
    protected static final int Invoke_Phase = 1;
    protected static final int Take_Phase = 2;

    private AWBinding[] _destinationBindings;
    private AWBinding[] _sourceBindings;

    public void init (String tagName, Map bindingsHashtable)
    {
        _destinationBindings = new AWBinding[bindingsHashtable.size()];
        _sourceBindings = new AWBinding[_destinationBindings.length];
        Iterator keys = bindingsHashtable.keySet().iterator();
        int index = 0;
        while (keys.hasNext()) {
            String currentKey = (String)keys.next();
            AWBinding currentBinding = (AWBinding)bindingsHashtable.get(currentKey);
            _sourceBindings[index] = currentBinding;
            _destinationBindings[index] =
                AWBinding.bindingWithNameAndKeyPath(currentKey, currentKey);
            index++;
        }
        super.init(tagName, null);
    }

    protected void pushBindingValues (AWComponent component)
    {
        for (int index = _sourceBindings.length - 1; index > -1; index--) {
            AWBinding sourceBinding = _sourceBindings[index];
            AWBinding destinationBinding = _destinationBindings[index];
            Object currentValue = sourceBinding.value(component);
            destinationBinding.setValue(currentValue, component);
        }
    }

    protected boolean shouldPush (AWComponent component, int phase)
    {
            // we re-set value every time through
        return true;
    }

    public void applyValues(AWRequestContext requestContext,
                                       AWComponent component)
    {
        if (shouldPush(component, Take_Phase)) {
            pushBindingValues(component);
        }
        super.applyValues(requestContext, component);
    }

    public AWResponseGenerating invokeAction(AWRequestContext requestContext,
                                                        AWComponent component)
    {
        AWResponseGenerating actionResults = null;
        if (shouldPush(component, Invoke_Phase)) {
            pushBindingValues(component);
        }
        actionResults = super.invokeAction(requestContext, component);
        return actionResults;
    }

    public void renderResponse(AWRequestContext requestContext, AWComponent component)
    {
        if (shouldPush(component, Append_Phase)) {
            pushBindingValues(component);
        }
        super.renderResponse(requestContext, component);
    }
}


text:
import {
  Component,
  OnInit,
  Input,
  OnChanges,
  SimpleChanges,
  ChangeDetectorRef,
  ViewChild,
  Output,
  EventEmitter,
  ViewEncapsulation,
  OnDestroy,
  AfterViewInit,
  AfterViewChecked
} from '@angular/core';
import { PatientStatuChangeVisualizationService } from './patient-status-change-visualization.service';
import * as _ from 'lodash';
import { Location } from '@angular/common';
import { Router, ActivatedRoute } from '@angular/router';
import { GridOptions } from 'ag-grid';
import { AgGridNg2 } from 'ag-grid-angular';
import { Subscription } from 'rxjs';
import { TimerObservable } from 'rxjs/observable/TimerObservable';
import * as moment from 'moment/moment';

@Component({
  selector: 'patient-status-change-visualization',
  templateUrl: './patient-status-change-visualization.component.html',
  providers: [PatientStatuChangeVisualizationService],
  styleUrls: ['./patient-status-change-visualization.component.css'],
  encapsulation: ViewEncapsulation.None
})
export class PatientStatusChangeVisualizationComponent
  implements OnInit, OnChanges, OnDestroy, AfterViewInit, AfterViewChecked {
  @Input()
  public renderType: string;
  @Input()
  public showAnalysisTypeSelector = false;
  @Input()
  public data: Array<any> = [];
  @Input()
  public indicatorDefinitions: Array<any> = [];
  public dataTable: Array<any> = [];
  public chartOptions: any;
  public columns: Array<any> = [];
  public analysisTypes: Array<any> = [];
  public selectedAnalysisType: string = null;
  public gridOptions: GridOptions;
  @ViewChild('agGrid')
  public agGrid: AgGridNg2;
  @Output() public filterModelChange = new EventEmitter<any>();

  public filterModel: any;
  public startDate: Date = new Date();
  public endDate: Date = new Date();
  public options: any = {
    date_range: true
  };
  public showIndicatorDefinitions = false;
  public showTable = true;
  public error = false;
  public loading;
  public progressBarTick = 30;
  public timerSubscription: Subscription;

  constructor(
    private patientStatusService: PatientStatuChangeVisualizationService,
    private location: Location,
    private route: ActivatedRoute,
    private router: Router,
    private cdr: ChangeDetectorRef
  ) {
    this.analysisTypes = this.patientStatusService.indicatorsKeys;
    this.selectedAnalysisType = this.analysisTypes[0].value;
  }

  public ngOnChanges(changes: SimpleChanges) {
    if (changes['data']) {
      this.renderView();
    }
  }

  public ngOnInit() {
    this.loading = false;
    this.initRoutesParam();
  }

  public ngOnDestroy(): void {
    if (this.timerSubscription) {
      this.timerSubscription.unsubscribe();
    }
  }
  public ngAfterViewChecked() {
    this.cdr.detectChanges();
  }
  public ngAfterViewInit() {
    this.renderView();
  }

  public onAnalysisTypeChange($event) {
    if ($event) {
      this.selectedAnalysisType = $event;
      const path = this.router.parseUrl(this.location.path());
      path.queryParams['analysis'] = $event;
      this.location.replaceState(path.toString());
      this.renderView();
    }
  }

  public onFilterModelChange(event) {
    const params = {};
    params['startDate'] = event.startDate.format('YYYY-MM-DD');
    params['endDate'] = event.endDate.format('YYYY-MM-DD');
    const path = this.router.parseUrl(this.location.path());
    path.queryParams = params;
    this.location.replaceState(path.toString());
    this.filterModelChange.emit(event);
  }

  public renderChart(): void {
    this.chartOptions = {};
    const immutableData = [...this.data]; // making sure it is immutable
    const data = this.patientStatusService.processData(
      this.selectedAnalysisType,
      immutableData,
      this.renderType,
      true
    );
    this.chartOptions = this.patientStatusService.generateChart({
      renderType: this.renderType,
      data: data,
      analysisType: this.selectedAnalysisType
    });
  }

  public renderDataTable(): void {
    const immutableData = [...this.data]; // making sure it is immutable
    this.dataTable = this.patientStatusService.processData(
      this.selectedAnalysisType,
      immutableData,
      this.renderType,
      false
    );
    const indicatorDefinitions = _.keyBy(this.indicatorDefinitions, 'name');
    this.columns = this.patientStatusService.generateColumnDefinitions(
      this.renderType,
      this.selectedAnalysisType,
      indicatorDefinitions
    );
    this.gridOptions = {} as GridOptions;
    this.gridOptions.columnDefs = this.columns;

    if (this.agGrid && this.agGrid.api) {
      this.agGrid.api.setColumnDefs(this.columns);
    }
    this.gridOptions.onGridReady = (event) => {
      this.gridOptions.enableColResize = true;
      this.gridOptions.enableSorting = true;
      this.gridOptions.enableFilter = true;
      this.gridOptions.showToolPanel = false;
      this.gridOptions.getRowStyle = (params) => {
        return { 'font-size': '14px', cursor: 'pointer' };
      };
      setTimeout(
        () => {
          if (this.gridOptions.api) {
            this.gridOptions.api.sizeColumnsToFit();
          }
        },
        500,
        true
      );
      // setTimeout( () => this.gridOptions.api.sizeColumnsToFit(), 500, true);
    };
  }

  public renderView(): void {
    this.renderChart();
    this.renderDataTable();
  }

  public initRoutesParam(): void {
    const path = this.router.parseUrl(this.location.path());
    // init analysis
    if (path.queryParams['analysis']) {
      this.selectedAnalysisType = path.queryParams['analysis'];
    } else {
      this.selectedAnalysisType = 'active_return';
      path.queryParams['analysis'] = this.selectedAnalysisType;
    }
    // init startDate
    if (path.queryParams['startDate']) {
      this.startDate = new Date(path.queryParams['startDate']);
    } else {
      this.startDate = this.getStartDate();
      path.queryParams['startDate'] = moment(this.startDate).format(
        'YYYY-MM-DD'
      );
    }
    // init endDate
    if (path.queryParams['endDate']) {
      this.endDate = new Date(path.queryParams['endDate']);
    } else {
      this.endDate = this.getEndDate();
      path.queryParams['endDate'] = moment(this.endDate).format('YYYY-MM-DD');
    }
    this.location.replaceState(path.toString());
  }

  public triggerBusyIndicators(
    interval: number,
    show: boolean,
    hasError: boolean = false
  ): void {
    if (show) {
      this.loading = true;
      this.error = false;
      this.progressBarTick = 30;
      if (this.timerSubscription) {
        this.timerSubscription.unsubscribe();
      }
      this.timerSubscription = TimerObservable.create(
        2000 * interval,
        1000 * interval
      ).subscribe((t) => {
        if (this.progressBarTick > 100) {
          this.progressBarTick = 30;
        }
        this.progressBarTick++;
      });
    } else {
      this.error = hasError;
      this.progressBarTick = 100;
      if (this.timerSubscription) {
        this.timerSubscription.unsubscribe();
      }
      this.loading = false;
    }
  }

  private getStartDate() {
    const d = new Date();
    const year = d.getFullYear();
    const month = d.getMonth();
    const day = d.getDate();
    const c = new Date(year, month - 5, 0);
    return c;
  }

  private getEndDate() {
    const d = new Date();
    const year = d.getFullYear();
    const month = d.getMonth();
    const day = d.getDate();
    const c = new Date(year, month - 1, 0);
    return c;
  }
}


text:
/*
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
 */

#ifndef __GTK_SELECTION_H__
#define __GTK_SELECTION_H__

#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

#include <gtk/gtkwidget.h>
#include <gtk/gtktextiter.h>

G_BEGIN_DECLS

typedef struct _GtkTargetPair GtkTargetPair;

/**
 * GtkTargetPair:
 * @target: #GdkAtom representation of the target type
 * @flags: #GtkTargetFlags for DND
 * @info: an application-assigned integer ID which will
 *     get passed as a parameter to e.g the #GtkWidget::selection-get
 *     signal. It allows the application to identify the target
 *     type without extensive string compares.
 *
 * A #GtkTargetPair is used to represent the same
 * information as a table of #GtkTargetEntry, but in
 * an efficient form.
 */
struct _GtkTargetPair
{
  GdkAtom   target;
  guint     flags;
  guint     info;
};

/**
 * GtkTargetList:
 *
 * A #GtkTargetList-struct is a reference counted list
 * of #GtkTargetPair and should be treated as
 * opaque.
 */
typedef struct _GtkTargetList  GtkTargetList;
typedef struct _GtkTargetEntry GtkTargetEntry;

#define GTK_TYPE_SELECTION_DATA (gtk_selection_data_get_type ())
#define GTK_TYPE_TARGET_LIST    (gtk_target_list_get_type ())

/**
 * GtkTargetEntry:
 * @target: a string representation of the target type
 * @flags: #GtkTargetFlags for DND
 * @info: an application-assigned integer ID which will
 *     get passed as a parameter to e.g the #GtkWidget::selection-get
 *     signal. It allows the application to identify the target
 *     type without extensive string compares.
 *
 * A #GtkTargetEntry represents a single type of
 * data than can be supplied for by a widget for a selection
 * or for supplied or received during drag-and-drop.
 */
struct _GtkTargetEntry
{
  gchar *target;
  guint  flags;
  guint  info;
};

GDK_AVAILABLE_IN_ALL
GType          gtk_target_list_get_type  (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GtkTargetList *gtk_target_list_new       (const GtkTargetEntry *targets,
                                          guint                 ntargets);
GDK_AVAILABLE_IN_ALL
GtkTargetList *gtk_target_list_ref       (GtkTargetList  *list);
GDK_AVAILABLE_IN_ALL
void           gtk_target_list_unref     (GtkTargetList  *list);
GDK_AVAILABLE_IN_ALL
void           gtk_target_list_add       (GtkTargetList  *list,
                                          GdkAtom         target,
                                          guint           flags,
                                          guint           info);
GDK_AVAILABLE_IN_ALL
void           gtk_target_list_add_text_targets      (GtkTargetList  *list,
                                                      guint           info);
GDK_AVAILABLE_IN_ALL
void           gtk_target_list_add_rich_text_targets (GtkTargetList  *list,
                                                      guint           info,
                                                      gboolean        deserializable,
                                                      GtkTextBuffer  *buffer);
GDK_AVAILABLE_IN_ALL
void           gtk_target_list_add_image_targets     (GtkTargetList  *list,
                                                      guint           info,
                                                      gboolean        writable);
GDK_AVAILABLE_IN_ALL
void           gtk_target_list_add_uri_targets       (GtkTargetList  *list,
                                                      guint           info);
GDK_AVAILABLE_IN_ALL
void           gtk_target_list_add_table (GtkTargetList        *list,
                                          const GtkTargetEntry *targets,
                                          guint                 ntargets);
GDK_AVAILABLE_IN_ALL
void           gtk_target_list_remove    (GtkTargetList  *list,
                                          GdkAtom         target);
GDK_AVAILABLE_IN_ALL
gboolean       gtk_target_list_find      (GtkTargetList  *list,
                                          GdkAtom         target,
                                          guint          *info);

GDK_AVAILABLE_IN_ALL
GtkTargetEntry * gtk_target_table_new_from_list (GtkTargetList  *list,
                                                 gint           *n_targets);
GDK_AVAILABLE_IN_ALL
void             gtk_target_table_free          (GtkTargetEntry *targets,
                                                 gint            n_targets);

GDK_AVAILABLE_IN_ALL
gboolean gtk_selection_owner_set             (GtkWidget  *widget,
                                              GdkAtom     selection,
                                              guint32     time_);
GDK_AVAILABLE_IN_ALL
gboolean gtk_selection_owner_set_for_display (GdkDisplay *display,
                                              GtkWidget  *widget,
                                              GdkAtom     selection,
                                              guint32     time_);

GDK_AVAILABLE_IN_ALL
void     gtk_selection_add_target    (GtkWidget            *widget,
                                      GdkAtom               selection,
                                      GdkAtom               target,
                                      guint                 info);
GDK_AVAILABLE_IN_ALL
void     gtk_selection_add_targets   (GtkWidget            *widget,
                                      GdkAtom               selection,
                                      const GtkTargetEntry *targets,
                                      guint                 ntargets);
GDK_AVAILABLE_IN_ALL
void     gtk_selection_clear_targets (GtkWidget            *widget,
                                      GdkAtom               selection);
GDK_AVAILABLE_IN_ALL
gboolean gtk_selection_convert       (GtkWidget            *widget,
                                      GdkAtom               selection,
                                      GdkAtom               target,
                                      guint32               time_);
GDK_AVAILABLE_IN_ALL
void     gtk_selection_remove_all    (GtkWidget             *widget);

GDK_AVAILABLE_IN_ALL
GdkAtom       gtk_selection_data_get_selection (const GtkSelectionData *selection_data);
GDK_AVAILABLE_IN_ALL
GdkAtom       gtk_selection_data_get_target    (const GtkSelectionData *selection_data);
GDK_AVAILABLE_IN_ALL
GdkAtom       gtk_selection_data_get_data_type (const GtkSelectionData *selection_data);
GDK_AVAILABLE_IN_ALL
gint          gtk_selection_data_get_format    (const GtkSelectionData *selection_data);
GDK_AVAILABLE_IN_ALL
const guchar *gtk_selection_data_get_data      (const GtkSelectionData *selection_data);
GDK_AVAILABLE_IN_ALL
gint          gtk_selection_data_get_length    (const GtkSelectionData *selection_data);
GDK_AVAILABLE_IN_ALL
const guchar *gtk_selection_data_get_data_with_length
                                               (const GtkSelectionData *selection_data,
                                                gint                   *length);

GDK_AVAILABLE_IN_ALL
GdkDisplay   *gtk_selection_data_get_display   (const GtkSelectionData *selection_data);

GDK_AVAILABLE_IN_ALL
void     gtk_selection_data_set      (GtkSelectionData     *selection_data,
                                      GdkAtom               type,
                                      gint                  format,
                                      const guchar         *data,
                                      gint                  length);
GDK_AVAILABLE_IN_ALL
gboolean gtk_selection_data_set_text (GtkSelectionData     *selection_data,
                                      const gchar          *str,
                                      gint                  len);
GDK_AVAILABLE_IN_ALL
guchar * gtk_selection_data_get_text (const GtkSelectionData     *selection_data);
GDK_AVAILABLE_IN_ALL
gboolean gtk_selection_data_set_pixbuf   (GtkSelectionData  *selection_data,
                                          GdkPixbuf         *pixbuf);
GDK_AVAILABLE_IN_ALL
GdkPixbuf *gtk_selection_data_get_pixbuf (const GtkSelectionData  *selection_data);
GDK_AVAILABLE_IN_ALL
gboolean gtk_selection_data_set_uris (GtkSelectionData     *selection_data,
                                      gchar               **uris);
GDK_AVAILABLE_IN_ALL
gchar  **gtk_selection_data_get_uris (const GtkSelectionData     *selection_data);

GDK_AVAILABLE_IN_ALL
gboolean gtk_selection_data_get_targets          (const GtkSelectionData  *selection_data,
                                                  GdkAtom          **targets,
                                                  gint              *n_atoms);
GDK_AVAILABLE_IN_ALL
gboolean gtk_selection_data_targets_include_text (const GtkSelectionData  *selection_data);
GDK_AVAILABLE_IN_ALL
gboolean gtk_selection_data_targets_include_rich_text (const GtkSelectionData *selection_data,
                                                       GtkTextBuffer    *buffer);
GDK_AVAILABLE_IN_ALL
gboolean gtk_selection_data_targets_include_image (const GtkSelectionData  *selection_data,
                                                   gboolean           writable);
GDK_AVAILABLE_IN_ALL
gboolean gtk_selection_data_targets_include_uri  (const GtkSelectionData  *selection_data);
GDK_AVAILABLE_IN_ALL
gboolean gtk_targets_include_text                (GdkAtom       *targets,
                                                  gint           n_targets);
GDK_AVAILABLE_IN_ALL
gboolean gtk_targets_include_rich_text           (GdkAtom       *targets,
                                                  gint           n_targets,
                                                  GtkTextBuffer *buffer);
GDK_AVAILABLE_IN_ALL
gboolean gtk_targets_include_image               (GdkAtom       *targets,
                                                  gint           n_targets,
                                                  gboolean       writable);
GDK_AVAILABLE_IN_ALL
gboolean gtk_targets_include_uri                 (GdkAtom       *targets,
                                                  gint           n_targets);

GDK_AVAILABLE_IN_ALL
GType             gtk_selection_data_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GtkSelectionData *gtk_selection_data_copy     (const GtkSelectionData *data);
GDK_AVAILABLE_IN_ALL
void              gtk_selection_data_free     (GtkSelectionData *data);

GDK_AVAILABLE_IN_ALL
GType             gtk_target_entry_get_type    (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GtkTargetEntry   *gtk_target_entry_new        (const gchar    *target,
                                               guint           flags,
                                               guint           info);
GDK_AVAILABLE_IN_ALL
GtkTargetEntry   *gtk_target_entry_copy       (GtkTargetEntry *data);
GDK_AVAILABLE_IN_ALL
void              gtk_target_entry_free       (GtkTargetEntry *data);

G_END_DECLS

#endif /* __GTK_SELECTION_H__ */


text:
package thrift

import (
	"math"
	"strconv"
)

type Numeric interface {
	Int64() int64
	Int32() int32
	Int16() int16
	Byte() byte
	Int() int
	Float64() float64
	Float32() float32
	String() string
	isNull() bool
}

type numeric struct {
	iValue int64
	dValue float64
	sValue string
	isNil  bool
}

var (
	INFINITY          Numeric = &numeric{iValue: 0, dValue: math.Inf(1), sValue: "Infinity", isNil: false}
	NEGATIVE_INFINITY Numeric = &numeric{iValue: 0, dValue: math.Inf(-1), sValue: "-Infinity", isNil: false}
	NAN               Numeric = &numeric{iValue: 0, dValue: math.NaN(), sValue: "NaN", isNil: false}
	ZERO              Numeric = &numeric{iValue: 0, dValue: 0, sValue: "0", isNil: false}
	NUMERIC_NULL      Numeric = &numeric{iValue: 0, dValue: 0, sValue: "0", isNil: true}
)

func NewNumericFromDouble(dValue float64) Numeric {
	if math.IsInf(dValue, 1) {
		return INFINITY
	}
	if math.IsInf(dValue, -1) {
		return NEGATIVE_INFINITY
	}
	if math.IsNaN(dValue) {
		return NAN
	}
	iValue := int64(dValue)
	sValue := strconv.FormatFloat(dValue, 'g', 10, 64)
	isNil := false
	return &numeric{iValue: iValue, dValue: dValue, sValue: sValue, isNil: isNil}
}

func NewNumericFromFloat(dValue float32) Numeric {
	if math.IsInf(float64(dValue), 1) {
		return INFINITY
	}
	if math.IsInf(float64(dValue), -1) {
		return NEGATIVE_INFINITY
	}
	if math.IsNaN(float64(dValue)) {
		return NAN
	}
	iValue := int32(dValue)
	sValue := strconv.FormatFloat(float64(dValue), 'g', 10, 32)
	isNil := false
	return &numeric{iValue: int64(iValue), dValue: float64(dValue), sValue: sValue, isNil: isNil}
}

func NewNumericFromI64(iValue int64) Numeric {
	dValue := float64(iValue)
	sValue := strconv.FormatInt(iValue, 10)
	isNil := false
	return &numeric{iValue: iValue, dValue: dValue, sValue: sValue, isNil: isNil}
}

func NewNumericFromI32(iValue int32) Numeric {
	dValue := float64(iValue)
	sValue := string(iValue)
	isNil := false
	return &numeric{iValue: int64(iValue), dValue: dValue, sValue: sValue, isNil: isNil}
}

func NewNumericFromString(sValue string) Numeric {
	if sValue == INFINITY.String() {
		return INFINITY
	}
	if sValue == NEGATIVE_INFINITY.String() {
		return NEGATIVE_INFINITY
	}
	if sValue == NAN.String() {
		return NAN
	}
	iValue, _ := strconv.ParseInt(sValue, 10, 64)
	dValue, _ := strconv.ParseFloat(sValue, 64)
	isNil := len(sValue) == 0
	return &numeric{iValue: iValue, dValue: dValue, sValue: sValue, isNil: isNil}
}

func NewNumericFromJSONString(sValue string, isNull bool) Numeric {
	if isNull {
		return NewNullNumeric()
	}
	if sValue == JSON_INFINITY {
		return INFINITY
	}
	if sValue == JSON_NEGATIVE_INFINITY {
		return NEGATIVE_INFINITY
	}
	if sValue == JSON_NAN {
		return NAN
	}
	iValue, _ := strconv.ParseInt(sValue, 10, 64)
	dValue, _ := strconv.ParseFloat(sValue, 64)
	return &numeric{iValue: iValue, dValue: dValue, sValue: sValue, isNil: isNull}
}

func NewNullNumeric() Numeric {
	return &numeric{iValue: 0, dValue: 0.0, sValue: "", isNil: true}
}

func (p *numeric) Int64() int64 {
	return p.iValue
}

func (p *numeric) Int32() int32 {
	return int32(p.iValue)
}

func (p *numeric) Int16() int16 {
	return int16(p.iValue)
}

func (p *numeric) Byte() byte {
	return byte(p.iValue)
}

func (p *numeric) Int() int {
	return int(p.iValue)
}

func (p *numeric) Float64() float64 {
	return p.dValue
}

func (p *numeric) Float32() float32 {
	return float32(p.dValue)
}

func (p *numeric) String() string {
	return p.sValue
}

func (p *numeric) isNull() bool {
	return p.isNil
}


text:
<!DOCTYPE html>

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <meta charset="utf-8"/>
    <title>API Documentation</title>
    <meta name="author" content=""/>
    <meta name="description" content=""/>

    <link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
    <link href="https://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
    <link href="../css/prism.css" rel="stylesheet" media="all"/>
    <link href="../css/template.css" rel="stylesheet" media="all"/>

    <link rel="shortcut icon" href="../images/favicon.ico"/>
    <link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
    <link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
    <link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>

            API Documentation

                            API Documentation

                            Charts

                                     Class hierarchy diagram

                            Reports

                                     Errors

                                     Markers

                                \

Simplify

Simplify_Webhook

Simplify_InvoiceItem

Simplify_PaymentsApi

Simplify_Event

Simplify_Payment

Simplify_CardToken

Simplify_Authentication

Simplify_Object

Simplify_Plan

Simplify_Tax

Simplify_Authorization

Simplify_ApiException

Simplify_ApiConnectionException

Simplify_AuthenticationException

Simplify_BadRequestException

Simplify_FieldError

Simplify_ObjectNotFoundException

Simplify_NotAllowedException

Simplify_SystemException

Simplify_Chargeback

Simplify_Subscription

Simplify_Refund

Simplify_Invoice

Simplify_Customer

Simplify_ResourceList

Simplify_Coupon

Simplify_AccessToken

Simplify_Deposit

                                                \

\Simplify_Chargeback

Base class for all domain objects.

Summary

                                Methods

                                Properties

                                Constants

                                                                    listChargeback()

                                                                    findChargeback()

                                                                    setAll()

                                                                    getProperties()

                                                                    No public properties found

                                                                    No constants found

                                                                    No protected methods found

                                                                    No protected properties found

                                N/A

                                                                    No private methods found

                                                                    $properties

                                N/A

File

Simplify/Chargeback.php

Package

\Simplify

Class hierarchy

\Simplify_Object

\Simplify_Chargeback

Tags

None found

Properties

$properties

$properties

Inherited from

\Simplify_Object

Tags

None found

Methods

listChargeback()

listChargeback( $criteria, mixed $authentication) : \ResourceList

Retrieve Simplify_Chargeback objects.

Parameters

                                $criteria

                                mixed
                                $authentication

information used for the API call.  If no value is passed the global keys Simplify::public_key and Simplify::private_key are used.  For backwards compatibility the public and private keys may be passed instead of the authentication object.

Returns

                    \ResourceList
                                            —
a ResourceList object that holds the list of Chargeback objects and the total
           number of Chargeback objects available for the given criteria.

                            static

See also

Tags

None found

findChargeback()

findChargeback( $id, mixed $authentication) : \Chargeback

Retrieve a Simplify_Chargeback object from the API

Parameters

                                $id

                                mixed
                                $authentication

information used for the API call.  If no value is passed the global keys Simplify::public_key and Simplify::private_key are used.  For backwards compatibility the public and private keys may be passed instead of the authentication object.

Returns

                    \Chargeback
                                            —
a Chargeback object

                            static

Tags

None found

setAll()

setAll(mixed $hash)

Updates the object's properties with the values in the specified map.

Parameters

                                mixed
                                $hash

array Map of values to set.

Inherited from

\Simplify_Object

Tags

None found

getProperties()

getProperties() : array

Returns the object's properties as a map.

Returns

                    array
                                            —
map of properties.

Inherited from

\Simplify_Object

Tags

None found

            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Chargeback.php

Class Hierarchy Diagram

Errors

Markers

                    Documentation is powered by phpDocumentor  and authored
                    on May 26th, 2015 at 07:26.


text:
package com.amashchenko.eclipse.strutsclipse.strutsxml;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.ui.text.java.CompletionProposalComparator;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;

import com.amashchenko.eclipse.strutsclipse.CompletionProposalHelper;
import com.amashchenko.eclipse.strutsclipse.JarEntryStorage;
import com.amashchenko.eclipse.strutsclipse.ProjectUtil;
import com.amashchenko.eclipse.strutsclipse.ResourceDocument;
import com.amashchenko.eclipse.strutsclipse.java.ActionMethodProposalComparator;
import com.amashchenko.eclipse.strutsclipse.java.JavaClassCompletion;
import com.amashchenko.eclipse.strutsclipse.tilesxml.TilesXmlParser;
import com.amashchenko.eclipse.strutsclipse.xmlparser.PackageData;
import com.amashchenko.eclipse.strutsclipse.xmlparser.TagRegion;

public class StrutsXmlCompletionProposalComputer implements
		ICompletionProposalComputer, StrutsXmlLocations {
	private final StrutsXmlParser strutsXmlParser;
	private final TilesXmlParser tilesXmlParser;

	private final CompletionProposalComparator proposalComparator;
	private final ActionMethodProposalComparator methodProposalComparator;

	public StrutsXmlCompletionProposalComputer() {
		strutsXmlParser = new StrutsXmlParser();
		tilesXmlParser = new TilesXmlParser();
		proposalComparator = new CompletionProposalComparator();
		proposalComparator.setOrderAlphabetically(true);
		methodProposalComparator = new ActionMethodProposalComparator();
	}

	@Override
	public List<ICompletionProposal> computeCompletionProposals(
			CompletionProposalInvocationContext context,
			IProgressMonitor monitor) {
		final TagRegion tagRegion = strutsXmlParser.getTagRegion(
				context.getDocument(), context.getInvocationOffset());

		List<ICompletionProposal> proposals = null;
		String[][] proposalsData = null;

		IRegion proposalRegion = null;
		String elementValuePrefix = null;
		String elementValue = null;
		String multiValueSeparator = null;
		boolean sortProposals = false;

		if (tagRegion != null && tagRegion.getCurrentElement() != null) {
			proposalRegion = tagRegion.getCurrentElement().getValueRegion();
			elementValuePrefix = tagRegion.getCurrentElementValuePrefix();
			elementValue = tagRegion.getCurrentElement().getValue();

			final String key = tagRegion.getName()
					+ tagRegion.getCurrentElement().getName();

			switch (key) {
			case PACKAGE_EXTENDS:
				proposalsData = computePackageExtendsProposals(
						context.getDocument(), tagRegion.getAttrValue(
								StrutsXmlConstants.NAME_ATTR, null));
				// extends attribute can have multiple values separated by ,
				multiValueSeparator = StrutsXmlConstants.MULTI_VALUE_SEPARATOR;
				sortProposals = true;
				break;
			case BEAN_SCOPE:
				proposalsData = StrutsXmlConstants.DEFAULT_BEAN_SCOPES;
				break;
			case CONSTANT_NAME:
				proposalsData = StrutsXmlConstants.DEFAULT_CONSTANTS;
				break;
			case INCLUDE_FILE:
				proposalsData = computeIncludeFileProposals(context
						.getDocument());
				break;
			case INTERCEPTOR_REF_NAME:
			case DEFAULT_INTERCEPTOR_REF_NAME:
				proposalsData = computeInterceptorRefProposals(
						context.getDocument(), context.getInvocationOffset());
				sortProposals = true;
				break;
			case DEFAULT_ACTION_REF_NAME:
				// same as for the result body, but with concrete namespace
				TagRegion packageTagRegion = strutsXmlParser
						.getParentTagRegion(context.getDocument(),
								context.getInvocationOffset(),
								StrutsXmlConstants.PACKAGE_TAG);
				if (packageTagRegion != null) {
					String namespace = packageTagRegion.getAttrValue(
							StrutsXmlConstants.NAMESPACE_ATTR, "");
					proposalsData = CompletionProposalHelper
							.proposalDataFromSet(findRedirectActionNames(
									context.getDocument(),
									context.getInvocationOffset(), namespace));
					sortProposals = true;
				}
				break;
			case ACTION_NAME:
			case ACTION_METHOD:
				final String classAttrValue = tagRegion.getAttrValue(
						StrutsXmlConstants.CLASS_ATTR, null);

				if (classAttrValue == null) {
					proposalsData = StrutsXmlConstants.DEFAULT_METHODS;
				} else {
					List<ICompletionProposal> methodProposals = JavaClassCompletion
							.getActionMethodProposals(elementValuePrefix,
									classAttrValue, context.getDocument(),
									proposalRegion);
					// sort
					Collections.sort(methodProposals, methodProposalComparator);

					// real proposals
					proposals = methodProposals;
				}
				break;
			case BEAN_CLASS:
			case ACTION_CLASS:
				// real proposals
				proposals = JavaClassCompletion.getSimpleJavaProposals(
						elementValuePrefix, context.getDocument(),
						proposalRegion);
				break;
			case RESULT_NAME:
				proposalsData = StrutsXmlConstants.DEFAULT_RESULT_NAMES;
				if (strutsXmlParser.atLeast2_5(context.getDocument())) {
					// from 2.5 result name attribute can have multiple values
					// separated by ,
					multiValueSeparator = StrutsXmlConstants.MULTI_VALUE_SEPARATOR;
				}
				break;
			case RESULT_TYPE:
				proposalsData = StrutsXmlConstants.DEFAULT_RESULT_TYPES;
				break;
			case RESULT_BODY:
				proposalsData = computeResultBodyProposals(
						context.getDocument(), context.getInvocationOffset(),
						tagRegion.getAttrValue(StrutsXmlConstants.TYPE_ATTR,
								null), null);
				sortProposals = true;
				break;
			case PARAM_BODY:
				final String nameAttrValue = tagRegion.getAttrValue(
						StrutsXmlConstants.NAME_ATTR, null);
				if (nameAttrValue != null) {
					TagRegion resultTagRegion = strutsXmlParser
							.getResultTagRegion(context.getDocument(),
									context.getInvocationOffset());
					if (resultTagRegion != null) {
						// name is type value, here
						final String typeAttrValue = resultTagRegion.getName();

						boolean redirectAction = typeAttrValue != null
								&& (StrutsXmlConstants.REDIRECT_ACTION_RESULT
										.equals(typeAttrValue) || StrutsXmlConstants.CHAIN_RESULT
										.equals(typeAttrValue));

						// param name="namespace"
						if (redirectAction
								&& StrutsXmlConstants.NAMESPACE_ATTR
										.equals(nameAttrValue)) {
							Set<String> packageNames = strutsXmlParser
									.getPackageNamespaces(context.getDocument());
							packageNames.remove("");
							proposalsData = CompletionProposalHelper
									.proposalDataFromSet(packageNames);
						} else {
							boolean correctTypeAndName = (StrutsXmlConstants.LOCATION_PARAM
									.equals(nameAttrValue) && !redirectAction)
									|| (redirectAction && StrutsXmlConstants.ACTION_NAME_PARAM
											.equals(nameAttrValue));
							if (correctTypeAndName) {
								final String namespaceParamValue = resultTagRegion
										.getAttrValue(
												StrutsXmlConstants.NAMESPACE_ATTR,
												null);
								proposalsData = computeResultBodyProposals(
										context.getDocument(),
										context.getInvocationOffset(),
										typeAttrValue, namespaceParamValue);
								sortProposals = true;
							}
						}
					}
				}
				break;
			}
		}

		if (proposals == null && proposalsData != null) {
			proposals = CompletionProposalHelper.createAttrCompletionProposals(
					proposalsData, elementValuePrefix, proposalRegion,
					multiValueSeparator, elementValue,
					sortProposals ? proposalComparator : null);
		}
		if (proposals == null) {
			proposals = new ArrayList<ICompletionProposal>();
		}

		return proposals;
	}

	private String[][] computePackageExtendsProposals(final IDocument document,
			final String currentPackageName) {
		// current document
		Set<String> packageNames = strutsXmlParser.getPackageNames(document);

		// other struts files
		IPath currentPath = ProjectUtil.getCurrentDocumentPath(document);
		List<ResourceDocument> resources = ProjectUtil
				.findStrutsResources(document);
		for (ResourceDocument rd : resources) {
			if (!rd.getResource().getFullPath().equals(currentPath)) {
				packageNames.addAll(strutsXmlParser.getPackageNames(rd
						.getDocument()));
			}
		}

		List<JarEntryStorage> jarStorages = ProjectUtil
				.findJarEntryStrutsResources(document);
		for (JarEntryStorage jarStorage : jarStorages) {
			packageNames.addAll(strutsXmlParser.getPackageNames(jarStorage
					.toDocument()));
		}

		// remove current package name
		if (currentPackageName != null
				&& packageNames.contains(currentPackageName)) {
			packageNames.remove(currentPackageName);
		}

		return CompletionProposalHelper.proposalDataFromSet(packageNames);
	}

	private String[][] computeResultBodyProposals(final IDocument document,
			final int offset, final String typeAttrValue,
			final String namespaceParamValue) {
		Set<String> set = null;
		// assume that default is dispatcher for now, TODO improve
		// that
		if (typeAttrValue == null
				|| StrutsXmlConstants.DISPATCHER_RESULT.equals(typeAttrValue)) {
			set = ProjectUtil.findJspHtmlFilesPaths(document);
		} else if (StrutsXmlConstants.TILES_RESULT.equals(typeAttrValue)) {
			set = findTilesDefinitionNames(document);
		} else if (StrutsXmlConstants.FREEMARKER_RESULT.equals(typeAttrValue)) {
			set = ProjectUtil.findFreeMarkerFilesPaths(document);
		} else if (StrutsXmlConstants.REDIRECT_ACTION_RESULT
				.equals(typeAttrValue)
				|| StrutsXmlConstants.CHAIN_RESULT.equals(typeAttrValue)) {
			set = findRedirectActionNames(document, offset, namespaceParamValue);
		}

		return CompletionProposalHelper.proposalDataFromSet(set);
	}

	private Set<String> findTilesDefinitionNames(final IDocument currentDocument) {
		final Set<String> names = new HashSet<String>();

		IProject project = ProjectUtil.getCurrentProject(currentDocument);
		if (project != null && project.exists()) {
			// find tiles resources
			List<ResourceDocument> resources = ProjectUtil
					.findTilesResources(currentDocument);
			for (ResourceDocument rd : resources) {
				names.addAll(tilesXmlParser.getDefinitionNames(rd.getDocument()));
			}
		}

		return names;
	}

	private String[][] computeIncludeFileProposals(
			final IDocument currentDocument) {
		IPath currentPath = ProjectUtil.getCurrentDocumentPath(currentDocument);

		Set<String> paths = new HashSet<String>();
		List<ResourceDocument> resources = ProjectUtil
				.findStrutsResources(currentDocument);

		if (resources != null) {
			for (ResourceDocument r : resources) {
				if (!r.getResource().getFullPath().equals(currentPath)) {
					paths.add(r.getRelativePath());
				}
			}
		}

		return CompletionProposalHelper.proposalDataFromSet(paths);
	}

	private Set<String> findRedirectActionNames(final IDocument document,
			final int offset, final String namespaceParamValue) {
		Set<String> namespaces = new HashSet<String>();

		// if there is a namespaceParamValue then used it, else get
		// namespace from parent package
		String namespace = namespaceParamValue;
		if (namespace == null) {
			TagRegion packageTagRegion = strutsXmlParser.getParentTagRegion(
					document, offset, StrutsXmlConstants.PACKAGE_TAG);
			if (packageTagRegion != null) {
				namespace = packageTagRegion.getAttrValue(
						StrutsXmlConstants.NAMESPACE_ATTR, "");
			} else {
				namespace = "";
			}

			// if namespace came NOT from namespaceParamValue then add special
			// namespaces
			namespaces.add("");
			namespaces.add("/");
		}

		namespaces.add(namespace);

		return strutsXmlParser.getActionNames(document, namespaces);
	}

	private String[][] computeInterceptorRefProposals(final IDocument document,
			final int offset) {
		List<String[]> results = new ArrayList<String[]>();

		TagRegion packageTagRegion = strutsXmlParser.getParentTagRegion(
				document, offset, StrutsXmlConstants.PACKAGE_TAG);
		if (packageTagRegion != null) {
			List<PackageData> packages = strutsXmlParser
					.getAllStrutsPackagesData(document, false);

			collectInterceptorsNames(packages, packageTagRegion.getAttrValue(
					StrutsXmlConstants.NAME_ATTR, ""),
					new ArrayList<PackageData>(), results);
		}

		return CompletionProposalHelper.proposalDataFromList(results);
	}

	private void collectInterceptorsNames(List<PackageData> packages,
			String packageName, List<PackageData> scaned, List<String[]> results) {
		for (PackageData pd : packages) {
			if (packageName.equals(pd.getName()) && !scaned.contains(pd)) {
				if (pd.getTagRegions() != null) {
					for (TagRegion tr : pd.getTagRegions()) {
						String val = tr.getAttrValue(
								StrutsXmlConstants.NAME_ATTR, null);
						if (val != null) {
							results.add(new String[] {
									val,
									tr.getName() + " from " + packageName
											+ " package" });
						}
					}
				}

				scaned.add(pd);

				for (String ext : pd.getExtending()) {
					collectInterceptorsNames(packages, ext, scaned, results);
				}
			}
		}
	}

	@Override
	public List<IContextInformation> computeContextInformation(
			CompletionProposalInvocationContext context,
			IProgressMonitor monitor) {
		return null;
	}

	@Override
	public String getErrorMessage() {
		return null;
	}

	@Override
	public void sessionStarted() {
	}

	@Override
	public void sessionEnded() {
	}
}


text:
//
// This file is auto-generated. Please don't modify it!
//
package org.opencv.contrib;

import org.opencv.core.Mat;

// C++: class StereoVar
/**
 *
Class for computing stereo correspondence using the variational matching
 * algorithm

 *
 *
class StereoVar

 *
 *
// C++ code:

 *
 *
 *
StereoVar();

 *
 *
StereoVar(int levels, double pyrScale,

 *
 *
int nIt, int minDisp, int maxDisp,

 *
 *
int poly_n, double poly_sigma, float fi,

 *
 *
float lambda, int penalization, int cycle,

 *
 *
int flags);

 *
 *
virtual ~StereoVar();

 *
 *
virtual void operator()(InputArray left, InputArray right, OutputArray disp);

 *
 *
int levels;

 *
 *
double pyrScale;

 *
 *
int nIt;

 *
 *
int minDisp;

 *
 *
int maxDisp;

 *
 *
int poly_n;

 *
 *
double poly_sigma;

 *
 *
float fi;

 *
 *
float lambda;

 *
 *
int penalization;

 *
 *
int cycle;

 *
 *
int flags;...

 *
 *
};

 *
 *
The class implements the modified S. G. Kosov algorithm [Publication] that
 * differs from the original one as follows:

 *

 *
 The automatic initialization of method's parameters is added.
 *
 The method of Smart Iteration Distribution (SID) is implemented.
 *
 The support of Multi-Level Adaptation Technique (MLAT) is not
 * included.
 *
 The method of dynamic adaptation of method's parameters is not
 * included.
 *

 *
 * @see org.opencv.contrib.StereoVar
 */
public class StereoVar {

    protected final long nativeObj;
    protected StereoVar(long addr) { nativeObj = addr; }

    public static final int
            USE_INITIAL_DISPARITY = 1,
            USE_EQUALIZE_HIST = 2,
            USE_SMART_ID = 4,
            USE_AUTO_PARAMS = 8,
            USE_MEDIAN_FILTERING = 16,
            CYCLE_O = 0,
            CYCLE_V = 1,
            PENALIZATION_TICHONOV = 0,
            PENALIZATION_CHARBONNIER = 1,
            PENALIZATION_PERONA_MALIK = 2;

    //
    // C++:   StereoVar::StereoVar()
    //

/**
 *
The constructor

 *
 *
The first constructor initializes StereoVar with all the default
 * parameters. So, you only have to set StereoVar.maxDisp and / or
 * StereoVar.minDisp at minimum. The second constructor enables
 * you to set each parameter to a custom value.

 *
 * @see org.opencv.contrib.StereoVar.StereoVar
 */
    public   StereoVar()
    {

        nativeObj = StereoVar_0();

        return;
    }

    //
    // C++:   StereoVar::StereoVar(int levels, double pyrScale, int nIt, int minDisp, int maxDisp, int poly_n, double poly_sigma, float fi, float lambda, int penalization, int cycle, int flags)
    //

/**
 *
The constructor

 *
 *
The first constructor initializes StereoVar with all the default
 * parameters. So, you only have to set StereoVar.maxDisp and / or
 * StereoVar.minDisp at minimum. The second constructor enables
 * you to set each parameter to a custom value.

 *
 * @param levels The number of pyramid layers, including the initial image.
 * levels=1 means that no extra layers are created and only the original images
 * are used. This parameter is ignored if flag USE_AUTO_PARAMS is set.
 * @param pyrScale Specifies the image scale (<1) to build the pyramids for each
 * image. pyrScale=0.5 means the classical pyramid, where each next layer is
 * twice smaller than the previous. (This parameter is ignored if flag
 * USE_AUTO_PARAMS is set).
 * @param nIt The number of iterations the algorithm does at each pyramid level.
 * (If the flag USE_SMART_ID is set, the number of iterations will be
 * redistributed in such a way, that more iterations will be done on more
 * coarser levels.)
 * @param minDisp Minimum possible disparity value. Could be negative in case
 * the left and right input images change places.
 * @param maxDisp Maximum possible disparity value.
 * @param poly_n Size of the pixel neighbourhood used to find polynomial
 * expansion in each pixel. The larger values mean that the image will be
 * approximated with smoother surfaces, yielding more robust algorithm and more
 * blurred motion field. Typically, poly_n = 3, 5 or 7
 * @param poly_sigma Standard deviation of the Gaussian that is used to smooth
 * derivatives that are used as a basis for the polynomial expansion. For
 * poly_n=5 you can set poly_sigma=1.1, for poly_n=7 a good value would be
 * poly_sigma=1.5
 * @param fi The smoothness parameter, ot the weight coefficient for the
 * smoothness term.
 * @param lambda The threshold parameter for edge-preserving smoothness. (This
 * parameter is ignored if PENALIZATION_CHARBONNIER or PENALIZATION_PERONA_MALIK
 * is used.)
 * @param penalization Possible values: PENALIZATION_TICHONOV - linear
 * smoothness; PENALIZATION_CHARBONNIER - non-linear edge preserving smoothness;
 * PENALIZATION_PERONA_MALIK - non-linear edge-enhancing smoothness. (This
 * parameter is ignored if flag USE_AUTO_PARAMS is set).
 * @param cycle Type of the multigrid cycle. Possible values: CYCLE_O and
 * CYCLE_V for null- and v-cycles respectively. (This parameter is ignored if
 * flag USE_AUTO_PARAMS is set).
 * @param flags The operation flags; can be a combination of the following:
 *

 *
 USE_INITIAL_DISPARITY: Use the input flow as the initial flow
 * approximation.
 *
 USE_EQUALIZE_HIST: Use the histogram equalization in the
 * pre-processing phase.
 *
 USE_SMART_ID: Use the smart iteration distribution (SID).
 *
 USE_AUTO_PARAMS: Allow the method to initialize the main parameters.
 *
 USE_MEDIAN_FILTERING: Use the median filer of the solution in the post
 * processing phase.
 *

 *
 * @see org.opencv.contrib.StereoVar.StereoVar
 */
    public   StereoVar(int levels, double pyrScale, int nIt, int minDisp, int maxDisp, int poly_n, double poly_sigma, float fi, float lambda, int penalization, int cycle, int flags)
    {

        nativeObj = StereoVar_1(levels, pyrScale, nIt, minDisp, maxDisp, poly_n, poly_sigma, fi, lambda, penalization, cycle, flags);

        return;
    }

    //
    // C++:  void StereoVar::operator ()(Mat left, Mat right, Mat& disp)
    //

    public  void compute(Mat left, Mat right, Mat disp)
    {

        compute_0(nativeObj, left.nativeObj, right.nativeObj, disp.nativeObj);

        return;
    }

    //
    // C++: int StereoVar::levels
    //

    public  int get_levels()
    {

        int retVal = get_levels_0(nativeObj);

        return retVal;
    }

    //
    // C++: void StereoVar::levels
    //

    public  void set_levels(int levels)
    {

        set_levels_0(nativeObj, levels);

        return;
    }

    //
    // C++: double StereoVar::pyrScale
    //

    public  double get_pyrScale()
    {

        double retVal = get_pyrScale_0(nativeObj);

        return retVal;
    }

    //
    // C++: void StereoVar::pyrScale
    //

    public  void set_pyrScale(double pyrScale)
    {

        set_pyrScale_0(nativeObj, pyrScale);

        return;
    }

    //
    // C++: int StereoVar::nIt
    //

    public  int get_nIt()
    {

        int retVal = get_nIt_0(nativeObj);

        return retVal;
    }

    //
    // C++: void StereoVar::nIt
    //

    public  void set_nIt(int nIt)
    {

        set_nIt_0(nativeObj, nIt);

        return;
    }

    //
    // C++: int StereoVar::minDisp
    //

    public  int get_minDisp()
    {

        int retVal = get_minDisp_0(nativeObj);

        return retVal;
    }

    //
    // C++: void StereoVar::minDisp
    //

    public  void set_minDisp(int minDisp)
    {

        set_minDisp_0(nativeObj, minDisp);

        return;
    }

    //
    // C++: int StereoVar::maxDisp
    //

    public  int get_maxDisp()
    {

        int retVal = get_maxDisp_0(nativeObj);

        return retVal;
    }

    //
    // C++: void StereoVar::maxDisp
    //

    public  void set_maxDisp(int maxDisp)
    {

        set_maxDisp_0(nativeObj, maxDisp);

        return;
    }

    //
    // C++: int StereoVar::poly_n
    //

    public  int get_poly_n()
    {

        int retVal = get_poly_n_0(nativeObj);

        return retVal;
    }

    //
    // C++: void StereoVar::poly_n
    //

    public  void set_poly_n(int poly_n)
    {

        set_poly_n_0(nativeObj, poly_n);

        return;
    }

    //
    // C++: double StereoVar::poly_sigma
    //

    public  double get_poly_sigma()
    {

        double retVal = get_poly_sigma_0(nativeObj);

        return retVal;
    }

    //
    // C++: void StereoVar::poly_sigma
    //

    public  void set_poly_sigma(double poly_sigma)
    {

        set_poly_sigma_0(nativeObj, poly_sigma);

        return;
    }

    //
    // C++: float StereoVar::fi
    //

    public  float get_fi()
    {

        float retVal = get_fi_0(nativeObj);

        return retVal;
    }

    //
    // C++: void StereoVar::fi
    //

    public  void set_fi(float fi)
    {

        set_fi_0(nativeObj, fi);

        return;
    }

    //
    // C++: float StereoVar::lambda
    //

    public  float get_lambda()
    {

        float retVal = get_lambda_0(nativeObj);

        return retVal;
    }

    //
    // C++: void StereoVar::lambda
    //

    public  void set_lambda(float lambda)
    {

        set_lambda_0(nativeObj, lambda);

        return;
    }

    //
    // C++: int StereoVar::penalization
    //

    public  int get_penalization()
    {

        int retVal = get_penalization_0(nativeObj);

        return retVal;
    }

    //
    // C++: void StereoVar::penalization
    //

    public  void set_penalization(int penalization)
    {

        set_penalization_0(nativeObj, penalization);

        return;
    }

    //
    // C++: int StereoVar::cycle
    //

    public  int get_cycle()
    {

        int retVal = get_cycle_0(nativeObj);

        return retVal;
    }

    //
    // C++: void StereoVar::cycle
    //

    public  void set_cycle(int cycle)
    {

        set_cycle_0(nativeObj, cycle);

        return;
    }

    //
    // C++: int StereoVar::flags
    //

    public  int get_flags()
    {

        int retVal = get_flags_0(nativeObj);

        return retVal;
    }

    //
    // C++: void StereoVar::flags
    //

    public  void set_flags(int flags)
    {

        set_flags_0(nativeObj, flags);

        return;
    }

    @Override
    protected void finalize() throws Throwable {
        delete(nativeObj);
    }

    // C++:   StereoVar::StereoVar()
    private static native long StereoVar_0();

    // C++:   StereoVar::StereoVar(int levels, double pyrScale, int nIt, int minDisp, int maxDisp, int poly_n, double poly_sigma, float fi, float lambda, int penalization, int cycle, int flags)
    private static native long StereoVar_1(int levels, double pyrScale, int nIt, int minDisp, int maxDisp, int poly_n, double poly_sigma, float fi, float lambda, int penalization, int cycle, int flags);

    // C++:  void StereoVar::operator ()(Mat left, Mat right, Mat& disp)
    private static native void compute_0(long nativeObj, long left_nativeObj, long right_nativeObj, long disp_nativeObj);

    // C++: int StereoVar::levels
    private static native int get_levels_0(long nativeObj);

    // C++: void StereoVar::levels
    private static native void set_levels_0(long nativeObj, int levels);

    // C++: double StereoVar::pyrScale
    private static native double get_pyrScale_0(long nativeObj);

    // C++: void StereoVar::pyrScale
    private static native void set_pyrScale_0(long nativeObj, double pyrScale);

    // C++: int StereoVar::nIt
    private static native int get_nIt_0(long nativeObj);

    // C++: void StereoVar::nIt
    private static native void set_nIt_0(long nativeObj, int nIt);

    // C++: int StereoVar::minDisp
    private static native int get_minDisp_0(long nativeObj);

    // C++: void StereoVar::minDisp
    private static native void set_minDisp_0(long nativeObj, int minDisp);

    // C++: int StereoVar::maxDisp
    private static native int get_maxDisp_0(long nativeObj);

    // C++: void StereoVar::maxDisp
    private static native void set_maxDisp_0(long nativeObj, int maxDisp);

    // C++: int StereoVar::poly_n
    private static native int get_poly_n_0(long nativeObj);

    // C++: void StereoVar::poly_n
    private static native void set_poly_n_0(long nativeObj, int poly_n);

    // C++: double StereoVar::poly_sigma
    private static native double get_poly_sigma_0(long nativeObj);

    // C++: void StereoVar::poly_sigma
    private static native void set_poly_sigma_0(long nativeObj, double poly_sigma);

    // C++: float StereoVar::fi
    private static native float get_fi_0(long nativeObj);

    // C++: void StereoVar::fi
    private static native void set_fi_0(long nativeObj, float fi);

    // C++: float StereoVar::lambda
    private static native float get_lambda_0(long nativeObj);

    // C++: void StereoVar::lambda
    private static native void set_lambda_0(long nativeObj, float lambda);

    // C++: int StereoVar::penalization
    private static native int get_penalization_0(long nativeObj);

    // C++: void StereoVar::penalization
    private static native void set_penalization_0(long nativeObj, int penalization);

    // C++: int StereoVar::cycle
    private static native int get_cycle_0(long nativeObj);

    // C++: void StereoVar::cycle
    private static native void set_cycle_0(long nativeObj, int cycle);

    // C++: int StereoVar::flags
    private static native int get_flags_0(long nativeObj);

    // C++: void StereoVar::flags
    private static native void set_flags_0(long nativeObj, int flags);

    // native support for java finalize()
    private static native void delete(long nativeObj);

}


text:
package io.crossbar.autobahn.utils;

import android.util.Log;

import static io.crossbar.autobahn.utils.Globals.DEBUG;

class ABALogger implements IABLogger {

    private final String mTag;

    public ABALogger(String tag) {
        mTag = tag;
    }

    @Override
    public void v(String msg) {
        if (DEBUG) Log.v(mTag, msg);
    }

    @Override
    public void v(String msg, Throwable throwable) {
        if (DEBUG) Log.v(mTag, msg, throwable);
    }

    @Override
    public void d(String msg) {
        if (DEBUG) Log.d(mTag, msg);
    }

    @Override
    public void i(String msg) {
        Log.i(mTag, msg);
    }

    @Override
    public void w(String msg) {
        Log.w(mTag, msg);
    }

    @Override
    public void w(String msg, Throwable throwable) {
        Log.w(mTag, msg, throwable);
    }

    @Override
    public void e(String msg) {
        Log.e(mTag, msg);
    }
}


text:
import numpy as np

from .soil import *

class SoilLayer(Soil):
    """
    Soil layer data class.
    """

    def __init__(self, s, wl, t, b, hc=0):
        """
        Initializes the soil layer class.

        :param s: soil class
        :param wl: water level
        :param t: top of the layer
        :param b: bottom of the layer
        :param hc: capillary_rise
        """
        self.soil = s
        self.water_layer = wl
        self.top_level = t
        self.bottom_level = b
        self.thickness = t - b
        self.capillary_rise = hc


text:
require 'capybara'
require 'capybara/dsl'

require 'ae_page_objects/version'
require 'ae_page_objects/exceptions'
require 'ae_page_objects/util/wait_time_manager'

module AePageObjects
  autoload :Node,              'ae_page_objects/node'
  autoload :Document,          'ae_page_objects/document'
  autoload :Element,           'ae_page_objects/element'

  autoload :Collection,        'ae_page_objects/elements/collection'
  autoload :Form,              'ae_page_objects/elements/form'
  autoload :Select,            'ae_page_objects/elements/select'
  autoload :Checkbox,          'ae_page_objects/elements/checkbox'

  class << self
    attr_accessor :default_router

    def browser
      @browser ||= begin
        driver = Capybara.current_session.driver

        case driver
        when Capybara::Selenium::Driver then
          require 'ae_page_objects/multiple_windows/browser'
          MultipleWindows::Browser.new
        else
          require 'ae_page_objects/single_window/browser'
          SingleWindow::Browser.new
        end
      end
    end

    def wait_until(seconds_to_wait = nil, error_message = nil, &block)
      @wait_until ||= 0
      @wait_until += 1

      result = nil

      if @wait_until > 1
        # We want to ensure that only the top-level wait_until does the waiting error handling,
        # which allows correct timing and best chance of recovering from an error.
        result = call_wait_until_block(error_message, &block)
      else
        seconds_to_wait ||= default_max_wait_time
        start_time      = Time.now

        # In an effort to avoid flakiness, Capybara waits, rescues errors, reloads nodes, and
        # retries.
        #
        # There are cases when Capybara will rescue an error and either nodes are not
        # reloadable or the DOM has changed in a such a way that no amount of reloading will
        # help (but perhaps a retry at the higher level may have a chance of success). This leads
        # to us needless waiting for a long time just to fail.
        #
        # There are also cases when Selenium will take such a long time to respond with an error
        # that Capybara's timeout will be exceeded and no reloading / retrying will occur. Instead,
        # Capabara will just raise the error.
        #
        # In order to combat the two cases, we start with a lower Capybara wait time and increase
        # it each iteration. This logic is encapsulated in a little utility class.
        time_manager = WaitTimeManager.new(1.0, seconds_to_wait)
        begin
          result = time_manager.using_wait_time { call_wait_until_block(error_message, &block) }
        rescue => e
          errors = Capybara.current_session.driver.invalid_element_errors
          errors += [Capybara::ElementNotFound]
          errors += [DocumentLoadError, LoadingElementFailed, LoadingPageFailed]
          errors += [WaitTimeoutError]
          raise e unless errors.include?(e.class)

          delay = seconds_to_wait - (Time.now - start_time)

          if delay <= 0
            # Raising the WaitTimeoutError in the rescue block ensures that Ruby attaches
            # the original exception as the cause for our WaitTimeoutError.
            raise WaitTimeoutError, e.message
          end

          sleep(0.05)
          raise FrozenInTime, "Time appears to be frozen" if Time.now == start_time

          retry
        end
      end

      result
    ensure
      @wait_until -= 1
    end

    private

    def call_wait_until_block(error_message, &block)
      result = block.call
      result ? result : raise(WaitTimeoutError, error_message || "Timed out waiting for condition")
    end

    def default_max_wait_time
      Capybara.default_max_wait_time
    end
  end
end

require 'ae_page_objects/core/basic_router'
AePageObjects.default_router = AePageObjects::BasicRouter.new


text:
import os
import glob

def write_config(filename, config):
    """
        Write options to a configuration file

        filename    the configuration filename
        config      a dictionary of config parameters

        The entries in the dictionary are written as a text file
    """

    fh = open(filename, 'w')
    for key in config.keys():
        fh.write("%s = %s\n" % (key, config[key]))

    fh.close()

def parse_config(filename, defaults=None):
    """ Read options for a configuration file.

        filename    the configuration filename
        defaults    a dictionary of allowed options with default values.

        The options are returned as a dictionary than can also be indexed
        by attribute.

        Sample format:

            lines = lines.dat
            x = 20
            save = T

        Ignores blank lines or lines starting with '#'

        Attempts to convert the values to int, float, boolean then string.

        Borrowed from Dr. Neil Crighton
    """
    if defaults is None:
        cfg = dict()
    else:
        cfg = dict(**defaults)
    fh = open(filename)
    for row in fh:
        if not row.strip() or row.lstrip().startswith('#'):
            continue
        option, value = [r.strip() for r in row.split('=')]
        if defaults is not None:
            assert option in defaults, 'Unknown option %r' % option
        try:
            value = int(value)
        except ValueError:
            try:
                value = float(value)
            except ValueError:
                if value == 'True':
                    value = True
                elif value == 'False':
                    value = False

        cfg[option] = value
    fh.close()
    return cfg


text:
package org.apache.directory.server.config.beans;

import org.apache.directory.server.config.ConfigurationElement;

/**
 * A class used to store the Interceptors configuration.
 *
 * @author Apache Directory Project
 */
public class InterceptorBean extends AdsBaseBean implements Comparable<InterceptorBean>
{
    /** The Interceptor ID */
    @ConfigurationElement(attributeType = "ads-interceptorId", isRdn = true)
    private String interceptorId;

    /** The interceptor FQCN */
    @ConfigurationElement(attributeType = "ads-interceptorClassName")
    private String interceptorClassName;

    /** The interceptor position in the chain */
    @ConfigurationElement(attributeType = "ads-interceptorOrder")
    private int interceptorOrder;

    /**
     * Creates a new InterceptorBean
     */
    public InterceptorBean()
    {
    }

    /**
     * Compares the order of the interceptor with the given one
     * @param o An interceptor
     * @return -1 if the current interceptor is below the given one, 1 if
     * it's above, 0 if it's equal
     */
    public int compareTo( InterceptorBean o )
    {
        if ( interceptorOrder > o.interceptorOrder )
        {
            return 1;
        }
        else if ( interceptorOrder < o.interceptorOrder )
        {
            return -1;
        }

        return 0;
    }

    /**
     * @return the id
     */
    public String getInterceptorId()
    {
        return interceptorId;
    }

    /**
     * @param id the id to set
     */
    public void setInterceptorId( String id )
    {
        this.interceptorId = id;
    }

    /**
     * @return the interceptor Order
     */
    public int getInterceptorOrder()
    {
        return interceptorOrder;
    }

    /**
     * @param interceptorOrder the interceptor Order to set
     */
    public void setInterceptorOrder( int interceptorOrder )
    {
        this.interceptorOrder = interceptorOrder;
    }

    /**
     * @return the interceptor ClassName
     */
    public String getInterceptorClassName()
    {
        return interceptorClassName;
    }

    /**
     * @param interceptorClassName the interceptor ClassName to set
     */
    public void setInterceptorClassName( String interceptorClassName )
    {
        this.interceptorClassName = interceptorClassName;
    }

    /**
     * {@inheritDoc}
     */
    public String toString( String tabs )
    {
        StringBuilder sb = new StringBuilder();

        sb.append( tabs ).append( "interceptor[" ).append( interceptorOrder ).append( "] : " ).append( '\n' );
        sb.append( tabs ).append( "  interceptor id : " ).append( interceptorId ).append( '\n' );
        sb.append( tabs ).append( "  class name : " ).append( interceptorClassName ).append( '\n' );

        return sb.toString();
    }

    /**
     * {@inheritDoc}
     */
    public String toString()
    {
        return toString( "" );
    }
}


text:
title: Overview
page_title: RadScriptManager Overview
description: Check our Web Forms article about Overview.
slug: scriptmanager/overview
tags: overview
published: True
position: 1
---

# WebForms ScriptManager Overview

By default, each of the RadControls for ASP.NET AJAX serves a set of files (JS code) needed for its proper client-side operation.

When loading a page with several controls on it, the number of these files can become very large, often resulting in a reduced page load time and increased traffic. The reason for this problem is that browsers make a separate request to the server for each of these resources.

##

Usually this problem is overcome by disabling the automatic script serving of the controls, combining them into a smaller set of files and registering the links to these files manually on the page.

This approach is not the best for of a number of reasons:

* You must extract the files from the assembly for each control release.

* Files become too large to be maintainable (or you have to write a script to merge the source files).

* The number of merged files you need to maintain can become very large depending on the control sets you have on different pages.

With the **RadScriptManager** control, the RadControls for ASP.NET AJAX suite gives developers the advantage of a simple drag-and-drop to combine resources into a single request. All you need is to add a **RadScriptManager** to your page and the JavaScript files get combined into a single file.

>note The performance gain of **RadScriptManager** should be monitored on a remote server, but not in a local development. This is, because the control optimizes the network latency delay when loading the scripts. This comes at the cost of some processor load, because the scripts get combined and compressed on the server.
>When testing locally, the largest part of the result you get is the time **RadScriptManager** takes to combine the scripts and serve them to the browser.
>Note that the **RadScriptManager** does **NOT** combine the web resources needed for the Telerik controls in a single request when the [CDN] ({%slug scriptmanager/cdn-support/overview%}) is enabled.
>

**RadScriptManager** needs an **HttpHandler** to be declared in the application configuration file to operate properly. The addition of the handler is made easier by the SmartTags of the control.

>caption

The **RadScriptManager** control replaces the ScriptManager available in the Microsoft Ajax Extensions suite.

When put on the page, the **RadScriptManager** combines all requests (to the "JavaScript assembly resource files" on the page) into a single one, thus reducing the time of the page load and the consumed traffic.

**RadScriptManager** does this by outputting a **<script>** tag with a specific URL, making a request to an HttpHandler, which then serves the combined scripts.

If the script combination is not needed for some reason (e.g. debugging) it can be disabled by giving the [EnableScriptCombine](https://docs.telerik.com/devtools/aspnet-ajax/api/server/Telerik.Web.UI/RadScriptManager#properties-EnableScriptCombine) property the value of **False**.

You can change Handler by using the [HttpHandlerUrl](https://www.telerik.com/help/aspnet-ajax/p_telerik_web_ui_radscriptmanager_httphandlerurl.html) property of the control.

## RadScriptManager needs the HttpHandler to be registered in the application's configuration file:

## Registering the HttpHandler for web sites running on IIS 5.0, 5.1 and 6.0:

````XML
<configuration>
	<system.web>
		<httpHandlers>
			<add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" validate="false" />
		</httpHandlers>
	</system.web>
</configuration>
````

## Registering the HttpHandler for Websites Running on IIS7:

When in integrated mode, IIS7 reads the application configuration from the **<system.webServer>** section group in the application configuration file, but not the **<system.web>** section group. Since Visual Studio 2005 does not provide "native" support for IIS7, the RadScriptManager registration cannot be automatically added to the **system.webServer**.

There are two cases:

* Telerik.Web.UI.dll is in the **GAC**:

````XML
<system.webserver>
…
<handlers>
	…
	<add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=[ASSEMBLY_VERSION], Culture=neutral, PublicKeyToken=121fae78165ba3d4" />
	…
</handlers>
</system.webserver>
````

>caution You need to replace [ **ASSEMBLY_VERSION** ] with the exact version of your DLL, e.g. **2008.2.723.20** - for the Q2 2008 assembly for ASP.NET 2.0 **OR 2008.2.723.35** - for the Q2 2008 assembly for ASP.NET 3.5
>

* Telerik.Web.UI.dll is **not in the GAC**:

````XML
<system.webserver>
	…
	<handlers>
		…
		<add name="Telerik.Web.UI.WebResource"  path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" />
		…
	</handlers>
 </system.webserver>
````

>note Additional information is available in this blog post: [Web Resources demystified](https://blogs.telerik.com/AtanasKorchev/Posts/08-07-18/Web_Resources_demystified_Part_3_Troubleshooting.aspx).
>

## Limitations of the Control:

* **RadScriptManager** ignores ScriptReferences to scripts embedded in an assembly, but pointed to a script file by using the Path property:

````XML
<telerik:RadScriptManager ID=""RadScriptManager1"" runat=""server"">
	<Scripts>
		<asp:ScriptReference Name="MyNamespace.MyFile.js" Assembly="MyAsembly" Path="/MyVirtualLocation/MyFile.js">
	</Scripts>
</telerik:RadScriptManager>
````

* **RadScriptManager** does not support the automatic switch to debug-mode. For example, having an assembly including ScriptReferences in both Debug and Release ScriptMode, where the application is in a debug mode, RadScriptManager will output only the "Release" ones. If debugging is needed, the **EnableScriptCombine** property can be set to **False**.

* **RadScriptManager** currently does not display IntelliSense information for the <Scripts> property and the ScriptReferences.

## See Also

 * [Online Demos](https://demos.telerik.com/aspnet-ajax/?_ga=2.169916642.391808064.1659423834-859616464.1659423834)

 * [ASP.NET AJAX Script Manager](https://www.telerik.com/products/aspnet-ajax/scriptmanager.aspx)


text:
require 'odania_core'
require 'odania'
require 'odania_timeline'

module OdaniaProfile
	PLUGIN_NAME = 'odania_profile'

	class Engine < ::Rails::Engine
		config.generators do |g|
			g.test_framework :rspec
			g.fixture_replacement :factory_girl, :dir => 'spec/factories'
		end

		Odania.protected.plugins << OdaniaProfile::PLUGIN_NAME
		Odania.protected.pages << {name: 'Personal Profile', in_menu: true, path: '/odania_profile/profile/index', controller: 'OdaniaProfileProfileController',
											template: 'odania_profile/profile/index', active: OdaniaProfile::PLUGIN_NAME}
		Odania.protected.pages << {name: 'Edit Personal Profile', in_menu: false, path: '/odania_profile/profile/edit', controller: 'OdaniaProfileEditProfileController',
											template: 'odania_profile/profile/edit', active: OdaniaProfile::PLUGIN_NAME}

		# Add content types
		Odania::TargetType.targets['PROFILES'] = {type: 'PROFILES',
																module: 'OdaniaProfile::EngineTargetType', validator_func: 'validate_profiles',
																render_func: '', selector: 'protected/odania_profile/profiles/choose_profiles',
																initial_data: 'admin/api/menu_items/empty_inital_data'}
		Odania::TargetType.targets['PROFILE'] = {type: 'PROFILE',
															  module: 'OdaniaProfile::EngineTargetType', validator_func: 'validate_profile',
															  render_func: '', selector: 'protected/odania_profile/profiles/choose_profile',
															  initial_data: 'protected/api/odania_profile/profiles/inital_data'}
	end
end


text:
/* eslint-env node */
"use strict";
var fluid = require("infusion");
var gpii  = fluid.registerNamespace("gpii");

fluid.registerNamespace("gpii.test.express.user.client");

var fs         = require("fs");
var MailParser = require("mailparser").MailParser;

// A function that responds to the mail server's receipt of a mail message and continues the reset process.  Instructs
// `environment.browser` to `goto` the link found using `urlPatternString`.
//
// `urlPatternString` should be a regex (in string form) whose first "capture" is the URL, as in:
//
// `(http://.+flibbertygibbit.+)`
//
// See the "forgot" and "signup" tests for concrete examples.
//
gpii.test.express.user.client.continueFromEmail = function (environment, urlPatternString) {
    // This is a MIME message, it will mangle the lines and special characters unless we decode it.
    var mailparser = new MailParser();

    mailparser.on("end", function (mailObject) {
        var content = mailObject.text;

        // Get the reset code and continue the reset process
        var resetCodeRegexp = new RegExp(urlPatternString, "i");
        var matches = content.toString().match(resetCodeRegexp);

        if (matches) {
            var destinationUrl = matches[1];
            environment.webdriver.get(destinationUrl);
        }
        else {
            fluid.fail("Could not extract URL from email...");
        }
    });

    // send the email source to the parser.
    var mailFileContents = fs.readFileSync(environment.smtp.mailServer.currentMessageFile, "utf8");
    mailparser.write(mailFileContents);
    mailparser.end();
};


text:
package com.blockhaus2000.main.bukkit;

import org.bukkit.plugin.java.JavaPlugin;

import com.blockhaus2000.plugin.SimpleIpmPluginLoader;
import com.blockhaus2000.plugin.SimpleIpmPluginManager;
import com.blockhaus2000.plugin.exception.PluginException;
import com.blockhaus2000.util.ExceptionHandler;
import com.blockhaus2000.util.PluginUtil;
import com.blockhaus2000.util.resources.MainPluginResource;
import com.blockhaus2000.util.resources.ResourceManager;

/**
 * Represents the main plugin of the InternalPluginManager.
 *
 * @author Blockhaus2000
 * @see org.bukkit.plugin.Plugin
 * @see org.bukkit.plugin.java.JavaPlugin
 */
public class IpmMain extends JavaPlugin {
    private static IpmMain instance;

    // Only for IpmTestPlugin
    // private final IpmPlugin ipmTestPlugin = new IpmTestMain();

    @SuppressWarnings("javadoc")
    public IpmMain() {
        ResourceManager.getInstance().registerResource(MainPluginResource.class, this);

        if (IpmMain.instance != null) {
            throw new IllegalStateException("Only bukkit initialize a new main plugin!");
        }

        IpmMain.instance = this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void onDisable() {
        SimpleIpmPluginManager.getInstance().disableAll();
        SimpleIpmPluginManager.getInstance().unregisterAll();

        // Only for IpmTestPlugin
        // ipmTestPlugin.onDisable();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void onEnable() {
        try {
            ResourceManager.initializeResources(ExceptionHandler.class);
        } catch (IllegalArgumentException ex) {
            ExceptionHandler.handle(ex);
            PluginUtil.disable(this);
        } catch (IllegalAccessException ex) {
            ExceptionHandler.handle(ex);
            PluginUtil.disable(this);
        }

        try {
            SimpleIpmPluginManager.getInstance().register(SimpleIpmPluginLoader.getInstance().loadAll());
        } catch (PluginException ex) {
            ExceptionHandler.handle(ex);
        }

        SimpleIpmPluginManager.getInstance().enableAll();

        // Only for IpmTestPlugin
        // ipmTestPlugin.onEnable();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void onLoad() {
        // Only for IpmTestPlugin
        // ipmTestPlugin.onLoad();
    }

    /**
     * Returns you an instance from the {@link IpmMain} class.
     *
     * <p>
     * <b> NOTE: This is only for internal usage! Use the
     * {@link ResourceManager} system instead!. </b>
     * </p>
     *
     * @deprecated Use the annotation {@link MainPluginResource} and call
     *             {@link ResourceManager#initializeResources(Object)} instead!
     * @return An instance from the {@link IpmMain} class.
     */
    @Deprecated
    public static IpmMain getInstance() {
        if (IpmMain.instance == null) {
            return IpmMain.instance = new IpmMain();
        }

        return IpmMain.instance;
    }
}


text:
package gitlab

import (
	"crypto/md5"
	"encoding/hex"
	"fmt"
	"net/url"
	"strconv"
	"strings"

	"github.com/drone/drone/remote/gitlab/client"
)

const (
	gravatarBase = "https://www.gravatar.com/avatar"
)

// NewClient is a helper function that returns a new GitHub
// client using the provided OAuth token.
func NewClient(url, accessToken string, skipVerify bool) *client.Client {
	client := client.New(url, "/api/v3", accessToken, skipVerify)
	return client
}

// IsRead is a helper function that returns true if the
// user has Read-only access to the repository.
func IsRead(proj *client.Project) bool {
	var user = proj.Permissions.ProjectAccess
	var group = proj.Permissions.GroupAccess

	switch {
	case proj.Public:
		return true
	case user != nil && user.AccessLevel >= 20:
		return true
	case group != nil && group.AccessLevel >= 20:
		return true
	default:
		return false
	}
}

// IsWrite is a helper function that returns true if the
// user has Read-Write access to the repository.
func IsWrite(proj *client.Project) bool {
	var user = proj.Permissions.ProjectAccess
	var group = proj.Permissions.GroupAccess

	switch {
	case user != nil && user.AccessLevel >= 30:
		return true
	case group != nil && group.AccessLevel >= 30:
		return true
	default:
		return false
	}
}

// IsAdmin is a helper function that returns true if the
// user has Admin access to the repository.
func IsAdmin(proj *client.Project) bool {
	var user = proj.Permissions.ProjectAccess
	var group = proj.Permissions.GroupAccess

	switch {
	case user != nil && user.AccessLevel >= 40:
		return true
	case group != nil && group.AccessLevel >= 40:
		return true
	default:
		return false
	}
}

// GetKeyTitle is a helper function that generates a title for the
// RSA public key based on the username and domain name.
func GetKeyTitle(rawurl string) (string, error) {
	var uri, err = url.Parse(rawurl)
	if err != nil {
		return "", err
	}
	return fmt.Sprintf("drone@%s", uri.Host), nil
}

func ns(owner, name string) string {
	return fmt.Sprintf("%s%%2F%s", owner, name)
}

func GetUserAvatar(email string) string {
	hasher := md5.New()
	hasher.Write([]byte(email))

	return fmt.Sprintf(
		"%s/%v.jpg?s=%s",
		gravatarBase,
		hex.EncodeToString(hasher.Sum(nil)),
		"128",
	)
}

func ExtractFromPath(str string) (string, string, error) {
	s := strings.Split(str, "/")
	if len(s) < 2 {
		return "", "", fmt.Errorf("Minimum match not found")
	}
	return s[0], s[1], nil
}

func GetUserEmail(c *client.Client, defaultURL string) (*client.Client, error) {
	return c, nil
}

func GetProjectId(r *Gitlab, c *client.Client, owner, name string) (projectId string, err error) {
	if r.Search {
		_projectId, err := c.SearchProjectId(owner, name)
		if err != nil || _projectId == 0 {
			return "", err
		}
		projectId := strconv.Itoa(_projectId)
		return projectId, nil
	} else {
		projectId := ns(owner, name)
		return projectId, nil
	}
}


text:
.. phovea_data_sql documentation master file, created by
   sphinx-quickstart on Tue Feb  7 19:42:32 2017.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to phovea_data_sql's documentation!
=========================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:

   modules

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
namespace net {

namespace {

// MAXNS is normally 3, but let's test 4 if possible.
const char* const kNameserversIPv4[] = {
    "8.8.8.8",
    "192.168.1.1",
    "63.1.2.4",
    "1.0.0.1",
};

#if BUILDFLAG(IS_CHROMEOS)
const char* const kNameserversIPv6[] = {
    NULL,
    "2001:DB8:0::42",
    NULL,
    "::FFFF:129.144.52.38",
};
#endif

void DummyConfigCallback(const DnsConfig& config) {
  // Do nothing
}

// Fills in |res| with sane configuration.
void InitializeResState(res_state res) {
  memset(res, 0, sizeof(*res));
  res->options = RES_INIT | RES_RECURSE | RES_DEFNAMES | RES_DNSRCH |
                 RES_ROTATE;
  res->ndots = 2;
  res->retrans = 4;
  res->retry = 7;

  const char kDnsrch[] = "chromium.org" "\0" "example.com";
  memcpy(res->defdname, kDnsrch, sizeof(kDnsrch));
  res->dnsrch[0] = res->defdname;
  res->dnsrch[1] = res->defdname + sizeof("chromium.org");

  for (unsigned i = 0; i < std::size(kNameserversIPv4) && i < MAXNS; ++i) {
    struct sockaddr_in sa;
    sa.sin_family = AF_INET;
    sa.sin_port = base::HostToNet16(NS_DEFAULTPORT + i);
    inet_pton(AF_INET, kNameserversIPv4[i], &sa.sin_addr);
    res->nsaddr_list[i] = sa;
    ++res->nscount;
  }

#if BUILDFLAG(IS_CHROMEOS)
  // Install IPv6 addresses, replacing the corresponding IPv4 addresses.
  unsigned nscount6 = 0;
  for (unsigned i = 0; i < std::size(kNameserversIPv6) && i < MAXNS; ++i) {
    if (!kNameserversIPv6[i])
      continue;
    // Must use malloc to mimick res_ninit.
    struct sockaddr_in6 *sa6;
    sa6 = (struct sockaddr_in6 *)malloc(sizeof(*sa6));
    sa6->sin6_family = AF_INET6;
    sa6->sin6_port = base::HostToNet16(NS_DEFAULTPORT - i);
    inet_pton(AF_INET6, kNameserversIPv6[i], &sa6->sin6_addr);
    res->_u._ext.nsaddrs[i] = sa6;
    memset(&res->nsaddr_list[i], 0, sizeof res->nsaddr_list[i]);
    ++nscount6;
  }
  res->_u._ext.nscount6 = nscount6;
#endif
}

void CloseResState(res_state res) {
#if BUILDFLAG(IS_CHROMEOS)
  for (int i = 0; i < res->nscount; ++i) {
    if (res->_u._ext.nsaddrs[i] != NULL)
      free(res->_u._ext.nsaddrs[i]);
  }
#endif
}

void InitializeExpectedConfig(DnsConfig* config) {
  config->ndots = 2;
  config->fallback_period = base::Seconds(4);
  config->attempts = 7;
  config->rotate = true;
  config->append_to_multi_label_name = true;
  config->search.clear();
  config->search.push_back("chromium.org");
  config->search.push_back("example.com");

  config->nameservers.clear();
  for (unsigned i = 0; i < std::size(kNameserversIPv4) && i < MAXNS; ++i) {
    IPAddress ip;
    EXPECT_TRUE(ip.AssignFromIPLiteral(kNameserversIPv4[i]));
    config->nameservers.push_back(IPEndPoint(ip, NS_DEFAULTPORT + i));
  }

#if BUILDFLAG(IS_CHROMEOS)
  for (unsigned i = 0; i < std::size(kNameserversIPv6) && i < MAXNS; ++i) {
    if (!kNameserversIPv6[i])
      continue;
    IPAddress ip;
    EXPECT_TRUE(ip.AssignFromIPLiteral(kNameserversIPv6[i]));
    config->nameservers[i] = IPEndPoint(ip, NS_DEFAULTPORT - i);
  }
#endif
}

TEST(DnsConfigServicePosixTest, CreateAndDestroy) {
  // Regression test to verify crash does not occur if DnsConfigServicePosix
  // instance is destroyed without calling WatchConfig()
  base::test::TaskEnvironment task_environment(
      base::test::TaskEnvironment::MainThreadType::IO);

  auto service = std::make_unique<internal::DnsConfigServicePosix>();
  service.reset();
  task_environment.RunUntilIdle();
}

TEST(DnsConfigServicePosixTest, ConvertResStateToDnsConfig) {
  struct __res_state res;
  InitializeResState(&res);
  absl::optional<DnsConfig> config = internal::ConvertResStateToDnsConfig(res);
  CloseResState(&res);
  ASSERT_TRUE(config.has_value());
  EXPECT_TRUE(config->IsValid());

  DnsConfig expected_config;
  EXPECT_FALSE(expected_config.EqualsIgnoreHosts(config.value()));
  InitializeExpectedConfig(&expected_config);
  EXPECT_TRUE(expected_config.EqualsIgnoreHosts(config.value()));
}

TEST(DnsConfigServicePosixTest, RejectEmptyNameserver) {
  struct __res_state res = {};
  res.options = RES_INIT | RES_RECURSE | RES_DEFNAMES | RES_DNSRCH;
  const char kDnsrch[] = "chromium.org";
  memcpy(res.defdname, kDnsrch, sizeof(kDnsrch));
  res.dnsrch[0] = res.defdname;

  struct sockaddr_in sa = {};
  sa.sin_family = AF_INET;
  sa.sin_port = base::HostToNet16(NS_DEFAULTPORT);
  sa.sin_addr.s_addr = INADDR_ANY;
  res.nsaddr_list[0] = sa;
  sa.sin_addr.s_addr = 0xCAFE1337;
  res.nsaddr_list[1] = sa;
  res.nscount = 2;

  EXPECT_FALSE(internal::ConvertResStateToDnsConfig(res));

  sa.sin_addr.s_addr = 0xDEADBEEF;
  res.nsaddr_list[0] = sa;
  EXPECT_TRUE(internal::ConvertResStateToDnsConfig(res));
}

TEST(DnsConfigServicePosixTest, DestroyWhileJobsWorking) {
  // Regression test to verify crash does not occur if DnsConfigServicePosix
  // instance is destroyed while SerialWorker jobs have posted to worker pool.
  base::test::TaskEnvironment task_environment(
      base::test::TaskEnvironment::MainThreadType::IO,
      base::test::TaskEnvironment::TimeSource::MOCK_TIME);

  std::unique_ptr<internal::DnsConfigServicePosix> service(
      new internal::DnsConfigServicePosix());
  // Call WatchConfig() which also tests ReadConfig().
  service->WatchConfig(base::BindRepeating(&DummyConfigCallback));
  service.reset();
  task_environment.FastForwardUntilNoTasksRemain();
}

TEST(DnsConfigServicePosixTest, DestroyOnDifferentThread) {
  // Regression test to verify crash does not occur if DnsConfigServicePosix
  // instance is destroyed on another thread.
  base::test::TaskEnvironment task_environment;

  scoped_refptr<base::SequencedTaskRunner> runner =
      base::ThreadPool::CreateSequencedTaskRunner({base::MayBlock()});
  std::unique_ptr<internal::DnsConfigServicePosix, base::OnTaskRunnerDeleter>
      service(new internal::DnsConfigServicePosix(),
              base::OnTaskRunnerDeleter(runner));

  runner->PostTask(FROM_HERE,
                   base::BindOnce(&internal::DnsConfigServicePosix::WatchConfig,
                                  base::Unretained(service.get()),
                                  base::BindRepeating(&DummyConfigCallback)));
  service.reset();
  task_environment.RunUntilIdle();
}

}  // namespace

}  // namespace net


text: from cyder.api.v1.endpoints.dhcp.static_interface import api


text:
<?php

$logger   = service('logger');
$renderer = service('renderer', APPPATH . 'views/');


text:
package ru.stqa.pft.addressbook.appmanager;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
import org.testng.Assert;
import ru.stqa.pft.addressbook.model.GroupData;
import ru.stqa.pft.addressbook.model.Groups;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Created by a.molodkin on 10.03.2016.
 */
public class GroupHelper extends HelperBase {

  public GroupHelper(WebDriver wd) {
    super(wd);
  }

  public void submitGroupCreation() {
    click(By.name("submit"));
  }

  public void fillGroupForm(GroupData groupData){//, boolean creation) {
    type(By.name("group_name"), groupData.getName());
    type(By.name("group_header"), groupData.getHeader());
    type(By.name("group_footer"), groupData.getFooter());
    /*if (creation) {
      isElementPresent(By.name("submit"));
    } else {
      Assert.assertFalse(isElementPresent(By.name("submit")));
    }*/
  }

  public void initGroupCreation() {
    click(By.name("new"));
  }

  public void deleteSelectedGroups() {
    click(By.name("delete"));
  }

  public void selectGroupById(int id) {
    wd.findElement(By.cssSelector("input[value='"+id+"']")).click();

  }

  public void initGroupModification() {
    click(By.name("edit"));
  }

  public void submitGroupModification() {
    click(By.name("update"));
  }

  public void returnGroupPage() {
    if (isElementPresent(By.tagName("h1"))
            && wd.findElement(By.tagName("h1")).getText().equals("Groups")
            && isElementPresent(By.name("new"))) {
      return;
    }
    click(By.linkText("groups"));
  }

  public void create(GroupData group) {
    initGroupCreation();
    fillGroupForm(group);
    submitGroupCreation();
    groupCache = null;
    returnGroupPage();
  }

  public void modify(GroupData group) {
   selectGroupById(group.getId());
   initGroupModification();
   fillGroupForm(group);
   submitGroupModification();
   groupCache = null;
   returnGroupPage();
  }

  public void delete(GroupData group) {
    selectGroupById(group.getId());
    deleteSelectedGroups();
    groupCache = null;
    returnGroupPage();
  }
  public boolean isThereAGroup() {
  return isElementPresent(By.name("selected[]"));
  }

  public int count() {
    return wd.findElements(By.name("selected[]")).size();
  }

private Groups groupCache=null;

  public Groups all() {
    if (groupCache!=null){
      return new Groups(groupCache);
    }
    groupCache = new Groups();
    List<WebElement> elements = wd.findElements(By.cssSelector("span.group"));
    for (WebElement element : elements){
      String name = element.getText();
      int id = Integer.parseInt(element.findElement(By.tagName("input")).getAttribute("value"));
      groupCache.add(new GroupData().withId(id).withName(name));
    }
    return new Groups(groupCache);
  }

}


text:
<form name="traktForm" novalidate>

    <configuration-item ng-repeat="item in itemsToConfigure" item="item" ng-if="item.ifExpression == undefined || config[item.ifExpression].value == true" />

	<button class="btn btn-primary" ng-click="saveSettings()"><span class="glyphicon glyphicon-save" /> Save Settings</button>

</form>