text:
static const int FIRCLSFatalSignals[FIRCLSSignalCount] = {SIGABRT, SIGBUS, SIGFPE, SIGILL,
                                                          SIGSEGV, SIGSYS, SIGTRAP};

#if CLS_USE_SIGALTSTACK
static void FIRCLSSignalInstallAltStack(FIRCLSSignalReadContext *roContext);
#endif
static void FIRCLSSignalInstallHandlers(FIRCLSSignalReadContext *roContext);
static void FIRCLSSignalHandler(int signal, siginfo_t *info, void *uapVoid);

void FIRCLSSignalInitialize(FIRCLSSignalReadContext *roContext) {
  if (!FIRCLSUnlinkIfExists(roContext->path)) {
    FIRCLSSDKLog("Unable to reset the signal log file %s\n", strerror(errno));
  }

#if CLS_USE_SIGALTSTACK
  FIRCLSSignalInstallAltStack(roContext);
#endif
  FIRCLSSignalInstallHandlers(roContext);
#if TARGET_IPHONE_SIMULATOR
  // prevent the OpenGL stack (by way of OpenGLES.framework/libLLVMContainer.dylib) from installing
  // signal handlers that do not chain back
  // TODO: I don't believe this is necessary as of recent iOS releases
  bool *ptr = dlsym(RTLD_DEFAULT, "_ZN4llvm23DisablePrettyStackTraceE");
  if (ptr) {
    *ptr = true;
  }
#endif
}

void FIRCLSSignalEnumerateHandledSignals(void (^block)(int idx, int signal)) {
  for (int i = 0; i < FIRCLSSignalCount; ++i) {
    block(i, FIRCLSFatalSignals[i]);
  }
}

#if CLS_USE_SIGALTSTACK

static void FIRCLSSignalInstallAltStack(FIRCLSSignalReadContext *roContext) {
  stack_t signalStack;
  stack_t originalStack;

  signalStack.ss_sp = _firclsContext.readonly->signalStack;
  signalStack.ss_size = CLS_SIGNAL_HANDLER_STACK_SIZE;
  signalStack.ss_flags = 0;

  if (sigaltstack(&signalStack, &originalStack) != 0) {
    FIRCLSSDKLog("Unable to setup stack %s\n", strerror(errno));

    return;
  }

  roContext->originalStack.ss_sp = NULL;
  roContext->originalStack = originalStack;
}

#endif

static void FIRCLSSignalInstallHandlers(FIRCLSSignalReadContext *roContext) {
  FIRCLSSignalEnumerateHandledSignals(^(int idx, int signal) {
    struct sigaction action;
    struct sigaction previousAction;

    action.sa_sigaction = FIRCLSSignalHandler;
    // SA_RESETHAND seems like it would be great, but it doesn't appear to
    // work correctly.  After taking a signal, causing another identical signal in
    // the handler will *not* cause the default handler to be invokved (which should
    // terminate the process).  I've found some evidence that others have seen this
    // behavior on MAC OS X.
    action.sa_flags = SA_SIGINFO | SA_ONSTACK;

    sigemptyset(&action.sa_mask);

    previousAction.sa_sigaction = NULL;
    if (sigaction(signal, &action, &previousAction) != 0) {
      FIRCLSSDKLog("Unable to install handler for %d (%s)\n", signal, strerror(errno));
    }

    // store the last action, so it can be recalled
    roContext->originalActions[idx].sa_sigaction = NULL;

    if (previousAction.sa_sigaction) {
      roContext->originalActions[idx] = previousAction;
    }
  });
}

void FIRCLSSignalCheckHandlers(void) {
  if (_firclsContext.readonly->debuggerAttached) {
    return;
  }

  FIRCLSSignalEnumerateHandledSignals(^(int idx, int signal) {
    struct sigaction previousAction;
    Dl_info info;
    void *ptr;

    if (sigaction(signal, 0, &previousAction) != 0) {
      fprintf(stderr, "Unable to read signal handler\n");
      return;
    }

    ptr = previousAction.__sigaction_u.__sa_handler;
    const char *signalName = NULL;
    const char *codeName = NULL;

    FIRCLSSignalNameLookup(signal, 0, &signalName, &codeName);

    if (ptr == FIRCLSSignalHandler) {
      return;
    }

    const char *name = NULL;
    if (dladdr(ptr, &info) != 0) {
      name = info.dli_sname;
    }

    fprintf(stderr,
            "[Crashlytics] The signal %s has a non-Crashlytics handler (%s).  This will interfere "
            "with reporting.\n",
            signalName, name);
  });
}

void FIRCLSSignalSafeRemoveHandlers(bool includingAbort) {
  for (int i = 0; i < FIRCLSSignalCount; ++i) {
    struct sigaction sa;

    if (!includingAbort && (FIRCLSFatalSignals[i] == SIGABRT)) {
      continue;
    }

    sa.sa_handler = SIG_DFL;
    sigemptyset(&sa.sa_mask);

    if (sigaction(FIRCLSFatalSignals[i], &sa, NULL) != 0)
      FIRCLSSDKLog("Unable to set default handler for %d (%s)\n", i, strerror(errno));
  }
}

bool FIRCLSSignalSafeInstallPreexistingHandlers(FIRCLSSignalReadContext *roContext) {
  bool success;

  FIRCLSSignalSafeRemoveHandlers(true);

#if CLS_USE_SIGALTSTACK

  // re-install the original stack, if needed
  if (roContext->originalStack.ss_sp) {
    if (sigaltstack(&roContext->originalStack, 0) != 0) {
      FIRCLSSDKLog("Unable to setup stack %s\n", strerror(errno));

      return false;
    }
  }

#endif

  // re-install the original handlers, if any
  success = true;
  for (int i = 0; i < FIRCLSSignalCount; ++i) {
    if (roContext->originalActions[i].sa_sigaction == NULL) {
      continue;
    }

    if (sigaction(FIRCLSFatalSignals[i], &roContext->originalActions[i], 0) != 0) {
      FIRCLSSDKLog("Unable to install handler for %d (%s)\n", i, strerror(errno));
      success = false;
    }
  }

  return success;
}

void FIRCLSSignalNameLookup(int number, int code, const char **name, const char **codeName) {
  if (!name || !codeName) {
    return;
  }

  *codeName = NULL;

  switch (number) {
    case SIGABRT:
      *name = "SIGABRT";
      *codeName = "ABORT";
      break;
    case SIGBUS:
      *name = "SIGBUS";
      break;
    case SIGFPE:
      *name = "SIGFPE";
      break;
    case SIGILL:
      *name = "SIGILL";
      break;
    case SIGSEGV:
      *name = "SIGSEGV";
      break;
    case SIGSYS:
      *name = "SIGSYS";
      break;
    case SIGTRAP:
      *name = "SIGTRAP";
      break;
    default:
      *name = "UNKNOWN";
      break;
  }
}

static void FIRCLSSignalRecordSignal(int savedErrno, siginfo_t *info, void *uapVoid) {
  if (!_firclsContext.readonly) {
    return;
  }

  if (FIRCLSContextMarkAndCheckIfCrashed()) {
    FIRCLSSDKLog("Error: aborting signal handler because crash has already occurred");
    exit(1);
    return;
  }

  FIRCLSFile file;

  if (!FIRCLSFileInitWithPath(&file, _firclsContext.readonly->signal.path, false)) {
    FIRCLSSDKLog("Unable to open signal file\n");
    return;
  }

  FIRCLSFileWriteSectionStart(&file, "signal");

  FIRCLSFileWriteHashStart(&file);

  if (FIRCLSIsValidPointer(info)) {
    FIRCLSFileWriteHashEntryUint64(&file, "number", info->si_signo);
    FIRCLSFileWriteHashEntryUint64(&file, "code", info->si_code);
    FIRCLSFileWriteHashEntryUint64(&file, "address", (uint64_t)info->si_addr);

    const char *name = NULL;
    const char *codeName = NULL;

    FIRCLSSignalNameLookup(info->si_signo, info->si_code, &name, &codeName);

    FIRCLSFileWriteHashEntryString(&file, "name", name);
    FIRCLSFileWriteHashEntryString(&file, "code_name", codeName);
  }

  FIRCLSFileWriteHashEntryUint64(&file, "errno", savedErrno);
  FIRCLSFileWriteHashEntryUint64(&file, "time", time(NULL));

  FIRCLSFileWriteHashEnd(&file);

  FIRCLSFileWriteSectionEnd(&file);

  FIRCLSHandler(&file, mach_thread_self(), uapVoid);

  FIRCLSFileClose(&file);
}

static void FIRCLSSignalHandler(int signal, siginfo_t *info, void *uapVoid) {
  int savedErrno;
  sigset_t set;

  // save errno, both because it is interesting, and so we can restore it afterwards
  savedErrno = errno;
  errno = 0;

  FIRCLSSDKLog("Signal: %d\n", signal);

  // it is important to do this before unmasking signals, otherwise we can get
  // called in a loop
  FIRCLSSignalSafeRemoveHandlers(true);

  sigfillset(&set);
  if (sigprocmask(SIG_UNBLOCK, &set, NULL) != 0) {
    FIRCLSSDKLog("Unable to unmask signals - we risk infinite recursion here\n");
  }

  // check info and uapVoid, and set them to appropriate values if invalid.  This can happen
  // if we have been called without the SA_SIGINFO flag set
  if (!FIRCLSIsValidPointer(info)) {
    info = NULL;
  }

  if (!FIRCLSIsValidPointer(uapVoid)) {
    uapVoid = NULL;
  }

  FIRCLSSignalRecordSignal(savedErrno, info, uapVoid);

  // re-install original handlers
  if (_firclsContext.readonly) {
    FIRCLSSignalSafeInstallPreexistingHandlers(&_firclsContext.readonly->signal);
  }

  // restore errno
  errno = savedErrno;
}
#endif

redpajama_set_name: RedPajamaGithub


text:
import {Directive, ElementRef, EventEmitter, HostListener, Inject, Input, Output, Renderer2} from '@angular/core';
import {
  AbstractControl,
  ControlValueAccessor,
  NG_VALIDATORS,
  NG_VALUE_ACCESSOR,
  ValidationErrors,
  Validator,
  ValidatorFn,
  Validators,
} from '@angular/forms';
import * as _moment from 'moment';
import {DL_DATE_TIME_DISPLAY_FORMAT, DL_DATE_TIME_INPUT_FORMATS, DlDateAdapter} from '../core/public-api';
import {DlDateTimeInputChange} from './dl-date-time-input-change';

/**
 * @internal
 */
const moment = _moment;

/**
 *  This directive allows the user to enter dates, using the keyboard, into an input box and
 *  angular will then store a date value in the model.
 *
 *  The input format(s), display format, and model format are independent and fully customizable.
 */
@Directive({
  selector: 'input[dlDateTimeInput]',
  providers: [
    {provide: NG_VALUE_ACCESSOR, useExisting:  DlDateTimeInputDirective, multi: true},
    {provide: NG_VALIDATORS, useExisting:  DlDateTimeInputDirective, multi: true}
  ]
})
export class DlDateTimeInputDirective<D> implements ControlValueAccessor, Validator {

