text:
import { useEffect } from 'react'
import Router from 'next/router'
import { map, last, slice, isEmpty, startsWith } from 'ramda'

import { ISSUE_ADDR } from '@/config'
import { EVENT, ERR, THREAD } from '@/constant'

import { buildLog } from '@/utils/logger'
import { Global, send, prettyNum, cutRest, errRescue } from '@/utils/helper'
import asyncSuit from '@/utils/async'

// import S from '../schema'
import { jumpToCommunity, jumpToContent, goToHelpPage } from './jumper'
import { searchContents } from './search'

import Pocket from './Pocket'
import { SwissArmyKnife } from './swissArmyKnife'
import githubLoginHandler from './oauth/github_handler'

const log = buildLog('L:Doraemon')

const { SR71, $solver, asyncRes, asyncErr } = asyncSuit
const sr71$ = new SR71({
  receive: [EVENT.QUERY_DORAMON],
})

let sub$ = null
let store = null
let pockect$ = null
let SAK = null
let cmdResolver = []

export const hidePanel = () => {
  emptySearchStates()
  store.hideDoraemon()
  pockect$.stop()
}

export const inputOnChange = ({ target: { value: inputValue } }) => {
  store.mark({ inputValue, cmdChain: null })
  queryPocket()
}

export const handleKeyDown = (e) => {
  switch (e.key) {
    case 'Tab': {
      SAK.completeInput()
      queryPocket()
      e.preventDefault()
      break
    }
    case 'Enter': {
      if (store.showThreadSelector) {
        doNavigate()
      } else {
        doSpecCmd()
      }

      e.preventDefault()
      break
    }
    // Prevent default behavior in text input while pressing arrow up
    // https://stackoverflow.com/questions/1080532/prevent-default-behavior-in-text-input-while-pressing-arrow-up
    case 'ArrowUp': {
      navSuggestion('up')
      e.preventDefault()
      break
    }
    case 'ArrowDown': {
      navSuggestion('down')
      e.preventDefault()
      break
    }
    default: {
      //  log('onKeyPress: ', e.key)
      break
    }
  }
}

// handle spec key input on input bar, like tab, enter...

export const navSuggestion = (direction) => SAK.navSuggestion(direction)
// mounseEnter
export const navToSuggestion = (suggestion) => SAK.navToSuggestion(suggestion)
export const suggestionOnSelect = () => {
  if (store.showThreadSelector) return doNavigate()
  doSpecCmd()
}

export const inputOnBlur = () => {
  return false
  // if (R.contains(store.prefix, ['/', '?', '@'])) {
  //   log('11')
  //   hidePanel()
  // }

  // if (!store.showThreadSelector && R.isEmpty(store.prefix)) {
  //   log('22')
  //   hidePanel()
  // }
}

// do dearch when thread changes
export const searchThreadOnChange = (searchThread) => {
  store.mark({ searchThread, showAlert: false })
  searchContents(store, sr71$, store.inputValue)
}

const queryPocket = () => pockect$.query(store.inputValue)

const doSpecCmd = () => {
  if (store.searching) return false
  const cmd = store.curCmdChain
  if (!cmd) return

  /* Do not use forEach, cause forEach will not break */
  for (let i = 0; i < cmdResolver.length; i += 1) {
    if (cmdResolver[i].match(cmd)) {
      return cmdResolver[i].action(cmd)
    }
  }
  return false
}

const doNavigate = () => {
  if (store.searching) return false

  // jump to user
  if (startsWith('user-raw', store.activeSuggestion.raw)) {
    const { raw } = store.activeSuggestion
    // const login = raw.split('user-raw-')[1]
    console.log('TODO: ', raw)
    // const data = { login }
    // const type = TYPE.DRAWER.USER_VIEW

    // send(EVENT.DRAWER.OPEN, { type, data })
    return hidePanel()
  }

  // jump to community
  if (store.searchThread === 'community') {
    const { raw: communityRaw } = store.activeSuggestion

    jumpToCommunity(store, communityRaw)
    return hidePanel()
  }

  jumpToContent(store)
  // the sort is important
  hidePanel()
}

// load search suggestion and mark related search hint state
const loadSearchSuggestions = (data, searchedTotalCount) => {
  if (searchedTotalCount === 0) {
    store.mark({
      showAlert: true,
      showUtils: true,
      searchedTotalCount,
    })
  }
  store.mark({ searching: false, showUtils: true, searchedTotalCount })
  store.loadSuggestions({ prefix: '', data })
}

// clean up state after search complete
const emptySearchStates = () =>
  store.mark({
    searching: false,
    showThreadSelector: false,
    showAlert: false,
    showUtils: false,
    searchThread: 'community',
  })

// ###############################
// Data & Error handlers
// ###############################
const DataSolver = [
  {
    match: asyncRes('githubSignin'),
    action: ({ githubSignin: { user, token } }) => {
      store.setSession(user, token)
      Global.location.reload()
    },
  },
  {
    match: asyncRes('searchCommunities'),
    action: ({ searchCommunities }) => {
      const data = map(
        (e) => ({
          id: e.id,
          logo: e.logo,
          // raw: `community-raw-${e.id}`,
          raw: `${e.raw}`,
          title: e.title,
          desc: `${e.desc}`,
        }),
        searchCommunities.entries,
      )
      const { totalCount } = searchCommunities
      loadSearchSuggestions(data, totalCount)
    },
  },
  {
    match: asyncRes('searchUsers'),
    action: ({ searchUsers }) => {
      const data = map(
        (e) => ({
          id: e.id,
          logo: e.avatar,
          raw: `user-raw-${e.login}`,
          title: e.nickname,
          desc: `${e.bio}`,
        }),
        searchUsers.entries,
      )
      const { totalCount } = searchUsers
      loadSearchSuggestions(data, totalCount)
    },
  },
  {
    match: asyncRes('searchPosts'),
    action: ({ searchPosts }) => {
      const data = map(
        (e) => ({
          id: e.id,
          logo: e.author.avatar,
          raw: `post-raw-${e.id}`,
          title: e.title,
          desc: `${e.commentsCount}/${prettyNum(e.views)}  ${e.digest}`,
        }),
        searchPosts.entries,
      )
      const { totalCount } = searchPosts
      loadSearchSuggestions(data, totalCount)
    },
  },
  {
    match: asyncRes('searchJobs'),
    action: ({ searchJobs }) => {
      const data = map(
        (e) => ({
          id: e.id,
          logo: e.companyLogo,
          raw: `job-raw-${e.id}`,
          title: `${e.company} / ${e.title} / ${e.salary}`,
          desc: `${prettyNum(e.views)}  ${e.digest}`,
        }),
        searchJobs.entries,
      )
      const { totalCount } = searchJobs
      loadSearchSuggestions(data, totalCount)
    },
  },
  {
    match: asyncRes('searchRepos'),
    action: ({ searchRepos }) => {
      const data = map(
        (e) => ({
          id: e.id,
          raw: `repo-raw-${e.id}`,
          title: `${e.ownerName} / ${cutRest(e.title, 30)}`,
          desc: `star:${prettyNum(e.starCount)}  ${e.desc}`,
        }),
        searchRepos.entries,
      )
      const { totalCount } = searchRepos
      loadSearchSuggestions(data, totalCount)
    },
  },
  {
    match: asyncRes(EVENT.QUERY_DORAMON),
    action: (res) => {
      const { data } = res[EVENT.QUERY_DORAMON]
      // focus = false
      store.open(false)
      /* "doraemonInputbar" */
      store.mark({ inputValue: data || '' })
      queryPocket()
    },
  },
]

const ErrSolver = [
  {
    match: asyncErr(ERR.GRAPHQL),
    action: (data) => {
      console.log('got oauth error: ', data)
      store.mark({ searching: false })
    },
  },
  {
    match: asyncErr(ERR.TIMEOUT),
    action: ({ details }) => {
      store.mark({ searching: false })
      errRescue({ type: ERR.TIMEOUT, details, path: 'Doraemon' })
    },
  },
  {
    match: asyncErr(ERR.NETWORK),
    action: () => {
      store.mark({ searching: false })
      errRescue({ type: ERR.NETWORK, path: 'Doraemon' })
    },
  },
]

const initSpecCmdResolver = () => {
  cmdResolver = [
    {
      match: SAK.stepOneCmd('theme'),
      action: () => {
        SAK.completeInput(true)
        queryPocket()
      },
    },
    {
      match: SAK.stepOneCmd('login'),
      action: () => {
        SAK.completeInput(true)
        queryPocket()
      },
    },
    {
      match: SAK.stepOneCmd('log'),
      action: () => {
        SAK.completeInput(true)
        queryPocket()
        store.mark({
          inputForOtherUse: true,
          inputValue: Global.localStorage.getItem('log'),
        })
      },
    },
    {
      match: SAK.stepOneCmd('hforward'),
      action: () => {
        log('SAK.stepOneCmd hforward')
      },
    },
    {
      match: SAK.stepOneCmd('hbackward'),
      action: () => {
        log('SAK.stepOneCmd hbackward')
      },
    },
    {
      match: SAK.stepOneCmd('discovery'),
      action: () => {
        log('SAK.stepOneCmd discovery')
        Router.push(
          {
            pathname: '/',
            query: { main: 'discovery', sub: 'all' },
          },
          '/explore',
        )
        hidePanel()
      },
    },
    {
      match: SAK.stepTwoCmd('theme'),
      action: (cmdpath) => {
        const theme = last(cmdpath)
        store.changeTheme(theme)
        send(EVENT.SET_C11N, { data: { theme } })
      },
    },
    {
      match: SAK.stepTwoCmd('login'),
      action: (cmdpath) => {
        log('stepTwoCmd login->: ', cmdpath)
        switch (last(cmdpath)) {
          case 'github': {
            hidePanel()
            return githubLoginHandler(store, sr71$)
          }
          case 'weibo':
          case 'twitter':
          case 'google':
          case 'weixin': {
            const url = `${ISSUE_ADDR}/251`
            const win = window.open(url, '_blank')

            // see https://stackoverflow.com/questions/4907843/open-a-url-in-a-new-tab-and-not-a-new-window-using-javascript
            return win.focus()
          }
          default: {
            log('unsupported login method: ', cmdpath)
            return hidePanel()
          }
        }

        /* reference */
        /* http://www.graphql.college/implementing-github-oauth-flow-in-react */
        /* SAK.completeInput(true) */
        /* queryPocket() */
      },
    },
    {
      match: SAK.stepTwoCmd('log'),
      action: (cmdpath) => {
        const cmd = last(cmdpath)
        if (cmd === 'github') {
          Global.window.open('https://github.com/visionmedia/log', '_blank')
        } else if (cmd === 'write') {
          Global.localStorage.setItem('log', store.inputValue)
          hidePanel()
        }
      },
    },
    {
      match: SAK.communityLinker,
      action: (cmdpath) => {
        const community = cmdpath[0]
        hidePanel()
        jumpToCommunity(store, community)
      },
    },
    {
      match: SAK.communityInsideLinker,
      action: (cmdpath) => {
        log('communityInsideLinker: ', cmdpath)
      },
    },
    {
      match: SAK.stepOneCmd('help_1'),
      action: () => {
        Global.location.href = '/home/post/1'
        hidePanel()
      },
    },
    {
      match: SAK.stepOneCmd('help_37'),
      action: () => goToHelpPage('37'),
    },
    {
      match: SAK.stepOneCmd('help_38'),
      action: () => goToHelpPage('38'),
    },
    {
      match: SAK.stepOneCmd('help_40'),
      action: () => goToHelpPage('40'),
    },
    {
      match: SAK.stepOneCmd('help_41'),
      action: () => goToHelpPage('41'),
    },
    {
      match: SAK.stepOneCmd('help_42'),
      action: () => goToHelpPage('42'),
    },
    {
      match: SAK.stepOneCmd('help_43'),
      action: () => goToHelpPage('43'),
    },
  ]
}

