text:
<!DOCTYPE html>

    <title>ESTNearable Class 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

      ESTNearable Class 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

ESTNearable

@interface ESTNearable : NSObject <NSCopying, NSCoding>

The ESTNearable class defines the interface for interacting with a single Estimote nearable. It enables you to retrieve properties of the nearable. You do not create instances of this class directly. The <ESTNearableManager> object reports encountered beacons to its associated delegate object.

The identity of a nearable is defined by its <identifier>` property. Identifier of the device is unique among all the Estimote nearables and can not be changed.

                    identifier

Unique device identifier.

Declaration

Objective-C

@property (readonly, strong, nonatomic) NSString *_Nonnull identifier;

Swift

var identifier: String { get }

                    zone

Zone indicating distance from the device.

Declaration

Objective-C

@property (readonly, assign, nonatomic) ESTNearableZone zone;

                    type

Type of the nearable device.

Declaration

Objective-C

@property (readonly, assign, nonatomic) ESTNearableType type;

Swift

var type: ESTNearableType { get }

                    color

Color of the nearable device.

Declaration

Objective-C

@property (readonly, assign, nonatomic) ESTColor color;

Swift

var color: ESTColor { get }

                    hardwareVersion

Revision of nearable hardware.

Declaration

Objective-C

@property (readonly, strong, nonatomic) NSString *_Nonnull hardwareVersion;

Swift

var hardwareVersion: String { get }

                    firmwareVersion

Version of nearable firmware.

Declaration

Objective-C

@property (readonly, strong, nonatomic) NSString *_Nonnull firmwareVersion;

Swift

var firmwareVersion: String { get }

                    rssi

Bluetooth signal strength. It can take value from -100 to 0. 127 value means RSSI reading error.

Declaration

Objective-C

@property (readonly, assign, nonatomic) NSInteger rssi;

Swift

var rssi: Int { get }

                    idleBatteryVoltage

Battery voltage when nearable is in idle state defined in Volts.

Declaration

Objective-C

@property (readonly, strong, nonatomic) NSNumber *_Nullable idleBatteryVoltage;

Swift

var idleBatteryVoltage: NSNumber? { get }

                    stressBatteryVoltage

Battery voltage when nearable is under stress (sending packet) defined in Volts.

Declaration

Objective-C

@property (readonly, strong, nonatomic) NSNumber *_Nullable stressBatteryVoltage;

Swift

var stressBatteryVoltage: NSNumber? { get }

                    currentMotionStateDuration

Time since last change of motion state (isMoving value change) returned in seconds.

Declaration

Objective-C

@property (readonly, assign, nonatomic)
    unsigned long long currentMotionStateDuration;

Swift

var currentMotionStateDuration: UInt64 { get }

                    previousMotionStateDuration

Time of nearable’s previous motion state returned in seconds.

Declaration

Objective-C

@property (readonly, assign, nonatomic)
    unsigned long long previousMotionStateDuration;

Swift

var previousMotionStateDuration: UInt64 { get }

                    isMoving

Flag indicates if nearable is moving or not.

Declaration

Objective-C

@property (readonly, assign, nonatomic) BOOL isMoving;

Swift

var isMoving: Bool { get }

                    orientation

Physical orientation of nearable in space.

Declaration

Objective-C

@property (readonly, assign, nonatomic) ESTNearableOrientation orientation;

Swift

var orientation: ESTNearableOrientation { get }

                    xAcceleration

X axis acceleration data.

Declaration

Objective-C

@property (readonly, assign, nonatomic) NSInteger xAcceleration;

Swift

var xAcceleration: Int { get }

                    yAcceleration

Y axis acceleration data.

Declaration

Objective-C

@property (readonly, assign, nonatomic) NSInteger yAcceleration;

Swift

var yAcceleration: Int { get }

                    zAcceleration

Z axis acceleration data.

Declaration

Objective-C

@property (readonly, assign, nonatomic) NSInteger zAcceleration;

Swift

var zAcceleration: Int { get }

                    temperature

Ambient temperature of nearable.

Declaration

Objective-C

@property (readonly, assign, nonatomic) double temperature;

Swift

var temperature: Double { get }

                    power

The power of the nearable’s radio signal in dBm.

Declaration

Objective-C

@property (readonly, strong, nonatomic) NSNumber *_Nonnull power;

Swift

var power: NSNumber { get }

                    advInterval

The advertising interval of the sticker in ms.

Declaration

Objective-C

@property (readonly, strong, nonatomic) NSNumber *_Nonnull advInterval;

Swift

var advInterval: NSNumber { get }

                    firmwareState

Indicates if nearable is in Boot or App state.

Declaration

Objective-C

@property (readonly, assign, nonatomic) ESTNearableFirmwareState firmwareState;

Swift

var firmwareState: ESTNearableFirmwareState { get }

                    broadcastingScheme

Indicates which broadcasting mode is device currently using.

Declaration

Objective-C

@property (readonly, assign, nonatomic)
    ESTNearableBroadcastingScheme broadcastingScheme;

Swift

var broadcastingScheme: ESTNearableBroadcastingScheme { get }

                    eddystoneURL

The URL address of Eddystone URL packet.

Declaration

Objective-C

@property (readonly, strong, nonatomic) NSString *_Nonnull eddystoneURL;

Swift

var eddystoneURL: String { get }

                    proximityUUID

The proximity UUID of iBeacon packet.

Declaration

Objective-C

@property (readonly, strong, nonatomic) NSString *_Nonnull proximityUUID;

Swift

var proximityUUID: String { get }

                    major

The major of iBeacon packet.

Declaration

Objective-C

@property (readonly, strong, nonatomic) NSNumber *_Nonnull major;

Swift

var major: NSNumber { get }

                    minor

The minor of iBeacon packet.

Declaration

Objective-C

@property (readonly, strong, nonatomic) NSNumber *_Nonnull minor;

Swift

var minor: NSNumber { get }

                    -beaconRegion

Allows to get iBeacon region (Proximiy UUID, major, minor)
  broadcasted by the sticker as every third bluetooth packet.

Declaration

Objective-C

- (nonnull CLBeaconRegion *)beaconRegion;

Swift

func beaconRegion() -> CLBeaconRegion

Return Value

iBeacon formated region

                    -isMotionBroken

Method indicating if motion sensor is working properly.

Declaration

Objective-C

- (BOOL)isMotionBroken;

Swift

func isMotionBroken() -> Bool

                    -isTemperatureBroken

Method indicating if temperature sensor is working properly.

Declaration

Objective-C

- (BOOL)isTemperatureBroken;

Swift

func isTemperatureBroken() -> Bool

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

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


text:
package org.intellij.lang.regexp.psi;

import org.jetbrains.annotations.Nullable;

public interface RegExpGroup extends RegExpAtom {
  boolean isCapturing();

  boolean isSimple();

  @Nullable
  RegExpPattern getPattern();

  boolean isPythonNamedGroup();

  boolean isRubyNamedGroup();

  @Nullable
  String getGroupName();
}

redpajama_set_name: RedPajamaGithub


text:
/* globals module */
/**
 * @module filesBatchRoute
 * @description Baasic Files Batch Route Definition provides Baasic route templates which can be expanded to Baasic REST URIs. Various services can use Baasic Files Route Definition to obtain needed routes while other routes will be obtained through HAL. By convention, all route services use the same function names as their corresponding services.
 */

import { injectable, inject } from "inversify";
import { BaseRoute, ModelMapper, TYPES as commonTypes } from '../../common';
import { IFileEntry } from './contracts';
import { IAppOptions, TYPES as coreTypes } from '../../core/contracts';

@injectable()
export class FilesBatchRoute extends BaseRoute {

    public readonly updateRoute: string = 'files/batch';

    public readonly linkRoute: string = 'files/batch/link';

    public readonly unlinkRoute: string = 'files/batch/unlink';

    constructor(@inject(coreTypes.IAppOptions) protected appOptions: IAppOptions) { super(appOptions); }

    /**
     * Parses update route; this URI template does not expose any additional options.
     * @method
     * @example filesBatchRoute.update();
     **/
    update(): any {
        return super.baseCreate(this.updateRoute, {});
    }

    /**
     * Parses update route; this URI template does not expose any additional options.
     * @method
     * @example filesBatchRoute.link();
     **/
    link(): any {
        return super.baseCreate(this.linkRoute, {});
    }

    /**
     * Parses unlink route; this URI template does not expose any additional options.
     * @method
     * @example filesBatchRoute.unlink();
     **/
    unlink(): any {
        return super.baseCreate(this.unlinkRoute, {});
    }
}

/**
 * @overview
 ***Notes:**
 - Refer to the [REST API documentation](http://dev.baasic.com/api/reference/home) for detailed information about available Baasic REST API end-points.
 - [URI Template](https://github.com/Baasic/uritemplate-js) syntax enables expanding the Baasic route templates to Baasic REST URIs providing it with an object that contains URI parameters.
 - All end-point objects are transformed by the associated route service.
 */


text:
// Formatting library for C++ - optional OS-specific functionality
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.

#ifndef FMT_OS_H_
#define FMT_OS_H_

#if defined(__MINGW32__) || defined(__CYGWIN__)
// Workaround MinGW bug https://sourceforge.net/p/mingw/bugs/2024/.
#  undef __STRICT_ANSI__
#endif

#include <cerrno>
#include <clocale>  // for locale_t
#include <cstddef>
#include <cstdio>
#include <cstdlib>  // for strtod_l

#if defined __APPLE__ || defined(__FreeBSD__)
#  include <xlocale.h>  // for LC_NUMERIC_MASK on OS X
#endif

#include "format.h"

// UWP doesn't provide _pipe.
#if FMT_HAS_INCLUDE("winapifamily.h")
#  include <winapifamily.h>
#endif
#if (FMT_HAS_INCLUDE(<fcntl.h>) || defined(__APPLE__) || \
     defined(__linux__)) &&                              \
    (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
#  include <fcntl.h>  // for O_RDONLY
#  define FMT_USE_FCNTL 1
#else
#  define FMT_USE_FCNTL 0
#endif

#ifndef FMT_POSIX
#  if defined(_WIN32) && !defined(__MINGW32__)
// Fix warnings about deprecated symbols.
#    define FMT_POSIX(call) _##call
#  else
#    define FMT_POSIX(call) call
#  endif
#endif

// Calls to system functions are wrapped in FMT_SYSTEM for testability.
#ifdef FMT_SYSTEM
#  define FMT_POSIX_CALL(call) FMT_SYSTEM(call)
#else
#  define FMT_SYSTEM(call) ::call
#  ifdef _WIN32
// Fix warnings about deprecated symbols.
#    define FMT_POSIX_CALL(call) ::_##call
#  else
#    define FMT_POSIX_CALL(call) ::call
#  endif
#endif

// Retries the expression while it evaluates to error_result and errno
// equals to EINTR.
#ifndef _WIN32
#  define FMT_RETRY_VAL(result, expression, error_result) \
    do {                                                  \
      (result) = (expression);                            \
    } while ((result) == (error_result) && errno == EINTR)
#else
#  define FMT_RETRY_VAL(result, expression, error_result) result = (expression)
#endif

#define FMT_RETRY(result, expression) FMT_RETRY_VAL(result, expression, -1)

FMT_BEGIN_NAMESPACE

/**
  \rst
  A reference to a null-terminated string. It can be constructed from a C
  string or ``std::string``.

  You can use one of the following type aliases for common character types:

  +---------------+-----------------------------+
  | Type          | Definition                  |
  +===============+=============================+
  | cstring_view  | basic_cstring_view<char>    |
  +---------------+-----------------------------+
  | wcstring_view | basic_cstring_view<wchar_t> |
  +---------------+-----------------------------+

  This class is most useful as a parameter type to allow passing
  different types of strings to a function, for example::

    template <typename... Args>
    std::string format(cstring_view format_str, const Args & ... args);

    format("{}", 42);
    format(std::string("{}"), 42);
  \endrst
 */
template <typename Char> class basic_cstring_view {
 private:
  const Char* data_;

 public:
  /** Constructs a string reference object from a C string. */
  basic_cstring_view(const Char* s) : data_(s) {}

  /**
    \rst
    Constructs a string reference from an ``std::string`` object.
    \endrst
   */
  basic_cstring_view(const std::basic_string<Char>& s) : data_(s.c_str()) {}

  /** Returns the pointer to a C string. */
  const Char* c_str() const { return data_; }
};

using cstring_view = basic_cstring_view<char>;
using wcstring_view = basic_cstring_view<wchar_t>;

// An error code.
class error_code {
 private:
  int value_;

 public:
  explicit error_code(int value = 0) FMT_NOEXCEPT : value_(value) {}

  int get() const FMT_NOEXCEPT { return value_; }
};

#ifdef _WIN32
namespace detail {
// A converter from UTF-16 to UTF-8.
// It is only provided for Windows since other systems support UTF-8 natively.
class utf16_to_utf8 {
 private:
  memory_buffer buffer_;

 public:
  utf16_to_utf8() {}
  FMT_API explicit utf16_to_utf8(wstring_view s);
  operator string_view() const { return string_view(&buffer_[0], size()); }
  size_t size() const { return buffer_.size() - 1; }
  const char* c_str() const { return &buffer_[0]; }
  std::string str() const { return std::string(&buffer_[0], size()); }

  // Performs conversion returning a system error code instead of
  // throwing exception on conversion error. This method may still throw
  // in case of memory allocation error.
  FMT_API int convert(wstring_view s);
};

FMT_API void format_windows_error(buffer<char>& out, int error_code,
                                  string_view message) FMT_NOEXCEPT;
}  // namespace detail

/** A Windows error. */
class windows_error : public system_error {
 private:
  FMT_API void init(int error_code, string_view format_str, format_args args);

 public:
  /**
   \rst
   Constructs a :class:`fmt::windows_error` object with the description
   of the form

   .. parsed-literal::
     *<message>*: *<system-message>*

   where *<message>* is the formatted message and *<system-message>* is the
   system message corresponding to the error code.
   *error_code* is a Windows error code as given by ``GetLastError``.
   If *error_code* is not a valid error code such as -1, the system message
   will look like "error -1".

   **Example**::

     // This throws a windows_error with the description
     //   cannot open file 'madeup': The system cannot find the file specified.
     // or similar (system message may vary).
     const char *filename = "madeup";
     LPOFSTRUCT of = LPOFSTRUCT();
     HFILE file = OpenFile(filename, &of, OF_READ);
     if (file == HFILE_ERROR) {
       throw fmt::windows_error(GetLastError(),
                                "cannot open file '{}'", filename);
     }
   \endrst
  */
  template <typename... Args>
  windows_error(int error_code, string_view message, const Args&... args) {
    init(error_code, message, make_format_args(args...));
  }
};

// Reports a Windows error without throwing an exception.
// Can be used to report errors from destructors.
FMT_API void report_windows_error(int error_code,
                                  string_view message) FMT_NOEXCEPT;
#endif  // _WIN32

// A buffered file.
class buffered_file {
 private:
  FILE* file_;

  friend class file;

  explicit buffered_file(FILE* f) : file_(f) {}

 public:
  buffered_file(const buffered_file&) = delete;
  void operator=(const buffered_file&) = delete;

  // Constructs a buffered_file object which doesn't represent any file.
  buffered_file() FMT_NOEXCEPT : file_(nullptr) {}

  // Destroys the object closing the file it represents if any.
  FMT_API ~buffered_file() FMT_NOEXCEPT;

 public:
  buffered_file(buffered_file&& other) FMT_NOEXCEPT : file_(other.file_) {
    other.file_ = nullptr;
  }

  buffered_file& operator=(buffered_file&& other) {
    close();
    file_ = other.file_;
    other.file_ = nullptr;
    return *this;
  }

  // Opens a file.
  FMT_API buffered_file(cstring_view filename, cstring_view mode);

  // Closes the file.
  FMT_API void close();

  // Returns the pointer to a FILE object representing this file.
  FILE* get() const FMT_NOEXCEPT { return file_; }

  // We place parentheses around fileno to workaround a bug in some versions
  // of MinGW that define fileno as a macro.
  FMT_API int(fileno)() const;

  void vprint(string_view format_str, format_args args) {
    fmt::vprint(file_, format_str, args);
  }

  template <typename... Args>
  inline void print(string_view format_str, const Args&... args) {
    vprint(format_str, make_format_args(args...));
  }
};

#if FMT_USE_FCNTL
// A file. Closed file is represented by a file object with descriptor -1.
// Methods that are not declared with FMT_NOEXCEPT may throw
// fmt::system_error in case of failure. Note that some errors such as
// closing the file multiple times will cause a crash on Windows rather
// than an exception. You can get standard behavior by overriding the
// invalid parameter handler with _set_invalid_parameter_handler.
class file {
 private:
  int fd_;  // File descriptor.

  // Constructs a file object with a given descriptor.
  explicit file(int fd) : fd_(fd) {}

 public:
  // Possible values for the oflag argument to the constructor.
  enum {
    RDONLY = FMT_POSIX(O_RDONLY),  // Open for reading only.
    WRONLY = FMT_POSIX(O_WRONLY),  // Open for writing only.
    RDWR = FMT_POSIX(O_RDWR),      // Open for reading and writing.
    CREATE = FMT_POSIX(O_CREAT),   // Create if the file doesn't exist.
    APPEND = FMT_POSIX(O_APPEND)   // Open in append mode.
  };

  // Constructs a file object which doesn't represent any file.
  file() FMT_NOEXCEPT : fd_(-1) {}

  // Opens a file and constructs a file object representing this file.
  FMT_API file(cstring_view path, int oflag);

 public:
  file(const file&) = delete;
  void operator=(const file&) = delete;

  file(file&& other) FMT_NOEXCEPT : fd_(other.fd_) { other.fd_ = -1; }

  file& operator=(file&& other) FMT_NOEXCEPT {
    close();
    fd_ = other.fd_;
    other.fd_ = -1;
    return *this;
  }

  // Destroys the object closing the file it represents if any.
  FMT_API ~file() FMT_NOEXCEPT;

  // Returns the file descriptor.
  int descriptor() const FMT_NOEXCEPT { return fd_; }

  // Closes the file.
  FMT_API void close();

  // Returns the file size. The size has signed type for consistency with
  // stat::st_size.
  FMT_API long long size() const;

  // Attempts to read count bytes from the file into the specified buffer.
  FMT_API size_t read(void* buffer, size_t count);

  // Attempts to write count bytes from the specified buffer to the file.
  FMT_API size_t write(const void* buffer, size_t count);

  // Duplicates a file descriptor with the dup function and returns
  // the duplicate as a file object.
  FMT_API static file dup(int fd);

  // Makes fd be the copy of this file descriptor, closing fd first if
  // necessary.
  FMT_API void dup2(int fd);

  // Makes fd be the copy of this file descriptor, closing fd first if
  // necessary.
  FMT_API void dup2(int fd, error_code& ec) FMT_NOEXCEPT;

  // Creates a pipe setting up read_end and write_end file objects for reading
  // and writing respectively.
  FMT_API static void pipe(file& read_end, file& write_end);

  // Creates a buffered_file object associated with this file and detaches
  // this file object from the file.
  FMT_API buffered_file fdopen(const char* mode);
};

// Returns the memory page size.
long getpagesize();

namespace detail {

struct buffer_size {
  size_t value = 0;
  buffer_size operator=(size_t val) const {
    auto bs = buffer_size();
    bs.value = val;
    return bs;
  }
};

struct ostream_params {
  int oflag = file::WRONLY | file::CREATE;
  size_t buffer_size = BUFSIZ > 32768 ? BUFSIZ : 32768;

  ostream_params() {}

  template <typename... T>
  ostream_params(T... params, int oflag) : ostream_params(params...) {
    this->oflag = oflag;
  }

  template <typename... T>
  ostream_params(T... params, detail::buffer_size bs)
      : ostream_params(params...) {
    this->buffer_size = bs.value;
  }
};
}  // namespace detail

static constexpr detail::buffer_size buffer_size();

// A fast output stream which is not thread-safe.
class ostream final : private detail::buffer<char> {
 private:
  file file_;

  void flush() {
    if (size() == 0) return;
    file_.write(data(), size());
    clear();
  }

  FMT_API void grow(size_t) override final;

  ostream(cstring_view path, const detail::ostream_params& params)
      : file_(path, params.oflag) {
    set(new char[params.buffer_size], params.buffer_size);
  }

 public:
  ostream(ostream&& other)
      : detail::buffer<char>(other.data(), other.size(), other.capacity()),
        file_(std::move(other.file_)) {
    other.set(nullptr, 0);
  }
  ~ostream() {
    flush();
    delete[] data();
  }

  template <typename... T>
  friend ostream output_file(cstring_view path, T... params);

  void close() {
    flush();
    file_.close();
  }

  template <typename S, typename... Args>
  void print(const S& format_str, const Args&... args) {
    format_to(detail::buffer_appender<char>(*this), format_str, args...);
  }
};

/**
  Opens a file for writing. Supported parameters passed in `params`:
  * ``<integer>``: Output flags (``file::WRONLY | file::CREATE`` by default)
  * ``buffer_size=<integer>``: Output buffer size
 */
template <typename... T>
inline ostream output_file(cstring_view path, T... params) {
  return {path, detail::ostream_params(params...)};
}
#endif  // FMT_USE_FCNTL

#ifdef FMT_LOCALE
// A "C" numeric locale.
class locale {
 private:
#  ifdef _WIN32
  using locale_t = _locale_t;

  static void freelocale(locale_t loc) { _free_locale(loc); }

  static double strtod_l(const char* nptr, char** endptr, _locale_t loc) {
    return _strtod_l(nptr, endptr, loc);
  }
#  endif

  locale_t locale_;

 public:
  using type = locale_t;
  locale(const locale&) = delete;
  void operator=(const locale&) = delete;

  locale() {
#  ifndef _WIN32
    locale_ = FMT_SYSTEM(newlocale(LC_NUMERIC_MASK, "C", nullptr));
#  else
    locale_ = _create_locale(LC_NUMERIC, "C");
#  endif
    if (!locale_) FMT_THROW(system_error(errno, "cannot create locale"));
  }
  ~locale() { freelocale(locale_); }

  type get() const { return locale_; }

  // Converts string to floating-point number and advances str past the end
  // of the parsed input.
  double strtod(const char*& str) const {
    char* end = nullptr;
    double result = strtod_l(str, &end, locale_);
    str = end;
    return result;
  }
};
using Locale FMT_DEPRECATED_ALIAS = locale;
#endif  // FMT_LOCALE
FMT_END_NAMESPACE

#endif  // FMT_OS_H_


text:
from TwitterSearch import *
import time
import requests
from tweet2geoJSON import format2geoJSON

# see: https://dev.twitter.com/rest/reference/get/search/tweets
# BASE_URL = "https://api.twitter.com/1.1/search/tweets.json"
# and https://github.com/ckoepp/TwitterSearch

from API_KEYS import consumer_key, consumer_secret, access_token, access_token_secret

keywordsThere = True
keywords = ["#earthquake", "#quake", "#shake", "#quakeAlert", "shakeAlert", "earthquake", "quake", "shake", "Prelim M"]

keyword_filesThere = False
keyword_files = ["corpori/animals_unique_translated.txt", "corpori/adjectives_unique_translated.txt", "corpori/earthquakes_unique_translated.txt"]

outputfile = "tweets.txt"
outputgeo = "tweets.geojson"

def get_keywords(filename):
        keywords = []
        with open(filename, 'r') as inF:
                for line in inF:
                        keywords.append(line)
        inF.close()
        return keywords #(filename, keywords)

def test_language(tso, language):
        try:
            # load  currently supported languages by Twitter and store them in a TwitterSearchOrder object
            ts.set_supported_languages(tso)
            # try to set language (see ISO 639-1)
            ts.set_language(language)
            print('{0} seems to be officially supported by Twitter. Yay!\n'.format(language))
            return 0

        except TwitterSearchException as e:
            # if we get an 1002 code it means that <language> is not supported (see TwitterSearchException)
            if e.code == 1002:
                print('Oh no - {0} is not supported :(\n'.format(language))
            print(e)
            return 0

def searchTweets(keywordLists=None, keywords=None, language=None, geo_lat=None, geo_lng=None, geo_rad=None, timeStart=None, timeStop=None, no_entities=False, no_retweets=False, no_links=False, no_answers=False):
        tweetsFound = []
        tweetsCount = 0
        tso = TwitterSearchOrder()
        # remove all restrictions from previos calls:
        tso.remove_all_filters()
        # this makes sure no videos/pics are commented
        tso.set_keywords(["-video", "-pic", "-foto", "-funny", "-clip", "-vid", "-movie", "-song"]) # append more synonyms and other languages TODO
        try:
            tso = TwitterSearchOrder()
            if keywordLists != None:
                for keywordList in keywordLists:
                        tso.add_keyword(keywordList, or_operator=True)
            if keywords != None:
                for keyword in keywords:
                    tso.add_keyword(keyword, or_operator=True)
            if language != None:
                tso.set_language(str(language))
            if geo_rad != None and geo_lat != None and geo_lng != None:
                tso.set_geocode(geo_lat, geo_lng, geo_rad, imperial_metric=True) # must be of format: str(lat,lng,radius) + 'km'/'mi'
            if timeStart != None:
                tso.add_keyword('since:' + str(timeStart)) # time has to be of the format: YYYY-MM-DD
            if timeStop != None:
                tso.add_keyword('until:' + str(timeStop)) # time has to be of the format: YYYY-MM-DD
            if no_entities:
                tso.set_include_entities(False)
            if no_retweets:
                pass #tso.set_include_rts(False) #TODO
            if no_links:
                pass #TODO
            if no_answers:
                pass #tso.set_exclude_replies(True) #TODO

            # Maybe use sentiment analysis? // tso.set_negative_attitude_filter()

            ts = TwitterSearch(
                consumer_key = consumer_key,
                consumer_secret = consumer_secret,
                access_token = access_token,
                access_token_secret = access_token_secret)

            for tweet in ts.search_tweets_iterable(tso, callback=my_callback):
                #tweetsFound.append(tweet)
                tweetsCount += 1
                # write to .txt file
                with open(outputfile, 'a+') as outP:
                        outP.write(str(tweet))
                        outP.write('\n')
                outP.close()
                # convert and write as geoJSON:
                with open(outputgeo, 'a+') as outPgeo:
                    outPgeo.write(format2geoJSON(tweet))
                outPgeo.close()
                print( '@%s tweeted: %s\n' % ( tweet['user']['screen_name'], tweet['text'] ) )

        except TwitterSearchException as e:
                print(e)
        except requests.exceptions.SSLError as e:
                print(e)

        return tweetsCount

def my_callback(current_ts_instance): # accepts ONE argument: an instance of TwitterSearch
        queries, tweets_seen = current_ts_instance.get_statistics()
        if queries > 0 and (queries % 10) == 0: # trigger delay every 10th query
                time.sleep(10) # sleep for 10 seconds

if __name__=='__main__':
        keywordLists = []
        if keyword_filesThere:
            for keyword_file in keyword_files:
                keywordLists.append(get_keywords(keyword_file))
            searchTweets(keywordLists=keywordLists, no_retweets=True, no_links=True, no_answers=True) #SF Area: geo_lat=34.0, geo_lng=-118.0, geo_rad=10,
        elif keywordsThere:
            searchTweets(keywords=keywords, no_retweets=True, no_links=False, no_answers=True)


text:
import eastbot
# https://github.com/lins05/slackbot

def main():
    eastbot.sched.start()
    eastbot.bot.run()

if __name__ == "__main__":
    main()


text:
#include "test.h"

static int lockCount;

static pthread_mutex_t mutex;
static pthread_mutexattr_t mxAttr;

void * locker(void * arg)
{
  assert(pthread_mutex_lock(&mutex) == 0);
  lockCount++;

  /* Should wait here (deadlocked) */
  assert(pthread_mutex_lock(&mutex) == 0);

  lockCount++;
  assert(pthread_mutex_unlock(&mutex) == 0);

  return (void *) 555;
}

int
main()
{
  pthread_t t;
  int mxType = -1;

  assert(pthread_mutexattr_init(&mxAttr) == 0);

  BEGIN_MUTEX_STALLED_ROBUST(mxAttr)

  lockCount = 0;
  assert(pthread_mutexattr_settype(&mxAttr, PTHREAD_MUTEX_NORMAL) == 0);
  assert(pthread_mutexattr_gettype(&mxAttr, &mxType) == 0);
  assert(mxType == PTHREAD_MUTEX_NORMAL);

  assert(pthread_mutex_init(&mutex, &mxAttr) == 0);

  assert(pthread_create(&t, NULL, locker, NULL) == 0);

  Sleep(100);

  assert(lockCount == 1);

  assert(pthread_mutex_unlock(&mutex) == IS_ROBUST?EPERM:0);

  Sleep (100);

  assert(lockCount == IS_ROBUST?1:2);

  END_MUTEX_STALLED_ROBUST(mxAttr)

  exit(0);

  /* Never reached */
  return 0;
}


text:
namespace MovieLib.Windows {
    partial class MainForm {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose( bool disposing )
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
            this._bsMovies = new System.Windows.Forms.BindingSource(this.components);
            this._toolStripMenuItemFile = new System.Windows.Forms.ToolStripMenuItem();
            this._childItemExit = new System.Windows.Forms.ToolStripMenuItem();
            this._toolStripMenuItemMovies = new System.Windows.Forms.ToolStripMenuItem();
            this._childItemAdd = new System.Windows.Forms.ToolStripMenuItem();
            this._childItemDelete = new System.Windows.Forms.ToolStripMenuItem();
            this._childItemEdit = new System.Windows.Forms.ToolStripMenuItem();
            this._toolStripMenuItemHelp = new System.Windows.Forms.ToolStripMenuItem();
            this._childItemAbout = new System.Windows.Forms.ToolStripMenuItem();
            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
            this._gridMovies = new System.Windows.Forms.DataGridView();
            this.titleDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.descriptionDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.lengthDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.isOwnedDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
            this.idDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
            ((System.ComponentModel.ISupportInitialize)(this._bsMovies)).BeginInit();
            this.menuStrip1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this._gridMovies)).BeginInit();
            this.SuspendLayout();
            //
            // _bsMovies
            //
            this._bsMovies.AllowNew = false;
            this._bsMovies.DataSource = typeof(MovieLib.Movie);
            //
            // _toolStripMenuItemFile
            //
            this._toolStripMenuItemFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this._childItemExit});
            this._toolStripMenuItemFile.Name = "_toolStripMenuItemFile";
            this._toolStripMenuItemFile.Size = new System.Drawing.Size(37, 20);
            this._toolStripMenuItemFile.Text = "&File";
            //
            // _childItemExit
            //
            this._childItemExit.Name = "_childItemExit";
            this._childItemExit.Size = new System.Drawing.Size(92, 22);
            this._childItemExit.Text = "E&xit";
            this._childItemExit.Click += new System.EventHandler(this.OnFileExit);
            //
            // _toolStripMenuItemMovies
            //
            this._toolStripMenuItemMovies.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this._childItemAdd,
            this._childItemDelete,
            this._childItemEdit});
            this._toolStripMenuItemMovies.Name = "_toolStripMenuItemMovies";
            this._toolStripMenuItemMovies.Size = new System.Drawing.Size(57, 20);
            this._toolStripMenuItemMovies.Text = "&Movies";
            //
            // _childItemAdd
            //
            this._childItemAdd.Name = "_childItemAdd";
            this._childItemAdd.Size = new System.Drawing.Size(107, 22);
            this._childItemAdd.Text = "&Add";
            this._childItemAdd.Click += new System.EventHandler(this.OnMovieAdd);
            //
            // _childItemDelete
            //
            this._childItemDelete.Name = "_childItemDelete";
            this._childItemDelete.Size = new System.Drawing.Size(107, 22);
            this._childItemDelete.Text = "&Delete";
            this._childItemDelete.Click += new System.EventHandler(this.OnMovieDelete);
            //
            // _childItemEdit
            //
            this._childItemEdit.Name = "_childItemEdit";
            this._childItemEdit.Size = new System.Drawing.Size(107, 22);
            this._childItemEdit.Text = "&Edit";
            this._childItemEdit.Click += new System.EventHandler(this.OnMovieEdit);
            //
            // _toolStripMenuItemHelp
            //
            this._toolStripMenuItemHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this._childItemAbout});
            this._toolStripMenuItemHelp.Name = "_toolStripMenuItemHelp";
            this._toolStripMenuItemHelp.Size = new System.Drawing.Size(44, 20);
            this._toolStripMenuItemHelp.Text = "&Help";
            //
            // _childItemAbout
            //
            this._childItemAbout.Name = "_childItemAbout";
            this._childItemAbout.Size = new System.Drawing.Size(107, 22);
            this._childItemAbout.Text = "&About";
            this._childItemAbout.Click += new System.EventHandler(this.OnHelpAbout);
            //
            // menuStrip1
            //
            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this._toolStripMenuItemFile,
            this._toolStripMenuItemMovies,
            this._toolStripMenuItemHelp});
            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
            this.menuStrip1.Name = "menuStrip1";
            this.menuStrip1.Size = new System.Drawing.Size(684, 24);
            this.menuStrip1.TabIndex = 0;
            this.menuStrip1.Text = "&File";
            //
            // _gridMovies
            //
            this._gridMovies.AllowUserToAddRows = false;
            this._gridMovies.AllowUserToDeleteRows = false;
            this._gridMovies.AllowUserToResizeRows = false;
            dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this._gridMovies.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
            this._gridMovies.AutoGenerateColumns = false;
            this._gridMovies.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this._gridMovies.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.titleDataGridViewTextBoxColumn,
            this.descriptionDataGridViewTextBoxColumn,
            this.lengthDataGridViewTextBoxColumn,
            this.isOwnedDataGridViewCheckBoxColumn,
            this.idDataGridViewTextBoxColumn});
            this._gridMovies.DataSource = this._bsMovies;
            this._gridMovies.Dock = System.Windows.Forms.DockStyle.Fill;
            this._gridMovies.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
            this._gridMovies.Location = new System.Drawing.Point(0, 24);
            this._gridMovies.Name = "_gridMovies";
            this._gridMovies.ReadOnly = true;
            this._gridMovies.RowHeadersVisible = false;
            this._gridMovies.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
            this._gridMovies.Size = new System.Drawing.Size(684, 337);
            this._gridMovies.TabIndex = 1;
            this._gridMovies.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.OnEditRow);
            this._gridMovies.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnKeyDownGrid);
            //
            // titleDataGridViewTextBoxColumn
            //
            this.titleDataGridViewTextBoxColumn.DataPropertyName = "Title";
            this.titleDataGridViewTextBoxColumn.FillWeight = 300F;
            this.titleDataGridViewTextBoxColumn.HeaderText = "Title";
            this.titleDataGridViewTextBoxColumn.MinimumWidth = 100;
            this.titleDataGridViewTextBoxColumn.Name = "titleDataGridViewTextBoxColumn";
            this.titleDataGridViewTextBoxColumn.ReadOnly = true;
            this.titleDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            //
            // descriptionDataGridViewTextBoxColumn
            //
            this.descriptionDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
            this.descriptionDataGridViewTextBoxColumn.DataPropertyName = "Description";
            this.descriptionDataGridViewTextBoxColumn.FillWeight = 300F;
            this.descriptionDataGridViewTextBoxColumn.HeaderText = "Description";
            this.descriptionDataGridViewTextBoxColumn.MinimumWidth = 100;
            this.descriptionDataGridViewTextBoxColumn.Name = "descriptionDataGridViewTextBoxColumn";
            this.descriptionDataGridViewTextBoxColumn.ReadOnly = true;
            this.descriptionDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            //
            // lengthDataGridViewTextBoxColumn
            //
            this.lengthDataGridViewTextBoxColumn.DataPropertyName = "Length";
            this.lengthDataGridViewTextBoxColumn.FillWeight = 300F;
            this.lengthDataGridViewTextBoxColumn.HeaderText = "Length";
            this.lengthDataGridViewTextBoxColumn.MinimumWidth = 100;
            this.lengthDataGridViewTextBoxColumn.Name = "lengthDataGridViewTextBoxColumn";
            this.lengthDataGridViewTextBoxColumn.ReadOnly = true;
            this.lengthDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            //
            // isOwnedDataGridViewCheckBoxColumn
            //
            this.isOwnedDataGridViewCheckBoxColumn.DataPropertyName = "IsOwned";
            this.isOwnedDataGridViewCheckBoxColumn.HeaderText = "IsOwned?";
            this.isOwnedDataGridViewCheckBoxColumn.MinimumWidth = 50;
            this.isOwnedDataGridViewCheckBoxColumn.Name = "isOwnedDataGridViewCheckBoxColumn";
            this.isOwnedDataGridViewCheckBoxColumn.ReadOnly = true;
            this.isOwnedDataGridViewCheckBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False;
            //
            // idDataGridViewTextBoxColumn
            //
            this.idDataGridViewTextBoxColumn.DataPropertyName = "Id";
            this.idDataGridViewTextBoxColumn.HeaderText = "Id";
            this.idDataGridViewTextBoxColumn.Name = "idDataGridViewTextBoxColumn";
            this.idDataGridViewTextBoxColumn.ReadOnly = true;
            this.idDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            this.idDataGridViewTextBoxColumn.Visible = false;
            //
            // MainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(684, 361);
            this.Controls.Add(this._gridMovies);
            this.Controls.Add(this.menuStrip1);
            this.MainMenuStrip = this.menuStrip1;
            this.Name = "MainForm";
            this.ShowIcon = false;
            this.Text = "Movie Library";
            ((System.ComponentModel.ISupportInitialize)(this._bsMovies)).EndInit();
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this._gridMovies)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion
        private System.Windows.Forms.BindingSource _bsMovies;
        private System.Windows.Forms.ToolStripMenuItem _toolStripMenuItemFile;
        private System.Windows.Forms.ToolStripMenuItem _childItemExit;
        private System.Windows.Forms.ToolStripMenuItem _toolStripMenuItemMovies;
        private System.Windows.Forms.ToolStripMenuItem _childItemAdd;
        private System.Windows.Forms.ToolStripMenuItem _childItemDelete;
        private System.Windows.Forms.ToolStripMenuItem _childItemEdit;
        private System.Windows.Forms.ToolStripMenuItem _toolStripMenuItemHelp;
        private System.Windows.Forms.ToolStripMenuItem _childItemAbout;
        private System.Windows.Forms.MenuStrip menuStrip1;
        private System.Windows.Forms.DataGridView _gridMovies;
        private System.Windows.Forms.DataGridViewTextBoxColumn titleDataGridViewTextBoxColumn;
        private System.Windows.Forms.DataGridViewTextBoxColumn descriptionDataGridViewTextBoxColumn;
        private System.Windows.Forms.DataGridViewTextBoxColumn lengthDataGridViewTextBoxColumn;
        private System.Windows.Forms.DataGridViewCheckBoxColumn isOwnedDataGridViewCheckBoxColumn;
        private System.Windows.Forms.DataGridViewTextBoxColumn idDataGridViewTextBoxColumn;
    }
}


text:
Team membership:  Jason Chan (Captain) & Braden D'Eith (Mate)
Team conventions: Allman notation, markdown for changelog, must edit changelog after every change
Changelog format: [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)

## version 1.2.5 ##

### Added 03-10-17 ###
- Completed job 11b
- added sizes, groups and status to edit and add
- fixed issue with the add item button

## version 1.2.4 ##

### Added 03-09-17 ###
- Completed job 12
- Task Item Maintenance
- Added button

## version 1.2.3 ##

### Added 03-09-17 ###
- Completed job 10
- Added job completion checklist

## version 1.2.2 ##

### Added 03-09-17 ###
- Completed job 11
- added role-specific maintenance list

## version 1.2.1 ##

### Added 03-09-17 ###
- Completed job 9
- added the caboose package
- added alert function

## version 1.2.0 ##

### Added 03-09-17 ###
- Completed job 8
- Init RDB for sessions
- created session table in SQL

## version 1.1.2 ##

### Added 03-02-17 ###
- Completed job 7
- Added the user role drop down menu
- Added role selection
- Bug on windows, no write permission

## version 1.1.1 ##

### Added 03-02-17 ###
- completed job 6
- Added pagination basics: Item page extraction and navigation.

## version 1.1.0 ##

### Added 03-02-17 ###
- completed job 4
- Added maintenance page functionality

## version 1.0.5 ##

### Added 02-18-17 ###
- updated Wanted page layout

## version 1.0.4 ##

### Added 02-18-17 ###
- Completed job 5
- Added job and wanted page

## Version 1.0.3 ##

### Added 02-18-17 ###
- Added functionality for the /View page
- Added views for the /View page
- Created Views controller
- Modified Tasks to get categorized tasks
- Created secondary template
- Completed job 3

## Version 1.0.2 ##

### Added 02-18-17 ###
- Modified homepage (view and controller)
- Completed job 2
- Changed changelog extension to .md file

## Version 1.0.1 ##

### Added 02-17-17 ###
- Completed job 1
-  Added models: flags, group, priorities, sizes, statuses, and tasks

## Version 1.0 ##

### Added 02-16-17 ###
-  Set up repository and added changelog


text:
#include "makeproject.h"
#include "ui_makeproject.h"
#include <QFileDialog>
#include <QShortcut>

/**
 * @brief MakeProject::MakeProject
 * @param mainwindow
 * @param file_handler
 * @param workspace, the standard
 * @param parent
 */
MakeProject::MakeProject(MainWindow *mainwindow, FileHandler *file_handler, std::string workspace, QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MakeProject) {
    ui->setupUi(this);
    this->project_path = QString::fromStdString(workspace);
    ui->project_path_input->setText(this->project_path); //sets the text in the input box
    this->video_path = QString::fromStdString(workspace);
    ui->video_path_input->setText(this->video_path); //sets the text in the input box
    this->file_handler = file_handler;
    this->mainwindow = mainwindow;
    QShortcut *ok_shortcut = new QShortcut(QKeySequence(tr("Return")), this);
    QObject::connect(ok_shortcut, SIGNAL(activated()), this, SLOT(on_ok_button_clicked()));
    QShortcut *cancel_shortcut = new QShortcut(QKeySequence(tr("Esc")), this);
    QObject::connect(cancel_shortcut, SIGNAL(activated()), this, SLOT(on_cancel_button_clicked()));
}

/**
 * @brief MakeProject::~MakeProject
 */
MakeProject::~MakeProject() {
    delete ui;
}

/**
 * @brief MakeProject::on_project_path_search_button_clicked
 * Gets a directort and sets the text in the input box.
 */
void MakeProject::on_project_path_search_button_clicked() {
    QString dir = QFileDialog::getExistingDirectory(this, tr("Choose path to project"),this->project_path);
    if(!dir.isEmpty()) {
        ui->project_path_input->setText(dir);
        this->project_path = dir;
    }
}

/**
 * @brief MakeProject::on_video_path_search_button_clicked
 * Gets a directort and sets the text in the input box.
 */
void MakeProject::on_video_path_search_button_clicked() {
    QString dir = QFileDialog::getExistingDirectory(this, tr("Choose path to videos"),this->video_path);
    if(!dir.isEmpty()) {
        ui->video_path_input->setText(dir);
        this->video_path = dir;
    }
}

/**
 * @brief MakeProject::on_ok_button_clicked
 * Creates a project and adds it to the project_tree.
 * Then deletes itself.
 */
void MakeProject::on_ok_button_clicked() {
    if(this->name.isEmpty())
        set_status_bar("Needs a name");
    else if(this->project_path.isEmpty())
        set_status_bar("Needs a path for the project");
    else if(this->video_path.isEmpty())
        set_status_bar("Needs a path for the videos");
   else {
        Project *proj = file_handler->create_project(name, project_path.toStdString(), video_path.toStdString());
        mainwindow->add_project_to_tree(proj);
        set_status_bar("Project " + name.toStdString() + " created.");
        delete this;
    }
}

/**
 * @brief MakeProject::on_cancel_button_clicked
 * Just deletes itself.
 */
void MakeProject::on_cancel_button_clicked() {
    delete this;
}

/**
 * @brief MakeProject::on_name_input_textChanged
 * @param arg1 the text of the input box
 * Sets name to what is inside the input box.
 */
void MakeProject::on_name_input_textChanged(const QString &name) {
    this->name = name;
}

/**
 * @brief MakeProject::set_status_bar
 * @param status text to show in the statusbar
 * @param timer time to show it in the bar in ms, 750ms is standard
 */
void MakeProject::set_status_bar(std::string status, int timer){
    ui->status_bar->showMessage(QString::fromStdString(status), timer);
    mainwindow->set_status_bar(status, timer);
}


text:
package com.sequenceiq.cloudbreak.core.flow2.stack.termination;

import static com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status.DELETE_IN_PROGRESS;
import static com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status.UPDATE_IN_PROGRESS;
import static com.sequenceiq.cloudbreak.event.ResourceEvent.DATALAKE_RECOVERY_IN_PROGRESS;
import static com.sequenceiq.cloudbreak.event.ResourceEvent.STACK_DELETE_IN_PROGRESS;

import java.util.Map;

import javax.inject.Inject;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.sequenceiq.cloudbreak.api.endpoint.v4.common.DetailedStackStatus;
import com.sequenceiq.cloudbreak.dto.StackDtoDelegate;
import com.sequenceiq.cloudbreak.reactor.api.event.recipe.StackPreTerminationFailed;
import com.sequenceiq.cloudbreak.reactor.api.event.recipe.StackPreTerminationRequest;
import com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationEvent;
import com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationType;
import com.sequenceiq.cloudbreak.service.StackUpdater;
import com.sequenceiq.cloudbreak.structuredevent.event.CloudbreakEventService;

@Component("StackPreTerminationAction")
public class StackPreTerminationAction extends AbstractStackTerminationAction<TerminationEvent> {

    private static final Logger LOGGER = LoggerFactory.getLogger(StackPreTerminationAction.class);

    @Inject
    private StackUpdater stackUpdater;

    @Inject
    private CloudbreakEventService cloudbreakEventService;

    public StackPreTerminationAction() {
        super(TerminationEvent.class);
    }

    @Override
    protected void prepareExecution(TerminationEvent payload, Map<Object, Object> variables) {
        variables.put(TERMINATION_TYPE, payload.getTerminationType());
    }

    @Override
    protected void doExecute(StackTerminationContext context, TerminationEvent payload, Map<Object, Object> variables) {
        StackDtoDelegate stack = context.getStack();
        if (stack == null || StringUtils.isEmpty(stack.getEnvironmentCrn())) {
            LOGGER.info("Could not trigger stack event on null, {}", payload);
            String statusReason = "Stack or environment not found.";
            StackPreTerminationFailed terminateStackResult = new StackPreTerminationFailed(payload.getResourceId(), new IllegalArgumentException(statusReason));
            sendEvent(context, StackTerminationEvent.PRE_TERMINATION_FAILED_EVENT.event(), terminateStackResult);
        } else {
            updateStatus(payload.getTerminationType(), stack.getId());
            fireCloudbreakEvent(payload.getTerminationType(), stack.getId());
            sendEvent(context, payload, stack);
        }
    }

    private void updateStatus(TerminationType terminationType, Long stackId) {
        if (terminationType.isRecovery()) {
            stackUpdater.updateStackStatus(stackId, DetailedStackStatus.CLUSTER_RECOVERY_IN_PROGRESS, "Recovering the cluster and its infrastructure.");
        } else {
            stackUpdater.updateStackStatus(stackId, DetailedStackStatus.DELETE_IN_PROGRESS, "Terminating the cluster and its infrastructure.");
        }
    }

    private void fireCloudbreakEvent(TerminationType terminationType, Long stackId) {
        if (terminationType.isRecovery()) {
            cloudbreakEventService.fireCloudbreakEvent(stackId, UPDATE_IN_PROGRESS.name(), DATALAKE_RECOVERY_IN_PROGRESS);
        } else {
            cloudbreakEventService.fireCloudbreakEvent(stackId, DELETE_IN_PROGRESS.name(), STACK_DELETE_IN_PROGRESS);
        }
    }

    private void sendEvent(StackTerminationContext context, TerminationEvent payload, StackDtoDelegate stack) {
        boolean recovery = payload.getTerminationType().isRecovery();
        LOGGER.debug("Assembling {} stack event for stack: {} and triggering event: {}", recovery ? "recovery" : "terminate", stack.getName(), payload);
        sendEvent(context);
    }

    @Override
    protected StackPreTerminationRequest createRequest(StackTerminationContext context) {
        return new StackPreTerminationRequest(context.getStack().getId(), context.getTerminationType().isForced());
    }
}


text:
package com.graphhopper.navigation;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.graphhopper.GHRequest;
import com.graphhopper.GHResponse;
import com.graphhopper.GraphHopper;
import com.graphhopper.config.Profile;
import com.graphhopper.util.Helper;
import com.graphhopper.util.Parameters;
import com.graphhopper.util.TranslationMap;
import com.graphhopper.util.shapes.GHPoint;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.util.Locale;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class NavigateResponseConverterTest {

    private static final String graphFolder = "target/graphhopper-test-car";
    private static final String osmFile = "../core/files/andorra.osm.gz";
    private static GraphHopper hopper;
    private static final String vehicle = "car";
    private static final String profile = "my_car";

    private final TranslationMap trMap = hopper.getTranslationMap();
    private final DistanceConfig distanceConfig = new DistanceConfig(DistanceUtils.Unit.METRIC, trMap, Locale.ENGLISH);

    @BeforeAll
    public static void beforeClass() {
        // make sure we are using fresh files with correct vehicle
        Helper.removeDir(new File(graphFolder));

        hopper = new GraphHopper().
                setOSMFile(osmFile).
                setStoreOnFlush(true).
                setGraphHopperLocation(graphFolder).
                setProfiles(new Profile(profile).setVehicle(vehicle).setWeighting("fastest").setTurnCosts(false)).
                importOrLoad();
    }

    @AfterAll
    public static void afterClass() {
        Helper.removeDir(new File(graphFolder));
    }

    @Test
    public void basicTest() {

        GHResponse rsp = hopper.route(new GHRequest(42.554851, 1.536198, 42.510071, 1.548128).
                setProfile(profile));

        ObjectNode json = NavigateResponseConverter.convertFromGHResponse(rsp, trMap, Locale.ENGLISH, distanceConfig);

        JsonNode route = json.get("routes").get(0);
        double routeDistance = route.get("distance").asDouble();
        assertTrue(routeDistance > 9000, "distance wasn't correct:" + routeDistance);
        assertTrue(routeDistance < 9500, "distance wasn't correct:" + routeDistance);

        double routeDuration = route.get("duration").asDouble();
        assertTrue(routeDuration > 500, "duration wasn't correct:" + routeDuration);
        assertTrue(routeDuration < 600, "duration wasn't correct:" + routeDuration);

        assertEquals("en", route.get("voiceLocale").asText());

        JsonNode leg = route.get("legs").get(0);
        assertEquals(routeDistance, leg.get("distance").asDouble(), .000001);

        JsonNode steps = leg.get("steps");
        JsonNode step = steps.get(0);
        JsonNode maneuver = step.get("maneuver");
        // Intersection coordinates should be equal to maneuver coordinates
        assertEquals(maneuver.get("location").get(0).asDouble(), step.get("intersections").get(0).get("location").get(0).asDouble(), .00001);

        assertEquals("depart", maneuver.get("type").asText());
        assertEquals("straight", maneuver.get("modifier").asText());

        assertEquals("la Callisa", step.get("name").asText());
        double instructionDistance = step.get("distance").asDouble();
        assertTrue(instructionDistance < routeDistance);

        JsonNode voiceInstructions = step.get("voiceInstructions");
        assertEquals(1, voiceInstructions.size());
        JsonNode voiceInstruction = voiceInstructions.get(0);
        assertTrue(voiceInstruction.get("distanceAlongGeometry").asDouble() <= instructionDistance);
        assertEquals("turn sharp left onto la Callisa, then keep left", voiceInstruction.get("announcement").asText());

        JsonNode bannerInstructions = step.get("bannerInstructions");
        assertEquals(1, bannerInstructions.size());
        JsonNode bannerInstruction = bannerInstructions.get(0).get("primary");
        assertEquals("la Callisa", bannerInstruction.get("text").asText());
        assertEquals("turn", bannerInstruction.get("type").asText());
        assertEquals("sharp left", bannerInstruction.get("modifier").asText());
        JsonNode bannerInstructionComponent = bannerInstruction.get("components").get(0);
        assertEquals("la Callisa", bannerInstructionComponent.get("text").asText());

        // Get the second last step (and the last banner/voice instruction)
        step = steps.get(steps.size() - 2);

        voiceInstructions = step.get("voiceInstructions");
        assertEquals(1, voiceInstructions.size());
        voiceInstruction = voiceInstructions.get(0);
        assertTrue(voiceInstruction.get("distanceAlongGeometry").asDouble() < instructionDistance);

        bannerInstructions = step.get("bannerInstructions");
        assertEquals(1, bannerInstructions.size());
        bannerInstruction = bannerInstructions.get(0).get("primary");
        assertEquals("Arrive at destination", bannerInstruction.get("text").asText());

        JsonNode waypointsJson = json.get("waypoints");
        assertEquals(2, waypointsJson.size());
        JsonNode waypointLoc = waypointsJson.get(0).get("location");
        assertEquals(1.536198, waypointLoc.get(0).asDouble(), .001);

    }

    @Test
    public void voiceInstructionsTest() {

        GHResponse rsp = hopper.route(new GHRequest(42.554851, 1.536198, 42.510071, 1.548128).
                setProfile(profile));

        ObjectNode json = NavigateResponseConverter.convertFromGHResponse(rsp, trMap, Locale.ENGLISH, distanceConfig);

        JsonNode steps = json.get("routes").get(0).get("legs").get(0).get("steps");

        // Step 4 is about 240m long
        JsonNode step = steps.get(4);

        JsonNode voiceInstructions = step.get("voiceInstructions");
        assertEquals(2, voiceInstructions.size());
        JsonNode voiceInstruction = voiceInstructions.get(0);
        assertEquals(200, voiceInstruction.get("distanceAlongGeometry").asDouble(), 1);
        assertEquals("In 200 meters At roundabout, take exit 2 onto CS-340, then At roundabout, take exit 2 onto CG-3", voiceInstruction.get("announcement").asText());

        // Step 14 is over 3km long
        step = steps.get(14);

        voiceInstructions = step.get("voiceInstructions");
        assertEquals(4, voiceInstructions.size());
        voiceInstruction = voiceInstructions.get(0);
        assertEquals(2000, voiceInstruction.get("distanceAlongGeometry").asDouble(), 1);
        assertEquals("In 2 kilometers keep right", voiceInstruction.get("announcement").asText());

        voiceInstruction = voiceInstructions.get(3);
        assertEquals("keep right", voiceInstruction.get("announcement").asText());
    }

    @Test
    public void voiceInstructionsImperialTest() {

        GHResponse rsp = hopper.route(new GHRequest(42.554851, 1.536198, 42.510071, 1.548128).
                setProfile(profile));

        ObjectNode json = NavigateResponseConverter.convertFromGHResponse(rsp, trMap, Locale.ENGLISH,
                new DistanceConfig(DistanceUtils.Unit.IMPERIAL, trMap, Locale.ENGLISH));

        JsonNode steps = json.get("routes").get(0).get("legs").get(0).get("steps");

        // Step 4 is about 240m long
        JsonNode step = steps.get(4);
        JsonNode maneuver = step.get("maneuver");

        JsonNode voiceInstructions = step.get("voiceInstructions");
        assertEquals(2, voiceInstructions.size());
        JsonNode voiceInstruction = voiceInstructions.get(0);
        assertEquals(200, voiceInstruction.get("distanceAlongGeometry").asDouble(), 1);
        assertEquals("In 600 feet At roundabout, take exit 2 onto CS-340, then At roundabout, take exit 2 onto CG-3", voiceInstruction.get("announcement").asText());

        // Step 14 is over 3km long
        step = steps.get(14);
        maneuver = step.get("maneuver");

        voiceInstructions = step.get("voiceInstructions");
        assertEquals(4, voiceInstructions.size());
        voiceInstruction = voiceInstructions.get(0);
        assertEquals(3220, voiceInstruction.get("distanceAlongGeometry").asDouble(), 1);
        assertEquals("In 2 miles keep right", voiceInstruction.get("announcement").asText());

        voiceInstruction = voiceInstructions.get(3);
        assertEquals("keep right", voiceInstruction.get("announcement").asText());
    }

    @Test
    @Disabled
    public void alternativeRoutesTest() {

        GHResponse rsp = hopper.route(new GHRequest(42.554851, 1.536198, 42.510071, 1.548128).
                setProfile(profile).setAlgorithm(Parameters.Algorithms.ALT_ROUTE));

        assertEquals(2, rsp.getAll().size());

        ObjectNode json = NavigateResponseConverter.convertFromGHResponse(rsp, trMap, Locale.ENGLISH, distanceConfig);

        JsonNode routes = json.get("routes");
        assertEquals(2, routes.size());

        assertEquals("GraphHopper Route 0", routes.get(0).get("legs").get(0).get("summary").asText());
        assertEquals("Avinguda Sant Antoni, CG-3", routes.get(1).get("legs").get(0).get("summary").asText());
    }

    @Test
    public void voiceInstructionTranslationTest() {

        GHResponse rsp = hopper.route(new GHRequest(42.554851, 1.536198, 42.510071, 1.548128).
                setProfile(profile));

        ObjectNode json = NavigateResponseConverter.convertFromGHResponse(rsp, trMap, Locale.ENGLISH, distanceConfig);

        JsonNode steps = json.get("routes").get(0).get("legs").get(0).get("steps");
        JsonNode voiceInstruction = steps.get(14).get("voiceInstructions").get(0);
        assertEquals("In 2 kilometers keep right", voiceInstruction.get("announcement").asText());

        rsp = hopper.route(new GHRequest(42.554851, 1.536198, 42.510071, 1.548128).
                setProfile(profile).setLocale(Locale.GERMAN));

        DistanceConfig distanceConfigGerman = new DistanceConfig(DistanceUtils.Unit.METRIC, trMap, Locale.GERMAN);

        json = NavigateResponseConverter.convertFromGHResponse(rsp, trMap, Locale.GERMAN, distanceConfigGerman);

        steps = json.get("routes").get(0).get("legs").get(0).get("steps");
        voiceInstruction = steps.get(14).get("voiceInstructions").get(0);
        assertEquals("In 2 Kilometern rechts halten", voiceInstruction.get("announcement").asText());

    }

    @Test
    public void roundaboutDegreesTest() {

        GHResponse rsp = hopper.route(new GHRequest(42.554851, 1.536198, 42.510071, 1.548128).
                setProfile(profile));

        ObjectNode json = NavigateResponseConverter.convertFromGHResponse(rsp, trMap, Locale.ENGLISH, distanceConfig);

        JsonNode steps = json.get("routes").get(0).get("legs").get(0).get("steps");

        JsonNode step = steps.get(5);
        JsonNode bannerInstructions = step.get("bannerInstructions");
        JsonNode primary = bannerInstructions.get(0).get("primary");

        assertEquals("roundabout", primary.get("type").asText());
        assertEquals("right", primary.get("modifier").asText());
        assertEquals(222, primary.get("degrees").asDouble(), 1);

    }

    @Test
    public void testMultipleWaypoints() {

        GHRequest request = new GHRequest();
        request.addPoint(new GHPoint(42.504606, 1.522438));
        request.addPoint(new GHPoint(42.504776, 1.527209));
        request.addPoint(new GHPoint(42.505144, 1.526113));
        request.addPoint(new GHPoint(42.50529, 1.527218));
        request.setProfile(profile);

        GHResponse rsp = hopper.route(request);

        ObjectNode json = NavigateResponseConverter.convertFromGHResponse(rsp, trMap, Locale.ENGLISH, distanceConfig);

        //Check that all waypoints are there and in the right order
        JsonNode waypointsJson = json.get("waypoints");
        assertEquals(4, waypointsJson.size());

        JsonNode waypointLoc = waypointsJson.get(0).get("location");
        assertEquals(1.522438, waypointLoc.get(0).asDouble(), .00001);

        waypointLoc = waypointsJson.get(1).get("location");
        assertEquals(1.527209, waypointLoc.get(0).asDouble(), .00001);

        waypointLoc = waypointsJson.get(2).get("location");
        assertEquals(1.526113, waypointLoc.get(0).asDouble(), .00001);

        waypointLoc = waypointsJson.get(3).get("location");
        assertEquals(1.527218, waypointLoc.get(0).asDouble(), .00001);

        //Check that there are 3 legs
        JsonNode route = json.get("routes").get(0);
        JsonNode legs = route.get("legs");
        assertEquals(3, legs.size());

        double duration = 0;
        double distance = 0;

        for (int i = 0; i < 3; i++) {
            JsonNode leg = legs.get(i);

            duration += leg.get("duration").asDouble();
            distance += leg.get("distance").asDouble();

            JsonNode steps = leg.get("steps");
            JsonNode step = steps.get(0);
            JsonNode maneuver = step.get("maneuver");
            assertEquals("depart", maneuver.get("type").asText());

            maneuver = steps.get(steps.size() - 1).get("maneuver");
            assertEquals("arrive", maneuver.get("type").asText());
        }

        // Check if the duration and distance of the legs sum up to the overall route distance and duration
        assertEquals(route.get("duration").asDouble(), duration, 1);
        assertEquals(route.get("distance").asDouble(), distance, 1);
    }

    @Test
    public void testError() {
        GHResponse rsp = hopper.route(new GHRequest(42.554851, 111.536198, 42.510071, 1.548128).
                setProfile(profile));

        ObjectNode json = NavigateResponseConverter.convertFromGHResponseError(rsp);

        assertEquals("InvalidInput", json.get("code").asText());
        assertTrue(json.get("message").asText().startsWith("Point 0 is out of bounds: 42.554851,111.536198"));
    }

}


text:
package com.github.xdcrafts.flower.tools;

import java.util.Map;

/**
 * Interface for something that have meta-information.
 */
public interface WithMeta {

    /**
     * Meta-information.
     */
    Map<String, Object> meta();
}


text:
CREATE CLASS ddl_0001;
ALTER ddl_0001 add col1 string default '***';
ALTER CLASS ddl_0001 modify col1 string default '*****';

drop class ddl_0001;


text:
<?php
//defined('BASEPATH') OR exit('No direct script access allowed');

class User extends CI_Controller {

	// $data['message_registration_error'] = "";

	function __construct(){
		//calling CI_Controller constructer
		parent::__construct();
		$this->load->model('user_model');
		$this->load->view('header');
	}

	public function login(){
    $this->load->view('login');
		$this->load->view('footer');
	}

	public function login_validate(){
		$this->form_validation->set_rules('log_username','Username','required|min_length[5]|max_length[15]');
		$this->form_validation->set_rules('log_password','Password','required|callback_login_post');
		if($this->form_validation->run() != FALSE){
			// $this->load->view('index');
			// $this->load->view('footer');
			redirect(base_url(),'refresh');
		}else{
			$data['message_login_error'] = "Please follow given form rules to login.";
			$this->load->view('login', $data);
			$this->load->view('footer');
		}
	}

	public function signup_validate(){

		$this->form_validation->set_rules('reg_username','Username','required|min_length[5]|max_length[15]|is_unique[users.username]');
		$this->form_validation->set_rules('reg_password','Password','required|min_length[5]|max_length[15]|matches[reg_confirm_password]');
		$this->form_validation->set_rules('reg_confirm_password','Confirm Password','required|min_length[5]|max_length[15]|matches[reg_password]');
		$this->form_validation->set_rules('reg_email','Email','required|valid_email|is_unique[users.email]');
		$this->form_validation->set_rules('reg_fullname','Fullname','required|min_length[5]|max_length[15]');
		if($this->form_validation->run()==FALSE){
			$data['message_registration_error'] = "Please follow given form rules to register.";
			$this->load->view('login', $data);
		}else{
			$username = $this->input->post('reg_username');
			$email = $this->input->post('reg_email');
			$password = $this->input->post('reg_password');
			if($this->user_model->registerUser($username, $email, $password)){
				$data['message_successfully_registered'] = "Congratulations, you have been successfully registered! :) ";
				$this->load->view('login', $data);
			}
			$this->load->view('footer');
		}
	}

	public function login_post(){
		$username = $this->input->post('log_username');
		$password = $this->input->post('log_password');
		$result = $this->user_model->validate_user($username, $password);

		if($result){
			$sess_array =  array();
			foreach($result as $row){
				// set session
				$sess_array = array('username'=>$row->username, 'email'=>$row->email);
				$this->session->set_userdata('logged_in', $sess_array);
			}
			return true;
		}
		else{
			$this->form_validation->set_message('login_post', 'Username/password not matching!');
			return false;
		}
	}

	public function logout(){
		//remove all session data
		$this->session->unset_userdata('logged_in');
		$this->session->sess_destroy();
		$data['msg_logged_out'] = "You have successfully logged out.";
		$this->load->view('header');
		$this->load->view('login',$data);
		$this->load->view('footer');
	}

	public function send_email_validate(){
		$this->form_validation->set_rules('sender_name','Fullname','required|max_length[20]');
		$this->form_validation->set_rules('sender_email','Email','required|valid_email');
		$this->form_validation->set_rules('email_subject','Message Subject','required|max_length[40]');
		$this->form_validation->set_rules('email_message','Message','required|min_length[15]');
		if($this->form_validation->run() == false){
			$data['msg_send_failed'] = "Please follow the form rule to send email appropriately.";
			$this->load->view('contact', $data);
		}else{
			$data['msg_send_success'] = "Your message has been sent successfully. We will get back to you ASAP!";
			$this->email->from(set_value('sender_email'), set_value('sender_name'));
			$this->email->to('iamsarthakjoshi@gmail.com');
			$this->email->subject(set_value('email_subject'));
			$this->email->message(set_value('email_message'));
			$this->email->send();
			// echo $this->email->print_debugger();
			$this->load->view('contact', $data);
		}
		$this->load->view('footer');
	}

	public function suscribe(){
		if($this->session->has_userdata('logged_in')){
			$session_data = $this->session->userdata('logged_in');
      $data['email'] = $session_data['email'];
      $data['username'] = $session_data['username'];
			$data['msg_suscribe_success'] = "Thank you for suscribing us. Have a good day. :)";
			$this->load->view('header', $data);
      $this->load->view('login', $data);
      $this->load->view('footer');
		}else{
			$data['msg_suscribe_error'] = "Please sign up to suscribe us. It's quick.";
      $this->load->view('login', $data);
      $this->load->view('footer');
		}
	}
}


text:
using LaunchApp.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace LaunchApp.Services
{
    public class FaceSwapService
    {
        private readonly HttpClient httpClient = new HttpClient();

        public async Task<string> PostAsync(FaceSwapDetails details)
        {
            var response = new HttpResponseMessage();
            var responseBody = string.Empty;
            var bodyContent = new StringContent(JsonConvert.SerializeObject(details));

            try
            {
                response = await httpClient.PostAsync("https://launchatl.azurewebsites.net/api/face", bodyContent);
                response.EnsureSuccessStatusCode();
                responseBody = await response.Content.ReadAsStringAsync();

            }
            catch (Exception up)
            {
                responseBody = "Error: " + up.HResult.ToString("X") + " Message: " + up.Message;
            }

            return responseBody;
        }
    }
}


text:
using Artemis.Common;
using Artemis.Web.Models;
using Artemis.Web.ViewModels;
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web.Http;
using System.Web.Http.Cors;

namespace Artemis.Web.Controllers
{
    [EnableCors(origins: "*", headers: "*",  methods: "*")]
    public class CarAdvertController : ControllerBase<CarAdvert, CarAdvertDto>
    {
        public CarAdvertController(IViewModel<CarAdvert> vm, IMapper mapper)
            : base(vm, mapper)
        {

        }
    }
}