  /* tslint:disable:member-ordering */
  private _filterValidator: ValidatorFn = (control: AbstractControl): ValidationErrors | null => {
    // @ts-ignore
    return (this._inputFilter || (() => true))(this._value) ?
      null : {'dlDateTimeInputFilter': {'value': control.value}};
  }
  private _inputFilter: (value: (D | null)) => boolean = () => true;
  private _isValid = true;
  private _parseValidator: ValidatorFn = (): ValidationErrors | null => {
    return this._isValid ?
      null : {'dlDateTimeInputParse': {'text': this._elementRef.nativeElement.value}};
  }
  private _changed: ((value: D) => void)[] = [];
  private _touched: (() => void)[] = [];
  private _validator = Validators.compose([this._parseValidator, this._filterValidator]);
  private _onValidatorChange: () => void = () => {};
  private _value: D | undefined = undefined;

  /**
   * Emits when a `change` event when date/time is selected or
   * the value of the date/time picker changes.
   **/
  @Output()
  readonly dateChange = new EventEmitter<DlDateTimeInputChange<D>>();

  /**
   * Constructs a new instance of this directive.
   * @param _renderer
   *  reference to the renderer.
   * @param _elementRef
   *  reference to this element.
   * @param _dateAdapter
   *  date adapter for the date type in the model.
   * @param _displayFormat
   *  from `DL_DATE_TIME_DISPLAY_FORMAT`, which defines the format to use for a valid date/time value.
   * @param _inputFormats
   *  from `DL_DATE_TIME_INPUT_FORMATS`, which defines the input formats that allowed as valid date/time values.
   *  NB: moment is always in strict parse mode for this directive.
   */
  constructor(
    private _renderer: Renderer2,
    private _elementRef: ElementRef,
    private _dateAdapter: DlDateAdapter<D>,
    @Inject(DL_DATE_TIME_DISPLAY_FORMAT) private readonly _displayFormat: string,
    @Inject(DL_DATE_TIME_INPUT_FORMATS) private readonly _inputFormats: string[]
  ) {}

  /**
   * Set a function used to determine whether or not the `value` entered by the user is allowed.
   * @param inputFilterFunction
   *   a function that returns `true` if the `value` entered by the user is allowed, otherwise `false`.
   */
  @Input()
  set dlDateTimeInputFilter(inputFilterFunction: (value: D | null) => boolean) {
    this._inputFilter = inputFilterFunction || (() => true);
    this._onValidatorChange();
  }

  /* tslint:enable:member-ordering */

  /**
   * Returns `D` value of the date/time input or `undefined` | `null` if no value is set.
   **/
  get value(): D {
    return this._value;
  }

  /**
   * Set the value of the date/time input to a value of `D` | `undefined` | `null`;
   * @param newValue
   *  the new value of the date/time input
   */

  set value(newValue: D | null | undefined) {
    if (newValue !== this._value) {
      this._value = newValue;
      this._changed.forEach(onChanged => onChanged(this._value));
    }
  }

  /**
   * Emit a `change` event when the value of the input changes.
   */
  @HostListener('change') _onChange() {
    this.dateChange.emit(new DlDateTimeInputChange(this._value));
  }

  /**
   * Format the input text using {@link DL_DATE_TIME_DISPLAY_FORMAT} and mark the control as touched.
   */
  @HostListener('blur') _onBlur() {
    if (this._value) {
      this._setElementValue(this._value);
    }
    this._touched.forEach(onTouched => onTouched());
  }

  /**
   * Parse the user input into a possibly valid date.
   * The model value is not set if the input is NOT one of the {@link DL_DATE_TIME_INPUT_FORMATS}.
   * @param value
   *   Value of the input control.
   */
  @HostListener('input', ['$event.target.value']) _onInput(value: string | null | undefined): void {
    const testDate = value === null || value === undefined || value === ''
      ? undefined
      : moment(value, this._inputFormats, true);

    this._isValid = testDate && testDate.isValid();
    this.value = this._isValid ? this._dateAdapter.fromMilliseconds(testDate.valueOf()) : undefined;
  }

  /**
   * @internal
   */
  private _setElementValue(value: D) {
    if (value !== null && value !== undefined) {
      this._renderer.setProperty(this._elementRef.nativeElement, 'value', moment(value).format(this._displayFormat));
    }
  }

  /**
   * @internal
   */
  registerOnChange(onChange: (value: any) => void): void {
    this._changed.push(onChange);
  }

  /**
   * @internal
   */
  registerOnTouched(onTouched: () => void): void {
    this._touched.push(onTouched);
  }

  /**
   * @internal
   */
  registerOnValidatorChange(validatorOnChange: () => void): void {
    this._onValidatorChange = validatorOnChange;
  }

  /**
   * @internal
   */
  setDisabledState(isDisabled: boolean): void {
    this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
  }

  /**
   * @internal
   */
  validate(control: AbstractControl): ValidationErrors | null {
    return this._validator(control);
  }

  /**
   * @internal
   */
  writeValue(value: D): void {
    this._isValid = true;
    this.value = value;
    this._setElementValue(value);
  }
}


text:
<idea-plugin>
  <project-components>
    <component>
      <interface-class>com.intellij.xdebugger.XDebuggerManager</interface-class>
      <implementation-class>com.intellij.xdebugger.impl.XDebuggerManagerImpl</implementation-class>
    </component>
  </project-components>

  <extensionPoints>
    <extensionPoint name="xdebugger.settings" interface="com.intellij.xdebugger.settings.XDebuggerSettings"/>
    <extensionPoint name="xdebugger.breakpointType" interface="com.intellij.xdebugger.breakpoints.XBreakpointType"/>
    <extensionPoint name="xdebugger.debuggerSupport" interface="com.intellij.xdebugger.impl.DebuggerSupport"/>
  </extensionPoints>

  <extensions defaultExtensionNs="com.intellij">
    <colorSettingsPage implementation="com.intellij.xdebugger.impl.ui.DebuggerColorsPage"/>

    <applicationService serviceInterface="com.intellij.xdebugger.impl.settings.XDebuggerSettingsManager"
                        serviceImplementation="com.intellij.xdebugger.impl.settings.XDebuggerSettingsManager"/>

    <applicationService serviceInterface="com.intellij.xdebugger.XDebuggerUtil"
                        serviceImplementation="com.intellij.xdebugger.impl.XDebuggerUtilImpl"/>

    <projectService serviceImplementation="com.intellij.xdebugger.impl.evaluate.quick.common.ValueLookupManager"/>

    <projectService serviceInterface="com.intellij.xdebugger.impl.breakpoints.ui.BreakpointsDialogFactory"
                    serviceImplementation="com.intellij.xdebugger.impl.breakpoints.ui.BreakpointsDialogFactory"/>

    <projectService serviceInterface="com.intellij.xdebugger.impl.XDebuggerHistoryManager"
                    serviceImplementation="com.intellij.xdebugger.impl.XDebuggerHistoryManager"/>

    <applicationConfigurable provider="com.intellij.xdebugger.impl.settings.DebuggerConfigurableProvider"/>

    <customizableActionGroupProvider implementation="com.intellij.xdebugger.impl.ui.XDebugTabCustomizableActionGroupProvider"/>

    <xdebugger.debuggerSupport implementation="com.intellij.xdebugger.impl.XDebuggerSupport" order="first"/>

    <executor implementation="com.intellij.execution.executors.DefaultDebugExecutor" order="first,after run"/>
  </extensions>
</idea-plugin>


text:
export const CREATE_PROJECT = 'CREATE_PROJECT';
export const GET_PROJECTS = 'GET_PROJECTS';
export const GET_PROJECT = 'GET_PROJECT';
export const DROP_CURRENT_PROJECT = 'DROP_CURRENT_PROJECT';
export const DELETE_PROJECT = 'DELETE_PROJECT';
export const UPDATE_PROJECT = 'UPDATE_PROJECT';
export const GET_DICTONARY_KEYS = 'GET_DICTONARY_KEYS';
export const UPDATE_DICTIONARY_PAIR = 'UPDATE_DICTIONARY_PAIR';


text:
namespace MartenAndRabbitMessages;

public class IssueTask
{
    public IssueTask(string title, string description)
    {
        Title = title;
        Description = description;
        Id = Guid.NewGuid();
    }

    public Guid Id { get; set; }

    public string Title { get; set; }
    public string Description { get; set; }
    public DateTimeOffset? Started { get; set; }
    public DateTimeOffset Finished { get; set; }
}


text:
#include <aws/es/model/CreateVpcEndpointResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::ElasticsearchService::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

CreateVpcEndpointResult::CreateVpcEndpointResult()
{
}

CreateVpcEndpointResult::CreateVpcEndpointResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

CreateVpcEndpointResult& CreateVpcEndpointResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  JsonView jsonValue = result.GetPayload().View();
  if(jsonValue.ValueExists("VpcEndpoint"))
  {
    m_vpcEndpoint = jsonValue.GetObject("VpcEndpoint");

  }

  return *this;
}


text:
package dk.CalendarService;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.text.format.DateUtils;

/*
 * References:
 * http://stackoverflow.com/questions/5883938/getting-events-from-calendar
 *
 * Please do not delete the references as they gave inspiration for the implementation
 */

public class CalendarService {

	// Default constructor
	public static void readCalendar(Context context) {
		readCalendar(context, 1, 0);
	}

	// Use to specify specific the time span
	public static void readCalendar(Context context, int days, int hours) {

		ContentResolver contentResolver = context.getContentResolver();

		// Create a cursor and read from the calendar (for Android API below 4.0)
		final Cursor cursor = contentResolver.query(Uri.parse("content://com.android.calendar/calendars"),
		        (new String[] { "_id", "displayName", "selected" }), null, null, null);

		/*
		* Use the cursor below for Android API 4.0+ (Thanks to SLEEPLisNight)
		*
		* Cursor cursor = contentResolver.query(Uri.parse("content://com.android.calendar/events"),
		* new String[]{ "calendar_id", "title", "description", "dtstart", "dtend", "eventLocation" },
		* null, null, null);
		*
		*/

		// Create a set containing all of the calendar IDs available on the phone
		HashSet<String> calendarIds = getCalenderIds(cursor);

		// Create a hash map of calendar ids and the events of each id
		HashMap<String, List<CalendarEvent>> eventMap = new HashMap<String, List<CalendarEvent>>();

		// Loop over all of the calendars
		for (String id : calendarIds) {

			// Create a builder to define the time span
			Uri.Builder builder = Uri.parse("content://com.android.calendar/instances/when").buildUpon();
	        long now = new Date().getTime();

	        // create the time span based on the inputs
	        ContentUris.appendId(builder, now - (DateUtils.DAY_IN_MILLIS * days) - (DateUtils.HOUR_IN_MILLIS * hours));
	        ContentUris.appendId(builder, now + (DateUtils.DAY_IN_MILLIS * days) + (DateUtils.HOUR_IN_MILLIS * hours));

	        // Create an event cursor to find all events in the calendar
	        Cursor eventCursor = contentResolver.query(builder.build(),
	                new String[]  { "title", "begin", "end", "allDay"}, "Calendars._id=" + id,
	                null, "startDay ASC, startMinute ASC");

	        System.out.println("eventCursor count="+eventCursor.getCount());

	        // If there are actual events in the current calendar, the count will exceed zero
	        if(eventCursor.getCount()>0)
	        {

	        	// Create a list of calendar events for the specific calendar
	        	List<CalendarEvent> eventList = new ArrayList<CalendarEvent>();

	        	// Move to the first object
	            eventCursor.moveToFirst();

	            // Create an object of CalendarEvent which contains the title, when the event begins and ends,
	            // and if it is a full day event or not
	            CalendarEvent ce = loadEvent(eventCursor);

	            // Adds the first object to the list of events
	            eventList.add(ce);

	            System.out.println(ce.toString());

	            // While there are more events in the current calendar, move to the next instance
	            while (eventCursor.moveToNext())
	            {

	            	// Adds the object to the list of events
	            	ce = loadEvent(eventCursor);
	            	eventList.add(ce);

	            	System.out.println(ce.toString());

	            }

	    	    Collections.sort(eventList);
	    	    eventMap.put(id, eventList);

	    	    System.out.println(eventMap.keySet().size() + " " + eventMap.values());

	        }
		}
	}