// ###############################
// init & uninit handlers
// ###############################
export const useInit = (_store) => {
  useEffect(() => {
    store = _store

    pockect$ = new Pocket(store)
    SAK = new SwissArmyKnife(store)

    initSpecCmdResolver()

    pockect$.search().subscribe((res) => {
      if (isEmpty(res)) return emptySearchStates()

      store.mark({
        searching: true,
        showThreadSelector: true,
        showAlert: false,
        showUtils: false,
      })
      searchContents(store, sr71$, res)
    })

    pockect$.searchUser().subscribe((name) => {
      const nickname = slice(1, Infinity, name)
      store.mark({
        prefix: '@',
        searchThread: THREAD.CPER,
        showThreadSelector: true,
        showAlert: false,
      })
      if (isEmpty(nickname)) return false
      searchContents(store, sr71$, nickname)
    })

    pockect$.cmdSuggesttion().subscribe((res) => store.loadSuggestions(res))
    pockect$.emptyInput().subscribe(() => store.clearSuggestions())

    sub$ = sr71$.data().subscribe($solver(DataSolver, ErrSolver))

    return () => {
      sub$.unsubscribe()
    }
  }, [_store])
}


text:
<!DOCTYPE html>

    <title>ESTSettingNearableEddystoneURLError Enum Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset="utf-8">

          EstimoteFleetManagementSDK Docs

        <form role="search" action="../search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>

            View on GitHub

      EstimoteFleetManagementSDK Reference

      ESTSettingNearableEddystoneURLError Enum Reference

            Classes

                ESTAnalyticsManager

                ESTBeacon

                ESTBeaconConnection

                ESTBeaconOperationConnectivityInterval

                ESTBeaconOperationConnectivityPower

                ESTBeaconOperationDeviceInfoApplicationVersion

                ESTBeaconOperationDeviceInfoBootloaderVersion

                ESTBeaconOperationDeviceInfoHardwareVersion

                ESTBeaconOperationDeviceInfoUTCTime

                ESTBeaconOperationDeviceInfoUptime

                ESTBeaconOperationEddystoneEIDEnable

                ESTBeaconOperationEddystoneEIDInterval

                ESTBeaconOperationEddystoneEIDPower

                ESTBeaconOperationEddystoneTLMEnable

                ESTBeaconOperationEddystoneTLMInterval

                ESTBeaconOperationEddystoneTLMPower

                ESTBeaconOperationEddystoneUIDEnable

                ESTBeaconOperationEddystoneUIDInstance

                ESTBeaconOperationEddystoneUIDInterval

                ESTBeaconOperationEddystoneUIDNamespace

                ESTBeaconOperationEddystoneUIDPower

                ESTBeaconOperationEddystoneURLData

                ESTBeaconOperationEddystoneURLEnable

                ESTBeaconOperationEddystoneURLInterval

                ESTBeaconOperationEddystoneURLPower

                ESTBeaconOperationEstimoteLocationEnable

                ESTBeaconOperationEstimoteLocationInterval

                ESTBeaconOperationEstimoteLocationPower

                ESTBeaconOperationEstimoteTLMEnable

                ESTBeaconOperationEstimoteTLMInterval

                ESTBeaconOperationEstimoteTLMPower

                ESTBeaconOperationGPIO0StateReflectingOnLEDEnable

                ESTBeaconOperationGPIOConfigPort0

                ESTBeaconOperationGPIOConfigPort1

                ESTBeaconOperationGPIONotificationEnable

                ESTBeaconOperationGPIOPortsData

                ESTBeaconOperationGenericAdvertiserData

                ESTBeaconOperationGenericAdvertiserEnable

                ESTBeaconOperationGenericAdvertiserInterval

                ESTBeaconOperationGenericAdvertiserPower

                ESTBeaconOperationIBeaconEnable

                ESTBeaconOperationIBeaconInterval

                ESTBeaconOperationIBeaconMajor

                ESTBeaconOperationIBeaconMinor

                ESTBeaconOperationIBeaconMotionUUID

                ESTBeaconOperationIBeaconMotionUUIDEnable

                ESTBeaconOperationIBeaconPower

                ESTBeaconOperationIBeaconProximityUUID

                ESTBeaconOperationIBeaconSecureUUIDEnable

                ESTBeaconOperationIBeaconSecureUUIDPeriodScaler

                ESTBeaconOperationPowerBatteryPercentage

                ESTBeaconOperationPowerBatteryVoltage

                ESTBeaconOperationPowerDarkToSleepEnable

                ESTBeaconOperationPowerFlipToSleepEnable

                ESTBeaconOperationPowerMotionOnlyBroadcastingDelay

                ESTBeaconOperationPowerMotionOnlyBroadcastingEnable

                ESTBeaconOperationPowerScheduledAdvertisingEnable

                ESTBeaconOperationPowerScheduledAdvertisingPeriod

                ESTBeaconOperationPowerSmartPowerModeEnable

                ESTBeaconOperationSensorsAmbientLight

                ESTBeaconOperationSensorsMotionNotificationEnable

                ESTBeaconOperationSensorsPressure

                ESTBeaconOperationSensorsTemperature

                ESTBeaconOperationSensorsTemperatureOffset

                ESTBeaconOperationShakeToConnectEnable

                ESTBeaconSettingsManager

                ESTBeaconUpdateConfig

                ESTBeaconUpdateInfo

                ESTBulkUpdater

                ESTCloudManager

                ESTCloudOperationDeviceInfoColor

                ESTCloudOperationDeviceInfoDevelopmentMode

                ESTCloudOperationDeviceInfoFirmwareVersion

                ESTCloudOperationDeviceInfoGeoLocation

                ESTCloudOperationDeviceInfoIndoorLocationIdentifier

                ESTCloudOperationDeviceInfoName

                ESTCloudOperationDeviceInfoTags

                ESTCloudOperationIBeaconNonStrictMode

                ESTCloudOperationPowerBatteryLifetime

                ESTConfig

                ESTDateRule

                ESTDeviceConnectable

                ESTDeviceDetails

                ESTDeviceFilterBeaconV1

                ESTDeviceFilterLocationBeacon

                ESTDeviceFilterNearable

                ESTDeviceGeoLocation

                ESTDeviceIndoorLocation

                ESTDeviceLocationBeacon

                ESTDeviceManager

                ESTDeviceNearable

                ESTDeviceSchedule

                ESTDeviceSettings

                ESTDeviceSettingsAdvertiser

                ESTDeviceSettingsAdvertiserConnectivity

                ESTDeviceSettingsAdvertiserEddystoneEID

                ESTDeviceSettingsAdvertiserEddystoneTLM

                ESTDeviceSettingsAdvertiserEddystoneUID

                ESTDeviceSettingsAdvertiserEddystoneURL

                ESTDeviceSettingsAdvertiserEstimoteLocation

                ESTDeviceSettingsAdvertiserEstimoteTLM

                ESTDeviceSettingsAdvertiserGeneric

                ESTDeviceSettingsAdvertiserIBeacon

                ESTDeviceSettingsCollection

                ESTDeviceSettingsGeneral

                ESTDeviceShadow

                ESTDeviceStatusReport

                ESTDeviceUpdateInfo

                ESTEddystone

                ESTEddystoneAttachment

                ESTEddystoneEID

                ESTEddystoneFilter

                ESTEddystoneFilterEID

                ESTEddystoneFilterUID

                ESTEddystoneFilterURL

                ESTEddystoneFilterURLDomain

                ESTEddystoneManager

                ESTEddystoneTLM

                ESTEddystoneUID

                ESTEddystoneURL

                ESTFeaturesetBackgroundMode

                ESTFeaturesetEstimoteMonitoring

                ESTGPIOPortsData

                ESTLocationBeaconBulkUpdateConfiguration

                ESTLocationBeaconBulkUpdater

                ESTLogger

                ESTMesh

                ESTMeshGateway

                ESTMeshManager

                ESTMeshNearablesScanReportVO

                ESTMeshNearablesScanResultVO

                ESTMeshScanReportsManager

                ESTMonitoringManager

                ESTMonitoringV2Manager

                ESTMotionRule

                ESTNearable

                ESTNearableManager

                ESTNearableOperationApplicationVersion

                ESTNearableOperationBroadcastingScheme

                ESTNearableOperationEddystoneURL

                ESTNearableOperationHardware

                ESTNearableOperationIBeaconMajor

                ESTNearableOperationIBeaconMinor

                ESTNearableOperationIBeaconProximityUUID

                ESTNearableOperationMotionOnly

                ESTNearableOperationName

                ESTNearableOperationNearableInterval

                ESTNearableOperationNearablePower

                ESTNearableRule

                ESTNearableSettingsManager

                ESTNotificationGPIOData

                ESTNotificationMotion

                ESTOrientationRule

                ESTPeripheralTypeUtility

                ESTProximityRule

                ESTRequestAssignGPSLocation

                ESTRequestBeaconColor

                ESTRequestBeaconMac

                ESTRequestCancelPendingSettings

                ESTRequestDeletePendingSettings

                ESTRequestGetBeacons

                ESTRequestGetBeaconsDetails

                ESTRequestGetDeviceDetails

                ESTRequestGetDevices

                ESTRequestGetNearables

                ESTRequestGetPendingSettings

                ESTRequestGetSettingsHistory

                ESTRequestRegisterDevice

                ESTRequestV2DeletePendingSettings

                ESTRequestV2DevicesUpdate

                ESTRequestV2GetDeviceDetails

                ESTRequestV2GetDevices

                ESTRequestV3GetDeviceOwner

                ESTRequestV3GetFirmwares

                ESTRule

                ESTSettingBase

                ESTSettingConnectivityInterval

                ESTSettingConnectivityPower

                ESTSettingDeviceInfoApplicationVersion

                ESTSettingDeviceInfoBootloaderVersion

                ESTSettingDeviceInfoColor

                ESTSettingDeviceInfoDevelopmentMode

                ESTSettingDeviceInfoFirmwareVersion

                ESTSettingDeviceInfoGeoLocation

                ESTSettingDeviceInfoHardwareVersion

                ESTSettingDeviceInfoIndoorLocationIdentifier

                ESTSettingDeviceInfoIndoorLocationName

                ESTSettingDeviceInfoName

                ESTSettingDeviceInfoTags

                ESTSettingDeviceInfoUTCTime

                ESTSettingDeviceInfoUptime

                ESTSettingEddystoneConfigurationServiceEnable

                ESTSettingEddystoneEIDEnable

                ESTSettingEddystoneEIDInterval

                ESTSettingEddystoneEIDPower

                ESTSettingEddystoneTLMEnable

                ESTSettingEddystoneTLMInterval

                ESTSettingEddystoneTLMPower

                ESTSettingEddystoneUIDEnable

                ESTSettingEddystoneUIDInstance

                ESTSettingEddystoneUIDInterval

                ESTSettingEddystoneUIDNamespace

                ESTSettingEddystoneUIDPower

                ESTSettingEddystoneURLData

                ESTSettingEddystoneURLEnable

                ESTSettingEddystoneURLInterval

                ESTSettingEddystoneURLPower

                ESTSettingEstimoteLocationEnable

                ESTSettingEstimoteLocationInterval

                ESTSettingEstimoteLocationPower

                ESTSettingEstimoteTLMEnable

                ESTSettingEstimoteTLMInterval

                ESTSettingEstimoteTLMPower

                ESTSettingGPIO0StateReflectingOnLEDEnable

                ESTSettingGPIOConfigPort0

                ESTSettingGPIOConfigPort1

                ESTSettingGPIONotificationEnable

                ESTSettingGPIOPortsData

                ESTSettingGenericAdvertiserData

                ESTSettingGenericAdvertiserEnable

                ESTSettingGenericAdvertiserInterval

                ESTSettingGenericAdvertiserPower

                ESTSettingIBeaconEnable

                ESTSettingIBeaconInterval

                ESTSettingIBeaconMajor

                ESTSettingIBeaconMinor

                ESTSettingIBeaconMotionUUID

                ESTSettingIBeaconMotionUUIDEnable

                ESTSettingIBeaconNonStrictMode

                ESTSettingIBeaconPower

                ESTSettingIBeaconProximityUUID

                ESTSettingIBeaconSecureUUIDEnable

                ESTSettingIBeaconSecureUUIDPeriodScaler

                ESTSettingNearableBroadcastingScheme

                ESTSettingNearableEddystoneURL

                ESTSettingNearableInterval

                ESTSettingNearablePower

                ESTSettingOperation

                ESTSettingPowerBatteryLifetime

                ESTSettingPowerBatteryPercentage

                ESTSettingPowerBatteryVoltage

                ESTSettingPowerDarkToSleepEnable

                ESTSettingPowerFlipToSleepEnable

                ESTSettingPowerMotionOnlyBroadcastingDelay

                ESTSettingPowerMotionOnlyBroadcastingEnable

                ESTSettingPowerScheduledAdvertisingEnable

                ESTSettingPowerScheduledAdvertisingPeriod

                ESTSettingPowerSmartPowerModeEnable

                ESTSettingReadOnly

                ESTSettingReadWrite

                ESTSettingSensorsAmbientLight

                ESTSettingSensorsMotionNotificationEnable

                ESTSettingSensorsPressure

                ESTSettingSensorsTemperature

                ESTSettingSensorsTemperatureOffset

                ESTSettingShakeToConnectEnable

                ESTSettingsConnectivity

                ESTSettingsDeviceInfo

                ESTSettingsEddystoneConfigurationService

                ESTSettingsEddystoneEID

                ESTSettingsEddystoneTLM

                ESTSettingsEddystoneUID

                ESTSettingsEddystoneURL

                ESTSettingsEstimoteLocation

                ESTSettingsEstimoteTLM

                ESTSettingsGPIO

                ESTSettingsIBeacon

                ESTSettingsPower

                ESTSettingsSensors

                ESTSimulatedNearableManager

                ESTStorageManager

                ESTTelemetryInfo

                ESTTelemetryInfoAmbientLight

                ESTTelemetryInfoGPIO

                ESTTelemetryInfoMagnetometer

                ESTTelemetryInfoMotion

                ESTTelemetryInfoPressure

                ESTTelemetryInfoSystemStatus

                ESTTelemetryInfoTemperature

                ESTTelemetryNotificationAmbientLight

                ESTTelemetryNotificationGPIO

                ESTTelemetryNotificationMagnetometer

                ESTTelemetryNotificationMotion

                ESTTelemetryNotificationPressure

                ESTTelemetryNotificationSystemStatus

                ESTTelemetryNotificationTemperature

                ESTTemperatureRule

                ESTTime

                ESTTimePeriod

                ESTTrigger

                ESTTriggerManager

                ESTUtilityManager

            Constants

                ESTBulkUpdaterBeginNotification

                ESTBulkUpdaterCompleteNotification

                ESTBulkUpdaterFailNotification

                ESTBulkUpdaterProgressNotification

                ESTBulkUpdaterTimeoutNotification

            Enums

                ESTBeaconPower

                ESTBulkUpdaterDeviceUpdateStatus

                ESTBulkUpdaterStatus

                ESTDeviceLocationBeaconError

                ESTDeviceSettingsManagerError

                ESTEddystoneEIDPower

                ESTEddystoneProximity

                ESTEddystoneTLMPower

                ESTEddystoneUIDPower

                ESTEddystoneURLPower

                ESTEstimoteLocationPower

                ESTEstimoteTLMPower

                ESTGPIOConfig

                ESTGPIOConfigError

                ESTGPIOPort

                ESTGPIOPortValue

                ESTGPIOPortsDataError

                ESTGenericAdvertiserID

                ESTIBeaconPower

                ESTLocationBeaconBulkUpdaterError

                ESTMonitoringManagerError

                ESTMonitoringProximity

                ESTMonitoringState

                ESTMonitoringV2ManagerError

                ESTNearableBroadcastingScheme

                ESTNearableFirmwareState

                ESTNearableOrientation

                ESTNearablePower

                ESTNearableType

                ESTNearableZone

                ESTPeripheralFirmwareState

                ESTPeripheralTypeUtilityError

                ESTPeripheralTypeUtilityErrorCode

                ESTRequestAssignGPSLocationError

                ESTRequestBaseError

                ESTRequestBeaconColorError

                ESTRequestBeaconMacError

                ESTRequestDeletePendingSettingsError

                ESTRequestGetBeaconsError

                ESTRequestGetDevicesTypeMask

                ESTRequestGetNearablesError

                ESTSettingConnectableIntervalError

                ESTSettingConnectablePowerError

                ESTSettingDeviceInfoApplicationVersionError

                ESTSettingDeviceInfoBootloaderVersionError

                ESTSettingDeviceInfoHardwareVersionError

                ESTSettingEddystoneEIDIntervalError

                ESTSettingEddystoneEIDPowerError

                ESTSettingEddystoneTLMIntervalError

                ESTSettingEddystoneTLMPowerError

                ESTSettingEddystoneUIDInstanceError

                ESTSettingEddystoneUIDIntervalError

                ESTSettingEddystoneUIDNamespaceError

                ESTSettingEddystoneUIDPowerError

                ESTSettingEddystoneURLIntervalError

                ESTSettingEddystoneURLNamespaceError

                ESTSettingEddystoneURLPowerError

                ESTSettingEstimoteLocationIntervalError

                ESTSettingEstimoteLocationPowerError

                ESTSettingEstimoteTLMIntervalError

                ESTSettingEstimoteTLMPowerError

                ESTSettingGenericAdvertiserDataError

                ESTSettingGenericAdvertiserEnableError

                ESTSettingGenericAdvertiserIntervalError

                ESTSettingGenericAdvertiserPowerError

                ESTSettingIBeaconIntervalError

                ESTSettingIBeaconMajorError

                ESTSettingIBeaconMinorError

                ESTSettingIBeaconPowerError

                ESTSettingIBeaconProximityUUIDError

                ESTSettingNearableBroadcastingSchemeError

                ESTSettingNearableEddystoneURLError

                ESTSettingNearableIntervalError

                ESTSettingNearablePowerError

                ESTSettingOperationStatus

                ESTSettingOperationType

                ESTSettingPowerMotionOnlyBroadcastingDelayError

                ESTSettingPowerScheduledAdvertisingPeriodError

                ESTSettingSensorsTemperatureOffsetError

                ESTSettingStorageType

                EStrequestV3GetFirmwresError

            Protocols

                ESBeaconUpdateInfoDelegate

                ESTBeaconConnectionDelegate

                ESTBeaconOperationProtocol

                ESTCloudOperationProtocol

                ESTDeviceConnectableDelegate

                ESTDeviceFilter

                ESTDeviceNotificationProtocol

                ESTEddystoneManagerDelegate

                ESTLocationBeaconBulkUpdaterDelegate

                ESTMeshManagerDelegate

                ESTMonitoringManagerDelegate

                ESTMonitoringV2ManagerDelegate

                ESTNearableManagerDelegate

                ESTNearableOperationProtocol

                ESTPeripheralNearableDelegate

                ESTPeripheralNotificationDelegate

                ESTPeripheralTypeUtilityDelegate

                ESTTelemetryNotificationProtocol

                ESTTriggerManagerDelegate

            Type Definitions

                ESTDeviceSettingsManagerOperationsCompletionBlock

                ESTNotificationGPIODataBlock

                ESTReportScanVOCompletionBlock

                ESTRequestDeletePendingSettingsBlock

                ESTRequestGetDeviceDetailsBlock

                ESTRequestGetDevicesBlock

                ESTRequestV2DeletePendingSettingsBlock

                ESTRequestV2GetDeviceDetailsBlock

                ESTRequestV2GetDevicesBlock

                ESTRequestV3GetDeviceOwnerBlock

                ESTSettingCompletionBlock

                ESTSettingConnectivityIntervalCompletionBlock

                ESTSettingConnectivityPowerCompletionBlock

                ESTSettingDeviceInfoApplicationVersionCompletionBlock

                ESTSettingDeviceInfoBootloaderVersionCompletionBlock

                ESTSettingDeviceInfoColorCompletionBlock

                ESTSettingDeviceInfoDevelopmentModeCompletionBlock

                ESTSettingDeviceInfoFirmwareVersionCompletionBlock

                ESTSettingDeviceInfoGeoLocationCompletionBlock

                ESTSettingDeviceInfoHardwareVersionCompletionBlock

                ESTSettingDeviceInfoIndoorLocationIdentifierCompletionBlock

                ESTSettingDeviceInfoIndoorLocationNameCompletionBlock

                ESTSettingDeviceInfoNameCompletionBlock

                ESTSettingDeviceInfoTagsCompletionBlock

                ESTSettingDeviceInfoUTCTimeCompletionBlock

                ESTSettingDeviceInfoUptimeCompletionBlock

                ESTSettingEddystoneConfigurationServiceEnableCompletionBlock

                ESTSettingEddystoneEIDEnableCompletionBlock

                ESTSettingEddystoneEIDIntervalCompletionBlock

                ESTSettingEddystoneEIDPowerCompletionBlock

                ESTSettingEddystoneTLMEnableCompletionBlock

                ESTSettingEddystoneTLMIntervalCompletionBlock

                ESTSettingEddystoneTLMPowerCompletionBlock

                ESTSettingEddystoneUIDEnableCompletionBlock

                ESTSettingEddystoneUIDInstanceCompletionBlock

                ESTSettingEddystoneUIDIntervalCompletionBlock

                ESTSettingEddystoneUIDNamespaceCompletionBlock

                ESTSettingEddystoneUIDPowerCompletionBlock

                ESTSettingEddystoneURLDataCompletionBlock

                ESTSettingEddystoneURLEnableCompletionBlock

                ESTSettingEddystoneURLIntervalCompletionBlock

                ESTSettingEddystoneURLPowerCompletionBlock

                ESTSettingEstimoteLocationEnableCompletionBlock

                ESTSettingEstimoteLocationIntervalCompletionBlock

                ESTSettingEstimoteLocationPowerCompletionBlock

                ESTSettingEstimoteTLMEnableCompletionBlock

                ESTSettingEstimoteTLMIntervalCompletionBlock

                ESTSettingEstimoteTLMPowerCompletionBlock

                ESTSettingGPIO0StateReflectingOnLEDCompletionBlock

                ESTSettingGPIOConfigPort0CompletionBlock

                ESTSettingGPIOConfigPort1CompletionBlock

                ESTSettingGPIONotificationEnableCompletionBlock

                ESTSettingGPIOPortsDataCompletionBlock

                ESTSettingGenericAdvertiserDataCompletionBlock

                ESTSettingGenericAdvertiserEnableCompletionBlock

                ESTSettingGenericAdvertiserIntervalCompletionBlock

                ESTSettingGenericAdvertiserPowerCompletionBlock

                ESTSettingIBeaconEnableCompletionBlock

                ESTSettingIBeaconIntervalCompletionBlock

                ESTSettingIBeaconMajorCompletionBlock

                ESTSettingIBeaconMinorCompletionBlock

                ESTSettingIBeaconMotionUUIDCompletionBlock

                ESTSettingIBeaconMotionUUIDEnableCompletionBlock

                ESTSettingIBeaconNonStrictModeCompletionBlock

                ESTSettingIBeaconPowerCompletionBlock

                ESTSettingIBeaconProximityUUIDCompletionBlock

                ESTSettingIBeaconSecureUUIDEnableCompletionBlock

                ESTSettingIBeaconSecureUUIDPeriodScalerCompletionBlock

                ESTSettingNearableBroadcastingSchemeCompletionBlock

                ESTSettingNearableEddystoneURLCompletionBlock

                ESTSettingNearableIntervalCompletionBlock

                ESTSettingNearablePowerCompletionBlock

                ESTSettingPowerBatteryLifetimeCompletionBlock

                ESTSettingPowerBatteryPercentageCompletionBlock

                ESTSettingPowerBatteryVoltageCompletionBlock

                ESTSettingPowerDarkToSleepEnableCompletionBlock

                ESTSettingPowerFlipToSleepEnableCompletionBlock

                ESTSettingPowerMotionOnlyBroadcastingDelayCompletionBlock

                ESTSettingPowerMotionOnlyBroadcastingEnableCompletionBlock

                ESTSettingPowerScheduledAdvertisingEnableCompletionBlock

                ESTSettingPowerScheduledAdvertisingPeriodCompletionBlock

                ESTSettingPowerSmartPowerModeEnableCompletionBlock

                ESTSettingSensorsAmbientLightCompletionBlock

                ESTSettingSensorsMotionNotificationEnableCompletionBlock

                ESTSettingSensorsPressureCompletionBlock

                ESTSettingSensorsTemperatureCompletionBlock

                ESTSettingSensorsTemperatureOffsetCompletionBlock

                ESTSettingShakeToConnectEnableCompletionBlock

                ESTTelemetryNotificationGPIONotificationBlock