	// Returns a new instance of the calendar object
	private static CalendarEvent loadEvent(Cursor csr) {
		return new CalendarEvent(csr.getString(0),
						new Date(csr.getLong(1)),
						new Date(csr.getLong(2)),
						!csr.getString(3).equals("0"));
	}

	// Creates the list of calendar ids and returns it in a set
	private static HashSet<String> getCalenderIds(Cursor cursor) {

		HashSet<String> calendarIds = new HashSet<String>();

		try
	    {

			// If there are more than 0 calendars, continue
	        if(cursor.getCount() > 0)
	        {

	        	// Loop to set the id for all of the calendars
		        while (cursor.moveToNext()) {

		             String _id = cursor.getString(0);
		             String displayName = cursor.getString(1);
		             Boolean selected = !cursor.getString(2).equals("0");

		            System.out.println("Id: " + _id + " Display Name: " + displayName + " Selected: " + selected);
		            calendarIds.add(_id);

		        	}
	        }
	    }

	    catch(AssertionError ex)
	    {
	        ex.printStackTrace();
	    }
	    catch(Exception e)
	    {
	        e.printStackTrace();
	    }

		return calendarIds;

	}
}


text:
extern crate gfx_macros;
extern crate gfx;
extern crate cgmath;
extern crate genmesh;
extern crate image;
extern crate "rustc-serialize" as rustc_serialize;

extern crate "snowmew-core" as snowmew;

use std::cmp::Ordering::{Less, Equal, Greater};
use std::cmp::Ordering;

use snowmew::common::{Common, Entity, Duplicate, Delete};
use snowmew::table::{Static, StaticIterator};

pub use geometry::{Geometry, VertexBuffer};
pub use material::Material;
pub use texture::Texture;
pub use light::Light;

pub use light::{
    Directional,
    Point
};

pub mod geometry;
pub mod material;
pub mod standard;
pub mod texture;
pub mod light;

#[derive(Clone, Default, Eq, PartialEq, PartialOrd, Hash, Debug, RustcEncodable, RustcDecodable, Copy)]
pub struct Drawable {
    pub geometry: Entity,
    pub material: Entity
}

impl Ord for Drawable {
    fn cmp(&self, other: &Drawable) -> Ordering {
        let order = self.geometry.cmp(&other.geometry);
        match order {
            Equal => self.material.cmp(&other.material),
            Greater => Greater,
            Less => Less
        }
    }
}

#[derive(Clone, RustcEncodable, RustcDecodable)]
pub struct GraphicsData {
    draw:               Static<Drawable>,
    geometry:           Static<Geometry>,
    vertex:             Static<VertexBuffer>,
    material:           Static<Material>,
    material_index:     Static<i32>,
    material_idx_last:  i32,
    texture:            Static<Texture>,
    lights:             Static<light::Light>,
    standard:           Option<standard::Standard>
}

impl GraphicsData {
    pub fn new() -> GraphicsData {
        GraphicsData {
            draw: Static::new(),
            geometry: Static::new(),
            vertex: Static::new(),
            material: Static::new(),
            material_index: Static::new(),
            texture: Static::new(),
            lights: Static::new(),
            material_idx_last: 0,
            standard: None
        }
    }
}

pub trait Graphics: Common + Sized {
    fn get_graphics<'a>(&'a self) -> &'a GraphicsData;
    fn get_graphics_mut<'a>(&'a mut self) -> &'a mut GraphicsData;

    fn load_standard_graphics(&mut self) {
        let standard = standard::Standard::new(self);
        self.get_graphics_mut().standard = Some(standard);
    }

    fn standard_graphics(&self) -> &standard::Standard {
        self.get_graphics().standard.as_ref().expect("Standard graphics not loaded")
    }

    fn drawable<'a>(&'a self, key: Entity) -> Option<&'a Drawable> {
        self.get_graphics().draw.get(key)
    }

    fn new_vertex_buffer(&mut self, vb: VertexBuffer) -> Entity {
        let oid = self.new_object(None);
        self.get_graphics_mut().vertex.insert(oid, vb);
        oid
    }

    fn geometry<'a>(&'a self, oid: Entity) -> Option<&'a Geometry> {
        self.get_graphics().geometry.get(oid)
    }

    fn new_geometry(&mut self, geo: Geometry) -> Entity {
        let oid = self.new_object(None);
        self.get_graphics_mut().geometry.insert(oid, geo);
        oid
    }

    fn material<'a>(&'a self, oid: Entity) -> Option<&'a Material> {
        self.get_graphics().material.get(oid)
    }

    fn material_index(&self, oid: Entity) -> Option<i32> {
        match self.get_graphics().material_index.get(oid) {
            Some(idx) => Some(*idx),
            None => None
        }
    }

    fn new_material(&mut self, material: Material) -> Entity {
        let obj = self.new_object(None);
        self.get_graphics_mut().material.insert(obj, material);
        let idx = self.get_graphics().material_idx_last;
        self.get_graphics_mut().material_idx_last += 1;
        self.get_graphics_mut().material_index.insert(obj, idx);
        obj
    }

    fn material_iter<'a>(&'a self) -> StaticIterator<'a, Material> {
        self.get_graphics().material.iter()
    }

    fn set_draw(&mut self, oid: Entity, geo: Entity, material: Entity) {
        let draw = Drawable {
            geometry: geo,
            material: material
        };

        self.get_graphics_mut().draw.insert(oid, draw.clone());
    }

    fn get_draw(&self, oid: Entity) -> Option<Drawable> {
        match self.get_graphics().draw.get(oid) {
            Some(d) => Some(d.clone()),
            None => None
        }
    }

    fn drawable_count(&self) -> usize {
        self.get_graphics().draw.len()
    }

    fn drawable_iter<'a>(&'a self) -> StaticIterator<'a, Drawable> {
        self.get_graphics().draw.iter()
    }

    fn vertex_buffer_iter<'a>(&'a self) -> StaticIterator<'a, VertexBuffer> {
        self.get_graphics().vertex.iter()
    }

    fn geometry_vertex_iter<'a>(&'a self, oid: Entity) -> Option<VertexBufferIter<'a>> {
        let geo = match self.get_graphics().geometry.get(oid) {
            None => return None,
            Some(geo) => geo
        };

        let vb = match self.get_graphics().vertex.get(geo.vb) {
            None => return None,
            Some(vb) => vb
        };

        Some(
            VertexBufferIter {
                vb: vb,
                idx_iter: vb.index[geo.offset..geo.offset + geo.count].iter()
            }
        )
    }

    fn new_texture(&mut self, texture: Texture) -> Entity {
        let oid = self.new_object(None);
        self.get_graphics_mut().texture.insert(oid, texture);
        oid
    }

    fn get_texture<'a>(&'a self, oid: Entity) -> Option<&'a Texture> {
        self.get_graphics().texture.get(oid)
    }

    fn texture_iter<'a>(&'a self) -> StaticIterator<'a, Texture> {
        self.get_graphics().texture.iter()
    }

    fn new_light(&mut self, light: Light) -> Entity {
        let oid = self.new_object(None);
        self.get_graphics_mut().lights.insert(oid, light);
        oid
    }

    fn get_light<'a>(&'a self, oid: Entity) -> Option<&'a Light> {
        self.get_graphics().lights.get(oid)
    }

    fn light_iter<'a>(&'a self) -> StaticIterator<'a, Light> {
        self.get_graphics().lights.iter()
    }
}

impl Duplicate for GraphicsData {
    fn duplicate(&mut self, src: Entity, dst: Entity) {
        let x = self.draw.get(src).map(|x| x.clone());
        x.map(|x| self.draw.insert(dst, x));
        let x = self.geometry.get(src).map(|x| x.clone());
        x.map(|x| self.geometry.insert(dst, x));
        let x = self.vertex.get(src).map(|x| x.clone());
        x.map(|x| self.vertex.insert(dst, x));
        let x = self.material.get(src).map(|x| x.clone());
        x.map(|x| self.material.insert(dst, x));
        let x = self.material_index.get(src).map(|x| x.clone());
        x.map(|x| self.material_index.insert(dst, x));
        let x = self.texture.get(src).map(|x| x.clone());
        x.map(|x| self.texture.insert(dst, x));
        let x = self.lights.get(src).map(|x| x.clone());
        x.map(|x| self.lights.insert(dst, x));
    }
}

impl Delete for GraphicsData {
    fn delete(&mut self, oid: Entity) -> bool {
        self.draw.remove(oid)             |
        self.geometry.remove(oid)         |
        self.vertex.remove(oid)           |
        self.material.remove(oid)         |
        self.material_index.remove(oid)   |
        self.texture.remove(oid)          |
        self.lights.remove(oid)
    }
}

pub struct VertexBufferIter<'a> {
    vb: &'a VertexBuffer,
    idx_iter: std::slice::Iter<'a, u32>
}

impl<'a> Iterator for VertexBufferIter<'a> {
    type Item = (u32, &'a [f32; 3], Option<&'a [f32; 2]>, Option<&'a [f32; 3]>);

    fn next(&mut self) -> Option<(u32,
                                  &'a [f32; 3],
                                  Option<&'a [f32; 2]>,
                                  Option<&'a [f32; 3]>)> {

        let idx = match self.idx_iter.next() {
            None => return None,
            Some(idx) => idx,
        };

        match self.vb.vertex {
            geometry::Vertex::Geo(ref v) => {
                let v = &v[*idx as usize];
                Some((*idx, &v.position, None, None))
            }
            geometry::Vertex::GeoTex(ref v) => {
                let v = &v[*idx as usize];
                Some((*idx, &v.position, Some(&v.texture), None))
            }
            geometry::Vertex::GeoNorm(ref v) => {
                let v = &v[*idx as usize];
                Some((*idx, &v.position, None, Some(&v.normal)))
            }
            geometry::Vertex::GeoTexNorm(ref v) => {
                let v = &v[*idx as usize];
                Some((*idx, &v.position, Some(&v.texture), Some(&v.normal)))
            }
            geometry::Vertex::GeoTexNormTan(ref v) => {
                let v = &v[*idx as usize];
                Some((*idx, &v.position, Some(&v.texture), Some(&v.normal)))
            }
        }
    }
}


text:
<?php

namespace Kalnoy\LaravelCommon\Repo\Pagination;

use Illuminate\Pagination\Paginator;
use Illuminate\Database\Eloquent\Collection;

/**
 * Eloquent paginator.
 */
class EloquentPaginator extends Lengt {

    /**
     * @inheritdoc
     *
     * @return \Illuminate\Database\Eloquent\Collection
     */
    public function getCollection()
    {
        return $this->items;
    }

}


text:
> [markdown2html](https://github.com/deepblue-will/fly-markdown2html) plugin for _[Fly][fly]_.

[![][fly-badge]][fly]
[![npm package][npm-ver-link]][releases]
[![][dl-badge]][npm-pkg-link]
[![][travis-badge]][travis-link]
[![][mit-badge]][mit]

## Usage
> Check out the [documentation](https://github.com/markdown-it/markdown-it) to see the available options.

### Install

```a
npm install -D fly-markdown2html
```

### Example

```js
export default function* () {
  yield this
  .source('md/*.md')
  .markdown2html({html: true})
  .target('dist');
};
```

## License

[MIT][mit] © [deepblue-will][author] et [al][contributors]

[mit]:          http://opensource.org/licenses/MIT
[author]:       http://github.com/deepblue-will
[contributors]: https://github.com/deepblue-will/fly-markdown2html/graphs/contributors
[releases]:     https://github.com/deepblue-will/fly-markdown2html/releases
[fly]:          https://www.github.com/flyjs/fly
[fly-badge]:    https://img.shields.io/badge/fly-JS-05B3E1.svg?style=flat-square
[mit-badge]:    https://img.shields.io/badge/license-MIT-444444.svg?style=flat-square
[npm-pkg-link]: https://www.npmjs.org/package/fly-markdown2html
[npm-ver-link]: https://img.shields.io/npm/v/fly-markdown2html.svg?style=flat-square
[dl-badge]:     http://img.shields.io/npm/dm/fly-markdown2html.svg?style=flat-square
[travis-link]:  https://travis-ci.org/deepblue-will/fly-markdown2html
[travis-badge]: http://img.shields.io/travis/deepblue-will/fly-markdown2html.svg?style=flat-square


text:
from __future__ import print_function

import argparse

WARNING_MSG = 'Actionable comment "{0}" found in {1}:{2}'

def main(argv=None):
    parser = argparse.ArgumentParser()
    parser.add_argument('--tags', type=lambda s: s.split(','), default=[],
                        help='comma delimited list of strings to look for, such as "FIXME"')
    parser.add_argument('filenames', nargs='*')
    args = parser.parse_args(argv)

    retcode = 0
    for filename in args.filenames:
        with open(filename, 'r') as inputfile:
            try:
                for i, line in enumerate(inputfile):
                    for pattern in args.tags:
                        if pattern in line:
                            print(WARNING_MSG.format(
                                pattern, filename, i + 1,
                            ))
                            retcode = 1
            except UnicodeDecodeError:
                continue

    return retcode

if __name__ == '__main__':
    exit(main())


text:
package org.apache.sysml.runtime.instructions.spark.functions;

import java.util.ArrayList;

import org.apache.spark.api.java.function.PairFunction;
import org.apache.spark.mllib.linalg.DenseMatrix;
import org.apache.spark.mllib.linalg.Matrix;
import org.apache.spark.mllib.linalg.SparseMatrix;

import scala.Tuple2;

import org.apache.sysml.runtime.matrix.data.IJV;
import org.apache.sysml.runtime.matrix.data.MatrixBlock;
import org.apache.sysml.runtime.matrix.data.MatrixIndexes;
import org.apache.sysml.runtime.matrix.data.SparseRowsIterator;
import org.apache.sysml.runtime.util.UtilFunctions;

public class GetMLLibBlocks implements PairFunction<Tuple2<MatrixIndexes,MatrixBlock>, Tuple2<Object, Object>, Matrix> {

	private static final long serialVersionUID = 5977179886312384315L;

	long rlen; long clen; int brlen; int bclen;
	public GetMLLibBlocks(long rlen, long clen, int brlen, int bclen) {
		this.rlen = rlen;
		this.clen = clen;
		this.brlen = brlen;
		this.bclen = bclen;
	}

	private int getNNZ(MatrixBlock blk) {
		if(blk.getNonZeros() != -1) {
			return (int) blk.getNonZeros();
		}
		else if(blk.isInSparseFormat()) {
			SparseRowsIterator iter = blk.getSparseRowsIterator();
			int nnz = 0;
			while( iter.hasNext() ) {
				nnz++;
			}
			return nnz;
		}
		else {
			return blk.getDenseArray().length;
		}
	}

	private int [] getArray(ArrayList<Integer> al) {
		int [] retVal = new int[al.size()];
		int i = 0;
		for(Integer v : al) {
			retVal[i] = v;
			i++;
		}
		return retVal;
	}

	@Override
	public Tuple2<Tuple2<Object, Object>, Matrix> call(
			Tuple2<MatrixIndexes, MatrixBlock> kv) throws Exception {
		Integer blockRowIndex = (int) kv._1.getRowIndex();
		Integer blockColIndex = (int) kv._1.getColumnIndex();

		Matrix mllibBlock = null;
		MatrixBlock blk = kv._2;
		// ------------------------------------------------------------------
		//	Compute local block size:
		int lrlen = UtilFunctions.computeBlockSize(rlen, kv._1.getRowIndex(), brlen);
		int lclen = UtilFunctions.computeBlockSize(clen, kv._1.getColumnIndex(), bclen);
		// ------------------------------------------------------------------

		if(blk.isInSparseFormat()) {
			SparseRowsIterator iter = blk.getSparseRowsIterator();
			int nnz = getNNZ(blk);
			double [] values = new double[nnz];
			int [] rowIndices = new int[nnz];
			ArrayList<Integer> colPtrList = new ArrayList<Integer>();
			int lastCol = -1; int index = 0;
			while( iter.hasNext() ) {
				IJV cell = iter.next(); // TODO: This might output global
				// MLLib's sparse rows are stored as Compressed Sparse Column (CSC) format
				if(lastCol != cell.j) {
					lastCol = cell.j;
					colPtrList.add(lastCol);
				}
				try {
					values[index] = cell.v;
					rowIndices[index] = cell.i;
					index++;
				}
				catch(Exception e) {
					throw new Exception("The number of non-zeros are not set correctly.");
				}
			}

			int [] colPtrs = getArray(colPtrList);
			mllibBlock = new SparseMatrix(lrlen, lclen, colPtrs, rowIndices, values);
		}
		else {
			mllibBlock = new DenseMatrix(lrlen, lclen, blk.getDenseArray());
		}
		return new Tuple2<Tuple2<Object,Object>, Matrix>(new Tuple2<Object,Object>(blockRowIndex, blockColIndex), mllibBlock);
	}

}


text:
//
//  ViewController.m
//  MantleExtension
//
//  Created by Hilen on 3/15/16.
//  Copyright © 2016 Hilen. All rights reserved.
//

#import "ViewController.h"
#import "TSTestModel.h"
#import "Mantle.h"
#import "MantleExtensionHeader.h"

/**
 *  1)处理返回 JSON 中的 JSON: https://github.com/Mantle/Mantle/issues/676
    2)处理 Enum 的默认值: https://github.com/Mantle/Mantle/issues/619
 */

@interface ViewController ()
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@"ssss :%@",[[[NSProcessInfo processInfo] environment] objectForKey:@"TARGET"]);

    //Create JSON object
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"json"];
    NSData *data = [NSData dataWithContentsOfFile:filePath];
    NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];

    NSLog(@"json object is :%@", json);
    NSLog(@"\n");

    NSArray *dictArray = json[@"data"];

    /**
     *  这里使用了 TARGET 来区分有无 `MantleExtension` 的作用,
     *  如果想要仅仅测试 Mantle 的功能,可以选择 Scheme 中的 Mantle.
     *  默认是把 Source 文件夹的内容加到 MantleExtension 的 target 内的。
     */

#ifdef WITHEXTENSION
    [self testWithExtension:dictArray];
#else
    [self testWithoutExtension:dictArray];
#endif

}

- (void)testWithExtension:(NSArray *)dictArray {
    NSArray *modelArray = [dictArray ts_modelsArrayWithClass:[TSTestMantleModel class]];
    NSLog(@"modelArray: %@", modelArray);
}