ESTSettingNearableEddystoneURLError

enum ESTSettingNearableEddystoneURLError {}

Describes Settings EddystoneURL validation error.

                    ESTSettingNearableEddystoneURLErrorInvalidURL

Provided value is not a valid Eddystone URL.

Declaration

Objective-C

ESTSettingNearableEddystoneURLErrorInvalidURL = 1

Swift

case invalidURL = 1

                    ESTSettingNearableEddystoneURLErrorConvenienceAPIUnsupported

Convenience API is not supported.

Declaration

Objective-C

ESTSettingNearableEddystoneURLErrorConvenienceAPIUnsupported

Swift

case convenienceAPIUnsupported = 2

© 2019 Estimote. All rights reserved. (Last updated: 2019-10-25)

Generated by jazzy ♪♫ v0.7.4, a Realm project.

redpajama_set_name: RedPajamaGithub


text:
import logging
import sys

from pyflink.common.time import Instant

from pyflink.common import Types
from pyflink.datastream import StreamExecutionEnvironment
from pyflink.table import (DataTypes, TableDescriptor, Schema, StreamTableEnvironment)
from pyflink.table.expressions import lit, col
from pyflink.table.udf import udaf
from pyflink.table.window import Tumble

def pandas_udaf():
    env = StreamExecutionEnvironment.get_execution_environment()
    env.set_parallelism(1)
    t_env = StreamTableEnvironment.create(stream_execution_environment=env)

    # define the source with watermark definition
    ds = env.from_collection(
        collection=[
            (Instant.of_epoch_milli(1000), 'Alice', 110.1),
            (Instant.of_epoch_milli(4000), 'Bob', 30.2),
            (Instant.of_epoch_milli(3000), 'Alice', 20.0),
            (Instant.of_epoch_milli(2000), 'Bob', 53.1),
            (Instant.of_epoch_milli(5000), 'Alice', 13.1),
            (Instant.of_epoch_milli(3000), 'Bob', 3.1),
            (Instant.of_epoch_milli(7000), 'Bob', 16.1),
            (Instant.of_epoch_milli(10000), 'Alice', 20.1)
        ],
        type_info=Types.ROW([Types.INSTANT(), Types.STRING(), Types.FLOAT()]))

    table = t_env.from_data_stream(
        ds,
        Schema.new_builder()
              .column_by_expression("ts", "CAST(f0 AS TIMESTAMP_LTZ(3))")
              .column("f1", DataTypes.STRING())
              .column("f2", DataTypes.FLOAT())
              .watermark("ts", "ts - INTERVAL '3' SECOND")
              .build()
    ).alias("ts", "name", "price")

    # define the sink
    t_env.create_temporary_table(
        'sink',
        TableDescriptor.for_connector('print')
                       .schema(Schema.new_builder()
                               .column('name', DataTypes.STRING())
                               .column('total_price', DataTypes.FLOAT())
                               .column('w_start', DataTypes.TIMESTAMP_LTZ())
                               .column('w_end', DataTypes.TIMESTAMP_LTZ())
                               .build())
                       .build())

    @udaf(result_type=DataTypes.FLOAT(), func_type="pandas")
    def mean_udaf(v):
        return v.mean()

    # define the tumble window operation
    table = table.window(Tumble.over(lit(5).seconds).on(col("ts")).alias("w")) \
                 .group_by(col('name'), col('w')) \
                 .select(col('name'), mean_udaf(col('price')), col("w").start, col("w").end)

    # submit for execution
    table.execute_insert('sink') \
         .wait()
    # remove .wait if submitting to a remote cluster, refer to
    # https://nightlies.apache.org/flink/flink-docs-stable/docs/dev/python/faq/#wait-for-jobs-to-finish-when-executing-jobs-in-mini-cluster
    # for more details