- (void)testWithoutExtension:(NSArray *)dictArray {
    NSMutableArray *tempList = @[].mutableCopy;
    [dictArray enumerateObjectsUsingBlock:^(NSDictionary *dict, NSUInteger idx, BOOL *stop) {
        NSError *error = nil;
        TSTestMantleModel *model = [MTLJSONAdapter modelOfClass:[TSTestMantleModel class] fromJSONDictionary:dict error:&error];
        if (error) {
            NSLog(@"error is:%@",error);
        } else {
            [tempList addObject:model];
        }
    }];
    NSLog(@"modelArray: %@", tempList);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
using System;

namespace SimpleSmtp.Core.Facades
{
	public interface ITcpListenerFacade
	{
		IAsyncResult BeginAcceptTcpClient(AsyncCallback callback, object state);

		ITcpClientFacade EndAcceptTcpClient(IAsyncResult result);

		void Start();

		void Stop();
	}
}


text:
package jxl.biff.drawing;

import jxl.common.Logger;

/**
 * Class for atoms.  This may be instantiated as is for unknown/uncared about
 * atoms, or subclassed if we have some semantic interest in the contents
 */
class EscherAtom extends EscherRecord
{
  /**
   * The logger
   */
  private static Logger logger = Logger.getLogger(EscherAtom.class);

  /**
   * Constructor
   *
   * @param erd the escher record data
   */
  public EscherAtom(EscherRecordData erd)
  {
    super(erd);
  }

  /**
   * Constructor
   *
   * @param type the type
   */
  protected EscherAtom(EscherRecordType type)
  {
    super(type);
  }

  /**
   * Gets the data for writing
   *
   * @return the data
   */
  byte[] getData()
  {
    logger.warn("escher atom getData called on object of type " +
                getClass().getName() + " code " +
                Integer.toString(getType().getValue(), 16));
    return null;
  }
}


text:
/*
 * $Id$
 */

/*

Copyright (c) 2000-2003 Board of Trustees of Leland Stanford Jr. University,
all rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
STANFORD UNIVERSITY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of Stanford University shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Stanford University.

*/

package org.lockss.util;

import java.util.*;

/**
 * A thread-safe priority queue
 * Elements must implement the Comparable interface (or be accepted
 * by the specified Comparator).
 * Elements are sorted in order upon insertion.  If any element changes
 * in a way that might affect its sort order, {@link #sort()} must be
 * called to resort the queue.
 */
public class PriorityQueue extends AbstractQueue {
  private Comparator comparator = null;

  /**
   * Create a new priority queue.
   */
  public PriorityQueue() {
    super();
  }

  /**
   * Create a new priority queue with the specified Comparator.
   */
  public PriorityQueue(Comparator c) {
    super();
    comparator = c;
  }

  private int compare(Object o1, Object o2) {
    return (comparator == null
	    ? ((Comparable)o1).compareTo(o2)
	    : comparator.compare(o1, o2));
  }

  /**
   * Insert an object in the queue. */
  public synchronized Object put(Object obj) {
    if (obj == null) {
      throw new NullPointerException("Attempt to put null element on Queue");
    }
    int size = queue.size();
    int ix = 0;
    for (; ix < size; ix++) {
      if (compare(obj, queue.elementAt(ix)) < 0) {
	queue.insertElementAt(obj, ix);
	break;
      }
    }
    if (ix >= size) {
      queue.addElement(obj);
    }
    // supposedly allows the highest priority thread to run first
    notifyAll();
    return obj;
  }

  /**
   * Resort the elements on the queue.  Must be called if any element
   * changes in a way that might affect its sort order
   */
  public synchronized void sort() {
    Collections.sort(queue, comparator);
  }
}


text:
/* Desc: RaySensor proximity sensor
 * Author: Nate Koenig
 * Date: 23 february 2004
*/

#ifndef _RAYSENSOR_HH_
#define _RAYSENSOR_HH_

#include <vector>
#include <string>

#include "math/Angle.hh"
#include "math/Pose.hh"
#include "transport/TransportTypes.hh"
#include "sensors/Sensor.hh"

namespace gazebo
{
  class OgreDynamicLines;
  class Collision;
  class MultiRayShape;

  /// \ingroup gazebo_sensors
  /// \brief Sensors namespace
  namespace sensors
  {
    /// \addtogroup gazebo_sensors
    /// \{

    /// \class RaySensor RaySensor.hh sensors/sensors.hh
    /// \brief Sensor with one or more rays.
    ///
    /// This sensor cast rays into the world, tests for intersections, and
    /// reports the range to the nearest object.  It is used by ranging
    /// sensor models (e.g., sonars and scanning laser range finders).
    class RaySensor: public Sensor
    {
      /// \brief Constructor
      public: RaySensor();

      /// \brief Destructor
      public: virtual ~RaySensor();

      // Documentation inherited
      public: virtual void Load(const std::string &_worldName);

      // Documentation inherited
      public: virtual void Init();

      // Documentation inherited
      protected: virtual void UpdateImpl(bool _force);

      // Documentation inherited
      protected: virtual void Fini();

      // Documentation inherited
      public: virtual std::string GetTopic() const;

      /// \brief Get the minimum angle
      /// \return The minimum angle object
      public: math::Angle GetAngleMin() const;

      /// \brief Get the maximum angle
      /// \return the maximum angle object
      public: math::Angle GetAngleMax() const;

      /// \brief Get the angle in radians between each range
      /// \return Resolution of the angle
      public: double GetAngleResolution() const;

      /// \brief Get the minimum range
      /// \return The minimum range
      public: double GetRangeMin() const;

      /// \brief Get the maximum range
      /// \return The maximum range
      public: double GetRangeMax() const;

      /// \brief Get the range resolution
      /// \return Resolution of the range
      public: double GetRangeResolution() const;

      /// \brief Get the ray count
      /// \return The number of rays
      public: int GetRayCount() const;

      /// \brief Get the range count
      /// \return The number of ranges
      public: int GetRangeCount() const;

      /// \brief Get the vertical scan line count
      /// \return The number of scan lines vertically
      public: int GetVerticalRayCount() const;

      /// \brief Get the vertical scan line count
      /// \return The number of scan lines vertically
      public: int GetVerticalRangeCount() const;

      /// \brief Get the vertical scan bottom angle
      /// \return The minimum angle of the scan block
      public: math::Angle GetVerticalAngleMin() const;

      /// \brief Get the vertical scan line top angle
      /// \return The Maximum angle of the scan block
      public: math::Angle GetVerticalAngleMax() const;

      /// \brief Get detected range for a ray.
      ///         Warning: If you are accessing all the ray data in a loop
      ///         it's possible that the Ray will update in the middle of
      ///         your access loop. This means some data will come from one
      ///         scan, and some from another scan. You can solve this
      ///         problem by using SetActive(false) <your accessor loop>
      ///         SetActive(true).
      /// \param[in] _index Index of specific ray
      /// \return Returns DBL_MAX for no detection.
      public: double GetRange(int _index);

      /// \brief Get all the ranges
      /// \param _ranges A vector that will contain all the range data
      public: void GetRanges(std::vector<double> &_ranges);

      /// \brief Get detected retro (intensity) value for a ray.
      ///         Warning: If you are accessing all the ray data in a loop
      ///         it's possible that the Ray will update in the middle of
      ///         your access loop. This means some data will come from one
      ///         scan, and some from another scan. You can solve this
      ///         problem by using SetActive(false) <your accessor loop>
      ///         SetActive(true).
      /// \param[in] _index Index of specific ray
      /// \return Retro (intensity) value for ray
      public: double GetRetro(int _index);

      /// \brief Get detected fiducial value for a ray.
      ///         Warning: If you are accessing all the ray data in a loop
      ///         it's possible that the Ray will update in the middle of
      ///         your access loop. This means some data will come from one
      ///         scan, and some from another scan. You can solve this
      ///         problem by using SetActive(false) <your accessor loop>
      ///         SetActive(true).
      /// \param[in] _index Index value of specific ray
      /// \return Fiducial value
      public: int GetFiducial(int _index);

      /// \brief Returns a pointer to the internal physics::MultiRayShape
      /// \return Pointer to ray shape
      public: physics::MultiRayShapePtr GetLaserShape() const
              {return this->laserShape;}

      // Documentation inherited
      public: virtual bool IsActive();

      private: physics::CollisionPtr laserCollision;
      private: physics::MultiRayShapePtr laserShape;
      private: physics::EntityPtr parentEntity;

      private: transport::PublisherPtr scanPub;
      private: boost::mutex mutex;
      private: msgs::LaserScanStamped laserMsg;

      // Which noise type we support
      private: enum NoiseModelType
      {
        NONE,
        GAUSSIAN
      };
      // If true, apply the noise model specified by other noise parameters
      private: bool noiseActive;
      // Which type of noise we're applying
      private: enum NoiseModelType noiseType;
      // If noiseType==GAUSSIAN, noiseMean is the mean of the distibution
      // from which we sample
      private: double noiseMean;
      // If noiseType==GAUSSIAN, noiseStdDev is the standard devation of
      // the distibution from which we sample
      private: double noiseStdDev;
    };
    /// \}
  }
}

#endif


text:
author: robmyers
comments: true
date: 2012-09-12 18:29:42+00:00
layout: post
slug: connecting-to-lambdamoo-from-tablets-and-smartphones
title: Connecting To LambdaMOO From Tablets And Smartphones
wordpress_id: 2058
categories:
- LambdaMOO
---

You can connect to [LambdaMOO](http://lambda.moo.mud.org/) from smart phones and tablets as easily as from desktop computers, if not more so. Then you can access the classic text-based virtual reality anywhere you have a wireless or cell network signal.

To do so, you will need to install and configure an app capable of communicating with LambdaMOO and then open a connection to it.

## Android

MuClient is a dedicated MOO client for Android. You can install it [here](https://play.google.com/store/apps/details?id=bander.muclient).

Use the following configuration:

**Address:** lambda.moo.mud.org

**Port:** 8888

**Login: **connect Guest

or, once you have a character:

**Login: **connect CHARACTER PASSWORD

## Blackberry

BBSSDH is a Telnet client for Blackberry devices. You can download it [here](http://bbssh.org/downloads/).

Use the following configuration:

**Host:** lambda.moo.mud.org

**Port:** 8888

Then when you connect, type:

`connect Guest`

or, once you have a character:

`connect CHARACTER PASSWORD`

## iOS (iPhone and iPad)

MudMaster is a MOO client for iOS. You can purchase it via Apple's app store [here](http://itunes.apple.com/us/app/mudmaster/id341160033).

Use the following configuration:

**Host:** lambda.moo.mud.org

**Port:** 8888

**Type:** Telnet

**Connection Command: **connect Guest

or, once you have a character:

**Connection Command: **connect CHARACTER PASSWORD


text:
<?php

declare(strict_types=1);

namespace Novuso\Common\Application\Validation;

/**
 * Interface Validator
 */
interface Validator
{
    /**
     * Validates the context
     *
     * This method should return true if validation passes; false otherwise.
     *
     * Optionally, this method may add errors to the context when validation
     * fails.
     */
    public function validate(ValidationContext $context): bool;
}


text:
package org.lwjgl.vulkan;

import javax.annotation.*;

import java.nio.*;

import org.lwjgl.*;
import org.lwjgl.system.*;

import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;

/**
 * Structure specifying descriptor image information.
 *
 *
Description

 *
 *
Members of {@link VkDescriptorImageInfo} that are not used in an update (as described above) are ignored.

 *
 *
Valid Usage

 *
 *

 *
{@code imageView} must not be a 2D array image view created from a 3D image

 *
If the {@code image2DViewOf3D} feature is not enabled and {@code descriptorType} is {@link VK10#VK_DESCRIPTOR_TYPE_STORAGE_IMAGE DESCRIPTOR_TYPE_STORAGE_IMAGE} then {@code imageView} must not be a 2D view created from a 3D image

 *
If the {@code sampler2DViewOf3D} feature is not enabled and {@code descriptorType} is {@link VK10#VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE DESCRIPTOR_TYPE_SAMPLED_IMAGE} or {@link VK10#VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER} then {@code imageView} must not be a 2D view created from a 3D image

 *
If {@code imageView} is created from a depth/stencil image, the {@code aspectMask} used to create the {@code imageView} must include either {@link VK10#VK_IMAGE_ASPECT_DEPTH_BIT IMAGE_ASPECT_DEPTH_BIT} or {@link VK10#VK_IMAGE_ASPECT_STENCIL_BIT IMAGE_ASPECT_STENCIL_BIT} but not both

 *
{@code imageLayout} must match the actual {@code VkImageLayout} of each subresource accessible from {@code imageView} at the time this descriptor is accessed as defined by the image layout matching rules

 *
If {@code sampler} is used and the {@code VkFormat} of the image is a multi-planar format, the image must have been created with {@link VK10#VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT IMAGE_CREATE_MUTABLE_FORMAT_BIT}, and the {@code aspectMask} of the {@code imageView} must be {@link VK11#VK_IMAGE_ASPECT_PLANE_0_BIT IMAGE_ASPECT_PLANE_0_BIT}, {@link VK11#VK_IMAGE_ASPECT_PLANE_1_BIT IMAGE_ASPECT_PLANE_1_BIT} or (for three-plane formats only) {@link VK11#VK_IMAGE_ASPECT_PLANE_2_BIT IMAGE_ASPECT_PLANE_2_BIT}

 *
If the {@link KHRPortabilitySubset VK_KHR_portability_subset} extension is enabled, and {@link VkPhysicalDevicePortabilitySubsetFeaturesKHR}{@code ::mutableComparisonSamplers} is {@link VK10#VK_FALSE FALSE}, then {@code sampler} must have been created with {@link VkSamplerCreateInfo}{@code ::compareEnable} set to {@link VK10#VK_FALSE FALSE}

 *

 *
 *
Valid Usage (Implicit)

 *
 *

 *
Both of {@code imageView}, and {@code sampler} that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the same {@code VkDevice}

 *

 *
 *
See Also

 *
 *
{@link VkWriteDescriptorSet}

 *
 *
Layout

 *
 *

 * struct VkDescriptorImageInfo {
 *     VkSampler {@link #sampler};
 *     VkImageView {@link #imageView};
 *     VkImageLayout {@link #imageLayout};
 * }

 */
public class VkDescriptorImageInfo extends Struct implements NativeResource {

    /** The struct size in bytes. */
    public static final int SIZEOF;

    /** The struct alignment in bytes. */
    public static final int ALIGNOF;

    /** The struct member offsets. */
    public static final int
        SAMPLER,
        IMAGEVIEW,
        IMAGELAYOUT;

    static {
        Layout layout = __struct(
            __member(8),
            __member(8),
            __member(4)
        );

        SIZEOF = layout.getSize();
        ALIGNOF = layout.getAlignment();

        SAMPLER = layout.offsetof(0);
        IMAGEVIEW = layout.offsetof(1);
        IMAGELAYOUT = layout.offsetof(2);
    }

    /**
     * Creates a {@code VkDescriptorImageInfo} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
     * visible to the struct instance and vice versa.
     *
     *
The created instance holds a strong reference to the container object.

     */
    public VkDescriptorImageInfo(ByteBuffer container) {
        super(memAddress(container), __checkContainer(container, SIZEOF));
    }

    @Override
    public int sizeof() { return SIZEOF; }

    /** a sampler handle, and is used in descriptor updates for types {@link VK10#VK_DESCRIPTOR_TYPE_SAMPLER DESCRIPTOR_TYPE_SAMPLER} and {@link VK10#VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER} if the binding being updated does not use immutable samplers. */
    @NativeType("VkSampler")
    public long sampler() { return nsampler(address()); }
    /** {@link VK10#VK_NULL_HANDLE NULL_HANDLE} or an image view handle, and is used in descriptor updates for types {@link VK10#VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE DESCRIPTOR_TYPE_SAMPLED_IMAGE}, {@link VK10#VK_DESCRIPTOR_TYPE_STORAGE_IMAGE DESCRIPTOR_TYPE_STORAGE_IMAGE}, {@link VK10#VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER}, and {@link VK10#VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT DESCRIPTOR_TYPE_INPUT_ATTACHMENT}. */
    @NativeType("VkImageView")
    public long imageView() { return nimageView(address()); }
    /** the layout that the image subresources accessible from {@code imageView} will be in at the time this descriptor is accessed. {@code imageLayout} is used in descriptor updates for types {@link VK10#VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE DESCRIPTOR_TYPE_SAMPLED_IMAGE}, {@link VK10#VK_DESCRIPTOR_TYPE_STORAGE_IMAGE DESCRIPTOR_TYPE_STORAGE_IMAGE}, {@link VK10#VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER}, and {@link VK10#VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT DESCRIPTOR_TYPE_INPUT_ATTACHMENT}. */
    @NativeType("VkImageLayout")
    public int imageLayout() { return nimageLayout(address()); }

    /** Sets the specified value to the {@link #sampler} field. */
    public VkDescriptorImageInfo sampler(@NativeType("VkSampler") long value) { nsampler(address(), value); return this; }
    /** Sets the specified value to the {@link #imageView} field. */
    public VkDescriptorImageInfo imageView(@NativeType("VkImageView") long value) { nimageView(address(), value); return this; }
    /** Sets the specified value to the {@link #imageLayout} field. */
    public VkDescriptorImageInfo imageLayout(@NativeType("VkImageLayout") int value) { nimageLayout(address(), value); return this; }

    /** Initializes this struct with the specified values. */
    public VkDescriptorImageInfo set(
        long sampler,
        long imageView,
        int imageLayout
    ) {
        sampler(sampler);
        imageView(imageView);
        imageLayout(imageLayout);

        return this;
    }

    /**
     * Copies the specified struct data to this struct.
     *
     * @param src the source struct
     *
     * @return this struct
     */
    public VkDescriptorImageInfo set(VkDescriptorImageInfo src) {
        memCopy(src.address(), address(), SIZEOF);
        return this;
    }

    // -----------------------------------

    /** Returns a new {@code VkDescriptorImageInfo} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
    public static VkDescriptorImageInfo malloc() {
        return wrap(VkDescriptorImageInfo.class, nmemAllocChecked(SIZEOF));
    }

    /** Returns a new {@code VkDescriptorImageInfo} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
    public static VkDescriptorImageInfo calloc() {
        return wrap(VkDescriptorImageInfo.class, nmemCallocChecked(1, SIZEOF));
    }

    /** Returns a new {@code VkDescriptorImageInfo} instance allocated with {@link BufferUtils}. */
    public static VkDescriptorImageInfo create() {
        ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
        return wrap(VkDescriptorImageInfo.class, memAddress(container), container);
    }

    /** Returns a new {@code VkDescriptorImageInfo} instance for the specified memory address. */
    public static VkDescriptorImageInfo create(long address) {
        return wrap(VkDescriptorImageInfo.class, address);
    }

    /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
    @Nullable
    public static VkDescriptorImageInfo createSafe(long address) {
        return address == NULL ? null : wrap(VkDescriptorImageInfo.class, address);
    }

    /**
     * Returns a new {@link VkDescriptorImageInfo.Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
     *
     * @param capacity the buffer capacity
     */
    public static VkDescriptorImageInfo.Buffer malloc(int capacity) {
        return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
    }

    /**
     * Returns a new {@link VkDescriptorImageInfo.Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
     *
     * @param capacity the buffer capacity
     */
    public static VkDescriptorImageInfo.Buffer calloc(int capacity) {
        return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity);
    }

    /**
     * Returns a new {@link VkDescriptorImageInfo.Buffer} instance allocated with {@link BufferUtils}.
     *
     * @param capacity the buffer capacity
     */
    public static VkDescriptorImageInfo.Buffer create(int capacity) {
        ByteBuffer container = __create(capacity, SIZEOF);
        return wrap(Buffer.class, memAddress(container), capacity, container);
    }

    /**
     * Create a {@link VkDescriptorImageInfo.Buffer} instance at the specified memory.
     *
     * @param address  the memory address
     * @param capacity the buffer capacity
     */
    public static VkDescriptorImageInfo.Buffer create(long address, int capacity) {
        return wrap(Buffer.class, address, capacity);
    }

    /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
    @Nullable
    public static VkDescriptorImageInfo.Buffer createSafe(long address, int capacity) {
        return address == NULL ? null : wrap(Buffer.class, address, capacity);
    }

    // -----------------------------------

    /** Deprecated for removal in 3.4.0. Use {@link #malloc(MemoryStack)} instead. */
    @Deprecated public static VkDescriptorImageInfo mallocStack() { return malloc(stackGet()); }
    /** Deprecated for removal in 3.4.0. Use {@link #calloc(MemoryStack)} instead. */
    @Deprecated public static VkDescriptorImageInfo callocStack() { return calloc(stackGet()); }
    /** Deprecated for removal in 3.4.0. Use {@link #malloc(MemoryStack)} instead. */
    @Deprecated public static VkDescriptorImageInfo mallocStack(MemoryStack stack) { return malloc(stack); }
    /** Deprecated for removal in 3.4.0. Use {@link #calloc(MemoryStack)} instead. */
    @Deprecated public static VkDescriptorImageInfo callocStack(MemoryStack stack) { return calloc(stack); }
    /** Deprecated for removal in 3.4.0. Use {@link #malloc(int, MemoryStack)} instead. */
    @Deprecated public static VkDescriptorImageInfo.Buffer mallocStack(int capacity) { return malloc(capacity, stackGet()); }
    /** Deprecated for removal in 3.4.0. Use {@link #calloc(int, MemoryStack)} instead. */
    @Deprecated public static VkDescriptorImageInfo.Buffer callocStack(int capacity) { return calloc(capacity, stackGet()); }
    /** Deprecated for removal in 3.4.0. Use {@link #malloc(int, MemoryStack)} instead. */
    @Deprecated public static VkDescriptorImageInfo.Buffer mallocStack(int capacity, MemoryStack stack) { return malloc(capacity, stack); }
    /** Deprecated for removal in 3.4.0. Use {@link #calloc(int, MemoryStack)} instead. */
    @Deprecated public static VkDescriptorImageInfo.Buffer callocStack(int capacity, MemoryStack stack) { return calloc(capacity, stack); }

    /**
     * Returns a new {@code VkDescriptorImageInfo} instance allocated on the specified {@link MemoryStack}.
     *
     * @param stack the stack from which to allocate
     */
    public static VkDescriptorImageInfo malloc(MemoryStack stack) {
        return wrap(VkDescriptorImageInfo.class, stack.nmalloc(ALIGNOF, SIZEOF));
    }

    /**
     * Returns a new {@code VkDescriptorImageInfo} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
     *
     * @param stack the stack from which to allocate
     */
    public static VkDescriptorImageInfo calloc(MemoryStack stack) {
        return wrap(VkDescriptorImageInfo.class, stack.ncalloc(ALIGNOF, 1, SIZEOF));
    }

    /**
     * Returns a new {@link VkDescriptorImageInfo.Buffer} instance allocated on the specified {@link MemoryStack}.
     *
     * @param stack    the stack from which to allocate
     * @param capacity the buffer capacity
     */
    public static VkDescriptorImageInfo.Buffer malloc(int capacity, MemoryStack stack) {
        return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
    }

    /**
     * Returns a new {@link VkDescriptorImageInfo.Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
     *
     * @param stack    the stack from which to allocate
     * @param capacity the buffer capacity
     */
    public static VkDescriptorImageInfo.Buffer calloc(int capacity, MemoryStack stack) {
        return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
    }

    // -----------------------------------

    /** Unsafe version of {@link #sampler}. */
    public static long nsampler(long struct) { return UNSAFE.getLong(null, struct + VkDescriptorImageInfo.SAMPLER); }
    /** Unsafe version of {@link #imageView}. */
    public static long nimageView(long struct) { return UNSAFE.getLong(null, struct + VkDescriptorImageInfo.IMAGEVIEW); }
    /** Unsafe version of {@link #imageLayout}. */
    public static int nimageLayout(long struct) { return UNSAFE.getInt(null, struct + VkDescriptorImageInfo.IMAGELAYOUT); }

    /** Unsafe version of {@link #sampler(long) sampler}. */
    public static void nsampler(long struct, long value) { UNSAFE.putLong(null, struct + VkDescriptorImageInfo.SAMPLER, value); }
    /** Unsafe version of {@link #imageView(long) imageView}. */
    public static void nimageView(long struct, long value) { UNSAFE.putLong(null, struct + VkDescriptorImageInfo.IMAGEVIEW, value); }
    /** Unsafe version of {@link #imageLayout(int) imageLayout}. */
    public static void nimageLayout(long struct, int value) { UNSAFE.putInt(null, struct + VkDescriptorImageInfo.IMAGELAYOUT, value); }

    // -----------------------------------

    /** An array of {@link VkDescriptorImageInfo} structs. */
    public static class Buffer extends StructBuffer<VkDescriptorImageInfo, Buffer> implements NativeResource {

        private static final VkDescriptorImageInfo ELEMENT_FACTORY = VkDescriptorImageInfo.create(-1L);

        /**
         * Creates a new {@code VkDescriptorImageInfo.Buffer} instance backed by the specified container.
         *
         * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
         * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
         * by {@link VkDescriptorImageInfo#SIZEOF}, and its mark will be undefined.
         *
         *
The created buffer instance holds a strong reference to the container object.

         */
        public Buffer(ByteBuffer container) {
            super(container, container.remaining() / SIZEOF);
        }

        public Buffer(long address, int cap) {
            super(address, null, -1, 0, cap, cap);
        }

        Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
            super(address, container, mark, pos, lim, cap);
        }

        @Override
        protected Buffer self() {
            return this;
        }

        @Override
        protected VkDescriptorImageInfo getElementFactory() {
            return ELEMENT_FACTORY;
        }

        /** @return the value of the {@link VkDescriptorImageInfo#sampler} field. */
        @NativeType("VkSampler")
        public long sampler() { return VkDescriptorImageInfo.nsampler(address()); }
        /** @return the value of the {@link VkDescriptorImageInfo#imageView} field. */
        @NativeType("VkImageView")
        public long imageView() { return VkDescriptorImageInfo.nimageView(address()); }
        /** @return the value of the {@link VkDescriptorImageInfo#imageLayout} field. */
        @NativeType("VkImageLayout")
        public int imageLayout() { return VkDescriptorImageInfo.nimageLayout(address()); }

        /** Sets the specified value to the {@link VkDescriptorImageInfo#sampler} field. */
        public VkDescriptorImageInfo.Buffer sampler(@NativeType("VkSampler") long value) { VkDescriptorImageInfo.nsampler(address(), value); return this; }
        /** Sets the specified value to the {@link VkDescriptorImageInfo#imageView} field. */
        public VkDescriptorImageInfo.Buffer imageView(@NativeType("VkImageView") long value) { VkDescriptorImageInfo.nimageView(address(), value); return this; }
        /** Sets the specified value to the {@link VkDescriptorImageInfo#imageLayout} field. */
        public VkDescriptorImageInfo.Buffer imageLayout(@NativeType("VkImageLayout") int value) { VkDescriptorImageInfo.nimageLayout(address(), value); return this; }

    }

}


text:
"use strict";

var RowAbstract         = require('./abstract'),
    util                = require('util'),
    ObjectIdentifier    = require('../../object/identifier/identifier');

/**
 * This class is a helper to structure data of the table,
 * this will only hold one table row.
 *
 * Also when extended the extra functions can be used.
 *
 * @class Row
 * @extends RowAbstract
 * @constructor
 */
function Row(config) {
    RowAbstract.call(this, config);
}

util.inherits(Row, RowAbstract);

/**
 * This method will intialize the Row object.
 *
 * @method initialize
 * @param {Object} config The configuration of the Row object
 * @returns {Promise}
 */
Row.prototype.initialize = function (config) {
    var self = this;

    if (config.table) {
        this.table = config.table;
    }

    return RowAbstract.prototype.initialize.call(self, config)
        .then(function() {
            return self.getTable();
        })
        .then(function(table) {
            return table.getColumns();
        })
        .then(function(columns) {
            return self.mapColumns(columns);
        });
};

/**
 * The load method will try to load the row from the database.
 *
 * @method load
 * @returns {Promise} The promise with the row object, or an empty row object.
 */
Row.prototype.load = function() {
    // This function will be slightly slower.
    var self = this;

    return this.getTable()
        .then(function(table) {
            return table.getQuery()
                .then(function(query) {
                    query = query.select();
                    query.table(table.getName());

                    return table.getUniqueColumns()
                        .then(function(columns) {
                            for(var index in self.data) {
                                if(columns[index]) {
                                    query.where(columns[index].name, '=', self.data[index]);
                                }
                            }

                            return table.select(query, 1);
                        });
                });
        });
};

/**
 * This method tries to save the object to the database,
 * when it is new the object is inerted into the database if it exists the row is updated.
 *
 * @method save
 * @returns {Promise} Returns the returned data.
 */
Row.prototype.save = function () {
    var self = this;

    if(Object.keys(this.modified).length == 0 && !this.new) {
        return Promise.resolve(this);
    }

    return this.getTable()
        .then(function(table) {
            if(self.new) {
                return table.insert(self);
            } else {
                return table.update(self);
            }
        });
};

/**
 * This method tries to remove an entity from the database.
 *
 * @method delete
 * @returns {Promise}
 */
Row.prototype.delete = function () {
    var self = this;

    return this.getTable()
        .then(function(table) {
            return table.delete(self);
        });
};

/**
 * Return the table assiciated to the Row.
 *
 * @method getTable
 * @returns {Object} Return the table of the current row.
 */
Row.prototype.getTable = function() {
    var self = this;

    if(this.table) {
        if(this.table instanceof ObjectIdentifier) {
            return self.getObject(this.table);
        } else {
            return Promise.resolve(this.table);
        }
    } else {
        var identifier = this.getIdentifier().clone();

        return this.getObject(identifier.setPath(['database', 'table']))
            .then(function(table) {
                self.table = table;

                return self.table;
            });
    }
};

/**
 * This method will map the table columns to the values of the row object.
 * Default table column values are supported.
 *
 * @method mapColumns
 * @param {Object} columns All the columns from the table.
 * @returns {Row} The current row object for chaining.
 */
Row.prototype.mapColumns = function(columns) {
    for(var index in columns) {
        this.data[index] = columns[index].value;
    }

    return this;
};

module.exports = Row;


text:
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

// disable moodle specific debug messages and any errors in output,
// comment out when debugging or better look into error log!
define('NO_DEBUG_DISPLAY', true);

// we need just the values from config.php and minlib.php
define('ABORT_AFTER_CONFIG', true);
require('../config.php'); // this stops immediately at the beginning of lib/setup.php
require_once("$CFG->dirroot/lib/jslib.php");

if ($slashargument = min_get_slash_argument()) {
    $slashargument = ltrim($slashargument, '/');
    if (substr_count($slashargument, '/') < 2) {
        image_not_found();
    }
    // image must be last because it may contain "/"
    list($themename, $rev, $type) = explode('/', $slashargument, 3);
    $themename = min_clean_param($themename, 'SAFEDIR');
    $rev       = min_clean_param($rev, 'INT');
    $type      = min_clean_param($type, 'SAFEDIR');

} else {
    $themename = min_optional_param('theme', 'standard', 'SAFEDIR');
    $rev       = min_optional_param('rev', 0, 'INT');
    $type      = min_optional_param('type', 'head', 'RAW');
}

if ($type !== 'head' and $type !== 'footer') {
    header('HTTP/1.0 404 not found');
    die('Theme was not found, sorry.');
}

if (file_exists("$CFG->dirroot/theme/$themename/config.php")) {
    // exists
} else if (!empty($CFG->themedir) and file_exists("$CFG->themedir/$themename/config.php")) {
    // exists
} else {
    header('HTTP/1.0 404 not found');
    die('Theme was not found, sorry.');
}

$candidate = "$CFG->cachedir/theme/$themename/javascript_$type.js";
$etag = sha1("$themename/$rev/$type");

if ($rev > -1 and file_exists($candidate)) {
    if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) || !empty($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
        // we do not actually need to verify the etag value because our files
        // never change in cache because we increment the rev parameter
        js_send_unmodified(filemtime($candidate), $etag);
    }
    js_send_cached($candidate, $etag);
}

//=================================================================================
// ok, now we need to start normal moodle script, we need to load all libs and $DB
define('ABORT_AFTER_CONFIG_CANCEL', true);

define('NO_MOODLE_COOKIES', true); // Session not used here
define('NO_UPGRADE_CHECK', true);  // Ignore upgrade check

require("$CFG->dirroot/lib/setup.php");

$theme = theme_config::load($themename);

$rev = theme_get_revision();
$etag = sha1("$themename/$rev/$type");

if ($rev > -1) {
    js_write_cache_file_content($candidate, js_minify($theme->javascript_files($type)));
    // verify nothing failed in cache file creation
    clearstatcache();
    if (file_exists($candidate)) {
        js_send_cached($candidate, $etag);
    }
}

js_send_uncached($theme->javascript_content($type));


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace DesktopCharacter.Model.Service.Rss
{
    //RSS渡せば喋ります(現在RSS1.0非対応)
    class RssService
    {
        public void ReturnRss(String url)
        {
            using (XmlReader reader = XmlReader.Create(url))
            {
                SyndicationFeed feed = SyndicationFeed.Load(reader);
                foreach (SyndicationItem items in feed.Items)
                {
                    DesktopCharacter.Model.CharacterNotify.Instance.Talk("タイトル:" + items.Title.Text);
                }
            }
        }
    }
}


text:
/**
 * The UI-Router for Angular directives:
 *
 * - [[UIView]]: A viewport for routed components
 * - [[UISref]]: A state ref to a target state; navigates when clicked
 * - [[UISrefActive]]: (and `UISrefActiveEq`) Adds a css class when a UISref's target state (or a child state) is active
 *
 * @ng2api
 * @preferred
 * @module directives
 */ /** */
import { UISref, AnchorUISref } from './uiSref';
import { UISrefActive } from './uiSrefActive';
import { UIView } from './uiView';
import { UISrefStatus } from './uiSrefStatus';

export * from './uiView';
export * from './uiSref';
export * from './uiSrefStatus';
export * from './uiSrefActive';

/** @internalapi */
export const _UIROUTER_DIRECTIVES = [UISref, AnchorUISref, UIView, UISrefActive, UISrefStatus];

/**
 * References to the UI-Router directive classes, for use within a @Component's `directives:` property
 * @deprecated use [[UIRouterModule]]
 * @internalapi
 */
export const UIROUTER_DIRECTIVES = _UIROUTER_DIRECTIVES;


text:
Contributing Code
=================

Categorical encoding is a python library in the scikit-learn-contrib family for encoding categorical variables as numeric. Our goals are to:

 * Provide a variety of different techniques for encoding
 * Provide a common, familiar API to all of these encoders
 * Support both numpy arrays and pandas dataframes equally
 * Be an all around nice project to use and contribute to

With that in mind, we welcome and in fact would love some help.

How to Contribute
=================

The preferred workflow to contribute to git-pandas is:

 1. Fork this repository into your own github account.
 2. Clone the fork on your account onto your local disk:

    $ git clone git@github.com:YourLogin/category_encoders.git
    $ cd category_encoders

 3. Create a branch for your new awesome feature, do not work in the master branch:

    $ git checkout -b new-awesome-feature

 4. Write some code, or docs, or tests.
 5. When you are done, submit a pull request.

Guidelines
==========

This is still a very young project, but we do have a few guiding principles:

 1. Maintain semantics of the scikit-learn API
 2. Write detailed docstrings in numpy format
 3. Support pandas dataframes and numpy arrays as inputs
 4. Write tests

Running Tests
=============

To run the tests, use:

    $ pytest

Easy Issues / Getting Started
=============================

There are usually some issues in the project github page looking for contributors, if not you're welcome to propose some
 ideas there, or a great first step is often to just use the library, and add to the examples directory. This helps us
 with documentation, and often helps to find things that would make the library better to use.


text:
__ace_shadowed__.define('ace/mode/c9search', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/c9search_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/c9search'], function(require, exports, module) {

var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var C9SearchHighlightRules = require("./c9search_highlight_rules").C9SearchHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var C9StyleFoldMode = require("./folding/c9search").FoldMode;

var Mode = function() {
    this.HighlightRules = C9SearchHighlightRules;
    this.$outdent = new MatchingBraceOutdent();
    this.foldingRules = new C9StyleFoldMode();
};
oop.inherits(Mode, TextMode);

(function() {

    this.getNextLineIndent = function(state, line, tab) {
        var indent = this.$getIndent(line);
        return indent;
    };

    this.checkOutdent = function(state, line, input) {
        return this.$outdent.checkOutdent(line, input);
    };

    this.autoOutdent = function(state, doc, row) {
        this.$outdent.autoOutdent(doc, row);
    };

}).call(Mode.prototype);

exports.Mode = Mode;

});

__ace_shadowed__.define('ace/mode/c9search_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {

var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;

function safeCreateRegexp(source, flag) {
    try {
        return new RegExp(source, flag);
    } catch(e) {}
}

var C9SearchHighlightRules = function() {
    this.$rules = {
        "start" : [
            {
                tokenNames : ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text", "c9searchresults.keyword"],
                regex : "(^\\s+[0-9]+)(:\\s)(.+)",
                onMatch : function(val, state, stack) {
                    var values = this.splitRegex.exec(val);
                    var types = this.tokenNames;
                    var tokens = [{
                        type: types[0],
                        value: values[1]
                    },{
                        type: types[1],
                        value: values[2]
                    }];

                    var regex = stack[1];
                    var str = values[3];
                    if (regex && str)
                        values = str.split(regex); // this doesn't work on ie8 but we don't care:)
                    else
                        values = [str];

                    for (var i = 0, l = values.length; i < l; i+=2) {
                        if (values[i])
                            tokens.push({
                                type: types[2],
                                value: values[i]
                            });
                        if (values[i+1])
                            tokens.push({
                                type: types[3],
                                value: values[i + 1]
                            });
                    }
                    return tokens;
                }
            },
            {
                token : ["string", "text"], // single line
                regex : "(\\S.*)(:$)"
            },
            {
                regex : "Searching for .*$",
                onMatch: function(val, state, stack) {
                    var parts = val.split("\x01");
                    var search = parts[1];
                    if (parts.length < 3)
                        return "text";
                    var options = parts[2] == " in" ? parts[5] : parts[6];

                    if (!/regex/.test(options))
                        search = lang.escapeRegExp(search);
                    if (/whole/.test(options))
                        search = "\\b" + search + "\\b";
                    var regex = safeCreateRegexp(
                        "(" + search + ")",
                        / sensitive/.test(options) ? "" : "i"
                    );
                    if (regex) {
                        stack[0] = state;
                        stack[1] = regex;
                    }

                    var i = 0;
                    var tokens = [
                        {
                            value: parts[i++] + "'",
                            type: "text"
                        },
                        {
                            value: parts[i++],
                            type: "text" // "c9searchresults.keyword"
                        },
                        {
                            value: "'" + parts[i++],
                            type: "text"
                        }
                    ];
                    if (parts[2] !== " in") {
                        tokens.push({
                            value: "'" + parts[i++] + "'",
                            type: "text"
                        }, {
                            value: parts[i++],
                            type: "text"
                        });
                    }
                    tokens.push({
                        value: " " + parts[i++] + " ",
                        type: "text"
                    });
                    if (parts[i+1]) {
                        tokens.push({
                            value: "(" + parts[i+1] + ")",
                            type: "text"
                        });
                        i += 1;
                    } else {
                        i -= 1;
                    }
                    while (i++ < parts.length)
                        parts[i] && tokens.push({
                            value: parts[i],
                            type: "text"
                        });

                    return tokens;
                }
            },
            {
                regex : "\\d+",
                token: "constant.numeric"
            }
        ]
    };
};

oop.inherits(C9SearchHighlightRules, TextHighlightRules);

exports.C9SearchHighlightRules = C9SearchHighlightRules;

});