if __name__ == '__main__':
    logging.basicConfig(stream=sys.stdout, level=logging.INFO, format="%(message)s")

    pandas_udaf()


text:
import '../styles/style.css';

export { default as AnimatedTree } from './components/animatedTree';
export { default as Tree } from './components/tree';


text:
Passes if the provided spies where called in the specified order.

```js
var obj = {
    foo: function () { return 'foo'; },
    bar: function () { return 'bar'; },
    baz: function () { return 'baz'; }
};
sinon.spy(obj, 'foo');
sinon.spy(obj, 'bar');
sinon.spy(obj, 'baz');
obj.foo();
obj.bar();
obj.baz();
expect([obj.foo, obj.bar, obj.baz], 'given call order');
```

In case of a failing expectation you get the following output:

```js
expect([obj.bar, obj.foo, obj.baz], 'given call order');
```

```output
expected [ bar, foo, baz ] given call order

┌─▷
│   foo(); at theFunction (theFileName:xx:yy)
└── bar(); at theFunction (theFileName:xx:yy) // should be moved
    baz(); at theFunction (theFileName:xx:yy)
```

NOTE: This assertion has slightly different semantics from Sinon.js' own
built-in [callOrder](http://sinonjs.org/docs/#assertions) assertion, which
is a bit loose a when a spy/stub has been called multiple times, especially
if the calls are interleaved with calls to the other spies.

This assertion supports listing the same spy multiple times, which then
asserts that the spy was called multiple times:

```js
var spy1 = sinon.spy().named('spy1');
var spy2 = sinon.spy().named('spy2');
spy1();
spy2();
spy1();

expect([spy1, spy2, spy2], 'given call order');
```

```output
expected [ spy1, spy2, spy2 ] given call order

spy1(); at theFunction (theFileName:xx:yy)
spy2(); at theFunction (theFileName:xx:yy)
spy1(); at theFunction (theFileName:xx:yy) // should be spy2
```


text:
class TParamsDlg: public TParamsDlgBase
{
public:
	// constructors and destructors
	TParamsDlg( wxWindow *parent, wxWindowID id, const wxString &title,
		const wxPoint& pos = wxDefaultPosition,
		const wxSize& size = wxDefaultSize,
		long style = wxDEFAULT_DIALOG_STYLE );
	~TParamsDlg();

	void OnInitDialog(wxInitDialogEvent& event);

	bool TransferDataToWindow();
	bool TransferDataFromWindow();

	void SetParams(const TParams &Params);
	void GetParams(TParams &Params);
	void UpdateEnableState();
	void RefreshLocationFields();
	void UpdateTimeString();
	void UpdateColorControl();
	void DeleteItem(wxListBox *pBox);
	int FindLayerByFilename(const vtString &fname);
	void UpdateScenarioChoices();

	// main copy of the parameters
	TParams		m_Params;

	// overall name
	wxString	m_strTerrainName;

	// elevation
	bool		m_bGrid;
	int			m_iLodMethod;
	int			m_iTriCount;
	bool		m_bTin;
	bool		m_bTileset;
	bool		m_bExternal;
	wxString	m_strExternalData;
	wxString	m_strFilename;
	wxString	m_strFilenameTin;
	wxString	m_strFilenameTileset;
	float		m_fTextureLODFactor;
	wxString	m_strTextureTileset;
	bool		m_bTextureGradual;
	float		m_fVerticalExag;

	// navigation
	float		m_fMinHeight;
	int			m_iNavStyle;
	float		m_fNavSpeed;
	float		m_fDamping;
	wxString	m_strLocFile;
	int			m_iInitLocation;
	wxString	m_strInitLocation;
	float		m_fHither;
	bool		m_bAccel;
	bool		m_bAllowRoll;

	// LOD
	int		m_iVertCount;
	int		m_iTileCacheSize;
	bool	m_bTileThreading;

	// time
	bool	m_bTimeOn;
	vtTime  m_InitTime;
	float   m_fTimeSpeed;

	// culture
	bool		m_bRoads;
	wxString	m_strRoadFile;
	bool		m_bHwy;
	bool		m_bPaved;
	bool		m_bDirt;
	float		m_fRoadHeight;
	float		m_fRoadDistance;
	bool		m_bTexRoads;
	bool		m_bRoadCulture;

	// vegetation
	int		m_iVegDistance;
	bool    m_bTreesUseShaders;

	bool	m_bFog;
	float   m_fFogDistance;

	wxString m_strContent;

	std::vector<vtTagArray> m_Layers;
	vtStringArray m_AnimPaths;
	int		m_iStructDistance;
	bool	m_bStructureShadows;
	int		m_iShadowRez;
	float	m_fDarkness;
	bool	m_bShadowsDefaultOn;
	bool	m_bShadowsEveryFrame;
	bool	m_bLimitShadowArea;
	float	m_fShadowRadius;
	bool	m_bPagingStructures;
	int		m_iPagingStructureMax;
	float	m_fPagingStructureDist;

	// ephemeris
	bool		m_bSky;
	wxString	m_strSkyTexture;
	bool		m_bOceanPlane;
	float		m_fOceanPlaneLevel;
	bool		m_bWater;
	wxString	m_strFilenameWater;
	bool		m_bDepressOcean;
	float		m_fDepressOceanLevel;
	wxColor		m_BgColor;

//	bool	m_bVehicles;
//  float   m_fVehicleSize;
//  float   m_fVehicleSpeed;

	wxString m_strUtilFile;

	// HUD
	wxString m_strOverlayFile;
	int		m_iOverlayX;
	int		m_iOverlayY;
	bool	m_bOverview;
	bool	m_bCompass;

	wxString m_strInitScenario;

	wxString m_strInitTime;
//  wxString   m_strMemRequired;

// Scenarios
	std::vector<ScenarioParams> m_Scenarios;

	// WDR: method declarations for TParamsDlg
	wxRadioButton* GetUseExternal()  { return (wxRadioButton*) FindWindow( ID_USE_EXTERNAL ); }
	wxButton* GetMovedownScenario()  { return (wxButton*) FindWindow( ID_MOVEDOWN_SCENARIO ); }
	wxButton* GetMoveupScenario()  { return (wxButton*) FindWindow( ID_MOVEUP_SCENARIO ); }
	wxButton* GetEditScenario()  { return (wxButton*) FindWindow( ID_EDIT_SCENARIO ); }
	wxButton* GetDeleteScenario()  { return (wxButton*) FindWindow( ID_DELETE_SCENARIO ); }
	wxStaticBitmap* GetColorBitmap()  { return (wxStaticBitmap*) FindWindow( ID_COLOR3 ); }
	wxCheckBox* GetCheckStructureShadows()  { return (wxCheckBox*) FindWindow( ID_CHECK_STRUCTURE_SHADOWS ); }
	wxRadioButton* GetUseGrid()  { return (wxRadioButton*) FindWindow( ID_USE_GRID ); }
	wxRadioButton* GetUseTin()  { return (wxRadioButton*) FindWindow( ID_USE_TIN ); }
	wxRadioButton* GetUseTileset()  { return (wxRadioButton*) FindWindow( ID_USE_TILESET ); }
	wxRadioButton* GetDerived()  { return (wxRadioButton*) FindWindow( ID_DERIVED ); }
	wxRadioButton* GetSingle()  { return (wxRadioButton*) FindWindow( ID_SINGLE ); }
	wxTextCtrl* GetLightFactor()  { return (wxTextCtrl*) FindWindow( ID_LIGHT_FACTOR ); }
	wxTextCtrl* GetFogDistance()  { return (wxTextCtrl*) FindWindow( ID_FOG_DISTANCE ); }

	bool	m_bReady;
	bool	m_bSetting;
	vtStringArray m_TextureFiles;

private:
	// WDR: member variable declarations for TParamsDlg
	wxTextCtrl* m_pPreLightFactor;
	wxListBox* m_pImageFiles;
	wxRadioButton* m_pSingle;
	wxRadioButton* m_pDerived;
	wxRadioButton* m_pTiled;
	wxRadioButton* m_pTileset;
	wxListBox* m_pScenarioList;

private:
	// WDR: handler declarations for TParamsDlg
	void OnComboTFileSingle( wxCommandEvent &event );
	void OnOverlay( wxCommandEvent &event );
	void OnBgColor( wxCommandEvent &event );
	void OnCheckBoxElevType( wxCommandEvent &event );
	void OnCheckBox( wxCommandEvent &event );
	void OnListDblClickElev( wxCommandEvent &event );
	void OnListDblClickPlants( wxCommandEvent &event );
	void OnListDblClickStructure( wxCommandEvent &event );
	void OnListDblClickRaw( wxCommandEvent &event );
	void OnListDblClickAnimPaths( wxCommandEvent &event );
	void OnListDblClickImage( wxCommandEvent &event );
	void OnChoiceLocFile( wxCommandEvent &event );
	void OnChoiceInitLocation( wxCommandEvent &event );
	void OnSetInitTime( wxCommandEvent &event );
	void OnStyle( wxCommandEvent &event );
	void OnScenarioListEvent( wxCommandEvent &event );
	void OnNewScenario( wxCommandEvent &event );
	void OnDeleteScenario( wxCommandEvent &event );
	void OnEditScenario( wxCommandEvent &event );
	void OnMoveUpScenario( wxCommandEvent &event );
	void OnMoveDownSceanario( wxCommandEvent &event );
	void OnChoiceScenario( wxCommandEvent &event );
	void OnPrimaryTexture( wxCommandEvent &event );
	void OnSetTinTexture( wxCommandEvent &event );
	void OnSetTexture( wxCommandEvent &event );

private:
	DECLARE_EVENT_TABLE()
};

#endif  // __TParamsDlg_H__


text:
package edu.sampleu.travel;

import org.junit.Ignore;
import org.junit.Test;

/**
 * @author Kuali Rice Team (rice.collab@kuali.org)
 */
public class FiscalOfficerInfoMaintenanceNavAft extends FiscalOfficerInfoMaintenanceAftBase {

    @Ignore // link removed
    @Test
    public void testFiscalOfficerInfoMaintenanceNav() throws Exception {
        testFiscalOfficerInfoMaintenanceNav(this);
    }
}


text:
package me.lucko.helper.shadows.nbt;

import me.lucko.shadow.Shadow;
import me.lucko.shadow.ShadowFactory;
import me.lucko.shadow.bukkit.Mapping;
import me.lucko.shadow.bukkit.NmsClassTarget;
import me.lucko.shadow.bukkit.ObfuscatedTarget;
import me.lucko.shadow.bukkit.PackageVersion;

import java.util.Set;

@NmsClassTarget("NBTTagCompound")
public interface NBTTagCompound extends Shadow, NBTBase {

    static NBTTagCompound create() {
        return ShadowFactory.global().constructShadow(NBTTagCompound.class);
    }

    @ObfuscatedTarget({
            @Mapping(value = "c", version = PackageVersion.v1_12_R1),
            @Mapping(value = "c", version = PackageVersion.v1_8_R3)
    })
    Set<String> keySet();

    @ObfuscatedTarget({
            @Mapping(value = "d", version = PackageVersion.v1_12_R1),
            // Not present on 1.8.8
    })
    int size();

    @ObfuscatedTarget({
            @Mapping(value = "set", version = PackageVersion.v1_12_R1),
            @Mapping(value = "set", version = PackageVersion.v1_8_R3)
    })
    void setTag(String key, NBTBase value);

    @ObfuscatedTarget({
            @Mapping(value = "remove", version = PackageVersion.v1_12_R1),
            @Mapping(value = "remove", version = PackageVersion.v1_8_R3)
    })
    void removeTag(String key);

    @ObfuscatedTarget({
            @Mapping(value = "setByte", version = PackageVersion.v1_12_R1),
            @Mapping(value = "setByte", version = PackageVersion.v1_8_R3)
    })
    void setByte(String key, byte value);

    @ObfuscatedTarget({
            @Mapping(value = "setShort", version = PackageVersion.v1_12_R1),
            @Mapping(value = "setShort", version = PackageVersion.v1_8_R3)
    })
    void setShort(String key, short value);

    @ObfuscatedTarget({
            @Mapping(value = "setInt", version = PackageVersion.v1_12_R1),
            @Mapping(value = "setInt", version = PackageVersion.v1_8_R3)
    })
    void setInteger(String key, int value);

    @ObfuscatedTarget({
            @Mapping(value = "setLong", version = PackageVersion.v1_12_R1),
            @Mapping(value = "setLong", version = PackageVersion.v1_8_R3)
    })
    void setLong(String key, long value);

    @ObfuscatedTarget({
            @Mapping(value = "setFloat", version = PackageVersion.v1_12_R1),
            @Mapping(value = "setFloat", version = PackageVersion.v1_8_R3)
    })
    void setFloat(String key, float value);

    @ObfuscatedTarget({
            @Mapping(value = "setDouble", version = PackageVersion.v1_12_R1),
            @Mapping(value = "setDouble", version = PackageVersion.v1_8_R3)
    })
    void setDouble(String key, double value);

    @ObfuscatedTarget({
            @Mapping(value = "setString", version = PackageVersion.v1_12_R1),
            @Mapping(value = "setString", version = PackageVersion.v1_8_R3)
    })
    void setString(String key, String value);

    @ObfuscatedTarget({
            @Mapping(value = "setByteArray", version = PackageVersion.v1_12_R1),
            @Mapping(value = "setByteArray", version = PackageVersion.v1_8_R3)
    })
    void setByteArray(String key, byte[] value);

    @ObfuscatedTarget({
            @Mapping(value = "setIntArray", version = PackageVersion.v1_12_R1),
            @Mapping(value = "setIntArray", version = PackageVersion.v1_8_R3)
    })
    void setIntArray(String key, int[] value);

    @ObfuscatedTarget({
            @Mapping(value = "setBoolean", version = PackageVersion.v1_12_R1),
            @Mapping(value = "setBoolean", version = PackageVersion.v1_8_R3)
    })
    void setBoolean(String key, boolean value);

    @ObfuscatedTarget({
            @Mapping(value = "get", version = PackageVersion.v1_12_R1),
            @Mapping(value = "get", version = PackageVersion.v1_8_R3)
    })
    NBTBase getTag(String key);

    @ObfuscatedTarget({
            @Mapping(value = "d", version = PackageVersion.v1_12_R1),
            @Mapping(value = "b", version = PackageVersion.v1_8_R3)
    })
    byte getTagId(String key);

    @ObfuscatedTarget({
            @Mapping(value = "hasKey", version = PackageVersion.v1_12_R1),
            @Mapping(value = "hasKey", version = PackageVersion.v1_8_R3)
    })
    boolean hasKey(String key);

    @ObfuscatedTarget({
            @Mapping(value = "hasKeyOfType", version = PackageVersion.v1_12_R1),
            @Mapping(value = "hasKeyOfType", version = PackageVersion.v1_8_R3)
    })
    boolean hasKey(String key, int type);

    @ObfuscatedTarget({
            @Mapping(value = "getByte", version = PackageVersion.v1_12_R1),
            @Mapping(value = "getByte", version = PackageVersion.v1_8_R3)
    })
    byte getByte(String key);

    @ObfuscatedTarget({
            @Mapping(value = "getShort", version = PackageVersion.v1_12_R1),
            @Mapping(value = "getShort", version = PackageVersion.v1_8_R3)
    })
    short getShort(String key);

    @ObfuscatedTarget({
            @Mapping(value = "getInt", version = PackageVersion.v1_12_R1),
            @Mapping(value = "getInt", version = PackageVersion.v1_8_R3)
    })
    int getInteger(String key);

    @ObfuscatedTarget({
            @Mapping(value = "getLong", version = PackageVersion.v1_12_R1),
            @Mapping(value = "getLong", version = PackageVersion.v1_8_R3)
    })
    long getLong(String key);

    @ObfuscatedTarget({
            @Mapping(value = "getFloat", version = PackageVersion.v1_12_R1),
            @Mapping(value = "getFloat", version = PackageVersion.v1_8_R3)
    })
    float getFloat(String key);

    @ObfuscatedTarget({
            @Mapping(value = "getDouble", version = PackageVersion.v1_12_R1),
            @Mapping(value = "getDouble", version = PackageVersion.v1_8_R3)
    })
    double getDouble(String key);

    @ObfuscatedTarget({
            @Mapping(value = "getString", version = PackageVersion.v1_12_R1),
            @Mapping(value = "getString", version = PackageVersion.v1_8_R3)
    })
    String getString(String key);

    @ObfuscatedTarget({
            @Mapping(value = "getByteArray", version = PackageVersion.v1_12_R1),
            @Mapping(value = "getByteArray", version = PackageVersion.v1_8_R3)
    })
    byte[] getByteArray(String key);

    @ObfuscatedTarget({
            @Mapping(value = "getIntArray", version = PackageVersion.v1_12_R1),
            @Mapping(value = "getIntArray", version = PackageVersion.v1_8_R3)
    })
    int[] getIntArray(String key);

    @ObfuscatedTarget({
            @Mapping(value = "getCompound", version = PackageVersion.v1_12_R1),
            @Mapping(value = "getCompound", version = PackageVersion.v1_8_R3)
    })
    NBTTagCompound getCompoundTag(String key);

    @ObfuscatedTarget({
            @Mapping(value = "getList", version = PackageVersion.v1_12_R1),
            @Mapping(value = "getList", version = PackageVersion.v1_8_R3)
    })
    NBTTagList getTagList(String key, int type);

    @ObfuscatedTarget({
            @Mapping(value = "getBoolean", version = PackageVersion.v1_12_R1),
            @Mapping(value = "getBoolean", version = PackageVersion.v1_8_R3)
    })
    boolean getBoolean(String key);

    @ObfuscatedTarget({
            @Mapping(value = "a", version = PackageVersion.v1_12_R1),
            @Mapping(value = "a", version = PackageVersion.v1_8_R3)
    })
    void merge(NBTTagCompound other);

}


text:
using System;
using Newtonsoft.Json;

namespace Rosie
{
	public class SetDeviceStateRequest
	{
		public string CommandKey { get; set; }

		[JsonProperty ("on")]
		public bool On { get; set; }

		[JsonProperty ("bri")]
		public int Bri { get; set; }

		public object Value { get; set; }
	}
}


text:
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>Jasmine Spec Runner v2.0.0</title>

  <link rel="shortcut icon" type="image/png" href="lib/jasmine-2.0.0/jasmine_favicon.png">
  <link rel="stylesheet" type="text/css" href="lib/jasmine-2.0.0/jasmine.css">

  <script type="text/javascript" src="lib/jasmine-2.0.0/jasmine.js"></script>
  <script type="text/javascript" src="lib/jasmine-2.0.0/jasmine-html.js"></script>
  <script type="text/javascript" src="lib/jasmine-2.0.0/boot.js"></script>

  <!-- include source files here... -->
  <script type="text/javascript" src="src/Trie.js"></script>
  <script type="text/javascript" src="src/dictionary.js"></script>
  <script type="text/javascript" src="src/TrieDictionary.js"></script>
  <script type="text/javascript" src="src/Board.js"></script>
  <script type="text/javascript" src="src/Dice.js"></script>
  <script type="text/javascript" src="src/BoggleGame.js"></script>
  <script type="text/javascript" src="src/Solver.js"></script>

  <!-- include spec files here... -->
  <script type="text/javascript" src="spec/SpecHelper.js"></script>
  <script type="text/javascript" src="spec/FullSearchSpec.js"></script>

</head>

<body>
</body>
</html>


text:
sample app of Apache Camel

# build

```
cd camelSample
mvn clean install
```

you use target/geo-XXX-jar-with-dependencies.jar as below

`
java -jar geo-XXX-jar-with-dependencies.jar
`

# develop

you can use the followings maven commands.

```
mvn camel:run
```

if you want to run with hawtio.
```
mvn hawtio:camel
```


text:
surface-nets
============
Extract a simplicial level set from an [ndarray](https://github.com/mikolalysenko/ndarray) in any dimension using naive surface nets.  This module works in both node.js and with [browserify](http://browserify.org/)!

# Example

Here is a 2D example:

```javascript
//Load modules
var surfaceNets = require("surface-nets")
var ndarray = require("ndarray")
var fill = require("ndarray-fill")

//Initialize array to a circle
var array = ndarray(new Float32Array(32*32), [32,32])
fill(array, function(i,j) {
  return Math.pow(i-16,2) + Math.pow(j-16,2)
})

//Extract 2D contour (this is all there is to it!)
var complex = surfaceNets(array, 15*15)

//Write SVG image to stdout
var svgFile = ['<svg xmlns="http://www.w3.org/2000/svg" width="320" height="320">']
complex.cells.forEach(function(cell) {
  var p0 = complex.positions[cell[0]]
  var p1 = complex.positions[cell[1]]
  svgFile.push('<line x1="', 10*p0[0], '" y1="', 10*p0[1], '" x2="', 10*p1[0], '" y2="', 10*p1[1], '" stroke="red" stroke-width="1" />')
})
complex.positions.forEach(function(p) {
  svgFile.push('<circle cx="', 10*p[0], '" cy="', 10*p[1], '" r="1" stroke="black" stroke-width="0.1" fill="black" />')
})
svgFile.push('</svg>')
console.log(svgFile.join(""))
```

And here is the output SVG:

This module also works in 3D.  Here is an example:

```javascript
//Load modules
var surfaceNets = require("surface-nets")
var ndarray = require("ndarray")
var fill = require("ndarray-fill")
var mat4 = require("gl-matrix").mat4

//Initialize array
var array = ndarray(new Float32Array(32*32*32), [32,32,32])
fill(array, function(i,j,k) {
  return Math.pow(i-16,2) + Math.pow(j-16,2) + Math.pow(k-16,2)
})

//Generate surface! (again, just one line)
var complex = surfaceNets(array, 100)

//Render the implicit surface to stdout
console.log('<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" version="1.1">')
console.log(require("svg-3d-simplicial-complex")(
  complex.cells,
  complex.positions, {
    view: mat4.lookAt(
      mat4.create(),
      [32, 32, 32],
      [16, 16, 16],
      [0,1,0]),
    projection: mat4.perspective(mat4.create(),
      Math.PI/4.0,
      1.0,
      0.1,
      1000.0),
    viewport: [[0,0], [512,512]]
  }))
console.log("</svg>")
```

And here is the result:

And while it is a bit trivial, you can also generate surfaces in 1D:

```javascript
var surfaceNets = require("surface-nets")
var ndarray = require("ndarray")

console.log(surfaceNets(ndarray([1, -1, 0, 5, -10])))
```

Output:

```javascript
{ positions: [ [ 0.5 ], [ 2 ], [ 3.3333333333333335 ] ],
  cells: [ [ 0 ], [ 1 ], [ 2 ] ] }
```

The code *should* work in 4D and higher dimensions, but this is not well tested and it is harder to visualize.  (Also, why would you want to bother!?!)

# Install

```
npm install surface-nets
```

# API

#### `require("surface-nets")(array[,level])`
Extracts the level set at `level` from `array` as a simplicial complex.

* `array` is an [ndarray](https://github.com/mikolalysenko/ndarray)
* `level` is an optional number which determines the level at which the levelset is evaluated (default `0`)

**Returns** An object with a pair of properties representing a simplicial complex:

* `positions` is an array encoding the positions of the vertices.  The coordinates of the positions are with respect to the indices in `array`.
* `cells` is an array encoding the cells of the simplicial complex as tuples of indices into the `position` array.

# Credits
(c) 2014 Mikola Lysenko. MIT License


text:
define(
	[
		'lib/interfaces/xfUIObject', 'lib/communication/applicationChannels', 'lib/models/xfMatch', 'lib/util/GUID',
		'lib/models/xfImmutableCluster', 'lib/util/xfUtil', 'lib/constants', 'lib/ui/xfLinkType'
	],
	function(
		xfUIObject, appChannel, xfMatch, guid,
		xfImmutableCluster, xfUtil, constants, xfLinkType
	) {

		//--------------------------------------------------------------------------------------------------------------
		// Private Variables
		//--------------------------------------------------------------------------------------------------------------

		var MODULE_NAME = constants.MODULE_NAMES.FILE;

		var xfFileToolBarSpecTemplate = {
			allowFile           : false,
			allowFocus          : false,
			allowClose          : true,
			allowSearch         : true
		};

		var xfFileSpecTemplate = {
			parent : {},
			dataId : ''
		};

		//--------------------------------------------------------------------------------------------------------------
		// Private Methods
		//--------------------------------------------------------------------------------------------------------------

		var _createMatchcard = function(parentFile, searchTerm){
			var matchSpec = xfMatch.getSpecTemplate();
			matchSpec.parent = parentFile;
			matchSpec.searchTerm = searchTerm;

			return xfMatch.createInstance(matchSpec);
		};

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

		var _hasMatchcard = function(state){
			return state.matchUIObject != null;
		};

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

		var _hasCluster = function(state){
			return state.clusterUIObject != null;
		};

		//--------------------------------------------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------------------------------------------

		var xfFileModule = {};

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

		xfFileModule.createInstance = function(spec){

			var _UIObjectState = {
				xfId                : '',
				UIType              : MODULE_NAME,
				spec                : {},
				toolbarSpec         : _.clone(xfFileToolBarSpecTemplate),
				matchUIObject       : null,
				clusterUIObject     : null,
				duplicateCount      : 1,
				links               : {},
				title               : '',
				isSelected          : false,
				isHighlighted       : false,
				isMatchHighlighted  : false,
				isHovered			: false,
				isHidden			: false,
				showToolbar         : true,
				showDetails         : true,
				showSpinner         : false,
				titleInitialized    : false
			};

			//---------------
			// Initialization
			//---------------

			// set the xfId
			_UIObjectState.xfId = 'file_'+guid.generateGuid();

			// populate UI object state spec with passed in spec
			_UIObjectState.spec = this.getSpecTemplate();
			for (var key in spec) {
				if ( spec.hasOwnProperty(key) ) {
					_UIObjectState.spec[key] = spec[key];
				}
			}
			_UIObjectState.spec.dataId = _UIObjectState.xfId;

			// create new object instance
			var xfFileInstance = {};
			xfUIObject.implementedBy(xfFileInstance, MODULE_NAME);

			//---------------
			// Public methods
			//---------------

			xfFileInstance.clone = function() {

				// create cloned object
				var clonedObject = xfFileModule.createInstance(_UIObjectState.spec);

				// add necessary UI state
				if (_UIObjectState.titleInitialized) {
					clonedObject.setLabel(_UIObjectState.title);
				}

				// clone match card if exists
				if (_hasMatchcard(_UIObjectState)) {
					clonedObject.setMatchUIObject(_UIObjectState.matchUIObject.clone());
				}

				// clone match card if exists
				if (_hasCluster(_UIObjectState)) {
					clonedObject.setClusterUIObject(_UIObjectState.clusterUIObject.clone());
				}
				// make the cloned object an orphan
				clonedObject.setParent(null);

				// return cloned object
				return clonedObject;
			};

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

			xfFileInstance.getXfId = function() {
				return _UIObjectState.xfId;
			};

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

			xfFileInstance.getDataId = function() {
				return _UIObjectState.spec.dataId;
			};

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

			xfFileInstance.getUIType = function() {
				return _UIObjectState.UIType;
			};

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

			xfFileInstance.getLabel = function() {
				return _UIObjectState.title;
			};

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

			xfFileInstance.isLabelInitialized = function() {
				return _UIObjectState.titleInitialized;
			};

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

			xfFileInstance.setLabel = function(newLabel) {
				if (typeof(newLabel) === 'string') {
					_UIObjectState.title = newLabel;
					_UIObjectState.titleInitialized = true;
				}
			};

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

			xfFileInstance.getUIObjectByXfId = function(xfId) {
				if (_UIObjectState.xfId === xfId) {
					return xfFileInstance;
				}

				// Check if the xfId corresponds to an associated xfMatch object.
				if (_hasMatchcard(_UIObjectState)){
					var matchObj = _UIObjectState.matchUIObject.getUIObjectByXfId(xfId);
					if (matchObj != null){
						return matchObj;
					}
				}

				// Check if the xfId corresponds to an associated xfMatch object.
				if (_hasCluster(_UIObjectState)){
					var clusterObj = _UIObjectState.clusterUIObject.getUIObjectByXfId(xfId);
					if (clusterObj != null){
						return clusterObj;
					}
				}

				return null;
			};

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

			xfFileInstance.getUIObjectsByDataId = function(dataId) {
				var objectList = [];

				if (_UIObjectState.spec.dataId === dataId) {
					objectList.push(xfFileInstance);
				}

				// Check if the dataId corresponds to an associated xfMatch object.
				if (_hasMatchcard(_UIObjectState)){
					var matchList = _UIObjectState.matchUIObject.getUIObjectsByDataId(dataId);
					if (matchList.length > 0){
						objectList = objectList.concat(matchList);
					}
				}

				// Check if the dataId corresponds to an associated xfMatch object.
				if (_hasCluster(_UIObjectState)){
					var clusterList = _UIObjectState.clusterUIObject.getUIObjectsByDataId(dataId);
					if (clusterList.length > 0){
						objectList = objectList.concat(clusterList);
					}
				}

				return objectList;
			};

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

			xfFileInstance.getParent = function() {
				return _UIObjectState.spec.parent;
			};

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

			xfFileInstance.setParent = function(xfUIObj){
				_UIObjectState.spec.parent = xfUIObj;
			};

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

			xfFileInstance.addLink = function(link) {

				if (link.getType() === xfLinkType.FILE) {
					_UIObjectState.links[link.getXfId()] = link;
				} else {
					if (_hasCluster(_UIObjectState)){
						_UIObjectState.clusterUIObject.addLink(link);
					}
					else {
						aperture.log.error('No cluster found. Unable to add link.');
					}
				}
			};

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

			xfFileInstance.getLinks = function() {

				var linkId = null;
				var links = {};

				// Get the links from the xfFile if it's expanded.
				for (linkId in _UIObjectState.links) {
					if (_UIObjectState.links.hasOwnProperty(linkId)) {
						links[linkId] = _UIObjectState.links[linkId];
					}
				}

				if (_hasCluster(_UIObjectState)) {
					var clusterLinks = _UIObjectState.clusterUIObject.getLinks();
					for (linkId in clusterLinks) {
						if (clusterLinks.hasOwnProperty(linkId)) {
							links[linkId] = clusterLinks[linkId];
						}
					}
				}

				// Get links from the internal match card.
				if (_hasMatchcard(_UIObjectState)) {
					var matchLinks = _UIObjectState.matchUIObject.getLinks();
					for (linkId in matchLinks) {
						if (matchLinks.hasOwnProperty(linkId)) {
							links[linkId] = matchLinks[linkId];
						}
					}
				}

				return links;
			};

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

			xfFileInstance.isLinkedTo = function(uiObject) {
				var links = xfFileInstance.getLinks();
				var linkedUIObjects = {};
				for (var linkId in links) {
					if (links.hasOwnProperty(linkId)) {
						var link = links[linkId];
						linkedUIObjects[link.getSource().getXfId()] = true;
						linkedUIObjects[link.getDestination().getXfId()] = true;
					}
				}

				return linkedUIObjects[uiObject.getXfId()];
			};

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

			xfFileInstance.removeLink = function(xfId) {

				if (_hasCluster(_UIObjectState)) {
					if (_UIObjectState.clusterUIObject.removeLink(xfId)) {
						return true;
					}
				}

				if (_hasMatchcard(_UIObjectState)) {
					if (_UIObjectState.matchUIObject.removeLink(xfId)) {
						return true;
					}
				}

				if (_UIObjectState.links.hasOwnProperty(xfId)) {
					delete _UIObjectState.links[xfId];
					return true;
				}

				return false;
			};

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

			xfFileInstance.removeAllLinks = function(linkType) {

				if (_hasCluster(_UIObjectState)) {
					_UIObjectState.clusterUIObject.removeAllLinks(linkType);
				}

				if (_hasMatchcard(_UIObjectState)) {
					_UIObjectState.matchUIObject.removeAllLinks(linkType);
				}

				var tempLinkMap = _.clone(_UIObjectState.links);
				for (var linkId in tempLinkMap) {
					if (tempLinkMap.hasOwnProperty(linkId)) {
						tempLinkMap[linkId].remove();
					}
				}
			};

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

			xfFileInstance.collapseLinks = function(direction) {
				aperture.log.error(MODULE_NAME + ': call to unimplemented method "collapseLinks".');
			};

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

			xfFileInstance.remove = function(eventChannel, dispose) {
				// An event channel argument is required to help enforce that this method should
				// ONLY ever be called from a pubsub type handler.
				if (appChannel.REMOVE_REQUEST === eventChannel){

					// Get all the links and remove them from any link maps.
					var allLinks = this.getLinks();
					for (var linkId in allLinks) {
						if (allLinks.hasOwnProperty(linkId)) {
							allLinks[linkId].remove();
						}
					}

					_UIObjectState.spec.parent.removeChild(
						_UIObjectState.xfId,
						(dispose != null) ? dispose : true,
						false
					);
				}
				else {
					aperture.log.error('Invalid or missing publish event. Unable to remove ' + MODULE_NAME + ': ' + _UIObjectState.xfId);
				}
			};

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

			xfFileInstance.removeChild = function(xfId, disposeObject, preserveLinks, removeIfEmpty) {

				if (_hasMatchcard(_UIObjectState) && _UIObjectState.matchUIObject.getXfId() === xfId) {
					_UIObjectState.matchUIObject.setParent(null);
					if (disposeObject) {
						_UIObjectState.matchUIObject.dispose();
					}
					_UIObjectState.matchUIObject = null;
				}
				else if (_hasCluster(_UIObjectState) && _UIObjectState.clusterUIObject.getXfId() === xfId){
					_UIObjectState.clusterUIObject.setParent(null);
					if (disposeObject) {
						_UIObjectState.clusterUIObject.dispose();
					}
					_UIObjectState.clusterUIObject = null;
				}
			};

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

			xfFileInstance.removeAllChildren = function() {

				if (_hasMatchcard(_UIObjectState)) {
					_UIObjectState.matchUIObject.dispose();
					_UIObjectState.matchUIObject = null;
				}

				if (_hasCluster(_UIObjectState)){
					_UIObjectState.clusterUIObject.dispose();
					_UIObjectState.clusterUIObject = null;
				}
			};

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

			xfFileInstance.insert = function(xfUIObj, beforeXfUIObj00) {
				aperture.log.error('Unable to insert children into ' + MODULE_NAME + '. Please use update method instead.');
			};

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

			xfFileInstance.expand = function() {
				if (_hasCluster(_UIObjectState)) {
					_UIObjectState.clusterUIObject.expand();
				}
			};

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

			xfFileInstance.collapse = function() {
				if (_hasCluster(_UIObjectState)) {
					_UIObjectState.clusterUIObject.collapse();
				}
			};

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

			xfFileInstance.showDetails = function(bShow) {
				if (bShow == null){
					return _UIObjectState.showDetails;
				}

				_UIObjectState.showDetails = bShow;

				if (_hasMatchcard(_UIObjectState)) {
					_UIObjectState.matchUIObject.showDetails(bShow);
				}

				if (_hasCluster(_UIObjectState)) {
					_UIObjectState.clusterUIObject.showDetails(bShow);
				}

				return _UIObjectState.showDetails;
			};

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

			xfFileInstance.showSpinner = function(bShow) {
				if (bShow != null) {
					if (_UIObjectState.showSpinner !== bShow) {
						_UIObjectState.showSpinner = bShow;
					}
				}

				return _UIObjectState.showSpinner;
			};
			//----------------------------------------------------------------------------------------------------------

			xfFileInstance.showToolbar = function(bShow) {
				if (bShow != null) {
					if (_hasMatchcard(_UIObjectState)) {
						_UIObjectState.matchUIObject.showToolbar(bShow);
					}

					if (_hasCluster(_UIObjectState)) {
						_UIObjectState.clusterUIObject.showToolbar(bShow);
					}
				}

				return _UIObjectState.showToolbar;
			};

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

			xfFileInstance.getChildren = function() {
				if (_hasCluster(_UIObjectState)) {
					return [_UIObjectState.clusterUIObject];
				}

				return [];
			};

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

			xfFileInstance.getSpecs = function(bOnlyEmptySpecs) {

				var i;
				var specs = [];

				if (_hasMatchcard(_UIObjectState)) {
					var matchSpecs = _UIObjectState.matchUIObject.getSpecs(bOnlyEmptySpecs);
					for (i = 0; i < matchSpecs.length; i++) {
						specs.push(matchSpecs[i]);
					}
				}

				if (_hasCluster(_UIObjectState)) {
					var clusterSpecs = _UIObjectState.clusterUIObject.getSpecs(bOnlyEmptySpecs);
					for (i = 0; i < clusterSpecs.length; i++) {
						specs.push(clusterSpecs[i]);
					}
				}

				return specs;
			};

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

			xfFileInstance.getVisualInfo = function() {
				return _UIObjectState != null ? _.clone(_UIObjectState) : null;
			};

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

			xfFileInstance.isSelected = function() {
				return _UIObjectState.isSelected;
			};

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

			xfFileInstance.setSelection = function(xfId) {

				if (xfId == null || _UIObjectState.xfId !== xfId) {
					if (_UIObjectState.isSelected) {
						_UIObjectState.isSelected = false;
					}
				} else {
					if (!_UIObjectState.isSelected) {
						_UIObjectState.isSelected = true;
					}
				}

				// Update the cluster
				if (_hasCluster(_UIObjectState)){
					_UIObjectState.clusterUIObject.setSelection(xfId);
				}

				// Update any attached xfMatch objects
				if (_hasMatchcard(_UIObjectState)){
					_UIObjectState.matchUIObject.setSelection(xfId);
				}
			};

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

			xfFileInstance.isHighlighted = function() {
				return _UIObjectState.isHighlighted;
			};

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

			xfFileInstance.highlightId = function(xfId) {
				var stateChanged = false;

				if (_UIObjectState.xfId === xfId) {
					if (!_UIObjectState.isHighlighted) {
						_UIObjectState.isHighlighted = true;
						stateChanged = true;
					}
				} else {
					if (_UIObjectState.isHighlighted) {
						_UIObjectState.isHighlighted = false;
						stateChanged = true;
					}
				}

				if (!stateChanged) {
					if (_hasCluster(_UIObjectState)){
						_UIObjectState.clusterUIObject.highlightId(xfId);
					}

					if (_hasMatchcard(_UIObjectState)){
						_UIObjectState.matchUIObject.highlightId(xfId);
					}
				}
			};

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

			xfFileInstance.isMatchHighlighted = function() {
				return _UIObjectState.isMatchHighlighted;
			};

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

			xfFileInstance.setMatchHighlighted = function(matchHighlighted) {
				_UIObjectState.isMatchHighlighted = matchHighlighted;
			};

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

			xfFileInstance.hasMatchCard = function() {
				return _hasMatchcard(_UIObjectState);
			};

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

			xfFileInstance.hasCluster = function() {
				return _hasCluster(_UIObjectState);
			};

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

			xfFileInstance.isHovered = function() {
				return _UIObjectState.isHovered;
			};

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

			xfFileInstance.setHovering = function(xfId) {
				// Set the hovering state of the file itself.
				var stateChanged = false;
				if (_UIObjectState.xfId === xfId) {
					if (!_UIObjectState.isHovered) {
						_UIObjectState.isHovered = true;
						stateChanged = true;
					}
				} else {
					if (_UIObjectState.isHovered) {
						_UIObjectState.isHovered = false;
						stateChanged = true;
					}
				}

				// Update all the children.
				if (_hasCluster(_UIObjectState)){
					_UIObjectState.clusterUIObject.setHovering(xfId);
				}

				// Update any attached xfMatch objects.
				if (_hasMatchcard(_UIObjectState)){
					_UIObjectState.matchUIObject.setHovering(xfId);
				}

				if (stateChanged) {
					aperture.pubsub.publish(appChannel.RENDER_UPDATE_REQUEST, {UIObject: xfFileInstance, updateOnly: true});
				}
			};

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

			xfFileInstance.setHidden = function(xfId, state) {

				if (_UIObjectState.xfId === xfId) {
					if (_UIObjectState.isHidden !== state) {

						_UIObjectState.isHidden = state;
						aperture.pubsub.publish(appChannel.RENDER_UPDATE_REQUEST, {UIObject: xfFileInstance, updateOnly: true});
					}
				}

				// Update all the children.
				if (_hasCluster(_UIObjectState)) {
					_UIObjectState.clusterUIObject.setHidden(xfId, state);
				}

				// Update any attached xfMatch objects.
				if (_hasMatchcard(_UIObjectState)) {
					_UIObjectState.matchUIObject.setHidden(xfId, state);
				}
			};

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

			xfFileInstance.setDuplicateCount = function(count) {
				// do nothing
			};

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

			xfFileInstance.getVisibleDataIds = function() {

				var visibleDataIds = [];

				if (_UIObjectState.spec.dataId != null) {
					visibleDataIds.push(_UIObjectState.spec.dataId);
				}

				// Check if the dataId corresponds to an associated xfMatch object.
				if (_hasMatchcard(_UIObjectState)){
					var matchList = _UIObjectState.matchUIObject.getVisibleDataIds();
					if (matchList.length > 0){
						visibleDataIds = visibleDataIds.concat(matchList);
					}
				}

				if (_hasCluster(_UIObjectState)){
					var clusterList = _UIObjectState.clusterUIObject.getVisibleDataIds();
					if (clusterList.length > 0){
						visibleDataIds = visibleDataIds.concat(clusterList);
					}
				}

				return visibleDataIds;
			};

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

			xfFileInstance.cleanState = function() {

				_UIObjectState.xfId = '';
				_UIObjectState.UIType = MODULE_NAME;
				_UIObjectState.spec = {};
				_UIObjectState.matchUIObject = null;
				_UIObjectState.clusterUIObject = null;
				_UIObjectState.children = [];
				_UIObjectState.duplicateCount = 1;
				_UIObjectState.title = '';
				_UIObjectState.isExpanded = false;
				_UIObjectState.isSelected = false;
				_UIObjectState.isHighlighted = false;
				_UIObjectState.isHovered = false;
				_UIObjectState.showToolbar = true;
				_UIObjectState.titleInitialized = false;
			};

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

			xfFileInstance.saveState = function() {

				var state = {};

				state['xfId'] = _UIObjectState.xfId;
				state['UIType'] = _UIObjectState.UIType;

				state['duplicateCount'] = _UIObjectState.duplicateCount;
				state['title'] = _UIObjectState.title;
				state['showToolbar'] = _UIObjectState.showToolbar;
				state['matchUIObject'] = (_hasMatchcard(_UIObjectState)) ? _UIObjectState.matchUIObject.saveState() : null;
				state['clusterUIObject'] = (_hasCluster(_UIObjectState)) ? _UIObjectState.clusterUIObject.saveState() : null;
				state['isExpanded'] = _UIObjectState.isExpanded;
				state['isSelected'] = _UIObjectState.isSelected;
				state['isHighlighted'] = _UIObjectState.isHighlighted;
				state['isHovered'] = _UIObjectState.isHovered;
				state['titleInitialized'] = _UIObjectState.titleInitialized;
				state['toolbarSpec'] = _UIObjectState.toolbarSpec;

				state['spec'] = {};
				state['spec']['parent'] = _UIObjectState.spec.parent.getXfId();
				state['spec']['dataId'] = _UIObjectState.spec.dataId;

				state['links'] = [];
				var links = xfFileInstance.getLinks();
				for (var linkId in links) {
					if (links.hasOwnProperty(linkId)) {
						var link = links[linkId];
						state['links'].push(link.saveState());
					}
				}

				return state;
			};

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

			xfFileInstance.restoreVisualState = function(state) {

				_UIObjectState.xfId = state.xfId;
				_UIObjectState.UIType = state.UIType;

				_UIObjectState.duplicateCount = state.duplicateCount;
				_UIObjectState.title = state.title;
				_UIObjectState.isExpanded = state.isExpanded;
				_UIObjectState.isSelected = state.isSelected;
				_UIObjectState.isHighlighted = state.isHighlighted;
				_UIObjectState.isHovered = state.isHovered;
				_UIObjectState.showToolbar = state.showToolbar;
				_UIObjectState.titleInitialized = state.titleInitialized;
				_UIObjectState.toolbarSpec = state.toolbarSpec;

				_UIObjectState.spec.dataId = state.spec.dataId;

				if (state.clusterUIObject != null) {
					var clusterSpec = xfImmutableCluster.getSpecTemplate();
					var clusterUIObj = xfImmutableCluster.createInstance(clusterSpec);
					clusterUIObj.cleanState();
					clusterUIObj.restoreVisualState(state.clusterUIObject);
					_UIObjectState.clusterUIObject = clusterUIObj;
				}

				if (state.matchUIObject != null) {
					var matchSpec = xfMatch.getSpecTemplate();
					var matchUIObj = xfMatch.createInstance(matchSpec);
					matchUIObj.cleanState();
					matchUIObj.restoreVisualState(state.matchUIObject);
					_UIObjectState.matchUIObject = matchUIObj;
				}
			};

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

			xfFileInstance.restoreHierarchy = function(state, workspace) {
				_UIObjectState.spec.parent = workspace.getUIObjectByXfId(state.spec.parent);

				if (_hasMatchcard(_UIObjectState)) {
					_UIObjectState.matchUIObject.restoreHierarchy(state.matchUIObject, workspace);
				}

				if (_hasCluster(_UIObjectState)) {
					_UIObjectState.clusterUIObject.restoreHierarchy(state.clusterUIObject, workspace);
				}
			};

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

			xfFileInstance.dispose = function() {

				if (_UIObjectState.isSelected) {
					aperture.pubsub.publish(
						appChannel.SELECTION_CHANGE_REQUEST,
						{
							xfId: null,
							selected : true,
							noRender: true
						}
					);
				}

				_UIObjectState.spec.parent = null;
				_UIObjectState.spec.flow = null;
				_UIObjectState.toolbarSpec = null;
				_UIObjectState.spec = null;
				_UIObjectState.children = null;

				for (var linkId in _UIObjectState.links) {
					if (_UIObjectState.links.hasOwnProperty(linkId)) {
						_UIObjectState.links[linkId].remove();
					}
				}
				_UIObjectState.links = null;

				if (_hasMatchcard(_UIObjectState)) {
					_UIObjectState.matchUIObject.dispose();
					_UIObjectState.matchUIObject = null;
				}
				if (_hasCluster(_UIObjectState)) {
					_UIObjectState.clusterUIObject.dispose();
					_UIObjectState.clusterUIObject = null;
				}

				_UIObjectState = null;
			};

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

			xfFileInstance.updatePromptState = function(dataId, state) {
				if (_hasMatchcard(_UIObjectState)){
					_UIObjectState.matchUIObject.updatePromptState(dataId, state);
				}

				if (_hasCluster(_UIObjectState)){
					_UIObjectState.clusterUIObject.updatePromptState(dataId, state);
				}
			};

			//-----------------------------
			// File Specific Implementation
			//-----------------------------

			xfFileInstance.setMatchUIObject = function(matchUIObject) {
				matchUIObject.setParent(this);
				_UIObjectState.matchUIObject = matchUIObject;
			};

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

			xfFileInstance.getMatchUIObject = function() {
				return _UIObjectState.matchUIObject;
			};

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

			xfFileInstance.setClusterUIObject = function(clusterUIObject) {

				if (_UIObjectState.clusterUIObject) {
					_UIObjectState.clusterUIObject.dispose();
				}

				clusterUIObject.setParent(this);
				clusterUIObject.updateToolbar(
					{
						allowFile: false,
						allowFocus: true,
						allowSearch: true,
						allowClose: true
					},
					true
				);

				_UIObjectState.clusterUIObject = clusterUIObject;
			};

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

			xfFileInstance.getClusterUIObject = function() {
				return _UIObjectState.clusterUIObject;
			};

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

			xfFileInstance.showSearchControl = function(isVisible, searchTerm){
				if (isVisible){
					if(!_hasMatchcard(_UIObjectState)) {
						_UIObjectState.matchUIObject = _createMatchcard(this, searchTerm);
					} else {
						_UIObjectState.matchUIObject.setSearchTerm(searchTerm);
					}
				}
				else if (_hasMatchcard(_UIObjectState)){
					aperture.pubsub.publish(
						appChannel.REMOVE_REQUEST,
						{
							xfIds : [_UIObjectState.matchUIObject.getXfId()],
							dispose : true
						}
					);
				}
			};

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

			xfFileInstance.getContainedCardDataIds = function() {
				var containedIds = [];

				if (_hasCluster(_UIObjectState) && _UIObjectState.clusterUIObject.getUIType() === constants.MODULE_NAMES.IMMUTABLE_CLUSTER) {
					containedIds = containedIds.concat(_UIObjectState.clusterUIObject.getContainedCardDataIds());
				}

				return containedIds;
			};

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

			xfFileInstance.getIncomingLinks = function() {

				var linkId = null;
				var incomingLinks = {};

				// Get the links from the xfFile if it's expanded.
				for (linkId in _UIObjectState.links) {
					if (_UIObjectState.links.hasOwnProperty(linkId)) {
						var link = _UIObjectState.links[linkId];
						if (link.getDestination().getXfId() === _UIObjectState.xfId) {
							incomingLinks[link.getXfId()] = link;
						}
					}
				}

				if (_hasCluster(_UIObjectState)) {
					var clusterLinks = _UIObjectState.clusterUIObject.getIncomingLinks();
					for (linkId in clusterLinks) {
						if (clusterLinks.hasOwnProperty(linkId)) {
							incomingLinks[linkId] = clusterLinks[linkId];
						}
					}
				}

				// Get links from the internal match card.
				if (_hasMatchcard(_UIObjectState)) {
					var matchLinks = _UIObjectState.matchUIObject.getIncomingLinks();
					for (linkId in matchLinks) {
						if (matchLinks.hasOwnProperty(linkId)) {
							incomingLinks[linkId] = matchLinks[linkId];
						}
					}
				}

				return incomingLinks;
			};

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

			xfFileInstance.getOutgoingLinks = function() {

				var linkId = null;
				var outgoingLinks = {};

				// Get the links from the xfFile if it's expanded.
				for (linkId in _UIObjectState.links) {
					if (_UIObjectState.links.hasOwnProperty(linkId)) {
						var link = _UIObjectState.links[linkId];
						if (link.getSource().getXfId() === _UIObjectState.xfId) {
							outgoingLinks[link.getXfId()] = link;
						}
					}
				}

				if (_hasCluster(_UIObjectState)) {
					var clusterLinks = _UIObjectState.clusterUIObject.getOutgoingLinks();
					for (linkId in clusterLinks) {
						if (clusterLinks.hasOwnProperty(linkId)) {
							outgoingLinks[linkId] = clusterLinks[linkId];
						}
					}
				}

				// Get links from the internal match card.
				if (_hasMatchcard(_UIObjectState)) {
					var matchLinks = _UIObjectState.matchUIObject.getOutgoingLinks();
					for (linkId in matchLinks) {
						if (matchLinks.hasOwnProperty(linkId)) {
							outgoingLinks[linkId] = matchLinks[linkId];
						}
					}
				}

				return outgoingLinks;
			};

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

			xfFileInstance.hasSelectedChild = function() {

				if (_hasCluster(_UIObjectState)) {
					if (_UIObjectState.clusterUIObject.isSelected) {
						return true;
					}

					return _UIObjectState.clusterUIObject.hasSelectedChild();
				}

				return false;
			};

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

			xfFileInstance.sortChildren = function(sortFunction) {
				if (_hasCluster(_UIObjectState)) {
					_UIObjectState.clusterUIObject.sortChildren(sortFunction);
				}
			};

			//----------------------------------------------------------------------------------------------------------
			xfFileInstance.setXfId = function(xfId) {
				_UIObjectState.xfId = xfId;
			};

			return xfFileInstance;
		};

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

		xfFileModule.getSpecTemplate = function() {

			var specTemplate = {};
			$.extend(true, specTemplate, xfFileSpecTemplate);

			return specTemplate;
		};

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

		if (constants.UNIT_TESTS_ENABLED) {
			xfFileModule.getModuleName = function () {
				return MODULE_NAME;
			};
		}

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

		return xfFileModule;
	}
);


text:
package nl.beehivejava.scriptj.parser;

import nl.beehivejava.scriptj.Plugin;
import nl.beehivejava.scriptj.PluginInformation;

import java.io.IOException;
import java.io.InputStream;

/**
 * A {@code PluginInformationParser} can convert/parse an {@link InputStream} to a {@link PluginInformation}.
 *
 * @author Lesley
 */
@FunctionalInterface
public interface PluginInformationParser {

    /**
     * Parses the given {@link InputStream} to a {@link PluginInformation}.
     *
     * @param is The {@code InputStream} that holds the data of the {@code PluginInformation}, should not be
     *           {@code null}.
     * @return A {@code PluginInformation} holding the data of a {@link Plugin}.
     * @throws IOException          If some error occurs while reading from the {@code InputStream}.
     * @throws NullPointerException If the given {@code InputStream} is {@code null}.
     */
    PluginInformation parse(InputStream is) throws IOException;

}


text:
<?php
/********************************************************
 GetExpressCheckoutDetails.php

 This functionality is called after the buyer returns from
 PayPal and has authorized the payment.

 Displays the payer details returned by the
 GetExpressCheckoutDetails response and calls
 DoExpressCheckoutPayment.php to complete the payment
 authorization.

 Called by ReviewOrder.php.

 Calls DoExpressCheckoutPayment.php and APIError.php.

 ********************************************************/

session_start ();

/* Collect the necessary information to complete the
 authorization for the PayPal payment
 */

$_SESSION ['token'] = $_REQUEST ['token'];
$_SESSION ['payer_id'] = $_REQUEST ['PayerID'];

$_SESSION ['paymentAmount'] = $_REQUEST ['paymentAmount'];
$_SESSION ['currCodeType'] = $_REQUEST ['currencyCodeType'];
$_SESSION ['paymentType'] = $_REQUEST ['paymentType'];

$resArray = $_SESSION ['reshash'];

/* Display the  API response back to the browser .
 If the response from PayPal was a success, display the response parameters
 */

?>

<title>PayPal PHP SDK - ExpressCheckout API</title>
<link href="sdk.css" rel="stylesheet" type="text/css" />

<form action="DoExpressCheckoutPayment.php">

		Order Total:
		<?=$_REQUEST ['currencyCodeType']?> <?=$_REQUEST ['paymentAmount']?>

		Shipping Address:

		Street 1:
		<?=$resArray ['SHIPTOSTREET']?>

		Street 2:
		<?=$resArray ['SHIPTOSTREET2']?>

		City:

		<?=$resArray ['SHIPTOCITY']?>

		State:
		<?=$resArray ['SHIPTOSTATE']?>

		Postal code:

		<?=$resArray ['SHIPTOZIP']?>

		Country:
		<?=$resArray ['SHIPTOCOUNTRYNAME']?>

		<input type="submit" value="Pay" />

</form>


text:
package org.locationtech.geomesa.hbase.index.legacy

import org.apache.hadoop.hbase.client.{Mutation, Scan}
import org.locationtech.geomesa.hbase.data.{HBaseDataStore, HBaseFeature}
import org.locationtech.geomesa.hbase.index.HBaseIndexAdapter.ScanConfig
import org.locationtech.geomesa.hbase.index.{HBaseFeatureIndex, HBaseIndexAdapter, HBasePlatform}
import org.locationtech.geomesa.index.index.legacy.AttributeShardedIndex

case object HBaseAttributeIndexV4 extends HBaseLikeAttributeIndexV4 with HBasePlatform

trait HBaseLikeAttributeIndexV4 extends HBaseFeatureIndex with HBaseIndexAdapter
    with AttributeShardedIndex[HBaseDataStore, HBaseFeature, Mutation, Scan, ScanConfig] {
  override val version: Int = 4
}