__ace_shadowed__.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {

var Range = require("../range").Range;

var MatchingBraceOutdent = function() {};

(function() {

    this.checkOutdent = function(line, input) {
        if (! /^\s+$/.test(line))
            return false;

        return /^\s*\}/.test(input);
    };

    this.autoOutdent = function(doc, row) {
        var line = doc.getLine(row);
        var match = line.match(/^(\s*\})/);

        if (!match) return 0;

        var column = match[1].length;
        var openBracePos = doc.findMatchingBracket({row: row, column: column});

        if (!openBracePos || openBracePos.row == row) return 0;

        var indent = this.$getIndent(doc.getLine(openBracePos.row));
        doc.replace(new Range(row, 0, row, column-1), indent);
    };

    this.$getIndent = function(line) {
        return line.match(/^\s*/)[0];
    };

}).call(MatchingBraceOutdent.prototype);

exports.MatchingBraceOutdent = MatchingBraceOutdent;
});

__ace_shadowed__.define('ace/mode/folding/c9search', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {

var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;

var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode);

(function() {

    this.foldingStartMarker = /^(\S.*\:|Searching for.*)$/;
    this.foldingStopMarker = /^(\s+|Found.*)$/;

    this.getFoldWidgetRange = function(session, foldStyle, row) {
        var lines = session.doc.getAllLines(row);
        var line = lines[row];
        var level1 = /^(Found.*|Searching for.*)$/;
        var level2 = /^(\S.*\:|\s*)$/;
        var re = level1.test(line) ? level1 : level2;

        if (this.foldingStartMarker.test(line)) {
            for (var i = row + 1, l = session.getLength(); i < l; i++) {
                if (re.test(lines[i]))
                    break;
            }

            return new Range(row, line.length, i, 0);
        }

        if (this.foldingStopMarker.test(line)) {
            for (var i = row - 1; i >= 0; i--) {
                line = lines[i];
                if (re.test(line))
                    break;
            }

            return new Range(i, line.length, row, 0);
        }
    };

}).call(FoldMode.prototype);

});


text:
'''
Blob detection in astronomical images using various options in scikit-image module

Copyright (c) 2015, Laura Eckman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
'''

from matplotlib import pyplot as plt
from skimage.feature import blob_log, blob_doh
from math import sqrt
import numpy as np
from pixel_regions import middle_box
from thresholding import threshold as thresh

def blobl (image,survey):
    '''
    LaPlacian of Gaussian implementation of scikit-image blob detection program
    WISE images: >85% accuracy with given params. No false positives seen.

    Args:
      image: numpy array
      out_file: str representing save location of processed image (if not empty)
      display: bool to display image as matplotlib figure
    Returns dict of detected blobs (fmt: {position tuple:radius})
    '''
    dimensions = [len(image),len(image[0])]

    #blob_log args for convenience
    if survey == 'WISE':
        min_sigma = 1.
        max_sigma = 30.
        num_sigma = 30.
        threshold = thresh(image)[1]
        overlap = 1.0
        log_scale = False
    elif survey == 'DSS':
        min_sigma = 3.
        max_sigma = 30.
        num_sigma = 20.
        threshold = 12.
        overlap = 1.0
        log_scale = False

    blobs_log = blob_log(image,min_sigma,max_sigma,num_sigma,
        threshold,overlap,log_scale)

    if blobs_log.any():
        blobs_log[:,2] = blobs_log[:,2] * sqrt(2) #radius is ~sqrt(2)*sigma

    fig = plt.imshow(image,cmap=plt.cm.gray,interpolation='nearest')
    blob_dict = {}
    for blob in blobs_log:
        y, x, r = blob
        if ((r>.25*dimensions[1] or r>.25*dimensions[1]) and
            (y in (0,dimensions[0]) or x in (0,dimensions[0]))):
            continue
        if (x,y) not in middle_box(dimensions) and r <= 1:
            continue
        blob_dict[(x,y)] = r
        c = plt.Circle((x,y), r, color='b', linewidth=2, fill=False)
        center = plt.Circle((x,y),.5,color ='b',linewidth=0.5,fill=True)
        fig.axes.add_patch(c)
        fig.axes.add_patch(center)
    plt.axis('off')
    fig.axes.get_xaxis().set_visible(False)
    fig.axes.get_yaxis().set_visible(False)

    return blob_dict

def blobdoh_2MASS(image):
    '''
    Determinant of Hessian Implementation for scikit-image blob detection
    Args:
      image: numpy array
      out_file: str representing save location of processed image (if not empty)
      display: bool to display image as matplotlib figure
    Returns dict of detected blobs (fmt: {position tuple:radius})

    Works great & fast with 2MASS images using default parameters, including auxilliary blobs
    BEST for 2MASS
    '''
    dimensions = [len(image),len(image[0])]

    blobs_doh = blob_doh(image)

    fig = plt.imshow(image,cmap=plt.cm.gray,interpolation='nearest')
    blob_dict = {}
    for blob in blobs_doh:
        y, x, r = blob
        if r >= 0.4*dimensions[0] or r >= 0.4*dimensions[1]:
            continue
        blob_dict[(x,y)] = r
        c = plt.Circle((x,y), r, color='y', linewidth=2, fill=False)
        center = plt.Circle((x,y),.5,color ='y',linewidth=0.5,fill=True)
        fig.axes.add_patch(c)
        fig.axes.add_patch(center)
    plt.axis('off')
    fig.axes.get_xaxis().set_visible(False)
    fig.axes.get_yaxis().set_visible(False)

    return blob_dict

if __name__ == '__main__':

    #Example Usage:
    '''
    blobl(<WISE_img_array>,'WISE')
    plt.draw()
    raw_input('Enter to continue: ')
    plt.close()
    '''
    pass


text:
from secret import twitter_instance
from json import dump
import sys

tw = twitter_instance()

# [1]
response = tw.blocks.create(screen_name='showa_yojyo')

# [2]
dump(response, sys.stdout, ensure_ascii=False, indent=4, sort_keys=True)


text:
Drupal-iOS-SDK-demo
===================

This is a demo app called Human Alert that demonstrates the use of Drupal iOS SDK with a live Drupal installation


text:
package com.itmuch.cloud.study.filters.pre;

import javax.servlet.http.HttpServletRequest;

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

import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;

public class PreRequestLogFilter extends ZuulFilter {
  private static final Logger LOGGER = LoggerFactory.getLogger(PreRequestLogFilter.class);

  @Override
  public String filterType() {
    return "pre";
  }

  @Override
  public int filterOrder() {
    return 1;
  }

  @Override
  public boolean shouldFilter() {
    return true;
  }

  @Override
  public Object run() {
    RequestContext ctx = RequestContext.getCurrentContext();
    HttpServletRequest request = ctx.getRequest();
    PreRequestLogFilter.LOGGER.info(String.format("send %s request to %s", request.getMethod(), request.getRequestURL().toString()));
    return null;
  }
}


text:
<form action="/group" method="get">
<input type="hidden" name="group" value="{{userMembership.group.key}}"/>
<input type="hidden" name="goToHistoryTab" value="true"/>

{{ShowLast}} <input
	type="text" name="transactionCount" value="{{transactionCount}}">
{{Transactions}} <input style="vertical-align:middle" type="image" src="/images/{{lang}}/Button_Refresh.gif" alt="{{Refresh}}" title="{{Refresh}}">
	{% if validationError %}
		{{validationMessage}}
	{%endif%}
</form>

{% if hasTransactions %}

		{% for tr in transactions %}
			{% if tr.benefical %}

{{tr.message}}
			{% else %}

{{tr.message}}
			{% endif %}

			{% if tr.isRejectable %}
				{{ Reject }}
			{% endif %}

		{% endfor %}

{% else %}

	{{NoTransactionsToShow}}

{% endif %}


text:
Enlisted Grades (from lowest to highest)
----------------------------------------
### Shipsman
Lowest KTS rank. Most who first sign up with the navy receive this
rank.
### Leading Shipsman
Second-lowest KTS rank.
### Petty Officer
Second highest enlisted grade.
### Leading Petty Officer
Highest enlisted grade.

Junior Officers
---------------
### Shipsman (senior grade)
Lowest junior officer.
### Ensign
Second-lowest junior officer.
### Ensign (senior grade)
Highest ensign.
### Lieutenant
Lowest lieutenant.
### Lieutenant (senior grade)
Second-lowest lieutenant.

Senior Officers
---------------
### Lieutenant Commander
Lowest commander.
### Commander
Standard commander.
### Shipmaster
Most common rank amongst those who command classed ships. The more
traditional term, Captain, is used to refer to any non-KTN person
or persons in command of any ship or ships.

Flag Officers
-------------
### Commodore
Commander of a task group or second in command of a task force.
### Rear Admiral
Commander of a task force or second in command of a flotilla.
### Vice Admiral
Commander of a flotilla or second in command of a fleet.
### Admiral
Commander of a fleet.

High Admiralty
--------------
### First Master of the Fleet
Subordinate to the Lord of Admirals. Commands all Kul United
Navy operations and defenses.

### Second Master of the Fleet
Subordinate to the Lord of Admirals. Commands all Kandir Corps
of Engineers operations and projects.

### Lord of Admirals
Commander of the entire KTN, both Kul United Navy and Kandir
Corps of Engineers. Answers to the alor'kaidon.


text:
package com.sun.xml.txw2;

/**
 * @author Kohsuke Kawaguchi
 */
final class EndTag extends Content {
    @Override
    boolean concludesPendingStartTag() {
        return true;
    }

    @Override
    void accept(ContentVisitor visitor) {
        visitor.onEndTag();
    }
}


text:
import browserSync from 'browser-sync'
import historyApiFallback from 'connect-history-api-fallback'

browserSync.init({
  port: 3000,
  ui: { port: 3001, },
  server: {
    baseDir: ['dist',],
  },

  files: [ 'src/*.html', ],

  middleware: [
    historyApiFallback(),
  ],
})